[hamradio-commits] [flwkey] 01/01: Imported Upstream version 1.1.6
Greg Beam
ki7mt-guest at moszumanska.debian.org
Sun Jan 11 07:05:59 UTC 2015
This is an automated email from the git hooks/post-receive script.
ki7mt-guest pushed a commit to branch master
in repository flwkey.
commit 3dcfac9070f109156c50ba8c5ef19a340638a678
Author: Greg Beam <ki7mt at yahoo.com>
Date: Sat Jan 10 23:59:43 2015 -0700
Imported Upstream version 1.1.6
---
AUTHORS | 8 +
COPYING | 340 +
ChangeLog | 114 +
INSTALL | 275 +
Makefile.am | 19 +
Makefile.in | 748 ++
README | 17 +
aclocal.m4 | 1141 +++
build-aux/config.guess | 1530 ++++
build-aux/config.sub | 1773 +++++
build-aux/depcomp | 688 ++
build-aux/install-sh | 527 ++
build-aux/missing | 331 +
configure | 9300 +++++++++++++++++++++++++
configure.ac | 167 +
data/flwkey.desktop | 9 +
data/flwkey.xpm | 325 +
data/mac/Info.plist.in | 44 +
data/mac/flwkey.icns | Bin 0 -> 11814 bytes
data/win32/fl_app.nsi | 166 +
data/win32/flwkey.ico | Bin 0 -> 16958 bytes
m4/build.m4 | 79 +
m4/debug.m4 | 104 +
m4/fltk.m4 | 54 +
m4/funcs.m4 | 15 +
m4/macosx.m4 | 42 +
m4/np-compat.m4 | 36 +
m4/opt.m4 | 29 +
m4/pkg-config.m4 | 44 +
m4/static.m4 | 9 +
m4/win32.m4 | 59 +
scripts/build4mingw.sh | 20 +
scripts/mkappbundle.sh | 119 +
scripts/mknsisinst.sh | 41 +
src/Makefile.am | 259 +
src/Makefile.in | 1483 ++++
src/compat/regex.c | 4927 +++++++++++++
src/compat/regex.h | 498 ++
src/config.h | 414 ++
src/config.h.in | 413 ++
src/dialogs.cxx | 704 ++
src/flwkey-rc.rc | 7 +
src/flwkey.cxx | 331 +
src/flwkey_icon.cxx | 325 +
src/include/FL/Fl_Native_File_Chooser.H | 40 +
src/include/FL/Fl_Native_File_Chooser_FLTK.H | 101 +
src/include/FL/Fl_Native_File_Chooser_MAC.H | 138 +
src/include/FL/Fl_Native_File_Chooser_WIN32.H | 108 +
src/include/FTextRXTX.h | 125 +
src/include/FTextView.h | 189 +
src/include/Fl_Text_Display_mod.H | 7 +
src/include/Fl_Text_Display_mod_1_1.H | 306 +
src/include/Fl_Text_Display_mod_1_3.H | 49 +
src/include/Fl_Text_Editor_mod.H | 7 +
src/include/Fl_Text_Editor_mod_1_1.H | 110 +
src/include/Fl_Text_Editor_mod_1_3.H | 51 +
src/include/ValueSlider.h | 31 +
src/include/XmlRpc.h | 95 +
src/include/XmlRpcClient.h | 135 +
src/include/XmlRpcDispatch.h | 92 +
src/include/XmlRpcException.h | 42 +
src/include/XmlRpcMutex.h | 46 +
src/include/XmlRpcServer.h | 157 +
src/include/XmlRpcServerConnection.h | 80 +
src/include/XmlRpcServerMethod.h | 45 +
src/include/XmlRpcSocket.h | 81 +
src/include/XmlRpcSource.h | 84 +
src/include/XmlRpcThread.h | 60 +
src/include/XmlRpcThreadedServer.h | 67 +
src/include/XmlRpcUtil.h | 65 +
src/include/XmlRpcValue.h | 277 +
src/include/adif_def.h | 21 +
src/include/adif_io.h | 81 +
src/include/base64.h | 377 +
src/include/calendar.h | 151 +
src/include/combo.h | 127 +
src/include/compat.h | 67 +
src/include/date.h | 132 +
src/include/debug.h | 101 +
src/include/dialogs.h | 14 +
src/include/field_def.h | 55 +
src/include/fileselect.h | 31 +
src/include/flinput2.h | 13 +
src/include/flslider2.h | 72 +
src/include/flwkey.h | 38 +
src/include/flwkeyrc.h | 3 +
src/include/font_browser.h | 100 +
src/include/gettext.h | 285 +
src/include/icons.h | 35 +
src/include/lgbook.h | 120 +
src/include/log.h | 23 +
src/include/logbook.h | 21 +
src/include/logger.h | 45 +
src/include/logsupport.h | 68 +
src/include/mingw.h | 97 +
src/include/pixmaps.h | 90 +
src/include/qso_db.h | 99 +
src/include/re.h | 79 +
src/include/serial.h | 211 +
src/include/status.h | 101 +
src/include/support.h | 135 +
src/include/table.h | 219 +
src/include/textio.h | 21 +
src/include/threads.h | 95 +
src/include/timeops.h | 33 +
src/include/util.h | 186 +
src/include/wkey_dialogs.h | 152 +
src/include/wkey_io.h | 27 +
src/logbook/adif_io.cxx | 424 ++
src/logbook/calendar.cxx | 585 ++
src/logbook/date.cxx | 378 +
src/logbook/lgbook.cxx | 1050 +++
src/logbook/lgbook.fl | 627 ++
src/logbook/logbook.cxx | 55 +
src/logbook/logsupport.cxx | 1303 ++++
src/logbook/qso_db.cxx | 616 ++
src/logbook/table.cxx | 1840 +++++
src/logbook/textio.cxx | 283 +
src/misc/debug.cxx | 280 +
src/misc/icons.cxx | 264 +
src/misc/mingw.c | 313 +
src/misc/pixmaps.cxx | 8175 ++++++++++++++++++++++
src/misc/re.cxx | 143 +
src/misc/serial.cxx | 761 ++
src/misc/status.cxx | 261 +
src/misc/support.cxx | 805 +++
src/misc/timeops.cxx | 203 +
src/misc/util.cxx | 264 +
src/misc/xmlrpc_log.cxx | 221 +
src/widgets/FTextRXTX.cxx | 585 ++
src/widgets/FTextView.cxx | 935 +++
src/widgets/Fl_Native_File_Chooser.cxx | 47 +
src/widgets/Fl_Native_File_Chooser_FLTK.cxx | 376 +
src/widgets/Fl_Native_File_Chooser_MAC.cxx | 865 +++
src/widgets/Fl_Native_File_Chooser_WIN32.cxx | 805 +++
src/widgets/Fl_Text_Display_mod.cxx | 7 +
src/widgets/Fl_Text_Display_mod_1_1.cxx | 3267 +++++++++
src/widgets/Fl_Text_Display_mod_1_3.cxx | 33 +
src/widgets/Fl_Text_Editor_mod.cxx | 7 +
src/widgets/Fl_Text_Editor_mod_1_1.cxx | 494 ++
src/widgets/Fl_Text_Editor_mod_1_3.cxx | 31 +
src/widgets/ValueSlider.cxx | 33 +
src/widgets/combo.cxx | 355 +
src/widgets/fileselect.cxx | 222 +
src/widgets/flinput2.cxx | 180 +
src/widgets/flnfc_common.cxx | 80 +
src/widgets/flslider2.cxx | 82 +
src/wkey_dialogs.cxx | 1466 ++++
src/wkey_dialogs.fl | 845 +++
src/wkey_io.cxx | 117 +
src/xmlrpccpp/XmlRpcClient.cpp | 529 ++
src/xmlrpccpp/XmlRpcDispatch.cpp | 270 +
src/xmlrpccpp/XmlRpcMutex.cpp | 60 +
src/xmlrpccpp/XmlRpcServer.cpp | 506 ++
src/xmlrpccpp/XmlRpcServerConnection.cpp | 216 +
src/xmlrpccpp/XmlRpcServerMethod.cpp | 24 +
src/xmlrpccpp/XmlRpcSocket.cpp | 224 +
src/xmlrpccpp/XmlRpcSource.cpp | 204 +
src/xmlrpccpp/XmlRpcThread.cpp | 74 +
src/xmlrpccpp/XmlRpcUtil.cpp | 317 +
src/xmlrpccpp/XmlRpcValue.cpp | 673 ++
161 files changed, 66427 insertions(+)
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..34a8448
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,8 @@
+AUTHOR: Dave Freese
+CALLSIGN: W1HKJ
+EMAIL: w1hkj at w1hkj.com
+
+Author can be contacted on the linuxham yahoo group
+
+EMAIL: linuxham at yahoo.com
+
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..3912109
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU 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) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..3a605e3
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,114 @@
+
+
+=Version 1.1.6=
+
+2013-06-28 David Freese <w1hkj at w1hkj.com>
+
+ 5943eea: Send text-command
+ 6d6dbce: Debug cleanup
+ 5b26983: MXE Build
+
+
+=Version 1.1.5=
+
+ 859786e: Binary build
+ efc1c66: Serial by-id
+
+
+=Version 1.1.4=
+
+ 2b39e79: build.m4 macro
+ 7913048: Combo update
+
+
+=Version 1.1.3=
+
+ 125f815: OS X File Chooser
+ 2f196c2: Desktop
+ 2a845fb: FLTK version
+ a1e4ab0: debug revision
+
+
+=Version 1.1.2=
+
+ 08e9da3: Fltk-1-3 mods
+
+
+=Version 1.1.1=
+
+ 6beb452: Log server
+ 27af029: Parse ARGS
+ b26455e: Weight correction
+
+2010-10-08 Fernando M. Maresca <fmaresca at gmail.com>
+
+ 1008508: QSO_DATE_OFF addition
+
+2010-08-29 David Freese <w1hkj at w1hkj.com>
+
+ 5d5b881: ADIF Band check
+ 4db4973: Remote Logbook / Contesting
+
+
+=Version 1.0.0=
+
+ ab356f6: Alt-L
+ 31535c6: Duplicate Checking
+ 4e68b36: LOG add restored
+ 3ac915d: Logbook Field Sizes
+ 840fa6d: Dialog Init
+ ec5c78b: Logbook Thread
+ 7764737: Contest
+ 5abb16c: Logging
+
+
+=Version 0.9.99=
+
+ 6351e40: Echo timing
+
+
+=Version 0.9.98=
+
+
+
+=Version 0.9.97=
+
+ a92cb82: Logbook
+ bd998a7: Serial timing
+
+
+=Version 0.9.96=
+
+ e92e25a: Key Port
+
+
+=Version 0.9.95=
+
+ 22b8013: WK1.0 mods
+
+
+=Version 0.9.94=
+
+ 11f2cf3: Logbook-Save
+
+
+=Version 0.9.93=
+
+ a59cfa8: Prosigns
+ eb3404c: Transmit Text
+
+
+=Version 0.9.92=
+
+ 16db6ee: Logbook
+ 2c7f002: OK removed
+ b8161e8: Sidetone - cut-0-9
+
+
+=Version 0.9.91=
+
+ 81505a9: flwkey initialization
+
+
+=Version 0.9.9=
+
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..796bfa4
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,275 @@
+Installation Instructions for flrig
+************************************
+
+To compile flrig you will need:
+
+ * A recent C++ compiler. The GNU C++ compilers in the 4.x series are
+ known to work.
+
+ * Version 1.1.x of the Fast Light Tool Kit (FLTK), with its
+ development library and headers. Versions 1.1.7 to 1.1.9 are known
+ to work. FLTK's multi-threading support is recommended but not
+ required.
+
+Once you have installed the required packages, the following commands
+should be sufficient to compile flrig and install it under /usr/local:
+
+ ./configure
+ make
+ make install (you may need superuser privileges for installation)
+
+The `install' target installs the executable, an icon, and a .desktop
+file. After installation, an flrig launcher should appear somewhere in
+your applications menu.
+
+Create the desktop launcher. flrig is designed as a desktop application
+that accepts target files to be wrapped or unwrapped by dropping the
+file onto the desktop launcher.
+
+Windows installation notes
+**************************
+
+flrig supports win32 systems as a cross compiled application using the
+MinGW win32 environment.
+
+To build an internationalized version of flrig, install these
+additional packages:
+
+ gettext gettext-devel libiconv libiconv2
+
+ ========== Generic installation instructions follow ==========
+
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
+2006 Free Software Foundation, Inc.
+
+This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package. The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package.
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+ It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring. Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+ The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'. You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
+
+The simplest way to compile this package is:
+
+ 1. `cd' to the directory containing the package's source code and type
+ `./configure' to configure the package for your system.
+
+ Running `configure' might take a while. While running, it prints
+ some messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Optionally, type `make check' to run any self-tests that come with
+ the package.
+
+ 4. Type `make install' to install the programs and any data files and
+ documentation.
+
+ 5. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'. To also remove the
+ files that `configure' created (so you can compile the package for
+ a different kind of computer), type `make distclean'. There is
+ also a `make maintainer-clean' target, but that is intended mainly
+ for the package's developers. If you use it, you may have to get
+ all sorts of other programs in order to regenerate files that came
+ with the distribution.
+
+Compilers and Options
+=====================
+
+Some systems require unusual options for compilation or linking that the
+`configure' script does not know about. Run `./configure --help' for
+details on some of the pertinent environment variables.
+
+ You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment. Here
+is an example:
+
+ ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+
+ *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you can use GNU `make'. `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+ With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory. After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
+
+Installation Names
+==================
+
+By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc. You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX'.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+ In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files. Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+There may be some features `configure' cannot figure out automatically,
+but needs to determine by the type of machine the package will run on.
+Usually, assuming the package is built to be run on the _same_
+architectures, `configure' can figure that out, but if it prints a
+message saying it cannot guess the machine type, give it the
+`--build=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+ CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+ OS KERNEL-OS
+
+ See the file `config.sub' for the possible values of each field. If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+ If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
+
+ If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+If you want to set default values for `configure' scripts to share, you
+can create a site shell script called `config.site' that gives default
+values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+Variables not defined in a site shell script can be set in the
+environment passed to `configure'. However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost. In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'. For example:
+
+ ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf bug. Until the bug is fixed you can use this workaround:
+
+ CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+`configure' Invocation
+======================
+
+`configure' recognizes the following options to control how it operates.
+
+`--help'
+`-h'
+ Print a summary of the options to `configure', and exit.
+
+`--version'
+`-V'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`--cache-file=FILE'
+ Enable the cache: use and save the results of the tests in FILE,
+ traditionally `config.cache'. FILE defaults to `/dev/null' to
+ disable caching.
+
+`--config-cache'
+`-C'
+ Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+ Do not print messages saying which checks are being made. To
+ suppress all normal output, redirect it to `/dev/null' (any error
+ messages will still be shown).
+
+`--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ `configure' can determine that directory automatically.
+
+`configure' also accepts some other, not widely useful, options. Run
+`configure --help' for more details.
+
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..5babc8a
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,19 @@
+ACLOCAL_AMFLAGS = -I m4
+SUBDIRS = src
+
+if HAVE_FLUID
+flgen:
+ (cd src && $(MAKE) $(AM_MAKEFLAGS) $@)
+endif
+
+if DARWIN
+appbundle:
+ (cd src && $(MAKE) $(AM_MAKEFLAGS) $@)
+endif
+
+if HAVE_NSIS
+nsisinst:
+ (cd src && $(MAKE) $(AM_MAKEFLAGS) $@)
+endif
+
+#EXTRA_DIST = build-aux/config.rpath
diff --git a/Makefile.in b/Makefile.in
new file mode 100644
index 0000000..524482d
--- /dev/null
+++ b/Makefile.in
@@ -0,0 +1,748 @@
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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.
+
+ at SET_MAKE@
+VPATH = @srcdir@
+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@
+target_triplet = @target@
+subdir = .
+DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(top_srcdir)/configure AUTHORS COPYING \
+ ChangeLog INSTALL build-aux/config.guess build-aux/config.sub \
+ build-aux/depcomp build-aux/install-sh build-aux/missing
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/build.m4 \
+ $(top_srcdir)/m4/debug.m4 $(top_srcdir)/m4/fltk.m4 \
+ $(top_srcdir)/m4/funcs.m4 $(top_srcdir)/m4/macosx.m4 \
+ $(top_srcdir)/m4/np-compat.m4 $(top_srcdir)/m4/opt.m4 \
+ $(top_srcdir)/m4/pkg-config.m4 $(top_srcdir)/m4/static.m4 \
+ $(top_srcdir)/m4/win32.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/src/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+ distdir dist dist-all distcheck
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+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__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
+GZIP_ENV = --best
+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@
+AC_CONFIG_ARGS = @AC_CONFIG_ARGS@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFD_CFLAGS = @BFD_CFLAGS@
+BFD_LIBS = @BFD_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+EXTRA_LIBS = @EXTRA_LIBS@
+FLTK_CFLAGS = @FLTK_CFLAGS@
+FLTK_CONFIG = @FLTK_CONFIG@
+FLTK_LIBS = @FLTK_LIBS@
+FLUID = @FLUID@
+FLWKEY_BUILD_CPPFLAGS = @FLWKEY_BUILD_CPPFLAGS@
+FLWKEY_BUILD_CXXFLAGS = @FLWKEY_BUILD_CXXFLAGS@
+FLWKEY_BUILD_LDADD = @FLWKEY_BUILD_LDADD@
+FLWKEY_BUILD_LDFLAGS = @FLWKEY_BUILD_LDFLAGS@
+FLWKEY_VERSION = @FLWKEY_VERSION@
+FLWKEY_VERSION_MAJOR = @FLWKEY_VERSION_MAJOR@
+FLWKEY_VERSION_MINOR = @FLWKEY_VERSION_MINOR@
+FLWKEY_VERSION_PATCH = @FLWKEY_VERSION_PATCH@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAC_UNIVERSAL_CFLAGS = @MAC_UNIVERSAL_CFLAGS@
+MAC_UNIVERSAL_LDFLAGS = @MAC_UNIVERSAL_LDFLAGS@
+MAKEINFO = @MAKEINFO@
+MAKENSIS = @MAKENSIS@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+OPT_CFLAGS = @OPT_CFLAGS@
+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@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+POW_LIB = @POW_LIB@
+PTW32_CFLAGS = @PTW32_CFLAGS@
+PTW32_LIBS = @PTW32_LIBS@
+RDYNAMIC = @RDYNAMIC@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+WINDRES = @WINDRES@
+X_CFLAGS = @X_CFLAGS@
+X_LIBS = @X_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+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@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+ACLOCAL_AMFLAGS = -I m4
+SUBDIRS = src
+all: all-recursive
+
+.SUFFIXES:
+am--refresh: Makefile
+ @:
+$(srcdir)/Makefile.in: $(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
+.PRECIOUS: 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__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+# 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.
+$(RECURSIVE_TARGETS):
+ @fail= failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; 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"
+
+$(RECURSIVE_CLEAN_TARGETS):
+ @fail= failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ 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; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ 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
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ 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"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(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 \
+ test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ 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) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+ $(am__remove_distdir)
+
+dist-lzip: distdir
+ tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
+ $(am__remove_distdir)
+
+dist-lzma: distdir
+ tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+ $(am__remove_distdir)
+
+dist-xz: distdir
+ tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
+ $(am__remove_distdir)
+
+dist-tarZ: distdir
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__remove_distdir)
+
+dist-shar: distdir
+ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ $(am__remove_distdir)
+
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__remove_distdir)
+
+dist dist-all: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__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*) \
+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.lzma*) \
+ lzma -dc $(distdir).tar.lzma | $(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*) \
+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ esac
+ chmod -R a-w $(distdir); chmod a+w $(distdir)
+ mkdir $(distdir)/_build
+ mkdir $(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 \
+ && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+ $(AM_DISTCHECK_CONFIGURE_FLAGS) \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(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__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
+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 mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -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 $(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
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
+ install-am install-strip tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am am--refresh check check-am clean clean-generic \
+ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
+ dist-lzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \
+ distcheck distclean distclean-generic 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-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 pdf \
+ pdf-am ps ps-am tags tags-recursive uninstall uninstall-am
+
+
+ at HAVE_FLUID_TRUE@flgen:
+ at HAVE_FLUID_TRUE@ (cd src && $(MAKE) $(AM_MAKEFLAGS) $@)
+
+ at DARWIN_TRUE@appbundle:
+ at DARWIN_TRUE@ (cd src && $(MAKE) $(AM_MAKEFLAGS) $@)
+
+ at HAVE_NSIS_TRUE@nsisinst:
+ at HAVE_NSIS_TRUE@ (cd src && $(MAKE) $(AM_MAKEFLAGS) $@)
+
+#EXTRA_DIST = build-aux/config.rpath
+
+# 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:
diff --git a/README b/README
new file mode 100644
index 0000000..fec3dac
--- /dev/null
+++ b/README
@@ -0,0 +1,17 @@
+Flrig is a transceiver control program for Amateur Radio use. It does
+not use any 3rd party transceiver control libraries. It is a c++ pro-
+gram that encapsulates each transceiver in it's own class. Where ever
+possible the transceiver class(s) use polymorphism to reuse code that
+is portable across a series of transceivers.
+
+The latest version can always be found at:
+
+ http://www.w1hkj.com/
+
+Join the linuxham, NBEMSham or win-fldigi Yahoo group for support, news
+and updates on W1HKJ software:
+
+ http://groups.yahoo.com/group/linuxham/join
+ http://groups.yahoo.com/group/NBEMSham/join
+ http://groups.yahoo.com/group/win-fldigi/join
+
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644
index 0000000..e975d92
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,1141 @@
+# generated automatically by aclocal 1.11.3 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
+# Inc.
+# 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.
+
+# 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.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
+[m4_warning([this file was generated for autoconf 2.68.
+You have another version of autoconf. It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
+# serial 1 (pkg-config-0.24)
+#
+# Copyright © 2004 Scott James Remnant <scott at netsplit.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 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.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# PKG_PROG_PKG_CONFIG([MIN-VERSION])
+# ----------------------------------
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+ AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+ _pkg_min_version=m4_default([$1], [0.9.0])
+ AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ PKG_CONFIG=""
+ fi
+fi[]dnl
+])# PKG_PROG_PKG_CONFIG
+
+# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# Check to see whether a particular set of modules exists. Similar
+# to PKG_CHECK_MODULES(), but does not set variables or print errors.
+#
+# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+# only at the first occurence in configure.ac, so if the first place
+# it's called might be skipped (such as if it is within an "if", you
+# have to call PKG_CHECK_EXISTS manually
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+ m4_default([$2], [:])
+m4_ifvaln([$3], [else
+ $3])dnl
+fi])
+
+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+# ---------------------------------------------
+m4_define([_PKG_CONFIG],
+[if test -n "$$1"; then
+ pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+ PKG_CHECK_EXISTS([$3],
+ [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes ],
+ [pkg_failed=yes])
+ else
+ pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _PKG_SHORT_ERRORS_SUPPORTED
+# -----------------------------
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi[]dnl
+])# _PKG_SHORT_ERRORS_SUPPORTED
+
+
+# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+# [ACTION-IF-NOT-FOUND])
+#
+#
+# Note that if there is a possibility the first call to
+# PKG_CHECK_MODULES might not happen, you should be sure to include an
+# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+#
+#
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $1])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+ AC_MSG_RESULT([no])
+ _PKG_SHORT_ERRORS_SUPPORTED
+ if test $_pkg_short_errors_supported = yes; then
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
+ else
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+ m4_default([$4], [AC_MSG_ERROR(
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT])[]dnl
+ ])
+elif test $pkg_failed = untried; then
+ AC_MSG_RESULT([no])
+ m4_default([$4], [AC_MSG_FAILURE(
+[The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
+ ])
+else
+ $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+ $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+ AC_MSG_RESULT([yes])
+ $3
+fi[]dnl
+])# PKG_CHECK_MODULES
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
+# Foundation, Inc.
+#
+# 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.
+
+# serial 1
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.11'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version. Point them to the right macro.
+m4_if([$1], [1.11.3], [],
+ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too. Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.11.3])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
+#
+# 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.
+
+# serial 1
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
+# Free Software Foundation, Inc.
+#
+# 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.
+
+# serial 9
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
+# 2010, 2011 Free Software Foundation, Inc.
+#
+# 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.
+
+# serial 12
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
+ [$1], CXX, [depcc="$CXX" am_compiler_list=],
+ [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], UPC, [depcc="$UPC" am_compiler_list=],
+ [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ am__universal=false
+ m4_case([$1], [CC],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac],
+ [CXX],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac])
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok `-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+ am__nodep='_no'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+AC_SUBST([am__nodep])dnl
+_AM_SUBST_NOTMAKE([am__nodep])dnl
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# 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.
+
+#serial 5
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+ # Autoconf 2.62 quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+ done
+}
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled. FIXME. This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+#
+# 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.
+
+# serial 16
+
+# This macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.62])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+ [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES(CC)],
+ [define([AC_PROG_CC],
+ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES(CXX)],
+ [define([AC_PROG_CXX],
+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+ [_AM_DEPENDENCIES(OBJC)],
+ [define([AC_PROG_OBJC],
+ defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+ [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+])
+
+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
+# Inc.
+#
+# 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.
+
+# serial 1
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+AC_SUBST(install_sh)])
+
+# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+#
+# 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.
+
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
+#
+# 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.
+
+# serial 4
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# 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.
+
+# serial 6
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
+# Inc.
+#
+# 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.
+
+# serial 1
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+ [[\\/$]]* | ?:[[\\/]]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
+# Foundation, Inc.
+#
+# 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.
+
+# serial 5
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# --------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# 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.
+
+# serial 5
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[[\\\"\#\$\&\'\`$am_lf]]*)
+ AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+ *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
+ AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+esac
+
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "$[2]" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
+#
+# 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.
+
+# serial 1
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
+#
+# 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.
+
+# serial 3
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# --------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# Check how to create a tarball. -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
+#
+# 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.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+# tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+# $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility. Yes, it's still used
+# in the wild :-( We should find a proper way to deprecate it ...
+AC_SUBST([AMTAR], ['$${TAR-tar}'])
+m4_if([$1], [v7],
+ [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
+ [m4_case([$1], [ustar],, [pax],,
+ [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar;
+ do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
+m4_include([m4/build.m4])
+m4_include([m4/debug.m4])
+m4_include([m4/fltk.m4])
+m4_include([m4/funcs.m4])
+m4_include([m4/macosx.m4])
+m4_include([m4/np-compat.m4])
+m4_include([m4/opt.m4])
+m4_include([m4/pkg-config.m4])
+m4_include([m4/static.m4])
+m4_include([m4/win32.m4])
diff --git a/build-aux/config.guess b/build-aux/config.guess
new file mode 100755
index 0000000..d622a44
--- /dev/null
+++ b/build-aux/config.guess
@@ -0,0 +1,1530 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+# 2011, 2012 Free Software Foundation, Inc.
+
+timestamp='2012-02-10'
+
+# This file 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Originally written by Per Bothner. Please send patches (context
+# diff format) to <config-patches at gnu.org> and include a ChangeLog
+# entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub. If it succeeds, it prints the system name on stdout, and
+# exits with 0. Otherwise, it exits with 1.
+#
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches at gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# != 0; then
+ echo "$me: too many arguments$help" >&2
+ exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int x;" > $dummy.c ;
+ for c in cc gcc c89 c99 ; do
+ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$c"; break ;
+ fi ;
+ done ;
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found ;
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi at noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+ # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+ #
+ # Note: NetBSD doesn't particularly care about the vendor
+ # portion of the name. We always set it to "unknown".
+ sysctl="sysctl -n hw.machine_arch"
+ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+ /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+ case "${UNAME_MACHINE_ARCH}" in
+ armeb) machine=armeb-unknown ;;
+ arm*) machine=arm-unknown ;;
+ sh3el) machine=shl-unknown ;;
+ sh3eb) machine=sh-unknown ;;
+ sh5el) machine=sh5le-unknown ;;
+ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ esac
+ # The Operating System including object format, if it has switched
+ # to ELF recently, or will in the future.
+ case "${UNAME_MACHINE_ARCH}" in
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ eval $set_cc_for_build
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ELF__
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ ;;
+ *)
+ os=netbsd
+ ;;
+ esac
+ # The OS release
+ # Debian GNU/NetBSD machines have a different userland, and
+ # thus, need a distinct triplet. However, they do not need
+ # kernel version information, so it can be replaced with a
+ # suitable tag, in the style of linux-gnu.
+ case "${UNAME_VERSION}" in
+ Debian*)
+ release='-gnu'
+ ;;
+ *)
+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ ;;
+ esac
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}"
+ exit ;;
+ *:OpenBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+ exit ;;
+ *:ekkoBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+ exit ;;
+ *:SolidBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+ exit ;;
+ macppc:MirBSD:*:*)
+ echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ *:MirBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ alpha:OSF1:*:*)
+ case $UNAME_RELEASE in
+ *4.0)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ ;;
+ *5.*)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ ;;
+ esac
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+ # OSF/1 and Tru64 systems produced since 1995. I hope that
+ # covers most systems running today. This code pipes the CPU
+ # types through head -n 1, so we only detect the type of CPU 0.
+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+ case "$ALPHA_CPU_TYPE" in
+ "EV4 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "EV4.5 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "LCA4 (21066/21068)")
+ UNAME_MACHINE="alpha" ;;
+ "EV5 (21164)")
+ UNAME_MACHINE="alphaev5" ;;
+ "EV5.6 (21164A)")
+ UNAME_MACHINE="alphaev56" ;;
+ "EV5.6 (21164PC)")
+ UNAME_MACHINE="alphapca56" ;;
+ "EV5.7 (21164PC)")
+ UNAME_MACHINE="alphapca57" ;;
+ "EV6 (21264)")
+ UNAME_MACHINE="alphaev6" ;;
+ "EV6.7 (21264A)")
+ UNAME_MACHINE="alphaev67" ;;
+ "EV6.8CB (21264C)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8AL (21264B)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8CX (21264D)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.9A (21264/EV69A)")
+ UNAME_MACHINE="alphaev69" ;;
+ "EV7 (21364)")
+ UNAME_MACHINE="alphaev7" ;;
+ "EV7.9 (21364A)")
+ UNAME_MACHINE="alphaev79" ;;
+ esac
+ # A Pn.n version is a patched version.
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+ exitcode=$?
+ trap '' 0
+ exit $exitcode ;;
+ Alpha\ *:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # Should we change UNAME_MACHINE based on the output of uname instead
+ # of the specific Alpha model?
+ echo alpha-pc-interix
+ exit ;;
+ 21064:Windows_NT:50:3)
+ echo alpha-dec-winnt3.5
+ exit ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-unknown-sysv4
+ exit ;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-amigaos
+ exit ;;
+ *:[Mm]orph[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-morphos
+ exit ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+ exit ;;
+ *:z/VM:*:*)
+ echo s390-ibm-zvmoe
+ exit ;;
+ *:OS400:*:*)
+ echo powerpc-ibm-os400
+ exit ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit ;;
+ arm:riscos:*:*|arm:RISCOS:*:*)
+ echo arm-unknown-riscos
+ exit ;;
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit ;;
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ # akee at wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit ;;
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit ;;
+ DRS?6000:unix:4.0:6*)
+ echo sparc-icl-nx6
+ exit ;;
+ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+ case `/usr/bin/uname -p` in
+ sparc) echo sparc-icl-nx7; exit ;;
+ esac ;;
+ s390x:SunOS:*:*)
+ echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+ echo i386-pc-auroraux${UNAME_RELEASE}
+ exit ;;
+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+ eval $set_cc_for_build
+ SUN_ARCH="i386"
+ # If there is a compiler, see if it is configured for 64-bit objects.
+ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+ # This test works for both compilers.
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ SUN_ARCH="x86_64"
+ fi
+ fi
+ echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ exit ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ ;;
+ sun4)
+ echo sparc-sun-sunos${UNAME_RELEASE}
+ ;;
+ esac
+ exit ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denotes a system which is actually not
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit ;;
+ m68k:machten:*:*)
+ echo m68k-apple-machten${UNAME_RELEASE}
+ exit ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+ exit ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ 2020:CLIX:*:* | 2430:CLIX:*:*)
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h> /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
+ #if defined (host_mips) && defined (MIPSEB)
+ #if defined (SYSTYPE_SYSV)
+ printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_SVR4)
+ printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+ printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ #endif
+ #endif
+ exit (-1);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c &&
+ dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+ SYSTEM_NAME=`$dummy $dummyarg` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo mips-mips-riscos${UNAME_RELEASE}
+ exit ;;
+ Motorola:PowerMAX_OS:*:*)
+ echo powerpc-motorola-powermax
+ exit ;;
+ Motorola:*:4.3:PL8-*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit ;;
+ m88k:CX/UX:7*:*)
+ echo m88k-harris-cxux7
+ exit ;;
+ m88k:*:4*:R4*)
+ echo m88k-motorola-sysv4
+ exit ;;
+ m88k:*:3*:R3*)
+ echo m88k-motorola-sysv3
+ exit ;;
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ then
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+ [ ${TARGET_BINARY_INTERFACE}x = x ]
+ then
+ echo m88k-dg-dgux${UNAME_RELEASE}
+ else
+ echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ fi
+ else
+ echo i586-dg-dgux${UNAME_RELEASE}
+ fi
+ exit ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit ;;
+ M88*:*:R3*:*)
+ # Delta 88k system running SVR3
+ echo m88k-motorola-sysv3
+ exit ;;
+ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+ echo m88k-tektronix-sysv3
+ exit ;;
+ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+ echo m68k-tektronix-bsd
+ exit ;;
+ *:IRIX*:*:*)
+ echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+ exit ;;
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ i*86:AIX:*:*)
+ echo i386-ibm-aix
+ exit ;;
+ ia64:AIX:*:*)
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <sys/systemcfg.h>
+
+ main()
+ {
+ if (!__power_pc())
+ exit(1);
+ puts("powerpc-ibm-aix3.2.5");
+ exit(0);
+ }
+EOF
+ if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+ then
+ echo "$SYSTEM_NAME"
+ else
+ echo rs6000-ibm-aix3.2.5
+ fi
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+ else
+ echo rs6000-ibm-aix3.2
+ fi
+ exit ;;
+ *:AIX:*:[4567])
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+ fi
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+ exit ;;
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+ exit ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+ exit ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+ exit ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit ;;
+ 9000/[34678]??:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ case "${UNAME_MACHINE}" in
+ 9000/31? ) HP_ARCH=m68000 ;;
+ 9000/[34]?? ) HP_ARCH=m68k ;;
+ 9000/[678][0-9][0-9])
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH="hppa2.0n" ;;
+ 64) HP_ARCH="hppa2.0w" ;;
+ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ esac ;;
+ esac
+ fi
+ if [ "${HP_ARCH}" = "" ]; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
+
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
+
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
+EOF
+ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ test -z "$HP_ARCH" && HP_ARCH=hppa
+ fi ;;
+ esac
+ if [ ${HP_ARCH} = "hppa2.0w" ]
+ then
+ eval $set_cc_for_build
+
+ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
+ # generating 64-bit code. GNU and HP use different nomenclature:
+ #
+ # $ CC_FOR_BUILD=cc ./config.guess
+ # => hppa2.0w-hp-hpux11.23
+ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+ # => hppa64-hp-hpux11.23
+
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+ grep -q __LP64__
+ then
+ HP_ARCH="hppa2.0w"
+ else
+ HP_ARCH="hppa64"
+ fi
+ fi
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ exit ;;
+ ia64:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux${HPUX_REV}
+ exit ;;
+ 3050*:HI-UX:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <unistd.h>
+ int
+ main ()
+ {
+ long cpu = sysconf (_SC_CPU_VERSION);
+ /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
+ results, however. */
+ if (CPU_IS_PA_RISC (cpu))
+ {
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+ default: puts ("hppa-hitachi-hiuxwe2"); break;
+ }
+ }
+ else if (CPU_IS_HP_MC68K (cpu))
+ puts ("m68k-hitachi-hiuxwe2");
+ else puts ("unknown-hitachi-hiuxwe2");
+ exit (0);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo unknown-hitachi-hiuxwe2
+ exit ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ echo hppa1.1-hp-bsd
+ exit ;;
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit ;;
+ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+ echo hppa1.0-hp-mpeix
+ exit ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ echo hppa1.1-hp-osf
+ exit ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit ;;
+ i*86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo ${UNAME_MACHINE}-unknown-osf1mk
+ else
+ echo ${UNAME_MACHINE}-unknown-osf1
+ fi
+ exit ;;
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+ exit ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+ exit ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+ -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*TS:*:*:*)
+ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*T3E:*:*:*)
+ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*SV1:*:*:*)
+ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ *:UNICOS/mp:*:*)
+ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ 5000:UNIX_System_V:4.*:*)
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ exit ;;
+ sparc*:BSD/OS:*:*)
+ echo sparc-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:FreeBSD:*:*)
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ case ${UNAME_PROCESSOR} in
+ amd64)
+ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ *)
+ echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ esac
+ exit ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+ exit ;;
+ *:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit ;;
+ i*:MSYS*:*)
+ echo ${UNAME_MACHINE}-pc-msys
+ exit ;;
+ i*:windows32*:*)
+ # uname -m includes "-pc" on this system.
+ echo ${UNAME_MACHINE}-mingw32
+ exit ;;
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+ exit ;;
+ *:Interix*:*)
+ case ${UNAME_MACHINE} in
+ x86)
+ echo i586-pc-interix${UNAME_RELEASE}
+ exit ;;
+ authenticamd | genuineintel | EM64T)
+ echo x86_64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ IA64)
+ echo ia64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ esac ;;
+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+ echo i${UNAME_MACHINE}-pc-mks
+ exit ;;
+ 8664:Windows_NT:*)
+ echo x86_64-pc-mks
+ exit ;;
+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+ # UNAME_MACHINE based on the output of uname instead of i386?
+ echo i586-pc-interix
+ exit ;;
+ i*:UWIN*:*)
+ echo ${UNAME_MACHINE}-pc-uwin
+ exit ;;
+ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+ echo x86_64-unknown-cygwin
+ exit ;;
+ p*:CYGWIN*:*)
+ echo powerpcle-unknown-cygwin
+ exit ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ *:GNU:*:*)
+ # the GNU system
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ exit ;;
+ *:GNU/*:*:*)
+ # other systems with GNU libc and userland
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+ exit ;;
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit ;;
+ aarch64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ aarch64_be:Linux:*:*)
+ UNAME_MACHINE=aarch64_be
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep -q ld.so.1
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ exit ;;
+ arm*:Linux:*:*)
+ eval $set_cc_for_build
+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_EABI__
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ else
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_PCS_VFP
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+ else
+ echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
+ fi
+ fi
+ exit ;;
+ avr32*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ cris:Linux:*:*)
+ echo ${UNAME_MACHINE}-axis-linux-gnu
+ exit ;;
+ crisv32:Linux:*:*)
+ echo ${UNAME_MACHINE}-axis-linux-gnu
+ exit ;;
+ frv:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ hexagon:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ i*86:Linux:*:*)
+ LIBC=gnu
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #ifdef __dietlibc__
+ LIBC=dietlibc
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+ exit ;;
+ ia64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ m32r*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ m68*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ mips:Linux:*:* | mips64:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef ${UNAME_MACHINE}
+ #undef ${UNAME_MACHINE}el
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=${UNAME_MACHINE}el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=${UNAME_MACHINE}
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ ;;
+ or32:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ padre:Linux:*:*)
+ echo sparc-unknown-linux-gnu
+ exit ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-gnu
+ exit ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+ PA7*) echo hppa1.1-unknown-linux-gnu ;;
+ PA8*) echo hppa2.0-unknown-linux-gnu ;;
+ *) echo hppa-unknown-linux-gnu ;;
+ esac
+ exit ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-gnu
+ exit ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-gnu
+ exit ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo ${UNAME_MACHINE}-ibm-linux
+ exit ;;
+ sh64*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ sh*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ tile*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ vax:Linux:*:*)
+ echo ${UNAME_MACHINE}-dec-linux-gnu
+ exit ;;
+ x86_64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ xtensa*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+ # sysname and nodename.
+ echo i386-sequent-sysv4
+ exit ;;
+ i*86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo ${UNAME_MACHINE}-pc-os2-emx
+ exit ;;
+ i*86:XTS-300:*:STOP)
+ echo ${UNAME_MACHINE}-unknown-stop
+ exit ;;
+ i*86:atheos:*:*)
+ echo ${UNAME_MACHINE}-unknown-atheos
+ exit ;;
+ i*86:syllable:*:*)
+ echo ${UNAME_MACHINE}-pc-syllable
+ exit ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ i*86:*DOS:*:*)
+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ exit ;;
+ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ else
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ fi
+ exit ;;
+ i*86:*:5:[678]*)
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+ esac
+ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ exit ;;
+ i*86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+ && UNAME_MACHINE=i686
+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+ && UNAME_MACHINE=i686
+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ else
+ echo ${UNAME_MACHINE}-pc-sysv32
+ fi
+ exit ;;
+ pc:*:*:*)
+ # Left here for compatibility:
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i586.
+ # Note: whatever this is, it MUST be the same as what config.sub
+ # prints for the "djgpp" host, or else GDB configury will decide that
+ # this is a cross-build.
+ echo i586-pc-msdosdjgpp
+ exit ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ fi
+ exit ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit ;;
+ mc68k:UNIX:SYSTEM5:3.51m)
+ echo m68k-convergent-sysv
+ exit ;;
+ M680?0:D-NIX:5.3:*)
+ echo m68k-diab-dnix
+ exit ;;
+ M68*:*:R3V[5678]*:*)
+ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4; exit; } ;;
+ NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+ OS_REL='.3'
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv${UNAME_RELEASE}
+ exit ;;
+ RM*:ReliantUNIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ echo ${UNAME_MACHINE}-sni-sysv4
+ else
+ echo ns32k-sni-sysv
+ fi
+ exit ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel at ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes at openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+ echo hppa1.1-stratus-sysv4
+ exit ;;
+ *:*:*:FTX*)
+ # From seanf at swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit ;;
+ i*86:VOS:*:*)
+ # From Paul.Green at stratus.com.
+ echo ${UNAME_MACHINE}-stratus-vos
+ exit ;;
+ *:VOS:*:*)
+ # From Paul.Green at stratus.com.
+ echo hppa1.1-stratus-vos
+ exit ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit ;;
+ news*:NEWS-OS:6*:*)
+ echo mips-sony-newsos6
+ exit ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+ exit ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit ;;
+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
+ echo powerpc-apple-beos
+ exit ;;
+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
+ echo i586-pc-beos
+ exit ;;
+ BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
+ echo i586-pc-haiku
+ exit ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-6:SUPER-UX:*:*)
+ echo sx6-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-7:SUPER-UX:*:*)
+ echo sx7-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8:SUPER-UX:*:*)
+ echo sx8-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8R:SUPER-UX:*:*)
+ echo sx8r-nec-superux${UNAME_RELEASE}
+ exit ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Rhapsody:*:*)
+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Darwin:*:*)
+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+ case $UNAME_PROCESSOR in
+ i386)
+ eval $set_cc_for_build
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ UNAME_PROCESSOR="x86_64"
+ fi
+ fi ;;
+ unknown) UNAME_PROCESSOR=powerpc ;;
+ esac
+ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+ exit ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+ UNAME_PROCESSOR=`uname -p`
+ if test "$UNAME_PROCESSOR" = "x86"; then
+ UNAME_PROCESSOR=i386
+ UNAME_MACHINE=pc
+ fi
+ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+ exit ;;
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit ;;
+ NEO-?:NONSTOP_KERNEL:*:*)
+ echo neo-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSE-?:NONSTOP_KERNEL:*:*)
+ echo nse-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSR-?:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ *:NonStop-UX:*:*)
+ echo mips-compaq-nonstopux
+ exit ;;
+ BS2000:POSIX*:*:*)
+ echo bs2000-siemens-sysv
+ exit ;;
+ DS/*:UNIX_System_V:*:*)
+ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+ exit ;;
+ *:Plan9:*:*)
+ # "uname -m" is not consistent, so use $cputype instead. 386
+ # is converted to i386 for consistency with other x86
+ # operating systems.
+ if test "$cputype" = "386"; then
+ UNAME_MACHINE=i386
+ else
+ UNAME_MACHINE="$cputype"
+ fi
+ echo ${UNAME_MACHINE}-unknown-plan9
+ exit ;;
+ *:TOPS-10:*:*)
+ echo pdp10-unknown-tops10
+ exit ;;
+ *:TENEX:*:*)
+ echo pdp10-unknown-tenex
+ exit ;;
+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+ echo pdp10-dec-tops20
+ exit ;;
+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+ echo pdp10-xkl-tops20
+ exit ;;
+ *:TOPS-20:*:*)
+ echo pdp10-unknown-tops20
+ exit ;;
+ *:ITS:*:*)
+ echo pdp10-unknown-its
+ exit ;;
+ SEI:*:*:SEIUX)
+ echo mips-sei-seiux${UNAME_RELEASE}
+ exit ;;
+ *:DragonFly:*:*)
+ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit ;;
+ *:*VMS:*:*)
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ case "${UNAME_MACHINE}" in
+ A*) echo alpha-dec-vms ; exit ;;
+ I*) echo ia64-dec-vms ; exit ;;
+ V*) echo vax-dec-vms ; exit ;;
+ esac ;;
+ *:XENIX:*:SysV)
+ echo i386-pc-xenix
+ exit ;;
+ i*86:skyos:*:*)
+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+ exit ;;
+ i*86:rdos:*:*)
+ echo ${UNAME_MACHINE}-pc-rdos
+ exit ;;
+ i*86:AROS:*:*)
+ echo ${UNAME_MACHINE}-pc-aros
+ exit ;;
+ x86_64:VMkernel:*:*)
+ echo ${UNAME_MACHINE}-unknown-esx
+ exit ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
+ I don't know.... */
+ printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+ "4"
+#else
+ ""
+#endif
+ ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+ printf ("arm-acorn-riscix\n"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+ printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+ int version;
+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+ if (version < 4)
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ else
+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+ exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+ printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+ printf ("ns32k-encore-mach\n"); exit (0);
+#else
+ printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+ printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+ printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+ printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+ struct utsname un;
+
+ uname(&un);
+
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+# include <sys/param.h>
+# if defined (BSD)
+# if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+# else
+# if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# endif
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# else
+ printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+ printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+ exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+ case `getsysinfo -f cpu_type` in
+ c1*)
+ echo c1-convex-bsd
+ exit ;;
+ c2*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ c34*)
+ echo c34-convex-bsd
+ exit ;;
+ c38*)
+ echo c38-convex-bsd
+ exit ;;
+ c4*)
+ echo c4-convex-bsd
+ exit ;;
+ esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches at gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo = `(hostinfo) 2>/dev/null`
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/build-aux/config.sub b/build-aux/config.sub
new file mode 100755
index 0000000..c894da4
--- /dev/null
+++ b/build-aux/config.sub
@@ -0,0 +1,1773 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+# 2011, 2012 Free Software Foundation, Inc.
+
+timestamp='2012-02-10'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine. It does not imply ALL GNU software can.
+#
+# This file 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Please send patches to <config-patches at gnu.org>. Submit a context
+# diff and a properly formatted GNU ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support. The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+ $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches at gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help"
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+ echo $1
+ exit ;;
+
+ * )
+ break ;;
+ esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+ exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+ exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+ knetbsd*-gnu* | netbsd*-gnu* | \
+ kopensolaris*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+ android-linux)
+ os=-linux-android
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+ ;;
+ *)
+ basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+ if [ $basic_machine != $1 ]
+ then os=`echo $1 | sed 's/.*-/-/'`
+ else os=; fi
+ ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work. We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+ -sun*os*)
+ # Prevent following clause from handling this invalid input.
+ ;;
+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+ -apple | -axis | -knuth | -cray | -microblaze)
+ os=
+ basic_machine=$1
+ ;;
+ -bluegene*)
+ os=-cnk
+ ;;
+ -sim | -cisco | -oki | -wec | -winbond)
+ os=
+ basic_machine=$1
+ ;;
+ -scout)
+ ;;
+ -wrs)
+ os=-vxworks
+ basic_machine=$1
+ ;;
+ -chorusos*)
+ os=-chorusos
+ basic_machine=$1
+ ;;
+ -chorusrdb)
+ os=-chorusrdb
+ basic_machine=$1
+ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco6)
+ os=-sco5v6
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5)
+ os=-sco3.2v5
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco4)
+ os=-sco3.2v4
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2v[4-9]*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco*)
+ os=-sco3.2v2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -udk*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -clix*)
+ basic_machine=clipper-intergraph
+ ;;
+ -isc*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -lynx*)
+ os=-lynxos
+ ;;
+ -ptx*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ ;;
+ -windowsnt*)
+ os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ ;;
+ -psos*)
+ os=-psos
+ ;;
+ -mint | -mint[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+ 1750a | 580 \
+ | a29k \
+ | aarch64 | aarch64_be \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | am33_2.0 \
+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+ | be32 | be64 \
+ | bfin \
+ | c4x | clipper \
+ | d10v | d30v | dlx | dsp16xx \
+ | epiphany \
+ | fido | fr30 | frv \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | hexagon \
+ | i370 | i860 | i960 | ia64 \
+ | ip2k | iq2000 \
+ | le32 | le64 \
+ | lm32 \
+ | m32c | m32r | m32rle | m68000 | m68k | m88k \
+ | maxq | mb | microblaze | mcore | mep | metag \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64el \
+ | mips64octeon | mips64octeonel \
+ | mips64orion | mips64orionel \
+ | mips64r5900 | mips64r5900el \
+ | mips64vr | mips64vrel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mips64vr5900 | mips64vr5900el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
+ | moxie \
+ | mt \
+ | msp430 \
+ | nds32 | nds32le | nds32be \
+ | nios | nios2 \
+ | ns16k | ns32k \
+ | open8 \
+ | or32 \
+ | pdp10 | pdp11 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle \
+ | pyramid \
+ | rl78 | rx \
+ | score \
+ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ | sh64 | sh64le \
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+ | spu \
+ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+ | ubicom32 \
+ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
+ | we32k \
+ | x86 | xc16x | xstormy16 | xtensa \
+ | z8k | z80)
+ basic_machine=$basic_machine-unknown
+ ;;
+ c54x)
+ basic_machine=tic54x-unknown
+ ;;
+ c55x)
+ basic_machine=tic55x-unknown
+ ;;
+ c6x)
+ basic_machine=tic6x-unknown
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ ;;
+ ms1)
+ basic_machine=mt-unknown
+ ;;
+
+ strongarm | thumb | xscale)
+ basic_machine=arm-unknown
+ ;;
+ xgate)
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ xscaleeb)
+ basic_machine=armeb-unknown
+ ;;
+
+ xscaleel)
+ basic_machine=armel-unknown
+ ;;
+
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+ *-*-*)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+ 580-* \
+ | a29k-* \
+ | aarch64-* | aarch64_be-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+ | avr-* | avr32-* \
+ | be32-* | be64-* \
+ | bfin-* | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* \
+ | clipper-* | craynv-* | cydra-* \
+ | d10v-* | d30v-* | dlx-* \
+ | elxsi-* \
+ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | hexagon-* \
+ | i*86-* | i860-* | i960-* | ia64-* \
+ | ip2k-* | iq2000-* \
+ | le32-* | le64-* \
+ | lm32-* \
+ | m32c-* | m32r-* | m32rle-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ | mips16-* \
+ | mips64-* | mips64el-* \
+ | mips64octeon-* | mips64octeonel-* \
+ | mips64orion-* | mips64orionel-* \
+ | mips64r5900-* | mips64r5900el-* \
+ | mips64vr-* | mips64vrel-* \
+ | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* \
+ | mips64vr5000-* | mips64vr5000el-* \
+ | mips64vr5900-* | mips64vr5900el-* \
+ | mipsisa32-* | mipsisa32el-* \
+ | mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa64-* | mipsisa64el-* \
+ | mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipstx39-* | mipstx39el-* \
+ | mmix-* \
+ | mt-* \
+ | msp430-* \
+ | nds32-* | nds32le-* | nds32be-* \
+ | nios-* | nios2-* \
+ | none-* | np1-* | ns16k-* | ns32k-* \
+ | open8-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
+ | pyramid-* \
+ | rl78-* | romp-* | rs6000-* | rx-* \
+ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+ | sparclite-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
+ | tahoe-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tile*-* \
+ | tron-* \
+ | ubicom32-* \
+ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+ | vax-* \
+ | we32k-* \
+ | x86-* | x86_64-* | xc16x-* | xps100-* \
+ | xstormy16-* | xtensa*-* \
+ | ymp-* \
+ | z8k-* | z80-*)
+ ;;
+ # Recognize the basic CPU types without company name, with glob match.
+ xtensa*)
+ basic_machine=$basic_machine-unknown
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 386bsd)
+ basic_machine=i386-unknown
+ os=-bsd
+ ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ abacus)
+ basic_machine=abacus-unknown
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ os=-scout
+ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
+ amd64)
+ basic_machine=x86_64-pc
+ ;;
+ amd64-*)
+ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+ basic_machine=m68k-unknown
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ os=-bsd
+ ;;
+ aros)
+ basic_machine=i386-pc
+ os=-aros
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
+ blackfin)
+ basic_machine=bfin-unknown
+ os=-linux
+ ;;
+ blackfin-*)
+ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ bluegene*)
+ basic_machine=powerpc-ibm
+ os=-cnk
+ ;;
+ c54x-*)
+ basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c55x-*)
+ basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c6x-*)
+ basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c90)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
+ cegcc)
+ basic_machine=arm-unknown
+ os=-cegcc
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=-bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=-bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=-bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+ cray | j90)
+ basic_machine=j90-cray
+ os=-unicos
+ ;;
+ craynv)
+ basic_machine=craynv-cray
+ os=-unicosmp
+ ;;
+ cr16 | cr16-*)
+ basic_machine=cr16-unknown
+ os=-elf
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+ crisv32 | crisv32-* | etraxfs*)
+ basic_machine=crisv32-axis
+ ;;
+ cris | cris-* | etrax*)
+ basic_machine=cris-axis
+ ;;
+ crx)
+ basic_machine=crx-unknown
+ os=-elf
+ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
+ decsystem10* | dec10*)
+ basic_machine=pdp10-dec
+ os=-tops10
+ ;;
+ decsystem20* | dec20*)
+ basic_machine=pdp10-dec
+ os=-tops20
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
+ dicos)
+ basic_machine=i686-pc
+ os=-dicos
+ ;;
+ djgpp)
+ basic_machine=i586-pc
+ os=-msdosdjgpp
+ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+ ;;
+ dpx2* | dpx2*-bull)
+ basic_machine=m68k-bull
+ os=-sysv3
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=-ebmon
+ ;;
+ elxsi)
+ basic_machine=elxsi-elxsi
+ os=-bsd
+ ;;
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ os=-ose
+ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+ genix)
+ basic_machine=ns32k-ns
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ os=-go32
+ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ os=-xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ os=-hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+ ;;
+ hp300-*)
+ basic_machine=m68k-hp
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=-bsd
+ ;;
+ hp300hpux)
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hppa-next)
+ os=-nextstep3
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ os=-osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=-proelf
+ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ ;;
+ i*86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+ i*86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+ i*86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+ i*86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ os=-mach
+ ;;
+ i386-vsta | vsta)
+ basic_machine=i386-unknown
+ os=-vsta
+ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+ -irix*)
+ ;;
+ *)
+ os=-irix4
+ ;;
+ esac
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=-sysv
+ ;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ os=-linux
+ ;;
+ m68knommu-*)
+ basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ m88k-omron*)
+ basic_machine=m88k-omron
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=-sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
+ microblaze)
+ basic_machine=microblaze-xilinx
+ ;;
+ mingw32)
+ basic_machine=i386-pc
+ os=-mingw32
+ ;;
+ mingw32ce)
+ basic_machine=arm-unknown
+ os=-mingw32ce
+ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ os=-morphos
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ os=-msdos
+ ;;
+ ms1-*)
+ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+ ;;
+ msys)
+ basic_machine=i386-pc
+ os=-msys
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
+ nacl)
+ basic_machine=le32-unknown
+ os=-nacl
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-unknown
+ os=-netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ os=-linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=-newsos
+ ;;
+ news-3600 | risc-news)
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ os=-sysv
+ ;;
+ next | m*-next )
+ basic_machine=m68k-next
+ case $os in
+ -nextstep* )
+ ;;
+ -ns2*)
+ os=-nextstep2
+ ;;
+ *)
+ os=-nextstep3
+ ;;
+ esac
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=-cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=-cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ os=-mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ os=-nonstopux
+ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
+ neo-tandem)
+ basic_machine=neo-tandem
+ ;;
+ nse-tandem)
+ basic_machine=nse-tandem
+ ;;
+ nsr-tandem)
+ basic_machine=nsr-tandem
+ ;;
+ op50n-* | op60c-*)
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
+ openrisc | openrisc-*)
+ basic_machine=or32-unknown
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+ os=-os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ os=-ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ os=-os68k
+ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=-osf
+ ;;
+ parisc)
+ basic_machine=hppa-unknown
+ os=-linux
+ ;;
+ parisc-*)
+ basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+ pc98)
+ basic_machine=i386-pc
+ ;;
+ pc98-*)
+ basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium | p5 | k5 | k6 | nexgen | viac3)
+ basic_machine=i586-pc
+ ;;
+ pentiumpro | p6 | 6x86 | athlon | athlon_*)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2 | pentiumiii | pentium3)
+ basic_machine=i686-pc
+ ;;
+ pentium4)
+ basic_machine=i786-pc
+ ;;
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium4-*)
+ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+ power) basic_machine=power-ibm
+ ;;
+ ppc | ppcbe) basic_machine=powerpc-unknown
+ ;;
+ ppc-* | ppcbe-*)
+ basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
+ ;;
+ ppc64le-* | powerpc64little-*)
+ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ os=-pw32
+ ;;
+ rdos)
+ basic_machine=i386-pc
+ os=-rdos
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+ s390 | s390-*)
+ basic_machine=s390-ibm
+ ;;
+ s390x | s390x-*)
+ basic_machine=s390x-ibm
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ sb1)
+ basic_machine=mipsisa64sb1-unknown
+ ;;
+ sb1el)
+ basic_machine=mipsisa64sb1el-unknown
+ ;;
+ sde)
+ basic_machine=mipsisa32-sde
+ os=-elf
+ ;;
+ sei)
+ basic_machine=mips-sei
+ os=-seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+ sh)
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
+ sh5el)
+ basic_machine=sh5le-unknown
+ ;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparclite-wrs | simso-wrs)
+ basic_machine=sparclite-wrs
+ os=-vxworks
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+ ;;
+ spur)
+ basic_machine=spur-unknown
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ os=-sysv4
+ ;;
+ strongarm-* | thumb-*)
+ basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=-sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=-sunos4
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=-sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=-sunos4
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=-sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=-sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=-solaris2
+ ;;
+ sun3 | sun3-*)
+ basic_machine=m68k-sun
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ os=-unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ os=-unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ os=-unicos
+ ;;
+ tile*)
+ basic_machine=$basic_machine-unknown
+ os=-linux-gnu
+ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ os=-tops20
+ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+ os=-tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ os=-none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+ basic_machine=f301-fujitsu
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=-vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+ w65*)
+ basic_machine=w65-wdc
+ os=-none
+ ;;
+ w89k-*)
+ basic_machine=hppa1.1-winbond
+ os=-proelf
+ ;;
+ xbox)
+ basic_machine=i686-pc
+ os=-mingw32
+ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+ xscale-* | xscalee[bl]-*)
+ basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ z8k-*-coff)
+ basic_machine=z8k-unknown
+ os=-sim
+ ;;
+ z80-*-coff)
+ basic_machine=z80-unknown
+ os=-sim
+ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+ ;;
+
+# Here we handle the default manufacturer of certain CPU types. It is in
+# some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ basic_machine=hppa1.1-winbond
+ ;;
+ op50n)
+ basic_machine=hppa1.1-oki
+ ;;
+ op60c)
+ basic_machine=hppa1.1-oki
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+ mmix)
+ basic_machine=mmix-knuth
+ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
+ pdp10)
+ # there are many clones, so DEC is not a safe bet
+ basic_machine=pdp10-unknown
+ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+ sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+ basic_machine=sh-unknown
+ ;;
+ sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+ basic_machine=sparc-sun
+ ;;
+ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+ basic_machine=orion-highlevel
+ ;;
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+ mac | mpw | mac-mpw)
+ basic_machine=m68k-apple
+ ;;
+ pmac | pmac-mpw)
+ basic_machine=powerpc-apple
+ ;;
+ *-unknown)
+ # Make sure to match an already-canonicalized machine name.
+ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+ *-digital*)
+ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+ # First match some system type aliases
+ # that might get confused with valid system types.
+ # -solaris* is a basic system type, with this one exception.
+ -auroraux)
+ os=-auroraux
+ ;;
+ -solaris1 | -solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+ -solaris)
+ os=-solaris2
+ ;;
+ -svr4*)
+ os=-sysv4
+ ;;
+ -unixware*)
+ os=-sysv4.2uw
+ ;;
+ -gnu/linux*)
+ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ ;;
+ # First accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST END IN A *, to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+ | -sym* | -kopensolaris* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* | -aros* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+ | -openbsd* | -solidbsd* \
+ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* | -cegcc* \
+ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux-gnu* | -linux-android* \
+ | -linux-newlib* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -qnx*)
+ case $basic_machine in
+ x86-* | i*86-*)
+ ;;
+ *)
+ os=-nto$os
+ ;;
+ esac
+ ;;
+ -nto-qnx*)
+ ;;
+ -nto*)
+ os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ ;;
+ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ ;;
+ -mac*)
+ os=`echo $os | sed -e 's|mac|macos|'`
+ ;;
+ -linux-dietlibc)
+ os=-linux-dietlibc
+ ;;
+ -linux*)
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+ -sunos5*)
+ os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ ;;
+ -sunos6*)
+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ ;;
+ -opened*)
+ os=-openedition
+ ;;
+ -os400*)
+ os=-os400
+ ;;
+ -wince*)
+ os=-wince
+ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+ -osf*)
+ os=-osf
+ ;;
+ -utek*)
+ os=-bsd
+ ;;
+ -dynix*)
+ os=-bsd
+ ;;
+ -acis*)
+ os=-aos
+ ;;
+ -atheos*)
+ os=-atheos
+ ;;
+ -syllable*)
+ os=-syllable
+ ;;
+ -386bsd)
+ os=-bsd
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
+ -nova*)
+ os=-rtmk-nova
+ ;;
+ -ns2 )
+ os=-nextstep2
+ ;;
+ -nsk*)
+ os=-nsk
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
+ ;;
+ -sinix*)
+ os=-sysv4
+ ;;
+ -tpf*)
+ os=-tpf
+ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+ -oss*)
+ os=-sysv3
+ ;;
+ -svr4)
+ os=-sysv4
+ ;;
+ -svr3)
+ os=-sysv3
+ ;;
+ -sysvr4)
+ os=-sysv4
+ ;;
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
+ -ose*)
+ os=-ose
+ ;;
+ -es1800*)
+ os=-ose
+ ;;
+ -xenix)
+ os=-xenix
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ os=-mint
+ ;;
+ -aros*)
+ os=-aros
+ ;;
+ -kaos*)
+ os=-kaos
+ ;;
+ -zvmoe)
+ os=-zvmoe
+ ;;
+ -dicos*)
+ os=-dicos
+ ;;
+ -nacl*)
+ ;;
+ -none)
+ ;;
+ *)
+ # Get rid of the `-' at the beginning of $os.
+ os=`echo $os | sed 's/[^-]*-//'`
+ echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system. Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+ score-*)
+ os=-elf
+ ;;
+ spu-*)
+ os=-elf
+ ;;
+ *-acorn)
+ os=-riscix1.2
+ ;;
+ arm*-rebel)
+ os=-linux
+ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
+ tic54x-*)
+ os=-coff
+ ;;
+ tic55x-*)
+ os=-coff
+ ;;
+ tic6x-*)
+ os=-coff
+ ;;
+ # This must come before the *-dec entry.
+ pdp10-*)
+ os=-tops20
+ ;;
+ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+ os=-ultrix4.2
+ ;;
+ m68*-apollo)
+ os=-domain
+ ;;
+ i386-sun)
+ os=-sunos4.0.2
+ ;;
+ m68000-sun)
+ os=-sunos3
+ ;;
+ m68*-cisco)
+ os=-aout
+ ;;
+ mep-*)
+ os=-elf
+ ;;
+ mips*-cisco)
+ os=-elf
+ ;;
+ mips*-*)
+ os=-elf
+ ;;
+ or32-*)
+ os=-coff
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
+ *-be)
+ os=-beos
+ ;;
+ *-haiku)
+ os=-haiku
+ ;;
+ *-ibm)
+ os=-aix
+ ;;
+ *-knuth)
+ os=-mmixware
+ ;;
+ *-wec)
+ os=-proelf
+ ;;
+ *-winbond)
+ os=-proelf
+ ;;
+ *-oki)
+ os=-proelf
+ ;;
+ *-hp)
+ os=-hpux
+ ;;
+ *-hitachi)
+ os=-hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+ os=-sysv
+ ;;
+ *-cbm)
+ os=-amigaos
+ ;;
+ *-dg)
+ os=-dgux
+ ;;
+ *-dolphin)
+ os=-sysv3
+ ;;
+ m68k-ccur)
+ os=-rtu
+ ;;
+ m88k-omron*)
+ os=-luna
+ ;;
+ *-next )
+ os=-nextstep
+ ;;
+ *-sequent)
+ os=-ptx
+ ;;
+ *-crds)
+ os=-unos
+ ;;
+ *-ns)
+ os=-genix
+ ;;
+ i370-*)
+ os=-mvs
+ ;;
+ *-next)
+ os=-nextstep3
+ ;;
+ *-gould)
+ os=-sysv
+ ;;
+ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+ *-sgi)
+ os=-irix
+ ;;
+ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+ f30[01]-fujitsu | f700-fujitsu)
+ os=-uxpv
+ ;;
+ *-rom68k)
+ os=-coff
+ ;;
+ *-*bug)
+ os=-coff
+ ;;
+ *-apple)
+ os=-macos
+ ;;
+ *-atari*)
+ os=-mint
+ ;;
+ *)
+ os=-none
+ ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer. We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+ *-unknown)
+ case $os in
+ -riscix*)
+ vendor=acorn
+ ;;
+ -sunos*)
+ vendor=sun
+ ;;
+ -cnk*|-aix*)
+ vendor=ibm
+ ;;
+ -beos*)
+ vendor=be
+ ;;
+ -hpux*)
+ vendor=hp
+ ;;
+ -mpeix*)
+ vendor=hp
+ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+ -unos*)
+ vendor=crds
+ ;;
+ -dgux*)
+ vendor=dg
+ ;;
+ -luna*)
+ vendor=omron
+ ;;
+ -genix*)
+ vendor=ns
+ ;;
+ -mvs* | -opened*)
+ vendor=ibm
+ ;;
+ -os400*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+ -tpf*)
+ vendor=ibm
+ ;;
+ -vxsim* | -vxworks* | -windiss*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
+ -hms*)
+ vendor=hitachi
+ ;;
+ -mpw* | -macos*)
+ vendor=apple
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ vendor=atari
+ ;;
+ -vos*)
+ vendor=stratus
+ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+esac
+
+echo $basic_machine$os
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/build-aux/depcomp b/build-aux/depcomp
new file mode 100755
index 0000000..bd0ac08
--- /dev/null
+++ b/build-aux/depcomp
@@ -0,0 +1,688 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2011-12-04.11; # UTC
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010,
+# 2011 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva at dcc.unicamp.br>.
+
+case $1 in
+ '')
+ echo "$0: No command. Try \`$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+ depmode Dependency tracking mode.
+ source Source file read by `PROGRAMS ARGS'.
+ object Object file output by `PROGRAMS ARGS'.
+ DEPDIR directory where to store dependencies.
+ depfile Dependency file to output.
+ tmpdepfile Temporary file to use when outputting dependencies.
+ libtool Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake at gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "depcomp $scriptversion"
+ exit $?
+ ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+ echo "depcomp: Variables source, object and depmode must be set" 1>&2
+ exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+ sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags. We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write. Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+ # HP compiler uses -M and no extra arg.
+ gccflag=-M
+ depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+ # This is just like dashmstdout with a different argument.
+ dashmflag=-xM
+ depmode=dashmstdout
+fi
+
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+ # This is just like msvisualcpp but w/o cygpath translation.
+ # Just convert the backslash-escaped backslashes to single forward
+ # slashes to satisfy depend.m4
+ cygpath_u='sed s,\\\\,/,g'
+ depmode=msvisualcpp
+fi
+
+if test "$depmode" = msvc7msys; then
+ # This is just like msvc7 but w/o cygpath translation.
+ # Just convert the backslash-escaped backslashes to single forward
+ # slashes to satisfy depend.m4
+ cygpath_u='sed s,\\\\,/,g'
+ depmode=msvc7
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want. Yay! Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff. Hmm.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am. Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+ for arg
+ do
+ case $arg in
+ -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+ *) set fnord "$@" "$arg" ;;
+ esac
+ shift # fnord
+ shift # $arg
+ done
+ "$@"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ mv "$tmpdepfile" "$depfile"
+ ;;
+
+gcc)
+## There are various ways to get dependency output from gcc. Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+## up in a subdir. Having to rename by hand is ugly.
+## (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+## -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+## than renaming).
+ if test -z "$gccflag"; then
+ gccflag=-MD,
+ fi
+ "$@" -Wp,"$gccflag$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+ sed -e 's/^[^:]*: / /' \
+ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header). We avoid this by adding
+## dummy dependencies for each header file. Too bad gcc doesn't do
+## this for us directly.
+ tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'. On the theory
+## that the space means something, we add a space to the output as
+## well. hp depmode also adds that space, but also prefixes the VPATH
+## to the object. Take care to not repeat it in the output.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
+ | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+sgi)
+ if test "$libtool" = yes; then
+ "$@" "-Wp,-MDupdate,$tmpdepfile"
+ else
+ "$@" -MDupdate "$tmpdepfile"
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+
+ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
+ echo "$object : \\" > "$depfile"
+
+ # Clip off the initial element (the dependent). Don't try to be
+ # clever and replace this with sed code, as IRIX sed won't handle
+ # lines with more than a fixed number of characters (4096 in
+ # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
+ # the IRIX cc adds comments like `#:fec' to the end of the
+ # dependency line.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+ tr '
+' ' ' >> "$depfile"
+ echo >> "$depfile"
+
+ # The second pass generates a dummy entry for each header file.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+ >> "$depfile"
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+aix)
+ # The C for AIX Compiler uses -M and outputs the dependencies
+ # in a .u file. In older versions, this file always lives in the
+ # current directory. Also, the AIX compiler puts `$object:' at the
+ # start of each line; $object doesn't have directory information.
+ # Version 6 uses the directory in both cases.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$base.u
+ tmpdepfile3=$dir.libs/$base.u
+ "$@" -Wc,-M
+ else
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$dir$base.u
+ tmpdepfile3=$dir$base.u
+ "$@" -M
+ fi
+ stat=$?
+
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ # Each line is of the form `foo.o: dependent.h'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+ # That's a tab and a space in the [].
+ sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+icc)
+ # Intel's C compiler understands `-MD -MF file'. However on
+ # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+ # ICC 7.0 will fill foo.d with something like
+ # foo.o: sub/foo.c
+ # foo.o: sub/foo.h
+ # which is wrong. We want:
+ # sub/foo.o: sub/foo.c
+ # sub/foo.o: sub/foo.h
+ # sub/foo.c:
+ # sub/foo.h:
+ # ICC 7.1 will output
+ # foo.o: sub/foo.c sub/foo.h
+ # and will wrap long lines using \ :
+ # foo.o: sub/foo.c ... \
+ # sub/foo.h ... \
+ # ...
+
+ "$@" -MD -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each line is of the form `foo.o: dependent.h',
+ # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process this invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
+ sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp2)
+ # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+ # compilers, which have integrated preprocessors. The correct option
+ # to use with these is +Maked; it writes dependencies to a file named
+ # 'foo.d', which lands next to the object file, wherever that
+ # happens to be.
+ # Much of this is similar to the tru64 case; see comments there.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir.libs/$base.d
+ "$@" -Wc,+Maked
+ else
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir$base.d
+ "$@" +Maked
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+ # Add `dependent.h:' lines.
+ sed -ne '2,${
+ s/^ *//
+ s/ \\*$//
+ s/$/:/
+ p
+ }' "$tmpdepfile" >> "$depfile"
+ else
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile" "$tmpdepfile2"
+ ;;
+
+tru64)
+ # The Tru64 compiler uses -MD to generate dependencies as a side
+ # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+ # dependencies in `foo.d' instead, so we check for that too.
+ # Subdirectories are respected.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+
+ if test "$libtool" = yes; then
+ # With Tru64 cc, shared objects can also be used to make a
+ # static library. This mechanism is used in libtool 1.4 series to
+ # handle both shared and static libraries in a single compilation.
+ # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+ #
+ # With libtool 1.5 this exception was removed, and libtool now
+ # generates 2 separate objects for the 2 libraries. These two
+ # compilations output dependencies in $dir.libs/$base.o.d and
+ # in $dir$base.o.d. We have to check for both files, because
+ # one of the two compilations can be disabled. We should prefer
+ # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+ # automatically cleaned when .libs/ is deleted, while ignoring
+ # the former would cause a distcleancheck panic.
+ tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
+ tmpdepfile2=$dir$base.o.d # libtool 1.5
+ tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
+ tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
+ "$@" -Wc,-MD
+ else
+ tmpdepfile1=$dir$base.o.d
+ tmpdepfile2=$dir$base.d
+ tmpdepfile3=$dir$base.d
+ tmpdepfile4=$dir$base.d
+ "$@" -MD
+ fi
+
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+ # That's a tab and a space in the [].
+ sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ else
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+msvc7)
+ if test "$libtool" = yes; then
+ showIncludes=-Wc,-showIncludes
+ else
+ showIncludes=-showIncludes
+ fi
+ "$@" $showIncludes > "$tmpdepfile"
+ stat=$?
+ grep -v '^Note: including file: ' "$tmpdepfile"
+ if test "$stat" = 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ # The first sed program below extracts the file names and escapes
+ # backslashes for cygpath. The second sed program outputs the file
+ # name when reading, but also accumulates all include files in the
+ # hold buffer in order to output them again at the end. This only
+ # works with sed implementations that can handle large buffers.
+ sed < "$tmpdepfile" -n '
+/^Note: including file: *\(.*\)/ {
+ s//\1/
+ s/\\/\\\\/g
+ p
+}' | $cygpath_u | sort -u | sed -n '
+s/ /\\ /g
+s/\(.*\)/ \1 \\/p
+s/.\(.*\) \\/\1:/
+H
+$ {
+ s/.*/ /
+ G
+ p
+}' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvc7msys)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+#nosideeffect)
+ # This comment above is used by automake to tell side-effect
+ # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout, regardless of -o.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove `-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ test -z "$dashmflag" && dashmflag=-M
+ # Require at least two characters before searching for `:'
+ # in the target name. This is to cope with DOS-style filenames:
+ # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+ "$@" $dashmflag |
+ sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+dashXmstdout)
+ # This case only exists to satisfy depend.m4. It is never actually
+ # run, as this mode is specially recognized in the preamble.
+ exit 1
+ ;;
+
+makedepend)
+ "$@" || exit $?
+ # Remove any Libtool call
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+ # X makedepend
+ shift
+ cleared=no eat=no
+ for arg
+ do
+ case $cleared in
+ no)
+ set ""; shift
+ cleared=yes ;;
+ esac
+ if test $eat = yes; then
+ eat=no
+ continue
+ fi
+ case "$arg" in
+ -D*|-I*)
+ set fnord "$@" "$arg"; shift ;;
+ # Strip any option that makedepend may not understand. Remove
+ # the object too, otherwise makedepend will parse it as a source file.
+ -arch)
+ eat=yes ;;
+ -*|$object)
+ ;;
+ *)
+ set fnord "$@" "$arg"; shift ;;
+ esac
+ done
+ obj_suffix=`echo "$object" | sed 's/^.*\././'`
+ touch "$tmpdepfile"
+ ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+ rm -f "$depfile"
+ # makedepend may prepend the VPATH from the source file name to the object.
+ # No need to regex-escape $object, excess matching of '.' is harmless.
+ sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
+ sed '1,2d' "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile" "$tmpdepfile".bak
+ ;;
+
+cpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove `-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ "$@" -E |
+ sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+ sed '$ s: \\$::' > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ cat < "$tmpdepfile" >> "$depfile"
+ sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvisualcpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ IFS=" "
+ for arg
+ do
+ case "$arg" in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+ set fnord "$@"
+ shift
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift
+ shift
+ ;;
+ esac
+ done
+ "$@" -E 2>/dev/null |
+ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
+ echo " " >> "$depfile"
+ sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvcmsys)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+none)
+ exec "$@"
+ ;;
+
+*)
+ echo "Unknown depmode $depmode" 1>&2
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/build-aux/install-sh b/build-aux/install-sh
new file mode 100755
index 0000000..a9244eb
--- /dev/null
+++ b/build-aux/install-sh
@@ -0,0 +1,527 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2011-01-19.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
+ # Protect names problematic for `test' and other utilities.
+ case $dst_arg in
+ -* | [=\(\)!]) dst_arg=./$dst_arg;;
+ esac
+ 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
+ # Protect names problematic for `test' and other utilities.
+ case $dst_arg in
+ -* | [=\(\)!]) dst_arg=./$dst_arg;;
+ esac
+ 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
+ do_exit='(exit $ret); exit $ret'
+ trap "ret=129; $do_exit" 1
+ trap "ret=130; $do_exit" 2
+ trap "ret=141; $do_exit" 13
+ trap "ret=143; $do_exit" 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 problematic for `test' and other utilities.
+ 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
+
+ # 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 X"$d" = X && continue
+
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
+ else
+ if $posix_mkdir; then
+ (umask=$mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
+ fi
+ prefix=$prefix/
+ 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:
diff --git a/build-aux/missing b/build-aux/missing
new file mode 100755
index 0000000..86a8fc3
--- /dev/null
+++ b/build-aux/missing
@@ -0,0 +1,331 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2012-01-06.13; # UTC
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
+# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+fi
+
+run=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+ configure_ac=configure.ac
+else
+ configure_ac=configure.in
+fi
+
+msg="missing on your system"
+
+case $1 in
+--run)
+ # Try to run requested program, and just exit if it succeeds.
+ run=
+ shift
+ "$@" && exit 0
+ # Exit code 63 means version mismatch. This often happens
+ # when the user try to use an ancient version of a tool on
+ # a file that requires a minimum version. In this case we
+ # we should proceed has if the program had been absent, or
+ # if --run hadn't been passed.
+ if test $? = 63; then
+ run=:
+ msg="probably too old"
+ fi
+ ;;
+
+ -h|--h|--he|--hel|--help)
+ echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version output version information and exit
+ --run try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+ aclocal touch file \`aclocal.m4'
+ autoconf touch file \`configure'
+ autoheader touch file \`config.h.in'
+ autom4te touch the output file, or create a stub one
+ automake touch all \`Makefile.in' files
+ bison create \`y.tab.[ch]', if possible, from existing .[ch]
+ flex create \`lex.yy.c', if possible, from existing .c
+ help2man touch the output file
+ lex create \`lex.yy.c', if possible, from existing .c
+ makeinfo touch the output file
+ yacc create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
+\`g' are ignored when checking the name.
+
+Send bug reports to <bug-automake at gnu.org>."
+ exit $?
+ ;;
+
+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+ echo "missing $scriptversion (GNU Automake)"
+ exit $?
+ ;;
+
+ -*)
+ echo 1>&2 "$0: Unknown \`$1' option"
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+ ;;
+
+esac
+
+# normalize program name to check for.
+program=`echo "$1" | sed '
+ s/^gnu-//; t
+ s/^gnu//; t
+ s/^g//; t'`
+
+# Now exit if we have it, but it failed. Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program). This is about non-GNU programs, so use $1 not
+# $program.
+case $1 in
+ lex*|yacc*)
+ # Not GNU programs, they don't have --version.
+ ;;
+
+ *)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ # Could not run --version or --help. This is probably someone
+ # running `$TOOL --version' or `$TOOL --help' to check whether
+ # $TOOL exists and not knowing $TOOL uses missing.
+ exit 1
+ fi
+ ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case $program in
+ aclocal*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`acinclude.m4' or \`${configure_ac}'. You might want
+ to install the \`Automake' and \`Perl' packages. Grab them from
+ any GNU archive site."
+ touch aclocal.m4
+ ;;
+
+ autoconf*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`${configure_ac}'. You might want to install the
+ \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
+ archive site."
+ touch configure
+ ;;
+
+ autoheader*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`acconfig.h' or \`${configure_ac}'. You might want
+ to install the \`Autoconf' and \`GNU m4' packages. Grab them
+ from any GNU archive site."
+ files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+ test -z "$files" && files="config.h"
+ touch_files=
+ for f in $files; do
+ case $f in
+ *:*) touch_files="$touch_files "`echo "$f" |
+ sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+ *) touch_files="$touch_files $f.in";;
+ esac
+ done
+ touch $touch_files
+ ;;
+
+ automake*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+ You might want to install the \`Automake' and \`Perl' packages.
+ Grab them from any GNU archive site."
+ find . -type f -name Makefile.am -print |
+ sed 's/\.am$/.in/' |
+ while read f; do touch "$f"; done
+ ;;
+
+ autom4te*)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, but is $msg.
+ You might have modified some files without having the
+ proper tools for further handling them.
+ You can get \`$1' as part of \`Autoconf' from any GNU
+ archive site."
+
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo "#! /bin/sh"
+ echo "# Created by GNU Automake missing as a replacement of"
+ echo "# $ $@"
+ echo "exit 0"
+ chmod +x $file
+ exit 1
+ fi
+ ;;
+
+ bison*|yacc*)
+ echo 1>&2 "\
+WARNING: \`$1' $msg. You should only need it if
+ you modified a \`.y' file. You may need the \`Bison' package
+ in order for those modifications to take effect. You can get
+ \`Bison' from any GNU archive site."
+ rm -f y.tab.c y.tab.h
+ if test $# -ne 1; then
+ eval LASTARG=\${$#}
+ case $LASTARG in
+ *.y)
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" y.tab.c
+ fi
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" y.tab.h
+ fi
+ ;;
+ esac
+ fi
+ if test ! -f y.tab.h; then
+ echo >y.tab.h
+ fi
+ if test ! -f y.tab.c; then
+ echo 'main() { return 0; }' >y.tab.c
+ fi
+ ;;
+
+ lex*|flex*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a \`.l' file. You may need the \`Flex' package
+ in order for those modifications to take effect. You can get
+ \`Flex' from any GNU archive site."
+ rm -f lex.yy.c
+ if test $# -ne 1; then
+ eval LASTARG=\${$#}
+ case $LASTARG in
+ *.l)
+ SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" lex.yy.c
+ fi
+ ;;
+ esac
+ fi
+ if test ! -f lex.yy.c; then
+ echo 'main() { return 0; }' >lex.yy.c
+ fi
+ ;;
+
+ help2man*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a dependency of a manual page. You may need the
+ \`Help2man' package in order for those modifications to take
+ effect. You can get \`Help2man' from any GNU archive site."
+
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo ".ab help2man is required to generate this page"
+ exit $?
+ fi
+ ;;
+
+ makeinfo*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a \`.texi' or \`.texinfo' file, or any other file
+ indirectly affecting the aspect of the manual. The spurious
+ call might also be the consequence of using a buggy \`make' (AIX,
+ DU, IRIX). You might want to install the \`Texinfo' package or
+ the \`GNU make' package. Grab either from any GNU archive site."
+ # The file to touch is that specified with -o ...
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -z "$file"; then
+ # ... or it is the one specified with @setfilename ...
+ infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+ file=`sed -n '
+ /^@setfilename/{
+ s/.* \([^ ]*\) *$/\1/
+ p
+ q
+ }' $infile`
+ # ... or it is derived from the source name (dir/f.texi becomes f.info)
+ test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
+ fi
+ # If the file does not exist, the user really needs makeinfo;
+ # let's fail without touching anything.
+ test -f $file || exit 1
+ touch $file
+ ;;
+
+ *)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, and is $msg.
+ You might have modified some files without having the
+ proper tools for further handling them. Check the \`README' file,
+ it often tells you about the needed prerequisites for installing
+ this package. You may also peek at any GNU archive site, in case
+ some other package would contain this missing \`$1' program."
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# 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:
diff --git a/configure b/configure
new file mode 100755
index 0000000..689a8cf
--- /dev/null
+++ b/configure
@@ -0,0 +1,9300 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.68 for FLWKEY 1.1.6.
+#
+# Report bugs to <w1hkj AT w1hkj DOT com>.
+#
+# Copyright (C) 2009 Dave Freese, W1HKJ (w1hkj AT w1hkj DOT com)
+#
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+# Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test "x$CONFIG_SHELL" = x; then
+ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+"
+ as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+ exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1"
+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+ if (eval "$as_required") 2>/dev/null; then :
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ as_found=:
+ case $as_dir in #(
+ /*)
+ for as_base in sh bash ksh sh5; do
+ # Try only shells that exist, to save several forks.
+ as_shell=$as_dir/$as_base
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ CONFIG_SHELL=$as_shell as_have_required=yes
+ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ break 2
+fi
+fi
+ done;;
+ esac
+ as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+ if test "x$CONFIG_SHELL" != x; then :
+ # We cannot yet assume a decent shell, so we have to provide a
+ # neutralization value for shells without unset; and this also
+ # works around shells that cannot unset nonexistent variables.
+ # Preserve -v and -x to the replacement shell.
+ BASH_ENV=/dev/null
+ ENV=/dev/null
+ (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+ export CONFIG_SHELL
+ case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+ esac
+ exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+fi
+
+ if test x$as_have_required = xno; then :
+ $as_echo "$0: This script requires a shell more modern than all"
+ $as_echo "$0: the shells that I found on your system."
+ if test x${ZSH_VERSION+set} = xset ; then
+ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+ else
+ $as_echo "$0: Please tell bug-autoconf at gnu.org and w1hkj AT w1hkj DOT
+$0: com about your system, including any error possibly
+$0: output before this message. Then install a modern
+$0: shell, or manually run the script under such a shell if
+$0: you do have one."
+ fi
+ exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -p'
+ fi
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in #(
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='FLWKEY'
+PACKAGE_TARNAME='flwkey'
+PACKAGE_VERSION='1.1.6'
+PACKAGE_STRING='FLWKEY 1.1.6'
+PACKAGE_BUGREPORT='w1hkj AT w1hkj DOT com'
+PACKAGE_URL=''
+
+ac_unique_file="src/flwkey.cxx"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+FLWKEY_BUILD_LDADD
+FLWKEY_BUILD_LDFLAGS
+FLWKEY_BUILD_CXXFLAGS
+FLWKEY_BUILD_CPPFLAGS
+COMPAT_STRCASESTR_FALSE
+COMPAT_STRCASESTR_TRUE
+EXTRA_LIBS
+COMPAT_REGEX_FALSE
+COMPAT_REGEX_TRUE
+HAVE_FLUID_FALSE
+HAVE_FLUID_TRUE
+FLUID
+FLTK_LIBS
+FLTK_CFLAGS
+FLTK_CONFIG
+PTW32_LIBS
+PTW32_CFLAGS
+MINGW32_FALSE
+MINGW32_TRUE
+WIN32_FALSE
+WIN32_TRUE
+HAVE_NSIS_FALSE
+HAVE_NSIS_TRUE
+HAVE_WINDRES_FALSE
+HAVE_WINDRES_TRUE
+MAKENSIS
+WINDRES
+DARWIN_FALSE
+DARWIN_TRUE
+MAC_UNIVERSAL_LDFLAGS
+MAC_UNIVERSAL_CFLAGS
+COMPAT_STACK_FALSE
+COMPAT_STACK_TRUE
+RDYNAMIC
+DEBUG_CFLAGS
+ENABLE_DEBUG_FALSE
+ENABLE_DEBUG_TRUE
+BFD_LIBS
+BFD_CFLAGS
+OPT_CFLAGS
+X_LIBS
+X_CFLAGS
+PKG_CONFIG_LIBDIR
+PKG_CONFIG_PATH
+PKG_CONFIG
+POW_LIB
+LIBOBJS
+EGREP
+GREP
+CPP
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+ac_ct_CC
+CFLAGS
+CC
+am__fastdepCXX_FALSE
+am__fastdepCXX_TRUE
+CXXDEPMODE
+am__nodep
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CXX
+CPPFLAGS
+LDFLAGS
+CXXFLAGS
+CXX
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_os
+target_vendor
+target_cpu
+target
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+AC_CONFIG_ARGS
+FLWKEY_VERSION
+FLWKEY_VERSION_PATCH
+FLWKEY_VERSION_MINOR
+FLWKEY_VERSION_MAJOR
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_dependency_tracking
+enable_static
+enable_optimizations
+enable_debug
+with_bfd
+enable_mac_universal
+with_ptw32
+'
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+CXX
+CXXFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CCC
+CC
+CFLAGS
+CPP
+PKG_CONFIG
+PKG_CONFIG_PATH
+PKG_CONFIG_LIBDIR
+X_CFLAGS
+X_LIBS
+BFD_CFLAGS
+BFD_LIBS
+PTW32_CFLAGS
+PTW32_LIBS
+FLTK_CONFIG
+FLTK_CFLAGS
+FLTK_LIBS
+FLUID'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+ case $ac_option in
+ *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *=) ac_optarg= ;;
+ *) ac_optarg=yes ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=\$ac_optarg ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst | --locals)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=\$ac_optarg ;;
+
+ -without-* | --without-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ case $ac_envvar in #(
+ '' | [0-9]* | *[!_$as_cr_alnum]* )
+ as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+ esac
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir
+do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+ case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
+ as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used" >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ as_fn_error $? "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures FLWKEY 1.1.6 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking ...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/flwkey]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+
+System types:
+ --build=BUILD configure for building on BUILD [guessed]
+ --host=HOST cross-compile to build programs to run on HOST [BUILD]
+ --target=TARGET configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of FLWKEY 1.1.6:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-option-checking ignore unrecognized --enable/--with options
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors
+ --enable-static enable static linking for some libraries
+ --enable-optimizations use x86 optimizations (none|sse|sse2|sse3|native)
+ [none]
+ --enable-debug turn on debugging
+ --enable-mac-universal build a universal binary on Mac OS X [no]
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-bfd[=DIR] search for libbfd in DIR/include and DIR/lib
+ [mingw32 only]
+ --with-ptw32[=DIR] search for pthreads-w32 in DIR/include and DIR/lib
+ [mingw32 only]
+
+Some influential environment variables:
+ CXX C++ compiler command
+ CXXFLAGS C++ compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ LIBS libraries to pass to the linker, e.g. -l<library>
+ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+ you have headers in a nonstandard directory <include dir>
+ CC C compiler command
+ CFLAGS C compiler flags
+ CPP C preprocessor
+ PKG_CONFIG path to pkg-config utility
+ PKG_CONFIG_PATH
+ directories to add to pkg-config's search path
+ PKG_CONFIG_LIBDIR
+ path overriding pkg-config's built-in search path
+ X_CFLAGS C compiler flags for X, overriding pkg-config
+ X_LIBS linker flags for X, overriding pkg-config
+ BFD_CFLAGS C compiler flags for libbfd
+ BFD_LIBS linker flags for libbfd
+ PTW32_CFLAGS
+ C compiler flags for pthreads-w32
+ PTW32_LIBS linker flags for pthreads-w32
+ FLTK_CONFIG Path to fltk-config utility
+ FLTK_CFLAGS C compiler flags for FLTK, overriding fltk-config
+ FLTK_LIBS linker flags for FLTK, overriding fltk-config
+ FLUID Fast Light User-Interface Designer
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to <w1hkj AT w1hkj DOT com>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+ continue
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+ cat <<\_ACEOF
+FLWKEY configure 1.1.6
+generated by GNU Autoconf 2.68
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+
+Copyright (C) 2009 Dave Freese, W1HKJ (w1hkj AT w1hkj DOT com)
+_ACEOF
+ exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_cxx_try_compile LINENO
+# ----------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_compile
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } > conftest.i && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if eval \${$3+:} false; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_header_compiler=yes
+else
+ ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ ac_header_preproc=yes
+else
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+ yes:no: )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+( $as_echo "## ------------------------------------- ##
+## Report this to w1hkj AT w1hkj DOT com ##
+## ------------------------------------- ##"
+ ) | sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_mongrel
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=$ac_status
+fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=no"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_type
+
+# ac_fn_c_find_intX_t LINENO BITS VAR
+# -----------------------------------
+# Finds a signed integer type with width BITS, setting cache variable VAR
+# accordingly.
+ac_fn_c_find_intX_t ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5
+$as_echo_n "checking for int$2_t... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=no"
+ # Order is important - never check a type that is potentially smaller
+ # than half of the expected target width.
+ for ac_type in int$2_t 'int' 'long int' \
+ 'long long int' 'short int' 'signed char'; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+ enum { N = $2 / 2 - 1 };
+int
+main ()
+{
+static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+ enum { N = $2 / 2 - 1 };
+int
+main ()
+{
+static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1)
+ < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ case $ac_type in #(
+ int$2_t) :
+ eval "$3=yes" ;; #(
+ *) :
+ eval "$3=\$ac_type" ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ if eval test \"x\$"$3"\" = x"no"; then :
+
+else
+ break
+fi
+ done
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_find_intX_t
+
+# ac_fn_c_find_uintX_t LINENO BITS VAR
+# ------------------------------------
+# Finds an unsigned integer type with width BITS, setting cache variable VAR
+# accordingly.
+ac_fn_c_find_uintX_t ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5
+$as_echo_n "checking for uint$2_t... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=no"
+ # Order is important - never check a type that is potentially smaller
+ # than half of the expected target width.
+ for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \
+ 'unsigned long long int' 'unsigned short int' 'unsigned char'; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ case $ac_type in #(
+ uint$2_t) :
+ eval "$3=yes" ;; #(
+ *) :
+ eval "$3=\$ac_type" ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ if eval test \"x\$"$3"\" = x"no"; then :
+
+else
+ break
+fi
+ done
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_find_uintX_t
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $2 (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+
+# ac_fn_cxx_try_link LINENO
+# -------------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_link
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by FLWKEY $as_me 1.1.6, which was
+generated by GNU Autoconf 2.68. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ $as_echo "PATH: $as_dir"
+ done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+ 2)
+ as_fn_append ac_configure_args1 " '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ as_fn_append ac_configure_args " '$ac_arg'"
+ ;;
+ esac
+ done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
+
+ $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+ # We do not want a PATH search for config.site.
+ case $CONFIG_SITE in #((
+ -*) ac_site_file1=./$CONFIG_SITE;;
+ */*) ac_site_file1=$CONFIG_SITE;;
+ *) ac_site_file1=./$CONFIG_SITE;;
+ esac
+elif test "x$prefix" != xNONE; then
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
+else
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+ test "x$ac_site_file" = xNONE && continue
+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file" \
+ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special files
+ # actually), so we avoid doing that. DJGPP emulates it as a regular file.
+ if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+FLWKEY_VERSION_MAJOR=1
+
+FLWKEY_VERSION_MINOR=1
+
+FLWKEY_VERSION_PATCH=.6
+
+FLWKEY_VERSION=1.1.6
+
+
+
+$as_echo "#define FLWKEY_VERSION_MAJOR 1" >>confdefs.h
+
+
+$as_echo "#define FLWKEY_VERSION_MINOR 1" >>confdefs.h
+
+
+$as_echo "#define FLWKEY_VERSION_PATCH \".6\"" >>confdefs.h
+
+
+$as_echo "#define FLWKEY_VERSION \"1.1.6\"" >>confdefs.h
+
+
+AC_CONFIG_ARGS=$ac_configure_args
+
+ac_aux_dir=
+for ac_dir in build-aux "$srcdir"/build-aux; do
+ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ as_fn_error $? "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
+
+
+# define build, build_cpu, build_vendor, build_os
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+ as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+ as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+# define host, host_cpu, host_vendor, host_os
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$host_alias" = x; then
+ ac_cv_host=$ac_cv_build
+else
+ ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+# define target, target_cpu, target_vendor, target_os
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
+$as_echo_n "checking target system type... " >&6; }
+if ${ac_cv_target+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$target_alias" = x; then
+ ac_cv_target=$ac_cv_host
+else
+ ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5
+$as_echo "$ac_cv_target" >&6; }
+case $ac_cv_target in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;;
+esac
+target=$ac_cv_target
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_target
+shift
+target_cpu=$1
+target_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+target_os=$*
+IFS=$ac_save_IFS
+case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
+
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+
+am__api_version='1.11'
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if ${ac_cv_path_install+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+ ./ | .// | /[cC]/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ rm -rf conftest.one conftest.two conftest.dir
+ echo one > conftest.one
+ echo two > conftest.two
+ mkdir conftest.dir
+ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ test -s conftest.one && test -s conftest.two &&
+ test -s conftest.dir/conftest.one &&
+ test -s conftest.dir/conftest.two
+ then
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+
+ done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ INSTALL=$ac_install_sh
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[\\\"\#\$\&\'\`$am_lf]*)
+ as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+ *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
+ as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+esac
+
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
+alias in your environment" "$LINENO" 5
+ fi
+
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+test "$program_prefix" != NONE &&
+ program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+ if ${ac_cv_path_mkdir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in mkdir gmkdir; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+ case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+ 'mkdir (GNU coreutils) '* | \
+ 'mkdir (coreutils) '* | \
+ 'mkdir (fileutils) '4.1*)
+ ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+ break 3;;
+ esac
+ done
+ done
+ done
+IFS=$as_save_IFS
+
+fi
+
+ test -d ./--version && rmdir ./--version
+ if test "${ac_cv_path_mkdir+set}" = set; then
+ MKDIR_P="$ac_cv_path_mkdir -p"
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for MKDIR_P within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ MKDIR_P="$ac_install_sh -d"
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+ [\\/$]* | ?:[\\/]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_AWK="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ SET_MAKE=
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ am__isrc=' -I$(srcdir)'
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='flwkey'
+ VERSION='1.1.6'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility. Yes, it's still used
+# in the wild :-( We should find a proper way to deprecate it ...
+AMTAR='$${TAR-tar}'
+
+am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
+
+
+
+
+
+
+#change the next config item for the specific application src's
+
+ac_config_headers="$ac_config_headers src/config.h"
+
+
+
+# Checks for programs.
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -z "$CXX"; then
+ if test -n "$CCC"; then
+ CXX=$CCC
+ else
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CXX"; then
+ ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
+$as_echo "$CXX" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CXX" && break
+ done
+fi
+if test -z "$CXX"; then
+ ac_ct_CXX=$CXX
+ for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CXX"; then
+ ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CXX="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
+$as_echo "$ac_ct_CXX" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CXX" && break
+done
+
+ if test "x$ac_ct_CXX" = x; then
+ CXX="g++"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CXX=$ac_ct_CXX
+ fi
+fi
+
+ fi
+fi
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler works" >&5
+$as_echo_n "checking whether the C++ compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link_default") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile. We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ then :; else
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ fi
+ # We set ac_cv_exeext here because the later test for it is not
+ # safe: cross compilers may not add the suffix if given an `-o'
+ # argument, so we may need to know it at that point already.
+ # Even if this section looks crufty: it has the advantage of
+ # actually working.
+ break;;
+ * )
+ break;;
+ esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+ ac_file=''
+fi
+if test -z "$ac_file"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C++ compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler default output file name" >&5
+$as_echo_n "checking for C++ compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+ { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if { ac_try='./conftest$ac_cv_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C++ compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ for ac_file in conftest.o conftest.obj conftest.*; do
+ test -f "$ac_file" || continue;
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
+$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
+if ${ac_cv_cxx_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
+$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GXX=yes
+else
+ GXX=
+fi
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
+$as_echo_n "checking whether $CXX accepts -g... " >&6; }
+if ${ac_cv_prog_cxx_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+ ac_cxx_werror_flag=yes
+ ac_cv_prog_cxx_g=no
+ CXXFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_cv_prog_cxx_g=yes
+else
+ CXXFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+else
+ ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+ CXXFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_cv_prog_cxx_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
+$as_echo "$ac_cv_prog_cxx_g" >&6; }
+if test "$ac_test_CXXFLAGS" = set; then
+ CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+ if test "$GXX" = yes; then
+ CXXFLAGS="-g -O2"
+ else
+ CXXFLAGS="-g"
+ fi
+else
+ if test "$GXX" = yes; then
+ CXXFLAGS="-O2"
+ else
+ CXXFLAGS=
+ fi
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then :
+ enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+ am__nodep='_no'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
+
+
+depcc="$CXX" am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CXX_dependencies_compiler_type+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CXX_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ am__universal=false
+ case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok `-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CXX_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+ am__fastdepCXX_TRUE=
+ am__fastdepCXX_FALSE='#'
+else
+ am__fastdepCXX_TRUE='#'
+ am__fastdepCXX_FALSE=
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+else
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CC" am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ am__universal=false
+ case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok `-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if ${ac_cv_prog_CPP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_GREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_GREP"; then
+ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ if test -z "$EGREP"; then
+ ac_path_EGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_EGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_EGREP"; then
+ as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_EGREP=$EGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stdc=yes
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+ ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
+if test "x$ac_cv_header_minix_config_h" = xyes; then :
+ MINIX=yes
+else
+ MINIX=
+fi
+
+
+ if test "$MINIX" = yes; then
+
+$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h
+
+
+$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h
+
+
+$as_echo "#define _MINIX 1" >>confdefs.h
+
+ fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
+$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
+if ${ac_cv_safe_to_define___extensions__+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+# define __EXTENSIONS__ 1
+ $ac_includes_default
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_safe_to_define___extensions__=yes
+else
+ ac_cv_safe_to_define___extensions__=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5
+$as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
+ test $ac_cv_safe_to_define___extensions__ = yes &&
+ $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
+
+ $as_echo "#define _ALL_SOURCE 1" >>confdefs.h
+
+ $as_echo "#define _GNU_SOURCE 1" >>confdefs.h
+
+ $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
+
+ $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h
+
+
+
+# Checks for header files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stdc=yes
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+ac_header_dirent=no
+for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
+ as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5
+$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; }
+if eval \${$as_ac_Header+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <$ac_hdr>
+
+int
+main ()
+{
+if ((DIR *) 0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$as_ac_Header=yes"
+else
+ eval "$as_ac_Header=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_ac_Header
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
+_ACEOF
+
+ac_header_dirent=$ac_hdr; break
+fi
+
+done
+# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
+if test $ac_header_dirent = dirent.h; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5
+$as_echo_n "checking for library containing opendir... " >&6; }
+if ${ac_cv_search_opendir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char opendir ();
+int
+main ()
+{
+return opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' dir; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_opendir=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_opendir+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_opendir+:} false; then :
+
+else
+ ac_cv_search_opendir=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5
+$as_echo "$ac_cv_search_opendir" >&6; }
+ac_res=$ac_cv_search_opendir
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5
+$as_echo_n "checking for library containing opendir... " >&6; }
+if ${ac_cv_search_opendir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char opendir ();
+int
+main ()
+{
+return opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' x; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_opendir=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_opendir+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_opendir+:} false; then :
+
+else
+ ac_cv_search_opendir=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5
+$as_echo "$ac_cv_search_opendir" >&6; }
+ac_res=$ac_cv_search_opendir
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+fi
+
+for ac_header in arpa/inet.h execinfo.h fcntl.h limits.h memory.h netdb.h netinet/in.h regex.h stdint.h stdlib.h string.h strings.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h sys/utsname.h termios.h unistd.h values.h linux/ppdev.h dev/ppbus/ppi.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+# Checks for typedefs, structures, and compiler characteristics.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
+$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
+if ${ac_cv_header_stdbool_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdbool.h>
+#ifndef bool
+ "error: bool is not defined"
+#endif
+#ifndef false
+ "error: false is not defined"
+#endif
+#if false
+ "error: false is not 0"
+#endif
+#ifndef true
+ "error: true is not defined"
+#endif
+#if true != 1
+ "error: true is not 1"
+#endif
+#ifndef __bool_true_false_are_defined
+ "error: __bool_true_false_are_defined is not defined"
+#endif
+
+ struct s { _Bool s: 1; _Bool t; } s;
+
+ char a[true == 1 ? 1 : -1];
+ char b[false == 0 ? 1 : -1];
+ char c[__bool_true_false_are_defined == 1 ? 1 : -1];
+ char d[(bool) 0.5 == true ? 1 : -1];
+ /* See body of main program for 'e'. */
+ char f[(_Bool) 0.0 == false ? 1 : -1];
+ char g[true];
+ char h[sizeof (_Bool)];
+ char i[sizeof s.t];
+ enum { j = false, k = true, l = false * true, m = true * 256 };
+ /* The following fails for
+ HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
+ _Bool n[m];
+ char o[sizeof n == m * sizeof n[0] ? 1 : -1];
+ char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
+ /* Catch a bug in an HP-UX C compiler. See
+ http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+ http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+ */
+ _Bool q = true;
+ _Bool *pq = &q;
+
+int
+main ()
+{
+
+ bool e = &s;
+ *pq |= q;
+ *pq |= ! q;
+ /* Refer to every declared value, to avoid compiler optimizations. */
+ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
+ + !m + !n + !o + !p + !q + !pq);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stdbool_h=yes
+else
+ ac_cv_header_stdbool_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
+$as_echo "$ac_cv_header_stdbool_h" >&6; }
+ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
+if test "x$ac_cv_type__Bool" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE__BOOL 1
+_ACEOF
+
+
+fi
+
+if test $ac_cv_header_stdbool_h = yes; then
+
+$as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
+$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
+if ${ac_cv_c_const+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+ /* Ultrix mips cc rejects this. */
+ typedef int charset[2];
+ const charset cs;
+ /* SunOS 4.1.1 cc rejects this. */
+ char const *const *pcpcc;
+ char **ppc;
+ /* NEC SVR4.0.2 mips cc rejects this. */
+ struct point {int x, y;};
+ static struct point const zero = {0,0};
+ /* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in
+ an arm of an if-expression whose if-part is not a constant
+ expression */
+ const char *g = "string";
+ pcpcc = &g + (g ? g-g : 0);
+ /* HPUX 7.0 cc rejects these. */
+ ++pcpcc;
+ ppc = (char**) pcpcc;
+ pcpcc = (char const *const *) ppc;
+ { /* SCO 3.2v4 cc rejects this. */
+ char *t;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+ if (s) return 0;
+ }
+ { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+ }
+ { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+ }
+ { /* AIX XL C 1.02.0.0 rejects this saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
+ }
+ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+ if (!foo) return 0;
+ }
+ return !cs[0] && !zero.x;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_const=yes
+else
+ ac_cv_c_const=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
+$as_echo "$ac_cv_c_const" >&6; }
+if test $ac_cv_c_const = no; then
+
+$as_echo "#define const /**/" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
+$as_echo_n "checking for inline... " >&6; }
+if ${ac_cv_c_inline+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_inline=$ac_kw
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test "$ac_cv_c_inline" != no && break
+done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
+$as_echo "$ac_cv_c_inline" >&6; }
+
+case $ac_cv_c_inline in
+ inline | yes) ;;
+ *)
+ case $ac_cv_c_inline in
+ no) ac_val=;;
+ *) ac_val=$ac_cv_c_inline;;
+ esac
+ cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
+_ACEOF
+ ;;
+esac
+
+ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t"
+case $ac_cv_c_int16_t in #(
+ no|yes) ;; #(
+ *)
+
+cat >>confdefs.h <<_ACEOF
+#define int16_t $ac_cv_c_int16_t
+_ACEOF
+;;
+esac
+
+ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t"
+case $ac_cv_c_int32_t in #(
+ no|yes) ;; #(
+ *)
+
+cat >>confdefs.h <<_ACEOF
+#define int32_t $ac_cv_c_int32_t
+_ACEOF
+;;
+esac
+
+ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t"
+case $ac_cv_c_int64_t in #(
+ no|yes) ;; #(
+ *)
+
+cat >>confdefs.h <<_ACEOF
+#define int64_t $ac_cv_c_int64_t
+_ACEOF
+;;
+esac
+
+ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t"
+case $ac_cv_c_int8_t in #(
+ no|yes) ;; #(
+ *)
+
+cat >>confdefs.h <<_ACEOF
+#define int8_t $ac_cv_c_int8_t
+_ACEOF
+;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5
+$as_echo_n "checking for C/C++ restrict keyword... " >&6; }
+if ${ac_cv_c_restrict+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_c_restrict=no
+ # The order here caters to the fact that C++ does not require restrict.
+ for ac_kw in __restrict __restrict__ _Restrict restrict; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+typedef int * int_ptr;
+ int foo (int_ptr $ac_kw ip) {
+ return ip[0];
+ }
+int
+main ()
+{
+int s[1];
+ int * $ac_kw t = s;
+ t[0] = 0;
+ return foo(t)
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_restrict=$ac_kw
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test "$ac_cv_c_restrict" != no && break
+ done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5
+$as_echo "$ac_cv_c_restrict" >&6; }
+
+ case $ac_cv_c_restrict in
+ restrict) ;;
+ no) $as_echo "#define restrict /**/" >>confdefs.h
+ ;;
+ *) cat >>confdefs.h <<_ACEOF
+#define restrict $ac_cv_c_restrict
+_ACEOF
+ ;;
+ esac
+
+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
+if test "x$ac_cv_type_size_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
+$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
+if ${ac_cv_header_time+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+
+int
+main ()
+{
+if ((struct tm *) 0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_time=yes
+else
+ ac_cv_header_time=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5
+$as_echo "$ac_cv_header_time" >&6; }
+if test $ac_cv_header_time = yes; then
+
+$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
+$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
+if ${ac_cv_struct_tm+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <time.h>
+
+int
+main ()
+{
+struct tm tm;
+ int *p = &tm.tm_sec;
+ return !p;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_struct_tm=time.h
+else
+ ac_cv_struct_tm=sys/time.h
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5
+$as_echo "$ac_cv_struct_tm" >&6; }
+if test $ac_cv_struct_tm = sys/time.h; then
+
+$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h
+
+fi
+
+ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t"
+case $ac_cv_c_uint16_t in #(
+ no|yes) ;; #(
+ *)
+
+
+cat >>confdefs.h <<_ACEOF
+#define uint16_t $ac_cv_c_uint16_t
+_ACEOF
+;;
+ esac
+
+ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t"
+case $ac_cv_c_uint32_t in #(
+ no|yes) ;; #(
+ *)
+
+$as_echo "#define _UINT32_T 1" >>confdefs.h
+
+
+cat >>confdefs.h <<_ACEOF
+#define uint32_t $ac_cv_c_uint32_t
+_ACEOF
+;;
+ esac
+
+ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t"
+case $ac_cv_c_uint64_t in #(
+ no|yes) ;; #(
+ *)
+
+$as_echo "#define _UINT64_T 1" >>confdefs.h
+
+
+cat >>confdefs.h <<_ACEOF
+#define uint64_t $ac_cv_c_uint64_t
+_ACEOF
+;;
+ esac
+
+ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t"
+case $ac_cv_c_uint8_t in #(
+ no|yes) ;; #(
+ *)
+
+$as_echo "#define _UINT8_T 1" >>confdefs.h
+
+
+cat >>confdefs.h <<_ACEOF
+#define uint8_t $ac_cv_c_uint8_t
+_ACEOF
+;;
+ esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5
+$as_echo_n "checking for working volatile... " >&6; }
+if ${ac_cv_c_volatile+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+volatile int x;
+int * volatile y = (int *) 0;
+return !x && !y;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_volatile=yes
+else
+ ac_cv_c_volatile=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5
+$as_echo "$ac_cv_c_volatile" >&6; }
+if test $ac_cv_c_volatile = no; then
+
+$as_echo "#define volatile /**/" >>confdefs.h
+
+fi
+
+
+# Checks for library functions.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether closedir returns void" >&5
+$as_echo_n "checking whether closedir returns void... " >&6; }
+if ${ac_cv_func_closedir_void+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_func_closedir_void=yes
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header_dirent>
+#ifndef __cplusplus
+int closedir ();
+#endif
+
+int
+main ()
+{
+return closedir (opendir (".")) != 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_closedir_void=no
+else
+ ac_cv_func_closedir_void=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_closedir_void" >&5
+$as_echo "$ac_cv_func_closedir_void" >&6; }
+if test $ac_cv_func_closedir_void = yes; then
+
+$as_echo "#define CLOSEDIR_VOID 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5
+$as_echo_n "checking for error_at_line... " >&6; }
+if ${ac_cv_lib_error_at_line+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <error.h>
+int
+main ()
+{
+error_at_line (0, 0, "", 0, "an error occurred");
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_error_at_line=yes
+else
+ ac_cv_lib_error_at_line=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5
+$as_echo "$ac_cv_lib_error_at_line" >&6; }
+if test $ac_cv_lib_error_at_line = no; then
+ case " $LIBOBJS " in
+ *" error.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS error.$ac_objext"
+ ;;
+esac
+
+fi
+
+if test $ac_cv_c_compiler_gnu = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5
+$as_echo_n "checking whether $CC needs -traditional... " >&6; }
+if ${ac_cv_prog_gcc_traditional+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_pattern="Autoconf.*'x'"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sgtty.h>
+Autoconf TIOCGETP
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "$ac_pattern" >/dev/null 2>&1; then :
+ ac_cv_prog_gcc_traditional=yes
+else
+ ac_cv_prog_gcc_traditional=no
+fi
+rm -f conftest*
+
+
+ if test $ac_cv_prog_gcc_traditional = no; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <termio.h>
+Autoconf TCGETA
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "$ac_pattern" >/dev/null 2>&1; then :
+ ac_cv_prog_gcc_traditional=yes
+fi
+rm -f conftest*
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5
+$as_echo "$ac_cv_prog_gcc_traditional" >&6; }
+ if test $ac_cv_prog_gcc_traditional = yes; then
+ CC="$CC -traditional"
+ fi
+fi
+
+for ac_header in sys/select.h sys/socket.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for select" >&5
+$as_echo_n "checking types of arguments for select... " >&6; }
+if ${ac_cv_func_select_args+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ for ac_arg234 in 'fd_set *' 'int *' 'void *'; do
+ for ac_arg1 in 'int' 'size_t' 'unsigned long int' 'unsigned int'; do
+ for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+#ifdef HAVE_SYS_SELECT_H
+# include <sys/select.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+
+int
+main ()
+{
+extern int select ($ac_arg1,
+ $ac_arg234, $ac_arg234, $ac_arg234,
+ $ac_arg5);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+ done
+done
+# Provide a safe default value.
+: "${ac_cv_func_select_args=int,int *,struct timeval *}"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_select_args" >&5
+$as_echo "$ac_cv_func_select_args" >&6; }
+ac_save_IFS=$IFS; IFS=','
+set dummy `echo "$ac_cv_func_select_args" | sed 's/\*/\*/g'`
+IFS=$ac_save_IFS
+shift
+
+cat >>confdefs.h <<_ACEOF
+#define SELECT_TYPE_ARG1 $1
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define SELECT_TYPE_ARG234 ($2)
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define SELECT_TYPE_ARG5 ($3)
+_ACEOF
+
+rm -f conftest*
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5
+$as_echo_n "checking return type of signal handlers... " >&6; }
+if ${ac_cv_type_signal+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <signal.h>
+
+int
+main ()
+{
+return *(signal (0, 0)) (0) == 1;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_type_signal=int
+else
+ ac_cv_type_signal=void
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5
+$as_echo "$ac_cv_type_signal" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define RETSIGTYPE $ac_cv_type_signal
+_ACEOF
+
+
+for ac_func in strftime
+do :
+ ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime"
+if test "x$ac_cv_func_strftime" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STRFTIME 1
+_ACEOF
+
+else
+ # strftime is in -lintl on SCO UNIX.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5
+$as_echo_n "checking for strftime in -lintl... " >&6; }
+if ${ac_cv_lib_intl_strftime+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lintl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char strftime ();
+int
+main ()
+{
+return strftime ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_intl_strftime=yes
+else
+ ac_cv_lib_intl_strftime=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_strftime" >&5
+$as_echo "$ac_cv_lib_intl_strftime" >&6; }
+if test "x$ac_cv_lib_intl_strftime" = xyes; then :
+ $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h
+
+LIBS="-lintl $LIBS"
+fi
+
+fi
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5
+$as_echo_n "checking for working strtod... " >&6; }
+if ${ac_cv_func_strtod+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_func_strtod=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+$ac_includes_default
+#ifndef strtod
+double strtod ();
+#endif
+int
+main()
+{
+ {
+ /* Some versions of Linux strtod mis-parse strings with leading '+'. */
+ char *string = " +69";
+ char *term;
+ double value;
+ value = strtod (string, &term);
+ if (value != 69 || term != (string + 4))
+ return 1;
+ }
+
+ {
+ /* Under Solaris 2.4, strtod returns the wrong value for the
+ terminating character under some conditions. */
+ char *string = "NaN";
+ char *term;
+ strtod (string, &term);
+ if (term != string && *(term - 1) == 0)
+ return 1;
+ }
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_strtod=yes
+else
+ ac_cv_func_strtod=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strtod" >&5
+$as_echo "$ac_cv_func_strtod" >&6; }
+if test $ac_cv_func_strtod = no; then
+ case " $LIBOBJS " in
+ *" strtod.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS strtod.$ac_objext"
+ ;;
+esac
+
+ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow"
+if test "x$ac_cv_func_pow" = xyes; then :
+
+fi
+
+if test $ac_cv_func_pow = no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5
+$as_echo_n "checking for pow in -lm... " >&6; }
+if ${ac_cv_lib_m_pow+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pow ();
+int
+main ()
+{
+return pow ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_m_pow=yes
+else
+ ac_cv_lib_m_pow=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5
+$as_echo "$ac_cv_lib_m_pow" >&6; }
+if test "x$ac_cv_lib_m_pow" = xyes; then :
+ POW_LIB=-lm
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5
+$as_echo "$as_me: WARNING: cannot find library containing definition of pow" >&2;}
+fi
+
+fi
+
+fi
+
+for ac_func in getaddrinfo gethostbyname hstrerror gmtime_r localtime_r memmove memset mkdir select setenv snprintf socket socketpair strcasecmp strcasestr strchr strdup strerror strlcpy strncasecmp strrchr strstr strtol uname unsetenv vsnprintf
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+### X11
+# Set ac_cv_x to yes/no
+# Define USE_X in config.h
+# Substitute X_CFLAGS and X_LIBS in Makefile
+if test "x$target_darwin" = "xno" && test "x$target_win32" = "xno"; then
+
+
+
+
+
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
+ # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $ac_pt_PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_pt_PKG_CONFIG" = x; then
+ PKG_CONFIG=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
+ fi
+else
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+ _pkg_min_version=0.9.0
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ PKG_CONFIG=""
+ fi
+fi
+
+
+
+
+
+
+
+test "x$ac_cv_want_x" = "x" && ac_cv_want_x="check"
+case "x$ac_cv_want_x" in
+ "xno")
+ ac_cv_x=no
+ ;;
+ "xcheck")
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5
+$as_echo_n "checking for X... " >&6; }
+
+if test -n "$X_CFLAGS"; then
+ pkg_cv_X_CFLAGS="$X_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "x11") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_X_CFLAGS=`$PKG_CONFIG --cflags "x11" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$X_LIBS"; then
+ pkg_cv_X_LIBS="$X_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "x11") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_X_LIBS=`$PKG_CONFIG --libs "x11" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ X_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "x11" 2>&1`
+ else
+ X_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "x11" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$X_PKG_ERRORS" >&5
+
+ ac_cv_x=no
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ ac_cv_x=no
+else
+ X_CFLAGS=$pkg_cv_X_CFLAGS
+ X_LIBS=$pkg_cv_X_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ ac_cv_x=yes
+fi
+ ;;
+ "xyes")
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5
+$as_echo_n "checking for X... " >&6; }
+
+if test -n "$X_CFLAGS"; then
+ pkg_cv_X_CFLAGS="$X_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "x11") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_X_CFLAGS=`$PKG_CONFIG --cflags "x11" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$X_LIBS"; then
+ pkg_cv_X_LIBS="$X_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "x11") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_X_LIBS=`$PKG_CONFIG --libs "x11" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ X_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "x11" 2>&1`
+ else
+ X_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "x11" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$X_PKG_ERRORS" >&5
+
+ as_fn_error $? "Package requirements (x11) were not met:
+
+$X_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables X_CFLAGS
+and X_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you may set the environment variables X_CFLAGS
+and X_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ X_CFLAGS=$pkg_cv_X_CFLAGS
+ X_LIBS=$pkg_cv_X_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+ # if we get here the test has succeeded
+ ac_cv_x=yes
+ ;;
+esac
+
+if test "x$ac_cv_x" = "xyes"; then
+
+$as_echo "#define USE_X 1" >>confdefs.h
+
+ pkg_x_version=`$PKG_CONFIG --modversion "x11" 2>/dev/null`
+else
+
+$as_echo "#define USE_X 0" >>confdefs.h
+
+ pkg_x_version=""
+fi
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define X_BUILD_VERSION "$pkg_x_version"
+_ACEOF
+
+
+:
+
+fi
+
+# Checks for typedefs, structures, and compiler characteristics.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
+$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
+if ${ac_cv_header_stdbool_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdbool.h>
+#ifndef bool
+ "error: bool is not defined"
+#endif
+#ifndef false
+ "error: false is not defined"
+#endif
+#if false
+ "error: false is not 0"
+#endif
+#ifndef true
+ "error: true is not defined"
+#endif
+#if true != 1
+ "error: true is not 1"
+#endif
+#ifndef __bool_true_false_are_defined
+ "error: __bool_true_false_are_defined is not defined"
+#endif
+
+ struct s { _Bool s: 1; _Bool t; } s;
+
+ char a[true == 1 ? 1 : -1];
+ char b[false == 0 ? 1 : -1];
+ char c[__bool_true_false_are_defined == 1 ? 1 : -1];
+ char d[(bool) 0.5 == true ? 1 : -1];
+ /* See body of main program for 'e'. */
+ char f[(_Bool) 0.0 == false ? 1 : -1];
+ char g[true];
+ char h[sizeof (_Bool)];
+ char i[sizeof s.t];
+ enum { j = false, k = true, l = false * true, m = true * 256 };
+ /* The following fails for
+ HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
+ _Bool n[m];
+ char o[sizeof n == m * sizeof n[0] ? 1 : -1];
+ char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
+ /* Catch a bug in an HP-UX C compiler. See
+ http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+ http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+ */
+ _Bool q = true;
+ _Bool *pq = &q;
+
+int
+main ()
+{
+
+ bool e = &s;
+ *pq |= q;
+ *pq |= ! q;
+ /* Refer to every declared value, to avoid compiler optimizations. */
+ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
+ + !m + !n + !o + !p + !q + !pq);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stdbool_h=yes
+else
+ ac_cv_header_stdbool_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
+$as_echo "$ac_cv_header_stdbool_h" >&6; }
+ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
+if test "x$ac_cv_type__Bool" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE__BOOL 1
+_ACEOF
+
+
+fi
+
+if test $ac_cv_header_stdbool_h = yes; then
+
+$as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h
+
+fi
+
+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
+if test "x$ac_cv_type_size_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
+
+# Checks for library functions.
+for ac_func in strstr
+do :
+ ac_fn_c_check_func "$LINENO" "strstr" "ac_cv_func_strstr"
+if test "x$ac_cv_func_strstr" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STRSTR 1
+_ACEOF
+
+fi
+done
+
+
+### static flag
+# Set ac_cv_static to yes/no
+# Substitute RTLIB in Makefile
+
+ # Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then :
+ enableval=$enable_static; case "${enableval}" in
+ yes|no) ac_cv_static="${enableval}" ;;
+ *) as_fn_error $? "bad value ${enableval} for --enable-static" "$LINENO" 5 ;;
+ esac
+else
+ ac_cv_static=no
+fi
+
+
+
+### optimizations
+# Set ac_cv_opt to arg
+# Substitute OPT_FLAGS in Makefile
+
+ # Check whether --enable-optimizations was given.
+if test "${enable_optimizations+set}" = set; then :
+ enableval=$enable_optimizations; case "${enableval}" in
+ none|sse|sse2|sse3|native) ac_cv_opt="${enableval}" ;;
+ *) as_fn_error $? "bad value ${enableval} for --enable-optimizations" "$LINENO" 5 ;;
+ esac
+else
+ ac_cv_opt=none
+fi
+
+ OPT_CFLAGS="-O2 -ffast-math -finline-functions -fomit-frame-pointer"
+ case "$ac_cv_opt" in
+ sse)
+ OPT_CFLAGS="$OPT_CFLAGS -msse -mfpmath=sse"
+ ;;
+ sse2)
+ OPT_CFLAGS="$OPT_CFLAGS -msse2 -mfpmath=sse"
+ ;;
+ sse3)
+ OPT_CFLAGS="$OPT_CFLAGS -msse3 -mfpmath=sse"
+ ;;
+ native)
+ OPT_CFLAGS="$OPT_CFLAGS -march=native -mfpmath=sse"
+ ;;
+ none)
+ ;;
+ esac
+
+
+
+
+### debug flag
+# Set ac_cv_debug to yes/no
+# Override CXXFLAGS
+# Set ENABLE_DEBUG Makefile conditional
+# Substitute RDYNAMIC in Makefile
+
+
+
+ # Check whether --enable-debug was given.
+if test "${enable_debug+set}" = set; then :
+ enableval=$enable_debug; case "${enableval}" in
+ yes|no) ac_cv_debug="${enableval}" ;;
+ *) as_fn_error $? "bad value ${enableval} for --enable-debug" "$LINENO" 5 ;;
+ esac
+else
+ ac_cv_debug=no
+fi
+
+
+
+
+
+# Check whether --with-bfd was given.
+if test "${with_bfd+set}" = set; then :
+ withval=$with_bfd; ac_cv_want_bfd="$withval"
+else
+ ac_cv_want_bfd=yes
+fi
+
+
+ if test "x$ac_cv_debug" = "xyes" && test "x$ac_cv_want_bfd" != "xno" && \
+ test "x$target_mingw32" = "xyes"; then
+ if test "x$ac_cv_want_bfd" != "xyes"; then # set -I and -L switches
+ bfd_default_cflags="-I${ac_cv_want_bfd}/include"
+ bfd_default_libs="-L${ac_cv_want_bfd}/lib"
+ fi
+ # don't override the user-specified vars
+ BFD_CFLAGS="${BFD_CFLAGS:-$bfd_default_cflags}"
+ BFD_LIBS="${BFD_LIBS:-$bfd_default_libs}"
+ ac_cv_want_bfd="yes"
+
+ CPPFLAGS_saved="$CPPFLAGS"
+ LDFLAGS_saved="$LDFLAGS"
+ CPPFLAGS="$CPPFLAGS $BFD_CFLAGS"
+ LDFLAGS="$LDFLAGS $BFD_LIBS"
+
+ ac_fn_c_check_header_mongrel "$LINENO" "bfd.h" "ac_cv_header_bfd_h" "$ac_includes_default"
+if test "x$ac_cv_header_bfd_h" = xyes; then :
+ ac_cv_have_bfd="yes"
+else
+ ac_cv_have_bfd="no"
+fi
+
+
+ if test "x$ac_cv_have_bfd" = "xyes"; then
+ bfd_other_libs="-liberty -lpsapi -limagehlp"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bfd_set_format in -lbfd" >&5
+$as_echo_n "checking for bfd_set_format in -lbfd... " >&6; }
+if ${ac_cv_lib_bfd_bfd_set_format+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbfd $bfd_other_libs $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char bfd_set_format ();
+int
+main ()
+{
+return bfd_set_format ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_bfd_bfd_set_format=yes
+else
+ ac_cv_lib_bfd_bfd_set_format=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfd_bfd_set_format" >&5
+$as_echo "$ac_cv_lib_bfd_bfd_set_format" >&6; }
+if test "x$ac_cv_lib_bfd_bfd_set_format" = xyes; then :
+ ac_cv_have_bfd="yes"
+else
+ ac_cv_have_bfd="no"
+fi
+
+ fi
+ CPPFLAGS="$CPPFLAGS_saved"
+ LDFLAGS="$LDFLAGS_saved"
+ if test "x$ac_cv_have_bfd" = "xyes"; then
+ BFD_LIBS="$BFD_LIBS -lbfd $bfd_other_libs"
+ fi
+ fi
+
+ if test "x$ac_cv_debug" = "xyes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for debug info flag" >&5
+$as_echo_n "checking for debug info flag... " >&6; }
+ if test "x$GXX" = "xyes"; then
+ if test "x$target_mingw32" = "xyes"; then
+ gflag="-gstabs"
+ else
+ gflag="-ggdb3"
+ fi
+ else
+ gflag="-g"
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gflag" >&5
+$as_echo "$gflag" >&6; }
+ DEBUG_CFLAGS="-O0 -fno-inline-functions -fno-omit-frame-pointer $gflag -Wall"
+
+
+ LDFLAGS_saved="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -rdynamic"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -rdynamic" >&5
+$as_echo_n "checking whether $CC supports -rdynamic... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_rdynamic=yes
+else
+ ac_cv_rdynamic=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_rdynamic" >&5
+$as_echo "$ac_cv_rdynamic" >&6; }
+
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports -rdynamic" >&5
+$as_echo_n "checking whether $CXX supports -rdynamic... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ ac_cv_rdynamic=yes
+else
+ ac_cv_rdynamic=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_rdynamic" >&5
+$as_echo "$ac_cv_rdynamic" >&6; }
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+ LDFLAGS="$LDFLAGS_saved"
+
+ if test "x$ac_cv_rdynamic" = "xyes"; then
+ RDYNAMIC=-rdynamic
+ fi
+
+ CXXFLAGS=""
+ CFLAGS="$CXXFLAGS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: debugging enabled; overriding CXXFLAGS" >&5
+$as_echo "$as_me: debugging enabled; overriding CXXFLAGS" >&6;}
+
+ if test "x$target_darwin" = "xyes"; then
+ ac_cv_compat_stack=yes
+
+$as_echo "#define HAVE_DBG_STACK 1" >>confdefs.h
+
+ elif test "x$target_mingw32" = "xyes" && test "x$ac_cv_have_bfd" = "xyes"; then
+ ac_cv_compat_stack=yes
+
+$as_echo "#define HAVE_DBG_STACK 1" >>confdefs.h
+
+ else
+ ac_cv_compat_stack=no
+
+$as_echo "#define HAVE_DBG_STACK 0" >>confdefs.h
+
+ fi
+ fi
+ if test "x$ac_cv_debug" = "xyes"; then
+ ENABLE_DEBUG_TRUE=
+ ENABLE_DEBUG_FALSE='#'
+else
+ ENABLE_DEBUG_TRUE='#'
+ ENABLE_DEBUG_FALSE=
+fi
+
+
+
+
+ if test "x$ac_cv_compat_stack" = "xyes"; then
+ COMPAT_STACK_TRUE=
+ COMPAT_STACK_FALSE='#'
+else
+ COMPAT_STACK_TRUE='#'
+ COMPAT_STACK_FALSE=
+fi
+
+
+
+###### OS support
+### OSX
+# Set ac_cv_mac_universal to yes/no
+# Set DARWIN Makefile conditional
+# Substitute MAC_UNIVERSAL_CFLAGS and MAC_UNIVERSAL_LDFLAGS in Makefile
+
+case "$target_os" in
+ darwin*)
+ target_darwin="yes"
+ ;;
+ *)
+ target_darwin="no"
+ ;;
+esac
+
+# Check whether --enable-mac-universal was given.
+if test "${enable_mac_universal+set}" = set; then :
+ enableval=$enable_mac_universal; case "${enableval}" in
+ yes|no) ac_cv_mac_universal="${enableval}" ;;
+ *) as_fn_error $? "bad value \"${enableval}\" for --enable-mac-universal" "$LINENO" 5 ;;
+ esac
+else
+ ac_cv_mac_universal=no
+fi
+
+
+if test "x$target_darwin" = "xyes" && test "x$ac_cv_mac_universal" = "xyes"; then
+ mac_minversion="-mmacosx-version-min=10.4"
+ case "$target_os" in
+ darwin8*)
+ mac_arches="-arch i386 -arch ppc"
+ mac_sysroot="-isysroot /Developer/SDKs/MacOSX10.4u.sdk"
+ ;;
+ darwin9*)
+ mac_arches="-arch i386 -arch ppc -arch x86_64 -arch ppc64"
+ mac_sysroot="-isysroot /Developer/SDKs/MacOSX10.5.sdk"
+ ;;
+ *)
+ mac_arches=""
+ mac_sysroot=""
+ ;;
+ esac
+ MAC_UNIVERSAL_CFLAGS="$mac_arches $mac_sysroot $mac_minversion"
+ MAC_UNIVERSAL_LDFLAGS="$mac_arches"
+fi
+
+
+
+ if test "x$target_darwin" = "xyes"; then
+ DARWIN_TRUE=
+ DARWIN_FALSE='#'
+else
+ DARWIN_TRUE='#'
+ DARWIN_FALSE=
+fi
+
+
+### win32
+# Set WIN32 Makefile conditional
+# Set HAVE_WINDRES Makefile conditional
+# Substitute WINDRES in Makefile
+
+case "$target_os" in
+ *mingw*)
+ target_win32="yes"
+ target_mingw32="yes"
+ ;;
+ *cygwin*|*win32*|*w32*)
+ target_win32="yes"
+ ;;
+ *)
+ target_win32="no"
+ ;;
+esac
+
+if test "x$target_win32" = "xyes"; then
+ # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
+set dummy ${ac_tool_prefix}windres; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_WINDRES+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$WINDRES"; then
+ ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_WINDRES="${ac_tool_prefix}windres"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+WINDRES=$ac_cv_prog_WINDRES
+if test -n "$WINDRES"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WINDRES" >&5
+$as_echo "$WINDRES" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ if test "x$WINDRES" = "x" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The windres utility could not be found" >&5
+$as_echo "$as_me: WARNING: The windres utility could not be found" >&2;}
+ fi
+
+$as_echo "#define __WOE32__ 1" >>confdefs.h
+
+fi
+
+if test "x$target_mingw32" = "xyes"; then
+ # Extract the first word of "makensis", so it can be a program name with args.
+set dummy makensis; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_MAKENSIS+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$MAKENSIS"; then
+ ac_cv_prog_MAKENSIS="$MAKENSIS" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_MAKENSIS="makensis"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+MAKENSIS=$ac_cv_prog_MAKENSIS
+if test -n "$MAKENSIS"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKENSIS" >&5
+$as_echo "$MAKENSIS" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+
+
+ if test "x$WINDRES" != "x"; then
+ HAVE_WINDRES_TRUE=
+ HAVE_WINDRES_FALSE='#'
+else
+ HAVE_WINDRES_TRUE='#'
+ HAVE_WINDRES_FALSE=
+fi
+
+
+ if test "x$MAKENSIS" != "x"; then
+ HAVE_NSIS_TRUE=
+ HAVE_NSIS_FALSE='#'
+else
+ HAVE_NSIS_TRUE='#'
+ HAVE_NSIS_FALSE=
+fi
+
+ if test "x$target_win32" = "xyes"; then
+ WIN32_TRUE=
+ WIN32_FALSE='#'
+else
+ WIN32_TRUE='#'
+ WIN32_FALSE=
+fi
+
+ if test "x$target_mingw32" = "xyes"; then
+ MINGW32_TRUE=
+ MINGW32_FALSE='#'
+else
+ MINGW32_TRUE='#'
+ MINGW32_FALSE=
+fi
+
+
+
+
+
+
+
+# Check whether --with-ptw32 was given.
+if test "${with_ptw32+set}" = set; then :
+ withval=$with_ptw32; ac_cv_want_ptw32="$withval"
+else
+ ac_cv_want_ptw32=no
+fi
+
+
+if test "x$ac_cv_want_ptw32" != "xno"; then
+ if test "x$ac_cv_want_ptw32" != "xyes"; then # set -I and -L switches
+ ptw32_default_cflags="-I${ac_cv_want_ptw32}/include"
+ ptw32_default_libs="-L${ac_cv_want_ptw32}/lib"
+ fi
+ ptw32_default_libs="$ptw32_default_libs -lpthreadGC2 -lws2_32"
+
+ # don't override the user-specified vars
+ PTW32_CFLAGS="${PTW32_CFLAGS:-$ptw32_default_cflags}"
+ PTW32_LIBS="${PTW32_LIBS:-$ptw32_default_libs}"
+ ac_cv_want_ptw32="yes"
+fi
+
+
+
+
+
+### FLTK
+# Substitute FLTK_CFLAGS and FLTK_LIBS in Makefile
+# Set FLUID variable
+# Set HAVE_FLUID Makefile conditional
+
+
+
+
+
+ if test "x$FLTK_CFLAGS" = "x" && test "x$FLTK_LIBS" = "x"; then
+ if test "x$FLTK_CONFIG" = "x"; then
+ # Extract the first word of "fltk-config", so it can be a program name with args.
+set dummy fltk-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_FLTK_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $FLTK_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_FLTK_CONFIG="$FLTK_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_FLTK_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_path_FLTK_CONFIG" && ac_cv_path_FLTK_CONFIG="no"
+ ;;
+esac
+fi
+FLTK_CONFIG=$ac_cv_path_FLTK_CONFIG
+if test -n "$FLTK_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FLTK_CONFIG" >&5
+$as_echo "$FLTK_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fltk-config" >&5
+$as_echo_n "checking for fltk-config... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FLTK_CONFIG" >&5
+$as_echo "$FLTK_CONFIG" >&6; }
+ fi
+ if test "$FLTK_CONFIG" = "no"; then
+ as_fn_error $? "
+ *** The fltk-config script could not be found. Please install the development
+ *** headers and libraries for FLTK 1.1.x, or set PATH to the directory that
+ *** contains fltk-config.
+ " "$LINENO" 5
+ fi
+ HAVE_FLTK_API_VERSION=no
+ FLTK_API_VERSION="`$FLTK_CONFIG --api-version`"
+ if test $? -ne 0; then
+ as_fn_error $? "$FLTK_CONFIG failed" "$LINENO" 5
+ fi
+ if test "x$FLTK_API_VERSION" = "x1.1" || test "x$FLTK_API_VERSION" = "x1.3"; then
+ HAVE_FLTK_API_VERSION=yes
+ fi
+ FLWKEY_FLTK_API_MAJOR=${FLTK_API_VERSION%%.*}
+ FLWKEY_FLTK_API_MINOR=${FLTK_API_VERSION#*.}; FLWKEY_FLTK_API_MINOR=${FLWKEY_FLTK_API_MINOR%%.*}
+ if test "${HAVE_FLTK_API_VERSION}" = "no"; then
+ as_fn_error $? "
+ *** The version of FLTK found on your system provides API version $FLTK_API_VERSION.
+ *** To build $PACKAGE you need a FLTK version that provides API 1.1 or 1.3.
+ " "$LINENO" 5
+ fi
+ FLTK_CFLAGS=`$FLTK_CONFIG --cxxflags`
+ if test "x$ac_cv_static" != "xyes"; then
+ FLTK_LIBS=`$FLTK_CONFIG --ldflags --use-images`
+ else
+ FLTK_LIBS=`$FLTK_CONFIG --ldstaticflags --use-images`
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not checking for FLTK" >&5
+$as_echo "$as_me: not checking for FLTK" >&6;}
+ fi
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define FLTK_BUILD_VERSION "`$FLTK_CONFIG --version`"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define FLWKEY_FLTK_API_MAJOR $FLWKEY_FLTK_API_MAJOR
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define FLWKEY_FLTK_API_MINOR $FLWKEY_FLTK_API_MINOR
+_ACEOF
+
+
+
+ # Extract the first word of "fluid", so it can be a program name with args.
+set dummy fluid; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_FLUID+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$FLUID"; then
+ ac_cv_prog_FLUID="$FLUID" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_FLUID="fluid"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+FLUID=$ac_cv_prog_FLUID
+if test -n "$FLUID"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FLUID" >&5
+$as_echo "$FLUID" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ if test -n "$FLUID"; then
+ HAVE_FLUID_TRUE=
+ HAVE_FLUID_FALSE='#'
+else
+ HAVE_FLUID_TRUE='#'
+ HAVE_FLUID_FALSE=
+fi
+
+
+
+### XML-RPC library
+# Set ac_cv_xmlrpc to yes/no
+# Substitute XMLRPC_CFLAGS and XMLRPC_LIBS in Makefile
+# Define USE_XMLRPC in config.h
+# Set ENABLE_XMLRPC Makefile conditional
+#AC_FLWKEY_XMLRPC
+
+### Non-POSIX compatibility (i.e. mingw32)
+# Sets various Makefile conditionals; see m4/np-compat.m4
+
+
+
+
+ if test "x$ac_cv_header_regex_h" != "xyes"; then
+ COMPAT_REGEX_TRUE=
+ COMPAT_REGEX_FALSE='#'
+else
+ COMPAT_REGEX_TRUE='#'
+ COMPAT_REGEX_FALSE=
+fi
+
+
+ if test "x$target_mingw32" = "xyes"; then
+ sem_libs="pthreadGC2"
+ else
+ sem_libs="pthread rt"
+ fi
+ other_libs=""
+
+ if test "x$ac_cv_want_ptw32" = "xyes"; then
+ CFLAGS_saved="$CFLAGS"
+ LDFLAGS_saved="$LDFLAGS"
+ EXTRA_LIBS_saved="$EXTRA_LIBS"
+ CFLAGS="$CFLAGS $PTW32_CFLAGS"
+ LDFLAGS="$LDFLAGS $PTW32_LIBS"
+ other_libs=-lws2_32
+ fi
+
+
+
+
+
+LIBS_search_libs_save="$LIBS"
+LIBS=""
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5
+$as_echo_n "checking for library containing dlopen... " >&6; }
+if ${ac_cv_search_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' dl; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $other_libs $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_dlopen=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_dlopen+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_dlopen+:} false; then :
+
+else
+ ac_cv_search_dlopen=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5
+$as_echo "$ac_cv_search_dlopen" >&6; }
+ac_res=$ac_cv_search_dlopen
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ ac_cv_have_func_dlopen=1
+else
+ ac_cv_have_func_dlopen=0
+fi
+
+if test "x$LIBS" != "x"; then
+ echo "$EXTRA_LIBS" | grep -q -e "$LIBS" || EXTRA_LIBS="$EXTRA_LIBS $LIBS"
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DLOPEN $ac_cv_have_func_dlopen
+_ACEOF
+
+LIBS="$LIBS_search_libs_save"
+
+
+
+
+
+
+LIBS_search_libs_save="$LIBS"
+LIBS=""
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5
+$as_echo_n "checking for library containing clock_gettime... " >&6; }
+if ${ac_cv_search_clock_gettime+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char clock_gettime ();
+int
+main ()
+{
+return clock_gettime ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' rt; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $other_libs $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_clock_gettime=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_clock_gettime+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_clock_gettime+:} false; then :
+
+else
+ ac_cv_search_clock_gettime=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5
+$as_echo "$ac_cv_search_clock_gettime" >&6; }
+ac_res=$ac_cv_search_clock_gettime
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ ac_cv_have_func_clock_gettime=1
+else
+ ac_cv_have_func_clock_gettime=0
+fi
+
+if test "x$LIBS" != "x"; then
+ echo "$EXTRA_LIBS" | grep -q -e "$LIBS" || EXTRA_LIBS="$EXTRA_LIBS $LIBS"
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_CLOCK_GETTIME $ac_cv_have_func_clock_gettime
+_ACEOF
+
+LIBS="$LIBS_search_libs_save"
+
+
+
+
+
+
+LIBS_search_libs_save="$LIBS"
+LIBS=""
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sem_unlink" >&5
+$as_echo_n "checking for library containing sem_unlink... " >&6; }
+if ${ac_cv_search_sem_unlink+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sem_unlink ();
+int
+main ()
+{
+return sem_unlink ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' $sem_libs; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $other_libs $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_sem_unlink=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_sem_unlink+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_sem_unlink+:} false; then :
+
+else
+ ac_cv_search_sem_unlink=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sem_unlink" >&5
+$as_echo "$ac_cv_search_sem_unlink" >&6; }
+ac_res=$ac_cv_search_sem_unlink
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ ac_cv_have_func_sem_unlink=1
+else
+ ac_cv_have_func_sem_unlink=0
+fi
+
+if test "x$LIBS" != "x"; then
+ echo "$EXTRA_LIBS" | grep -q -e "$LIBS" || EXTRA_LIBS="$EXTRA_LIBS $LIBS"
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SEM_UNLINK $ac_cv_have_func_sem_unlink
+_ACEOF
+
+LIBS="$LIBS_search_libs_save"
+
+
+
+
+
+
+LIBS_search_libs_save="$LIBS"
+LIBS=""
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sem_timedwait" >&5
+$as_echo_n "checking for library containing sem_timedwait... " >&6; }
+if ${ac_cv_search_sem_timedwait+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sem_timedwait ();
+int
+main ()
+{
+return sem_timedwait ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' $sem_libs; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $other_libs $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_sem_timedwait=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_sem_timedwait+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_sem_timedwait+:} false; then :
+
+else
+ ac_cv_search_sem_timedwait=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sem_timedwait" >&5
+$as_echo "$ac_cv_search_sem_timedwait" >&6; }
+ac_res=$ac_cv_search_sem_timedwait
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ ac_cv_have_func_sem_timedwait=1
+else
+ ac_cv_have_func_sem_timedwait=0
+fi
+
+if test "x$LIBS" != "x"; then
+ echo "$EXTRA_LIBS" | grep -q -e "$LIBS" || EXTRA_LIBS="$EXTRA_LIBS $LIBS"
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SEM_TIMEDWAIT $ac_cv_have_func_sem_timedwait
+_ACEOF
+
+LIBS="$LIBS_search_libs_save"
+
+
+
+ if test "x$ac_cv_want_ptw32" = "xyes"; then
+ CFLAGS="$CFLAGS_saved"
+ LDFLAGS="$LDFLAGS_saved"
+ EXTRA_LIBS="$EXTRA_LIBS_saved"
+ fi
+
+
+ if test "x$ac_cv_func_strcasestr" != "xyes"; then
+ COMPAT_STRCASESTR_TRUE=
+ COMPAT_STRCASESTR_FALSE='#'
+else
+ COMPAT_STRCASESTR_TRUE='#'
+ COMPAT_STRCASESTR_FALSE=
+fi
+
+
+
+### build info
+# Define various build variables in config.h
+
+# Define build flags and substitute in Makefile.in
+# CPPFLAGS
+ FLWKEY_BUILD_CPPFLAGS="-I\$(srcdir) -I\$(srcdir)/include -I\$(srcdir)/xmlrpcpp"
+ if test "x$target_win32" = "xyes"; then
+ FLWKEY_BUILD_CPPFLAGS="$FLWKEY_BUILD_CPPFLAGS -D_WINDOWS"
+ fi
+# CXXFLAGS
+ FLWKEY_BUILD_CXXFLAGS="$FLTK_CFLAGS -pipe -Wall -fexceptions $OPT_CFLAGS $DEBUG_CFLAGS \
+$PTW32_CFLAGS"
+ if test "x$target_mingw32" = "xyes"; then
+ FLWKEY_BUILD_CXXFLAGS="-mthreads $FLWKEY_BUILD_CXXFLAGS"
+ fi
+# LDFLAGS
+ FLWKEY_BUILD_LDFLAGS=
+# LDADD
+ FLWKEY_BUILD_LDADD="$FLTK_LIBS $EXTRA_LIBS $PTW32_LIBS"
+
+ if test "x$ac_cv_debug" = "xyes"; then
+ FLWKEY_BUILD_CXXFLAGS="$FLWKEY_BUILD_CXXFLAGS -UNDEBUG"
+ FLWKEY_BUILD_LDFLAGS="$FLWKEY_BUILD_LDFLAGS $RDYNAMIC"
+ else
+ FLWKEY_BUILD_CXXFLAGS="$FLWKEY_BUILD_CXXFLAGS -DNDEBUG"
+ fi
+ if test "x$target_mingw32" = "xyes"; then
+ FLWKEY_BUILD_LDFLAGS="-mthreads $FLWKEY_BUILD_LDFLAGS"
+ fi
+ if test "x$target_mingw32" = "xyes"; then
+ FLWKEY_BUILD_LDFLAGS="-mthreads $FLWKEY_BUILD_LDFLAGS"
+ else if test "x$target_darwin" = "xyes"; then
+ FLWKEY_BUILD_LDFLAGS="$FLWKEY_BUILD_LDFLAGS"
+ else
+ FLWKEY_BUILD_LDFLAGS="$FLWKEY_BUILD_LDFLAGS -lm -lX11"
+ fi
+ fi
+
+
+
+
+
+
+#define build variables for config.h
+
+cat >>confdefs.h <<_ACEOF
+#define BUILD_BUILD_PLATFORM "$build"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define BUILD_HOST_PLATFORM "$host"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define BUILD_TARGET_PLATFORM "$target"
+_ACEOF
+
+
+ test "x$LC_ALL" != "x" && LC_ALL_saved="$LC_ALL"
+ LC_ALL=C
+ export LC_ALL
+
+
+ ac_sh_dq="\"`echo $ac_configure_args | sed 's/"/\\\\"/g'`\""
+
+
+cat >>confdefs.h <<_ACEOF
+#define BUILD_CONFIGURE_ARGS $ac_sh_dq
+_ACEOF
+
+
+
+ ac_sh_dq="\"`date | sed 's/"/\\\\"/g'`\""
+
+
+cat >>confdefs.h <<_ACEOF
+#define BUILD_DATE $ac_sh_dq
+_ACEOF
+
+
+
+ ac_sh_dq="\"`whoami | sed 's/"/\\\\"/g'`\""
+
+
+cat >>confdefs.h <<_ACEOF
+#define BUILD_USER $ac_sh_dq
+_ACEOF
+
+
+
+ ac_sh_dq="\"`hostname | sed 's/"/\\\\"/g'`\""
+
+
+cat >>confdefs.h <<_ACEOF
+#define BUILD_HOST $ac_sh_dq
+_ACEOF
+
+
+
+ ac_sh_dq="\"`$CXX -v 2>&1 | tail -1 | sed 's/"/\\\\"/g'`\""
+
+
+cat >>confdefs.h <<_ACEOF
+#define BUILD_COMPILER $ac_sh_dq
+_ACEOF
+
+
+
+ ac_sh_dq="\"`echo $FLWKEY_BUILD_CPPFLAGS $FLWKEY_BUILD_CXXFLAGS | sed 's/"/\\\\"/g'`\""
+
+
+cat >>confdefs.h <<_ACEOF
+#define FLWKEY_BUILD_CXXFLAGS $ac_sh_dq
+_ACEOF
+
+
+ ac_sh_dq="\"`echo $FLWKEY_BUILD_LDFLAGS $FLWKEY_BUILD_LDADD | sed 's/"/\\\\"/g'`\""
+
+
+cat >>confdefs.h <<_ACEOF
+#define FLWKEY_BUILD_LDFLAGS $ac_sh_dq
+_ACEOF
+
+
+ if test "x$LC_ALL_saved" != "x"; then
+ LC_ALL="$LC_ALL_saved"
+ export LC_ALL
+ fi
+
+
+ac_config_files="$ac_config_files Makefile src/Makefile"
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes: double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \.
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ if test "x$cache_file" != "x/dev/null"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ if test ! -f "$cache_file" || test -h "$cache_file"; then
+ cat confcache >"$cache_file"
+ else
+ case $cache_file in #(
+ */* | ?:*)
+ mv -f confcache "$cache_file"$$ &&
+ mv -f "$cache_file"$$ "$cache_file" ;; #(
+ *)
+ mv -f confcache "$cache_file" ;;
+ esac
+ fi
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+ if test -n "$EXEEXT"; then
+ am__EXEEXT_TRUE=
+ am__EXEEXT_FALSE='#'
+else
+ am__EXEEXT_TRUE='#'
+ am__EXEEXT_FALSE=
+fi
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+ as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${ENABLE_DEBUG_TRUE}" && test -z "${ENABLE_DEBUG_FALSE}"; then
+ as_fn_error $? "conditional \"ENABLE_DEBUG\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${COMPAT_STACK_TRUE}" && test -z "${COMPAT_STACK_FALSE}"; then
+ as_fn_error $? "conditional \"COMPAT_STACK\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${DARWIN_TRUE}" && test -z "${DARWIN_FALSE}"; then
+ as_fn_error $? "conditional \"DARWIN\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_WINDRES_TRUE}" && test -z "${HAVE_WINDRES_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_WINDRES\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_NSIS_TRUE}" && test -z "${HAVE_NSIS_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_NSIS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${WIN32_TRUE}" && test -z "${WIN32_FALSE}"; then
+ as_fn_error $? "conditional \"WIN32\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${MINGW32_TRUE}" && test -z "${MINGW32_FALSE}"; then
+ as_fn_error $? "conditional \"MINGW32\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_FLUID_TRUE}" && test -z "${HAVE_FLUID_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_FLUID\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${COMPAT_REGEX_TRUE}" && test -z "${COMPAT_REGEX_FALSE}"; then
+ as_fn_error $? "conditional \"COMPAT_REGEX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${COMPAT_STRCASESTR_TRUE}" && test -z "${COMPAT_STRCASESTR_FALSE}"; then
+ as_fn_error $? "conditional \"COMPAT_STRCASESTR\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -p'
+ fi
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in #(
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by FLWKEY $as_me 1.1.6, which was
+generated by GNU Autoconf 2.68. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration. Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ --config print configuration, then exit
+ -q, --quiet, --silent
+ do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <w1hkj AT w1hkj DOT com>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+FLWKEY config.status 1.1.6
+configured by $0, generated by GNU Autoconf 2.68,
+ with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=?*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ --*=)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ $as_echo "$ac_cs_version"; exit ;;
+ --config | --confi | --conf | --con | --co | --c )
+ $as_echo "$ac_cs_config"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ '') as_fn_error $? "missing file argument" ;;
+ esac
+ as_fn_append CONFIG_FILES " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --he | --h)
+ # Conflict between --help and --header
+ as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+ --help | --hel | -h )
+ $as_echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+ *) as_fn_append ac_config_targets " $1"
+ ac_need_defaults=false ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+ set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
+ export CONFIG_SHELL
+ exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+ case $ac_config_target in
+ "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;;
+ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+
+ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp= ac_tmp=
+ trap 'exit_status=$?
+ : "${ac_tmp:=$tmp}"
+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+ trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+ eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ . ./conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
+h
+s///
+s/^/:/
+s/[ ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[ ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+ ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+ if test -z "$ac_tt"; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any. Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[ ]*#[ ]*define[ ][ ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ for (key in D) D_is_set[key] = 1
+ FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+ line = \$ 0
+ split(line, arg, " ")
+ if (arg[1] == "#") {
+ defundef = arg[2]
+ mac1 = arg[3]
+ } else {
+ defundef = substr(arg[1], 2)
+ mac1 = arg[2]
+ }
+ split(mac1, mac2, "(") #)
+ macro = mac2[1]
+ prefix = substr(line, 1, index(line, defundef) - 1)
+ if (D_is_set[macro]) {
+ # Preserve the white space surrounding the "#".
+ print prefix "define", macro P[macro] D[macro]
+ next
+ } else {
+ # Replace #undef with comments. This is necessary, for example,
+ # in the case of _POSIX_SOURCE, which is predefined and required
+ # on some systems where configure will not decide to define it.
+ if (defundef == "undef") {
+ print "/*", prefix defundef, macro, "*/"
+ next
+ }
+ }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$ac_tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ as_fn_append ac_file_inputs " '$ac_f'"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+ fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$ac_tmp/stdin" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir="$ac_dir"; as_fn_mkdir_p
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+ esac
+ ac_MKDIR_P=$MKDIR_P
+ case $MKDIR_P in
+ [\\/$]* | ?:[\\/]* ) ;;
+ */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+ esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
+ "$ac_tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&2;}
+
+ rm -f "$ac_tmp/stdin"
+ case $ac_file in
+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+ esac \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+ :H)
+ #
+ # CONFIG_HEADER
+ #
+ if test x"$ac_file" != x-; then
+ {
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+ } >"$ac_tmp/config.h" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ rm -f "$ac_file"
+ mv "$ac_tmp/config.h" "$ac_file" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ fi
+ else
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+ || as_fn_error $? "could not create -" "$LINENO" 5
+ fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$_am_arg" : 'X\(//\)[^/]' \| \
+ X"$_am_arg" : 'X\(//\)$' \| \
+ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+ :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+ esac
+
+
+ case $ac_file$ac_mode in
+ "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+ # Autoconf 2.62 quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir=$dirpart/$fdir; as_fn_mkdir_p
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+ done
+}
+ ;;
+
+ esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+ as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
+
+### summary
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result:
+Configuration summary:
+
+ Version ..................... $VERSION
+
+ Target OS ................... $target_os
+
+ Static linking .............. $ac_cv_static
+ CPU optimizations ........... $ac_cv_opt
+ Debugging ................... $ac_cv_debug
+
+" >&5
+$as_echo "
+Configuration summary:
+
+ Version ..................... $VERSION
+
+ Target OS ................... $target_os
+
+ Static linking .............. $ac_cv_static
+ CPU optimizations ........... $ac_cv_opt
+ Debugging ................... $ac_cv_debug
+
+" >&6; }
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..2c1a9e7
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,167 @@
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+# Generic support for FLTK applications
+
+
+AC_COPYRIGHT([Copyright (C) 2009 Dave Freese, W1HKJ (w1hkj AT w1hkj DOT com)])
+
+AC_PREREQ([2.63])
+
+dnl major and minor must be integers; patch may
+dnl contain other characters or be empty
+m4_define(FLWKEY_MAJOR, [1])
+m4_define(FLWKEY_MINOR, [1])
+m4_define(FLWKEY_PATCH, [.6])
+
+AC_INIT([FLWKEY], FLWKEY_MAJOR.FLWKEY_MINOR[]FLWKEY_PATCH, [w1hkj AT w1hkj DOT com])
+
+AC_SUBST([FLWKEY_VERSION_MAJOR], [FLWKEY_MAJOR])
+AC_SUBST([FLWKEY_VERSION_MINOR], [FLWKEY_MINOR])
+AC_SUBST([FLWKEY_VERSION_PATCH], [FLWKEY_PATCH])
+AC_SUBST([FLWKEY_VERSION], [FLWKEY_MAJOR.FLWKEY_MINOR[]FLWKEY_PATCH])
+
+AC_DEFINE([FLWKEY_VERSION_MAJOR], [FLWKEY_MAJOR], [major version number])
+AC_DEFINE([FLWKEY_VERSION_MINOR], [FLWKEY_MINOR], [minor version number])
+AC_DEFINE([FLWKEY_VERSION_PATCH], ["FLWKEY_PATCH"], [patch/alpha version string])
+AC_DEFINE([FLWKEY_VERSION], ["FLWKEY_MAJOR.FLWKEY_MINOR[]FLWKEY_PATCH"], [version string])
+
+AC_SUBST([AC_CONFIG_ARGS], [$ac_configure_args])
+AC_CONFIG_AUX_DIR([build-aux])
+
+# define build, build_cpu, build_vendor, build_os
+AC_CANONICAL_BUILD
+# define host, host_cpu, host_vendor, host_os
+AC_CANONICAL_HOST
+# define target, target_cpu, target_vendor, target_os
+AC_CANONICAL_TARGET
+
+AM_INIT_AUTOMAKE([-Wall foreign std-options 1.9.6])
+
+#change the next config item for the specific application src's
+AC_CONFIG_SRCDIR([src/flwkey.cxx])
+AC_CONFIG_HEADERS([src/config.h])
+AC_CONFIG_MACRO_DIR([m4])
+
+# Checks for programs.
+AC_PROG_CXX
+AC_PROG_CC
+AC_USE_SYSTEM_EXTENSIONS
+
+# Checks for header files.
+AC_HEADER_STDC
+AC_HEADER_DIRENT
+AC_CHECK_HEADERS([arpa/inet.h execinfo.h fcntl.h limits.h memory.h netdb.h netinet/in.h regex.h stdint.h stdlib.h string.h strings.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h sys/utsname.h termios.h unistd.h values.h linux/ppdev.h dev/ppbus/ppi.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_HEADER_STDBOOL
+AC_C_CONST
+AC_C_INLINE
+AC_TYPE_INT16_T
+AC_TYPE_INT32_T
+AC_TYPE_INT64_T
+AC_TYPE_INT8_T
+AC_C_RESTRICT
+AC_TYPE_SIZE_T
+AC_HEADER_TIME
+AC_STRUCT_TM
+AC_TYPE_UINT16_T
+AC_TYPE_UINT32_T
+AC_TYPE_UINT64_T
+AC_TYPE_UINT8_T
+AC_C_VOLATILE
+
+# Checks for library functions.
+AC_FUNC_CLOSEDIR_VOID
+AC_FUNC_ERROR_AT_LINE
+AC_PROG_GCC_TRADITIONAL
+dnl AC_FUNC_MALLOC
+dnl AC_FUNC_REALLOC
+AC_FUNC_SELECT_ARGTYPES
+AC_TYPE_SIGNAL
+AC_FUNC_STRFTIME
+AC_FUNC_STRTOD
+AC_CHECK_FUNCS([getaddrinfo gethostbyname hstrerror gmtime_r localtime_r memmove memset mkdir select setenv snprintf socket socketpair strcasecmp strcasestr strchr strdup strerror strlcpy strncasecmp strrchr strstr strtol uname unsetenv vsnprintf])
+
+### X11
+# Set ac_cv_x to yes/no
+# Define USE_X in config.h
+# Substitute X_CFLAGS and X_LIBS in Makefile
+if test "x$target_darwin" = "xno" && test "x$target_win32" = "xno"; then
+ AC_FLWKEY_PKG_CHECK([x], [x11], [no], [yes])
+fi
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_HEADER_STDBOOL
+AC_TYPE_SIZE_T
+
+# Checks for library functions.
+AC_CHECK_FUNCS([strstr])
+
+### static flag
+# Set ac_cv_static to yes/no
+# Substitute RTLIB in Makefile
+AC_FL_STATIC
+
+### optimizations
+# Set ac_cv_opt to arg
+# Substitute OPT_FLAGS in Makefile
+AC_FL_OPT
+
+### debug flag
+# Set ac_cv_debug to yes/no
+# Override CXXFLAGS
+# Set ENABLE_DEBUG Makefile conditional
+# Substitute RDYNAMIC in Makefile
+AC_FL_DEBUG
+
+###### OS support
+### OSX
+# Set ac_cv_mac_universal to yes/no
+# Set DARWIN Makefile conditional
+# Substitute MAC_UNIVERSAL_CFLAGS and MAC_UNIVERSAL_LDFLAGS in Makefile
+AC_FL_MACOSX
+### win32
+# Set WIN32 Makefile conditional
+# Set HAVE_WINDRES Makefile conditional
+# Substitute WINDRES in Makefile
+AC_FL_WIN32
+
+### FLTK
+# Substitute FLTK_CFLAGS and FLTK_LIBS in Makefile
+# Set FLUID variable
+# Set HAVE_FLUID Makefile conditional
+AC_CHECK_FLTK
+
+### XML-RPC library
+# Set ac_cv_xmlrpc to yes/no
+# Substitute XMLRPC_CFLAGS and XMLRPC_LIBS in Makefile
+# Define USE_XMLRPC in config.h
+# Set ENABLE_XMLRPC Makefile conditional
+#AC_FLWKEY_XMLRPC
+
+### Non-POSIX compatibility (i.e. mingw32)
+# Sets various Makefile conditionals; see m4/np-compat.m4
+AC_FL_NP_COMPAT
+
+### build info
+# Define various build variables in config.h
+AC_FLWKEY_BUILD_INFO
+
+AC_CONFIG_FILES([Makefile src/Makefile])
+
+AC_OUTPUT
+
+### summary
+AC_MSG_RESULT([
+Configuration summary:
+
+ Version ..................... $VERSION
+
+ Target OS ................... $target_os
+
+ Static linking .............. $ac_cv_static
+ CPU optimizations ........... $ac_cv_opt
+ Debugging ................... $ac_cv_debug
+
+])
diff --git a/data/flwkey.desktop b/data/flwkey.desktop
new file mode 100644
index 0000000..452ac68
--- /dev/null
+++ b/data/flwkey.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Name=Flwkey
+GenericName=Winkey interface program
+Comment=Amateur Radio Communications
+Exec=flwkey
+Icon=flwkey
+Terminal=false
+Type=Application
+Categories=Network;HamRadio;
diff --git a/data/flwkey.xpm b/data/flwkey.xpm
new file mode 100644
index 0000000..c8c48e4
--- /dev/null
+++ b/data/flwkey.xpm
@@ -0,0 +1,325 @@
+/* XPM */
+static char * flwkey_xpm[] = {
+"64 64 256 2",
+" c #010000",
+". c #0B0100",
+"X c #140100",
+"o c #1B0200",
+"O c #130903",
+"+ c #1B0C05",
+"@ c #1C130B",
+"# c #230300",
+"$ c #2C0601",
+"% c #230E04",
+"& c #2C0D05",
+"* c #390801",
+"= c #261007",
+"- c #291206",
+"; c #23150B",
+": c #2E1509",
+"> c #2B1A0D",
+", c #3B1607",
+"< c #331609",
+"1 c #351A0B",
+"2 c #3C1E0D",
+"3 c #2C1C12",
+"4 c #3E200E",
+"5 c #2D2015",
+"6 c #312317",
+"7 c #3C2313",
+"8 c #36281B",
+"9 c #3C2E21",
+"0 c #322E27",
+"q c #3E3228",
+"w c #430D02",
+"e c #490601",
+"r c #590D02",
+"t c #441B0A",
+"y c #4A1708",
+"u c #581706",
+"i c #670D03",
+"p c #780D03",
+"a c #691906",
+"s c #7C1503",
+"d c #771A05",
+"f c #442512",
+"g c #452915",
+"h c #4B2B16",
+"j c #4D2E19",
+"k c #472A18",
+"l c #572713",
+"z c #4C311C",
+"x c #53331C",
+"c c #58381E",
+"v c #5A220E",
+"b c #682409",
+"n c #75240A",
+"m c #7B2A0C",
+"M c #692B12",
+"N c #7A3416",
+"B c #6C391E",
+"V c #433629",
+"C c #49382A",
+"Z c #5C3C22",
+"A c #553A25",
+"S c #483C31",
+"D c #452E22",
+"F c #613F25",
+"G c #4C4137",
+"H c #51453B",
+"J c #5B493A",
+"K c #604126",
+"L c #65452A",
+"P c #69492E",
+"I c #68472D",
+"U c #6D4E33",
+"Y c #634834",
+"T c #715135",
+"R c #75573C",
+"E c #714834",
+"W c #564C44",
+"Q c #5A4E47",
+"! c #5D544F",
+"~ c #765C46",
+"^ c #6F5642",
+"/ c #7B6954",
+"( c #850D02",
+") c #8D0B01",
+"_ c #930A00",
+"` c #9B0C01",
+"' c #8E1A05",
+"] c #A90E02",
+"[ c #BA0E02",
+"{ c #B70C02",
+"} c #AB1402",
+"| c #AD1904",
+" . c #A41806",
+".. c #B21501",
+"X. c #BB1505",
+"o. c #B71D06",
+"O. c #88280B",
+"+. c #992809",
+"@. c #8E3012",
+"#. c #9B3611",
+"$. c #AC2509",
+"%. c #B62704",
+"&. c #A73705",
+"*. c #AD330C",
+"=. c #943F28",
+"-. c #C40E02",
+";. c #C90E01",
+":. c #C51303",
+">. c #CA1402",
+",. c #C41A06",
+"<. c #CB1A05",
+"1. c #C51E08",
+"2. c #CA1E08",
+"3. c #D21600",
+"4. c #D31B02",
+"5. c #DA1D00",
+"6. c #D41904",
+"7. c #C3240A",
+"8. c #CB230A",
+"9. c #C52A0B",
+"0. c #CD2B0D",
+"q. c #CC2703",
+"w. c #D52202",
+"e. c #DC2300",
+"r. c #DA2B03",
+"t. c #D2240A",
+"y. c #D32D0C",
+"u. c #D72A05",
+"i. c #C03700",
+"p. c #CD310E",
+"a. c #C83C01",
+"s. c #D13809",
+"d. c #CD3411",
+"f. c #CA3A12",
+"g. c #D33312",
+"h. c #D43C15",
+"j. c #DA3B14",
+"k. c #D2381C",
+"l. c #CB2C11",
+"z. c #E12500",
+"x. c #E42B00",
+"c. c #E92D00",
+"v. c #E33401",
+"b. c #EC3300",
+"n. c #E73900",
+"m. c #EB3C00",
+"M. c #F33C00",
+"N. c #F03600",
+"B. c #E13816",
+"V. c #AA431B",
+"C. c #B94B1B",
+"Z. c #884925",
+"A. c #B05821",
+"S. c #C94618",
+"D. c #D64016",
+"F. c #D94115",
+"G. c #D5441A",
+"H. c #D9451A",
+"J. c #DB4C1D",
+"K. c #D64A1B",
+"L. c #DE511D",
+"P. c #D44B03",
+"I. c #ED4400",
+"U. c #E94803",
+"Y. c #F54400",
+"T. c #F34C00",
+"R. c #FA4C00",
+"E. c #FB4700",
+"W. c #F55301",
+"Q. c #FB5500",
+"!. c #F55A00",
+"~. c #FD5B00",
+"^. c #F75709",
+"/. c #E14714",
+"(. c #E64C16",
+"). c #E85318",
+"_. c #DB6D1E",
+"`. c #F76500",
+"'. c #FD6203",
+"]. c #FD6C01",
+"[. c #FD6E0B",
+"{. c #FB640A",
+"}. c #FE7B02",
+"|. c #FD720C",
+" X c #FD7705",
+".X c #FD7D19",
+"XX c #FA7715",
+"oX c #ED6717",
+"OX c #DC4D26",
+"+X c #CA5823",
+"@X c #DD5422",
+"#X c #DE5C2B",
+"$X c #DB5B25",
+"%X c #E64927",
+"&X c #E15B25",
+"*X c #E25E29",
+"=X c #E55822",
+"-X c #D86026",
+";X c #E3622B",
+":X c #E5692E",
+">X c #E96A2C",
+",X c #E96529",
+"<X c #F87825",
+"1X c #E26530",
+"2X c #E66B30",
+"3X c #E86D31",
+"4X c #E66038",
+"5X c #EA7334",
+"6X c #ED7B39",
+"7X c #E67331",
+"8X c #F37A36",
+"9X c #F47D39",
+"0X c #F07534",
+"qX c #F16121",
+"wX c #866D56",
+"eX c #96785C",
+"rX c #86705D",
+"tX c #AD7153",
+"yX c #AD6A4C",
+"uX c #877467",
+"iX c #D16642",
+"pX c #E77951",
+"aX c #E36442",
+"sX c #FC821E",
+"dX c #FD820C",
+"fX c #FB8724",
+"gX c #FE8A24",
+"hX c #FC8C2B",
+"jX c #EE813D",
+"kX c #F4833D",
+"lX c #FA8C35",
+"zX c #FB953B",
+"xX c #FD983C",
+"cX c #FC9032",
+"vX c #FD922E",
+"bX c #958478",
+"nX c #CA805D",
+"mX c #F18640",
+"MX c #F18842",
+"NX c #FD9D45",
+"BX c #FEA14C",
+"VX c #FEA859",
+"CX c #ED9777",
+"ZX c #FFAD63",
+"AX c #F4A468",
+"SX c #A39183",
+"DX c #BCAEA0",
+"FX c #FFBC84",
+"GX c #C7BCAE",
+"HX c #D1C9BE",
+"JX c #D5CDC8",
+"KX c #CBD1E4",
+"LX c #FEFDFD",
+"PX c #F7F6F8",
+"IX c #ECECF1",
+"UX c None",
+/* pixels */
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUX4 UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXf UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXh x UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXT UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX1 UXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXc UXUXUXUXUXUXUXUXUXUXUXUXUXh c K I P K c j UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX1 UXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXj c UXUXUXUXUXUXUXUXUXUX2 2 f x c F Z Z x f f 2 UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXh - UXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUX4 x UXUXUXUXUXUXUXUXUXK eXj , f j x x x h f 2 2 1 UXUXUXUXUXUXUXUXUXUXUXUXUXc f UXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXZ UXUXUXUXUXUXUXUX2 + x wXeXU c f g f f 2 7 8 ; 7 UXUXUXUXUXUXUXUXUXUXUXK j UXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXc Z K UXUXUXUXUX2 4 t : % j T ~ T c : < D Y ~ J J J UXUXUXUXUXUXUXUXUXUXF + UXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXh A c UXUXUX2 2 2 2 2 7 1 & % - = + 3 Q J S S G W Q UXUXUXUXUXUXUXUXI 4 UXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXh f A bX2 1 2 2 2 2 2 2 f 2 2 - > 6 8 9 V G H Q ! C UXUXUXUXZ Z c UXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXf KXuX1 < < < 1 2 4 2 4 2 ; ; 3 5 8 V S G H ! W , 4 j c c x UXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXs.%.J IXJXSXrX^ K g 1 4 4 2 = + ; 3 8 8 V S H W 8 E UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXa.{.'.a.R PXLXLXIXSXK 7 1 t 2 = O ; > 5 8 9 V G 6 tXpXp.UXUXUX UXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX[.|.|.[.*.U PXLXLXJXrXD 4 4 4 + . + @ 3 6 9 q 5 tXCXk.h.+.UXUXUXUXUXUXUXUXUX: UXUXUXUXUXUXUX",
+"UXUXUX< 1 UXUXUXUXUXUXUXUXUXUXUXUX.XsXsXXXXX|.+.R PXLXPXDXT f 1 2 % O + > 3 8 0 tXCXk.f.G.h.UXUXUXUXUXUXUXUXx < UXUXUXUXUXUXUX",
+"UXUXUXUXUX1 c K P T P Z x UXUXUX<XvXvXhXfXsXXX|.&.c GXLXIXbXA 4 4 % . O @ @ q yXpXl.k.G.K.G.D.UXUXUXUXUXUXZ j UXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXA x f 1 Z.ZXBXNXxXcXhXgXsXdXP.b R HXJXwXf 2 % ; E nXaXk.k.G.OXOX$XK. at .1 z c Z Z h UXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXAXFXZXVXNXxXvXhXsXdX}.}.%.a U / Z 1 + 3 E yXpXOXy.k.j.OX at X#X#X#X at XM UXh g h UXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXBXZXZXVXVXxXcXgXsXdX}.].].Q.q.s % . & =.iX4X%Xk.t.g.k.*.u +.*X1X1X;XUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXP.gXxXBXBXNXzXfX_.oX}.].].`.!.T.M...e l.%XB.r.u.y.y.g.l.# #.*X1X1X+XUXUXUX UXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUX{.sXvXzXxXzXhXA.l , &.'.`.`.!.T.m.c.} 5.e.r.v.r.r.y.y. . w OX#X;X;XUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUX{..XgXhXhXgX<XB t O * W.~.!.!.T.m.r.} 5.e.r.r.y.t.6.t. . . . S.&X*X>XUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXE.{.|..X.X.X.XXXv % o U.R.T.W.I.n.z...w.e.r.r.w.<.<.<.2.* w H.=X#X:X+XUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXP.~.{.[.|.|.|.].&. a E.Y.Y.I.I.b.z...5.r.r.r.w.<.<.:.t.o.r a f.J. at X&X2X$XUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXf I.~.~.'.'.'.~.~.Q.i.%.Y.M.N.I.I.I.v.e.| 4.w.r.u.4.<.>.>.2.t.y.j.F.J. at X-X2X1XM UXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXZ z &.R.Q.~.~.Q.Q.Q.Q.Q.Q.E.M.M.m.m.I.m.v.e.| 4.w.r.w.<.>.>.2.2.8.g.g.k.J. at X:X2X7XM UXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXK A UXUX^.{.Q.Q.Q.R.R.E.E.Y.M.M.b.b.N.m.n.x.e...<.w.w.w.<.>.>.<.2.0.0.g.D.J.&X;X3X0XN 8 UXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXK I I I Z UXUXi <XXX^.R.T.Y.Y.Y.M.N.N.b.b.c.b.n.v.r.5.| <.w.w.4.>.>.:.<.2.t.g.h.j.J.&X:X5X6Xm 1 c UXUXUXUXUXUXUXUXUXUX",
+"UXUX4 f f f f h 1 UXUXUXUX<X<XQ.Y.M.M.M.N.N.b.c.c.c.x.x.x.z.z.6.| <.w.w.<.>.:.<.2.8.t.g.h.H.J.&X:X5X9XO.UXj K UXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXqXqXY.N.m.m.b.b.b.c.c.c.x.z.x.z.z.5.6.| <.<.6.6.:.<.:.2.8.l.g.h.H. at X*X:X5X9Xm UXUXc I P UXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUX(.).m.m.c.c.c.c.c.c.c.z.z.z.z.5.5.5.;. .:.<.w.<.>.:.<.2.t.l.g.j.K. at X*X2X6XkXb UXUXUXx I L Z UXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXv.U.v.z.z.x.z.z.z.z.z.z.z.5.5.5.3.3.3.} :.<.<.>.>.<.2.8.l.y.k.F.OX$X:X5X9X8Xu UXUXUXUX: UXh x j UXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXe.r.x.z.e.z.z.z.z.z.5.5.5.5.5.6.3.3.;. .:.<.4.2.<.6.2.t.y.g.j.H. at X&X2X5XkX7X, UXUXUXUXUXUXUXUX< < 2 UX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXw.r.r.5.5.e.e.5.z.5.5.5.5.3.6.3.3.;.;.` [ >.<.6.,.s r | g.k.h.H.&X;X3X6XmX-X# UXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXr.r.4.5.5.5.5.5.z.5.6.6.3.3.3.;.;.-.` [ :.2.,.e a g.j.H. at X$X:X5XjXkXC.. UXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXw.e.4.4.4.5.>.' p X.6.3.3.;.;.;.;.-.` { :.6.p & t M f.F.H.=X*X3X6XmX9Xm . UXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUX<.w.<.3.3.3.n 1 - & } 3.;.;.;.;.-.-.` { :.6.p O t l N h.J. at X$X:X5X6XkX:Xw UXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUX| 5.<.>.3.>.v t , % e ;.;.;.;.;.-.-._ { :.2.| 1 l B V.k.OX at X*X3X6XmXkXC.o UXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUX>.>.:.>.>.a f , % $ -.-.-.-.-.;.-._ [ ,.8.t.+.N V.G.J. at X$X2X5X9XMX8Xb X UXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUX] ;.:.;.;...u , w ` ;.:.-.;.;.,.[ _ X.2.8.l.g.g.j.H.L.&X,X5X6XMXlX-X$ UXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX[ [ [ -.;.[ ] :.;.-.:.:.>.,.>.X.) X.8.0.g.g.h.J.J.$X;X>X6XpXkX8Xn X UXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX( -.:.:.:.:.>.:.:.>.>.>.,.2.2.,.) X.8.g.k.j.H.L.=X;X>X5XjXjX8XC.# UXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX} :.:.:.,.:.,.2.2.2.2.2.2.8.X.) ,.l.g.j.J.J. at X$X:X5X6XkX5X;Xw X UXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXe X.,.,.,.,.,.,.2.2.2.8.8.0.X.) %.g.D.H.J. at X*X:X5X5X6X5X,Xn X UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXi ,.,.1.8.8.8.8.8.l.l.l.g.1._ 7.d.J.J.&X;X:X5X0X5X>X=X+.o UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXi 8.1.7.8.8.l.l.l.g.g.g.1._ %.d.OX$X;X:X2X3X>X).).+.o X UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXi 7.8.7.9.l.d.g.f.h.k.o.) 9.f. at X;X;X;X&X).).(.O.o X UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX e $.l.9.9.9.d.f.D.j.%.) 9.s.L.L.L.L.).).D.a O X UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX# s %.8.7.9.p.d.d.o.( 0.h.D.P./.(./.+.w X X UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX * s $.9.9.0.0.o.( s.j./.F.S.+.r o X UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX . $ r s +.$.$.' *.*.O.a * o X X UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX. . . o o $ $ o o X X o X UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX"
+};
diff --git a/data/mac/Info.plist.in b/data/mac/Info.plist.in
new file mode 100644
index 0000000..6b16ce5
--- /dev/null
+++ b/data/mac/Info.plist.in
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+
+ <key>CFBundleIdentifier</key>
+ <string>%%IDENTIFIER%%</string>
+
+ <key>CFBundleName</key>
+ <string>%%NAME%%</string>
+
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+
+ <key>CFBundleSignature</key>
+ <string>%%SIGNATURE%%</string>
+
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+
+ <key>CFBundleExecutable</key>
+ <string>%%BINARY%%</string>
+
+ <key>CFBundleVersion</key>
+ <string>%%VERSION%%</string>
+
+ <key>CFBundleShortVersionString</key>
+ <string>%%VERSION%%</string>
+
+ <key>CFBundleLongVersionString</key>
+ <string>%%VERSION%%</string>
+
+ <key>CFBundleIconFile</key>
+ <string>%%ICON%%</string>
+
+ <key>NSAppleScriptEnabled</key>
+ <string>No</string>
+
+ <key>NSHumanReadableCopyright</key>
+ <string>Copyright (c) 2009 Dave Freese W1HKJ</string>
+</dict>
+</plist>
diff --git a/data/mac/flwkey.icns b/data/mac/flwkey.icns
new file mode 100644
index 0000000..d21a82f
Binary files /dev/null and b/data/mac/flwkey.icns differ
diff --git a/data/win32/fl_app.nsi b/data/win32/fl_app.nsi
new file mode 100644
index 0000000..f7b02f5
--- /dev/null
+++ b/data/win32/fl_app.nsi
@@ -0,0 +1,166 @@
+# -*- conf -*-
+
+# NSIS installer script based on example2.nsi from the nsis-2.44 distribution.
+# Copyright (c) 2009 Stelios Bounanos, M0GLD.
+# Copyright (c) 2009 Dave Freese, W1HKJ
+
+# substitute your application name for instances of FLWKEY
+
+# Variables
+!define FLWKEY_DESCRIPTION "${FLWKEY_NAME} ${FLWKEY_VERSION}"
+!define FLWKEY_STRING "${FLWKEY_NAME}-${FLWKEY_VERSION}"
+
+!define PRODUCT_BINARY "${FLWKEY_BINARY}"
+!define PRODUCT_NAME "${FLWKEY_NAME}"
+!define PRODUCT_VERSION "${FLWKEY_VERSION}"
+!define PRODUCT_STRING "${FLWKEY_STRING}"
+!define PRODUCT_DESCRIPTION "${FLWKEY_DESCRIPTION}"
+
+# Compression options
+SetCompressor /SOLID lzma
+
+# This function is called before displaying the first installer page.
+# It aborts the installation if the Windows version is too old.
+!include WinVer.nsh
+Function .onInit
+ ${IfNot} ${AtLeastWin2000}
+ MessageBox MB_ICONSTOP "Sorry, your Windows version is too old.$\n${PRODUCT_NAME} requires Windows 2000 or later."
+ Abort
+ ${EndIf}
+FunctionEnd
+
+# The name of the installer
+Name "${PRODUCT_DESCRIPTION}"
+
+# The file to write
+OutFile ${INSTALLER_FILE}
+
+# The default installation directory
+InstallDir $PROGRAMFILES\${PRODUCT_STRING}
+
+# Registry key to check for directory (so if you install again, it will
+# overwrite the old one automatically)
+!define INSTALL_DIR_REG_KEY SOFTWARE\${PRODUCT_STRING}
+InstallDirRegKey HKLM "${INSTALL_DIR_REG_KEY}" "Install_Dir"
+
+# Request application privileges for Windows Vista
+RequestExecutionLevel admin
+
+# License
+LicenseText "${PRODUCT_NAME} is distributed under the GNU GPL as detailed \
+below. You must abide by the terms of this license if you modify or \
+redistribute the program." "Continue"
+LicenseData "${LICENSE_FILE}"
+SubCaption 0 ": License Information"
+
+# Other options
+BrandingText " "
+InstProgressFlags smooth
+VIAddVersionKey ProductName "${PRODUCT_NAME}"
+VIAddVersionKey ProductVersion "${PRODUCT_VERSION}"
+VIAddVersionKey FileVersion "${PRODUCT_VERSION}"
+VIAddVersionKey FileDescription "${FLWKEY_DESCRIPTION} installer"
+VIAddVersionKey LegalCopyright "${PRODUCT_NAME} developers"
+VIAddVersionKey OriginalFilename "${INSTALLER_FILE}"
+VIProductVersion "3.0.0.0"
+WindowIcon off
+XPStyle on
+
+# Installer pages
+Page license
+Page components
+Page directory
+Page instfiles
+UninstPage uninstConfirm
+UninstPage instfiles
+
+# Registry uninstall path
+!define REG_UNINSTALL_PATH Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_STRING}
+
+# This is a hidden section and is always selected. It writes the uninstall
+# registry keys and uninstaller binary.
+Section -install
+ # Set output path to the installation directory.
+ SetOutPath $INSTDIR
+ # Write the installation paths into the registry
+ WriteRegStr HKLM "${INSTALL_DIR_REG_KEY}" "Install_Dir" "$INSTDIR"
+ # Write the uninstall keys for Windows
+ WriteRegStr HKLM "${REG_UNINSTALL_PATH}" "DisplayName" "${PRODUCT_DESCRIPTION}"
+ WriteRegStr HKLM "${REG_UNINSTALL_PATH}" "DisplayVersion" "${PRODUCT_VERSION}"
+ WriteRegStr HKLM "${REG_UNINSTALL_PATH}" "DisplayIcon" '"$INSTDIR\${PRODUCT_BINARY}"'
+ WriteRegStr HKLM "${REG_UNINSTALL_PATH}" "HelpLink" "${SUPPORT_URL}"
+ WriteRegStr HKLM "${REG_UNINSTALL_PATH}" "Publisher" "FLWKEY developers"
+ WriteRegStr HKLM "${REG_UNINSTALL_PATH}" "URLUpdateInfo" "${UPDATES_URL}"
+ WriteRegStr HKLM "${REG_UNINSTALL_PATH}" "UninstallString" '"$INSTDIR\uninstall.exe"'
+ WriteRegStr HKLM "${REG_UNINSTALL_PATH}" "QuietUninstallString" '"$INSTDIR\uninstall.exe" /S'
+ WriteRegDWORD HKLM "${REG_UNINSTALL_PATH}" "NoModify" 1
+ WriteRegDWORD HKLM "${REG_UNINSTALL_PATH}" "NoRepair" 1
+ WriteUninstaller "uninstall.exe"
+SectionEnd
+
+#Var WANT_FLWKEY
+
+Section "FLWKEY"
+ SectionIn RO
+ SetOutPath $INSTDIR
+ File "${FLWKEY_BINARY}"
+SectionEnd
+
+# Start Menu path
+!define SM_PATH_BASE $SMPROGRAMS\${PRODUCT_NAME}
+!define SM_PATH ${SM_PATH_BASE}\${PRODUCT_STRING}
+
+# The following sections are optional
+Section "Start Menu Shortcuts"
+ CreateDirectory "${SM_PATH}"
+ CreateShortCut "${SM_PATH}\${FLWKEY_NAME}.lnk" "$INSTDIR\${FLWKEY_BINARY}" "" "$INSTDIR\${FLWKEY_BINARY}" 0
+ CreateShortCut "${SM_PATH}\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
+SectionEnd
+
+Section "Desktop Shortcuts"
+ CreateShortCut "$DESKTOP\${FLWKEY_DESCRIPTION}.lnk" "$INSTDIR\${FLWKEY_BINARY}" "" \
+ "$INSTDIR\${FLWKEY_BINARY}" 0
+SectionEnd
+
+# This is unselected by default
+Section /o "Quick Launch Shortcuts"
+ CreateShortCut "$QUICKLAUNCH\${FLWKEY_DESCRIPTION}}.lnk" "$INSTDIR\${FLWKEY_BINARY}" "" \
+ "$INSTDIR\${FLWKEY_BINARY}" 0
+SectionEnd
+
+# Uninstaller
+Section "Uninstall"
+ # Remove registry keys
+ DeleteRegKey HKLM "${REG_UNINSTALL_PATH}"
+ DeleteRegKey HKLM "${INSTALL_DIR_REG_KEY}"
+
+# Remove files and uninstaller
+ Delete /REBOOTOK $INSTDIR\${FLWKEY_BINARY}
+ Delete /REBOOTOK $INSTDIR\uninstall.exe
+
+# Remove shortcuts, if any
+ Delete "${SM_PATH}\*.*"
+ Delete "$DESKTOP\${FLWKEY_DESCRIPTION}.lnk"
+ Delete "$QUICKLAUNCH\${FLWKEY_DESCRIPTION}.lnk"
+
+# Remove directories used
+ RMDir "${SM_PATH}"
+ RMDir "${SM_PATH_BASE}"
+ RMDir "$INSTDIR"
+SectionEnd
+
+# Offer to reboot the machine if the reboot flag is nonzero. This flag is set by
+# commands that specify the /REBOOTOK switch if the BINARY_* files were in use
+# during uninstallation. Stupid Windows.
+Function un.onGUIEnd
+ IfRebootFlag 0 noreboot
+ MessageBox MB_YESNO|MB_ICONQUESTION \
+ "A reboot is required to finish removing ${PRODUCT_NAME}. Do you wish to reboot now?" IDNO noreboot
+ Reboot
+ noreboot:
+FunctionEnd
+
+# Tell the user if we could not reboot for some reason.
+Function un.onRebootFailed
+ MessageBox MB_OK|MB_ICONSTOP "Reboot failed. Please reboot manually." /SD IDOK
+FunctionEnd
diff --git a/data/win32/flwkey.ico b/data/win32/flwkey.ico
new file mode 100644
index 0000000..8ac9e14
Binary files /dev/null and b/data/win32/flwkey.ico differ
diff --git a/m4/build.m4 b/m4/build.m4
new file mode 100644
index 0000000..b691d00
--- /dev/null
+++ b/m4/build.m4
@@ -0,0 +1,79 @@
+AC_DEFUN([AC_FLWKEY_SH_DQ], [
+ ac_sh_dq="\"`$1 | sed 's/"/\\\\"/g'`\""
+])
+
+AC_DEFUN([AC_FLWKEY_BUILD_INFO], [
+# Define build flags and substitute in Makefile.in
+# CPPFLAGS
+ FLWKEY_BUILD_CPPFLAGS="-I\$(srcdir) -I\$(srcdir)/include -I\$(srcdir)/xmlrpcpp"
+ if test "x$target_win32" = "xyes"; then
+ FLWKEY_BUILD_CPPFLAGS="$FLWKEY_BUILD_CPPFLAGS -D_WINDOWS"
+ fi
+# CXXFLAGS
+ FLWKEY_BUILD_CXXFLAGS="$FLTK_CFLAGS -pipe -Wall -fexceptions $OPT_CFLAGS $DEBUG_CFLAGS \
+$PTW32_CFLAGS"
+ if test "x$target_mingw32" = "xyes"; then
+ FLWKEY_BUILD_CXXFLAGS="-mthreads $FLWKEY_BUILD_CXXFLAGS"
+ fi
+# LDFLAGS
+ FLWKEY_BUILD_LDFLAGS=
+# LDADD
+ FLWKEY_BUILD_LDADD="$FLTK_LIBS $EXTRA_LIBS $PTW32_LIBS"
+
+ if test "x$ac_cv_debug" = "xyes"; then
+ FLWKEY_BUILD_CXXFLAGS="$FLWKEY_BUILD_CXXFLAGS -UNDEBUG"
+ FLWKEY_BUILD_LDFLAGS="$FLWKEY_BUILD_LDFLAGS $RDYNAMIC"
+ else
+ FLWKEY_BUILD_CXXFLAGS="$FLWKEY_BUILD_CXXFLAGS -DNDEBUG"
+ fi
+ if test "x$target_mingw32" = "xyes"; then
+ FLWKEY_BUILD_LDFLAGS="-mthreads $FLWKEY_BUILD_LDFLAGS"
+ fi
+ if test "x$target_mingw32" = "xyes"; then
+ FLWKEY_BUILD_LDFLAGS="-mthreads $FLWKEY_BUILD_LDFLAGS"
+ else if test "x$target_darwin" = "xyes"; then
+ FLWKEY_BUILD_LDFLAGS="$FLWKEY_BUILD_LDFLAGS"
+ else
+ FLWKEY_BUILD_LDFLAGS="$FLWKEY_BUILD_LDFLAGS -lm -lX11"
+ fi
+ fi
+
+ AC_SUBST([FLWKEY_BUILD_CPPFLAGS])
+ AC_SUBST([FLWKEY_BUILD_CXXFLAGS])
+ AC_SUBST([FLWKEY_BUILD_LDFLAGS])
+ AC_SUBST([FLWKEY_BUILD_LDADD])
+
+#define build variables for config.h
+ AC_DEFINE_UNQUOTED([BUILD_BUILD_PLATFORM], ["$build"], [Build platform])
+ AC_DEFINE_UNQUOTED([BUILD_HOST_PLATFORM], ["$host"], [Host platform])
+ AC_DEFINE_UNQUOTED([BUILD_TARGET_PLATFORM], ["$target"], [Target platform])
+
+ test "x$LC_ALL" != "x" && LC_ALL_saved="$LC_ALL"
+ LC_ALL=C
+ export LC_ALL
+
+ AC_FLWKEY_SH_DQ([echo $ac_configure_args])
+ AC_DEFINE_UNQUOTED([BUILD_CONFIGURE_ARGS], [$ac_sh_dq], [Configure arguments])
+
+ AC_FLWKEY_SH_DQ([date])
+ AC_DEFINE_UNQUOTED([BUILD_DATE], [$ac_sh_dq], [Build date])
+
+ AC_FLWKEY_SH_DQ([whoami])
+ AC_DEFINE_UNQUOTED([BUILD_USER], [$ac_sh_dq], [Build user])
+
+ AC_FLWKEY_SH_DQ([hostname])
+ AC_DEFINE_UNQUOTED([BUILD_HOST], [$ac_sh_dq], [Build host])
+
+ AC_FLWKEY_SH_DQ([$CXX -v 2>&1 | tail -1])
+ AC_DEFINE_UNQUOTED([BUILD_COMPILER], [$ac_sh_dq], [Compiler])
+
+ AC_FLWKEY_SH_DQ([echo $FLWKEY_BUILD_CPPFLAGS $FLWKEY_BUILD_CXXFLAGS])
+ AC_DEFINE_UNQUOTED([FLWKEY_BUILD_CXXFLAGS], [$ac_sh_dq], [FLWKEY compiler flags])
+ AC_FLWKEY_SH_DQ([echo $FLWKEY_BUILD_LDFLAGS $FLWKEY_BUILD_LDADD])
+ AC_DEFINE_UNQUOTED([FLWKEY_BUILD_LDFLAGS], [$ac_sh_dq], [FLWKEY linker flags])
+
+ if test "x$LC_ALL_saved" != "x"; then
+ LC_ALL="$LC_ALL_saved"
+ export LC_ALL
+ fi
+])
diff --git a/m4/debug.m4 b/m4/debug.m4
new file mode 100644
index 0000000..fe6c1ad
--- /dev/null
+++ b/m4/debug.m4
@@ -0,0 +1,104 @@
+AC_DEFUN([AC_FL_RDYNAMIC], [
+ LDFLAGS_saved="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -rdynamic"
+
+ AC_MSG_CHECKING([whether $CC supports -rdynamic])
+ AC_TRY_LINK([], [], [ac_cv_rdynamic=yes], [ac_cv_rdynamic=no])
+ AC_MSG_RESULT([$ac_cv_rdynamic])
+
+ AC_LANG_PUSH(C++)
+ AC_MSG_CHECKING([whether $CXX supports -rdynamic])
+ AC_TRY_LINK([], [], [ac_cv_rdynamic=yes], [ac_cv_rdynamic=no])
+ AC_MSG_RESULT([$ac_cv_rdynamic])
+ AC_LANG_POP(C++)
+
+ LDFLAGS="$LDFLAGS_saved"
+])
+
+
+AC_DEFUN([AC_FL_DEBUG], [
+ AC_REQUIRE([AC_FL_OPT])
+ AC_ARG_ENABLE([debug],
+ AC_HELP_STRING([--enable-debug], [turn on debugging]),
+ [case "${enableval}" in
+ yes|no) ac_cv_debug="${enableval}" ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
+ esac],
+ [ac_cv_debug=no])
+
+ AC_ARG_VAR([BFD_CFLAGS], [C compiler flags for libbfd])
+ AC_ARG_VAR([BFD_LIBS], [linker flags for libbfd])
+ AC_ARG_WITH([bfd],
+ AC_HELP_STRING([--with-bfd@<:@=DIR@:>@],
+ [search for libbfd in DIR/include and DIR/lib @<:@mingw32 only@:>@]),
+ [ac_cv_want_bfd="$withval"],
+ [ac_cv_want_bfd=yes])
+
+ if test "x$ac_cv_debug" = "xyes" && test "x$ac_cv_want_bfd" != "xno" && \
+ test "x$target_mingw32" = "xyes"; then
+ if test "x$ac_cv_want_bfd" != "xyes"; then # set -I and -L switches
+ bfd_default_cflags="-I${ac_cv_want_bfd}/include"
+ bfd_default_libs="-L${ac_cv_want_bfd}/lib"
+ fi
+ # don't override the user-specified vars
+ BFD_CFLAGS="${BFD_CFLAGS:-$bfd_default_cflags}"
+ BFD_LIBS="${BFD_LIBS:-$bfd_default_libs}"
+ ac_cv_want_bfd="yes"
+
+ CPPFLAGS_saved="$CPPFLAGS"
+ LDFLAGS_saved="$LDFLAGS"
+ CPPFLAGS="$CPPFLAGS $BFD_CFLAGS"
+ LDFLAGS="$LDFLAGS $BFD_LIBS"
+
+ AC_CHECK_HEADER([bfd.h], [ac_cv_have_bfd="yes"], [ac_cv_have_bfd="no"])
+ if test "x$ac_cv_have_bfd" = "xyes"; then
+ bfd_other_libs="-liberty -lpsapi -limagehlp"
+ AC_CHECK_LIB([bfd], [bfd_set_format], [ac_cv_have_bfd="yes"], [ac_cv_have_bfd="no"], [$bfd_other_libs])
+ fi
+ CPPFLAGS="$CPPFLAGS_saved"
+ LDFLAGS="$LDFLAGS_saved"
+ if test "x$ac_cv_have_bfd" = "xyes"; then
+ BFD_LIBS="$BFD_LIBS -lbfd $bfd_other_libs"
+ fi
+ fi
+
+ if test "x$ac_cv_debug" = "xyes"; then
+ AC_MSG_CHECKING([for debug info flag])
+ if test "x$GXX" = "xyes"; then
+ if test "x$target_mingw32" = "xyes"; then
+ gflag="-gstabs"
+ else
+ gflag="-ggdb3"
+ fi
+ else
+ gflag="-g"
+ fi
+ AC_MSG_RESULT([$gflag])
+ DEBUG_CFLAGS="-O0 -fno-inline-functions -fno-omit-frame-pointer $gflag -Wall"
+
+ AC_FL_RDYNAMIC
+ if test "x$ac_cv_rdynamic" = "xyes"; then
+ RDYNAMIC=-rdynamic
+ fi
+
+ CXXFLAGS=""
+ CFLAGS="$CXXFLAGS"
+ AC_MSG_NOTICE([debugging enabled; overriding CXXFLAGS])
+
+ if test "x$target_darwin" = "xyes"; then
+ ac_cv_compat_stack=yes
+ AC_DEFINE([HAVE_DBG_STACK], 1, [Define to 1 if we have dbg::stack])
+ elif test "x$target_mingw32" = "xyes" && test "x$ac_cv_have_bfd" = "xyes"; then
+ ac_cv_compat_stack=yes
+ AC_DEFINE([HAVE_DBG_STACK], 1, [Define to 1 if we have dbg::stack])
+ else
+ ac_cv_compat_stack=no
+ AC_DEFINE([HAVE_DBG_STACK], 0, [Define to 0 if not using dbg::stack])
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_DEBUG], [test "x$ac_cv_debug" = "xyes"])
+ AC_SUBST([DEBUG_CFLAGS])
+ AC_SUBST([RDYNAMIC])
+
+ AM_CONDITIONAL([COMPAT_STACK], [test "x$ac_cv_compat_stack" = "xyes"])
+])
diff --git a/m4/fltk.m4 b/m4/fltk.m4
new file mode 100644
index 0000000..c461637
--- /dev/null
+++ b/m4/fltk.m4
@@ -0,0 +1,54 @@
+AC_DEFUN([AC_CHECK_FLTK], [
+ AC_ARG_VAR([FLTK_CONFIG], [Path to fltk-config utility])
+ AC_ARG_VAR([FLTK_CFLAGS], [C compiler flags for FLTK, overriding fltk-config])
+ AC_ARG_VAR([FLTK_LIBS], [linker flags for FLTK, overriding fltk-config])
+
+ if test "x$FLTK_CFLAGS" = "x" && test "x$FLTK_LIBS" = "x"; then
+ if test "x$FLTK_CONFIG" = "x"; then
+ AC_PATH_PROG([FLTK_CONFIG], [fltk-config], [no])
+ else
+ AC_MSG_CHECKING([for fltk-config])
+ AC_MSG_RESULT([$FLTK_CONFIG])
+ fi
+ if test "$FLTK_CONFIG" = "no"; then
+ AC_MSG_ERROR([
+ *** The fltk-config script could not be found. Please install the development
+ *** headers and libraries for FLTK 1.1.x, or set PATH to the directory that
+ *** contains fltk-config.
+ ])
+ fi
+ HAVE_FLTK_API_VERSION=no
+ FLTK_API_VERSION="`$FLTK_CONFIG --api-version`"
+ if test $? -ne 0; then
+ AC_MSG_ERROR([$FLTK_CONFIG failed])
+ fi
+ if test "x$FLTK_API_VERSION" = "x1.1" || test "x$FLTK_API_VERSION" = "x1.3"; then
+ HAVE_FLTK_API_VERSION=yes
+ fi
+ FLWKEY_FLTK_API_MAJOR=${FLTK_API_VERSION%%.*}
+ FLWKEY_FLTK_API_MINOR=${FLTK_API_VERSION#*.}; FLWKEY_FLTK_API_MINOR=${FLWKEY_FLTK_API_MINOR%%.*}
+ if test "${HAVE_FLTK_API_VERSION}" = "no"; then
+ AC_MSG_ERROR([
+ *** The version of FLTK found on your system provides API version $FLTK_API_VERSION.
+ *** To build $PACKAGE you need a FLTK version that provides API 1.1 or 1.3.
+ ])
+ fi
+ FLTK_CFLAGS=`$FLTK_CONFIG --cxxflags`
+ if test "x$ac_cv_static" != "xyes"; then
+ FLTK_LIBS=`$FLTK_CONFIG --ldflags --use-images`
+ else
+ FLTK_LIBS=`$FLTK_CONFIG --ldstaticflags --use-images`
+ fi
+ else
+ AC_MSG_NOTICE([not checking for FLTK])
+ fi
+ AC_SUBST([FLTK_CFLAGS])
+ AC_SUBST([FLTK_LIBS])
+ AC_DEFINE_UNQUOTED([FLTK_BUILD_VERSION], ["`$FLTK_CONFIG --version`"], [FLTK version])
+ AC_DEFINE_UNQUOTED([FLWKEY_FLTK_API_MAJOR], [$FLWKEY_FLTK_API_MAJOR], [FLTK API major version])
+ AC_DEFINE_UNQUOTED([FLWKEY_FLTK_API_MINOR], [$FLWKEY_FLTK_API_MINOR], [FLTK API minor version])
+
+ AC_ARG_VAR([FLUID], [Fast Light User-Interface Designer])
+ AC_CHECK_PROG([FLUID], [fluid], [fluid])
+ AM_CONDITIONAL([HAVE_FLUID], [test -n "$FLUID"])
+])
diff --git a/m4/funcs.m4 b/m4/funcs.m4
new file mode 100644
index 0000000..2c366e3
--- /dev/null
+++ b/m4/funcs.m4
@@ -0,0 +1,15 @@
+# args: function, search-libs, other-libraries
+AC_DEFUN([AC_FL_SEARCH_LIBS], [
+
+m4_define([FUNC_NAME_UC], m4_translit([$1], [a-z], [A-Z]))
+
+LIBS_search_libs_save="$LIBS"
+LIBS=""
+AC_SEARCH_LIBS($1, $2, [ac_cv_have_func_[]$1=1], [ac_cv_have_func_[]$1=0], $3)
+if test "x$LIBS" != "x"; then
+ echo "$EXTRA_LIBS" | grep -q -e "$LIBS" || EXTRA_LIBS="$EXTRA_LIBS $LIBS"
+fi
+AC_DEFINE_UNQUOTED([HAVE_]FUNC_NAME_UC, $ac_cv_have_func_[]$1, [Define to 1 if we have $1])
+LIBS="$LIBS_search_libs_save"
+
+])
diff --git a/m4/macosx.m4 b/m4/macosx.m4
new file mode 100644
index 0000000..78bb8b2
--- /dev/null
+++ b/m4/macosx.m4
@@ -0,0 +1,42 @@
+AC_DEFUN([AC_FL_MACOSX], [
+case "$target_os" in
+ darwin*)
+ target_darwin="yes"
+ ;;
+ *)
+ target_darwin="no"
+ ;;
+esac
+
+AC_ARG_ENABLE([mac-universal], AC_HELP_STRING([--enable-mac-universal],
+ [build a universal binary on Mac OS X @<:@no@:>@]),
+ [case "${enableval}" in
+ yes|no) ac_cv_mac_universal="${enableval}" ;;
+ *) AC_MSG_ERROR([bad value "${enableval}" for --enable-mac-universal]) ;;
+ esac],
+ [ac_cv_mac_universal=no])
+
+if test "x$target_darwin" = "xyes" && test "x$ac_cv_mac_universal" = "xyes"; then
+ mac_minversion="-mmacosx-version-min=10.4"
+ case "$target_os" in
+ darwin8*)
+ mac_arches="-arch i386 -arch ppc"
+ mac_sysroot="-isysroot /Developer/SDKs/MacOSX10.4u.sdk"
+ ;;
+ darwin9*)
+ mac_arches="-arch i386 -arch ppc -arch x86_64 -arch ppc64"
+ mac_sysroot="-isysroot /Developer/SDKs/MacOSX10.5.sdk"
+ ;;
+ *)
+ mac_arches=""
+ mac_sysroot=""
+ ;;
+ esac
+ MAC_UNIVERSAL_CFLAGS="$mac_arches $mac_sysroot $mac_minversion"
+ MAC_UNIVERSAL_LDFLAGS="$mac_arches"
+fi
+AC_SUBST([MAC_UNIVERSAL_CFLAGS])
+AC_SUBST([MAC_UNIVERSAL_LDFLAGS])
+
+AM_CONDITIONAL([DARWIN], [test "x$target_darwin" = "xyes"])
+])
diff --git a/m4/np-compat.m4 b/m4/np-compat.m4
new file mode 100644
index 0000000..9e1d4e7
--- /dev/null
+++ b/m4/np-compat.m4
@@ -0,0 +1,36 @@
+AC_DEFUN([AC_FL_NP_COMPAT], [
+ AC_REQUIRE([AC_FL_MACOSX])
+ AC_REQUIRE([AC_FL_WIN32])
+
+ AM_CONDITIONAL([COMPAT_REGEX], [test "x$ac_cv_header_regex_h" != "xyes"])
+
+ if test "x$target_mingw32" = "xyes"; then
+ sem_libs="pthreadGC2"
+ else
+ sem_libs="pthread rt"
+ fi
+ other_libs=""
+
+ if test "x$ac_cv_want_ptw32" = "xyes"; then
+ CFLAGS_saved="$CFLAGS"
+ LDFLAGS_saved="$LDFLAGS"
+ EXTRA_LIBS_saved="$EXTRA_LIBS"
+ CFLAGS="$CFLAGS $PTW32_CFLAGS"
+ LDFLAGS="$LDFLAGS $PTW32_LIBS"
+ other_libs=-lws2_32
+ fi
+
+ AC_FL_SEARCH_LIBS([dlopen], [dl], [$other_libs])
+ AC_FL_SEARCH_LIBS([clock_gettime], [rt], [$other_libs])
+ AC_FL_SEARCH_LIBS([sem_unlink], [$sem_libs], [$other_libs])
+ AC_FL_SEARCH_LIBS([sem_timedwait], [$sem_libs], [$other_libs])
+
+ if test "x$ac_cv_want_ptw32" = "xyes"; then
+ CFLAGS="$CFLAGS_saved"
+ LDFLAGS="$LDFLAGS_saved"
+ EXTRA_LIBS="$EXTRA_LIBS_saved"
+ fi
+ AC_SUBST([EXTRA_LIBS])
+
+ AM_CONDITIONAL([COMPAT_STRCASESTR], [test "x$ac_cv_func_strcasestr" != "xyes"])
+])
diff --git a/m4/opt.m4 b/m4/opt.m4
new file mode 100644
index 0000000..460d23b
--- /dev/null
+++ b/m4/opt.m4
@@ -0,0 +1,29 @@
+AC_DEFUN([AC_FL_OPT], [
+ AC_ARG_ENABLE([optimizations],
+ AC_HELP_STRING([--enable-optimizations],
+ [use x86 optimizations (none|sse|sse2|sse3|native) @<:@none@:>@]),
+ [case "${enableval}" in
+ none|sse|sse2|sse3|native) ac_cv_opt="${enableval}" ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-optimizations]) ;;
+ esac],
+ [ac_cv_opt=none])
+ OPT_CFLAGS="-O2 -ffast-math -finline-functions -fomit-frame-pointer"
+ case "$ac_cv_opt" in
+ sse)
+ OPT_CFLAGS="$OPT_CFLAGS -msse -mfpmath=sse"
+ ;;
+ sse2)
+ OPT_CFLAGS="$OPT_CFLAGS -msse2 -mfpmath=sse"
+ ;;
+ sse3)
+ OPT_CFLAGS="$OPT_CFLAGS -msse3 -mfpmath=sse"
+ ;;
+ native)
+ OPT_CFLAGS="$OPT_CFLAGS -march=native -mfpmath=sse"
+ ;;
+ none)
+ ;;
+ esac
+
+ AC_SUBST([OPT_CFLAGS])
+])
diff --git a/m4/pkg-config.m4 b/m4/pkg-config.m4
new file mode 100644
index 0000000..49428fa
--- /dev/null
+++ b/m4/pkg-config.m4
@@ -0,0 +1,44 @@
+# name, version, show-in-help?, optional?, help-text, [am-cond]
+AC_DEFUN([AC_FLWKEY_PKG_CHECK], [
+
+m4_define([PKG_NAME_UC], m4_translit([$1], [a-z], [A-Z]))
+
+m4_if([$3], [yes],
+ [ AC_ARG_WITH($1, AC_HELP_STRING([--with-[]$1], [$5]),
+ [case "${withval}" in
+ yes|no) ac_cv_want_[]$1="${withval}" ;;
+ *) AC_MSG_ERROR([bad value "${withval}" for --with-[]$1]) ;;
+ esac],
+ [ac_cv_want_[]$1=check])
+ ])
+m4_if([$4], [no], [ac_cv_want_[]$1=yes])
+
+test "x$ac_cv_want_[]$1" = "x" && ac_cv_want_[]$1="check"
+case "x$ac_cv_want_[]$1" in
+ "xno")
+ ac_cv_[]$1=no
+ ;;
+ "xcheck")
+ PKG_CHECK_MODULES(PKG_NAME_UC, [$2], [ac_cv_[]$1=yes], [ac_cv_[]$1=no])
+ ;;
+ "xyes")
+ PKG_CHECK_MODULES(PKG_NAME_UC, [$2])
+ # if we get here the test has succeeded
+ ac_cv_[]$1=yes
+ ;;
+esac
+
+if test "x$ac_cv_[]$1" = "xyes"; then
+ AC_DEFINE([USE_]PKG_NAME_UC, 1, [Define to 1 if we are using $1])
+ pkg_[]$1_version=`$PKG_CONFIG --modversion "$2" 2>/dev/null`
+else
+ AC_DEFINE([USE_]PKG_NAME_UC, 0, [Define to 1 if we are using $1])
+ pkg_[]$1_version=""
+fi
+
+AC_SUBST(PKG_NAME_UC[_CFLAGS])
+AC_SUBST(PKG_NAME_UC[_LIBS])
+AC_DEFINE_UNQUOTED(PKG_NAME_UC[_BUILD_VERSION], ["$pkg_[]$1_version"], [$1 version])
+
+m4_ifval([$6], [ AM_CONDITIONAL([$6], [test "x$ac_cv_[]$1" = "xyes"]) ], [:])
+])
diff --git a/m4/static.m4 b/m4/static.m4
new file mode 100644
index 0000000..8c5bdd2
--- /dev/null
+++ b/m4/static.m4
@@ -0,0 +1,9 @@
+AC_DEFUN([AC_FL_STATIC], [
+ AC_ARG_ENABLE([static],
+ AC_HELP_STRING([--enable-static], [enable static linking for some libraries]),
+ [case "${enableval}" in
+ yes|no) ac_cv_static="${enableval}" ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-static]) ;;
+ esac],
+ [ac_cv_static=no])
+])
diff --git a/m4/win32.m4 b/m4/win32.m4
new file mode 100644
index 0000000..eb62768
--- /dev/null
+++ b/m4/win32.m4
@@ -0,0 +1,59 @@
+AC_DEFUN([AC_FL_WIN32], [
+case "$target_os" in
+ *mingw*)
+ target_win32="yes"
+ target_mingw32="yes"
+ ;;
+ *cygwin*|*win32*|*w32*)
+ target_win32="yes"
+ ;;
+ *)
+ target_win32="no"
+ ;;
+esac
+
+if test "x$target_win32" = "xyes"; then
+ AC_CHECK_PROG([WINDRES], [${ac_tool_prefix}windres], [${ac_tool_prefix}windres])
+ if [ test "x$WINDRES" = "x" ]; then
+ AC_MSG_WARN([The windres utility could not be found])
+ fi
+ AC_DEFINE([__WOE32__], 1, [Define to 1 if we are building on mingw])
+fi
+
+if test "x$target_mingw32" = "xyes"; then
+ AC_CHECK_PROG([MAKENSIS], [makensis], [makensis])
+fi
+
+AC_SUBST([WINDRES])
+AM_CONDITIONAL([HAVE_WINDRES], [test "x$WINDRES" != "x"])
+AC_SUBST([MAKENSIS])
+AM_CONDITIONAL([HAVE_NSIS], [test "x$MAKENSIS" != "x"])
+AM_CONDITIONAL([WIN32], [test "x$target_win32" = "xyes"])
+AM_CONDITIONAL([MINGW32], [test "x$target_mingw32" = "xyes"])
+
+
+AC_ARG_VAR([PTW32_CFLAGS], [C compiler flags for pthreads-w32])
+AC_ARG_VAR([PTW32_LIBS], [linker flags for pthreads-w32])
+
+AC_ARG_WITH([ptw32],
+ AC_HELP_STRING([--with-ptw32@<:@=DIR@:>@],
+ [search for pthreads-w32 in DIR/include and DIR/lib @<:@mingw32 only@:>@]),
+ [ac_cv_want_ptw32="$withval"],
+ [ac_cv_want_ptw32=no])
+
+if test "x$ac_cv_want_ptw32" != "xno"; then
+ if test "x$ac_cv_want_ptw32" != "xyes"; then # set -I and -L switches
+ ptw32_default_cflags="-I${ac_cv_want_ptw32}/include"
+ ptw32_default_libs="-L${ac_cv_want_ptw32}/lib"
+ fi
+ ptw32_default_libs="$ptw32_default_libs -lpthreadGC2 -lws2_32"
+
+ # don't override the user-specified vars
+ PTW32_CFLAGS="${PTW32_CFLAGS:-$ptw32_default_cflags}"
+ PTW32_LIBS="${PTW32_LIBS:-$ptw32_default_libs}"
+ ac_cv_want_ptw32="yes"
+fi
+
+AC_SUBST([PTW32_CFLAGS])
+AC_SUBST([PTW32_LIBS])
+])
diff --git a/scripts/build4mingw.sh b/scripts/build4mingw.sh
new file mode 100755
index 0000000..f358747
--- /dev/null
+++ b/scripts/build4mingw.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+### Script to build a win32 installation
+
+./configure \
+ $PKGCFG \
+ $CROSSCFG \
+ --with-ptw32=/opt/mxe/usr/i686-pc-mingw32 \
+ --enable-static \
+ PTW32_LIBS="-lpthread -lpcreposix -lpcre -lregex" \
+ FLTK_CONFIG=$PREFIX/bin/i686-pc-mingw32-fltk-config \
+
+make
+
+make
+$PREFIX/bin/i686-pc-mingw32-strip src/flwkey.exe
+make nsisinst
+mv src/*setup*exe .
+
+
diff --git a/scripts/mkappbundle.sh b/scripts/mkappbundle.sh
new file mode 100755
index 0000000..e215c98
--- /dev/null
+++ b/scripts/mkappbundle.sh
@@ -0,0 +1,119 @@
+#!/bin/sh
+
+### Script to create the .app structure for osx
+### 20090730 Stelios Bounanos M0GLD
+
+if [ $# -ne 2 ]; then
+ echo "Syntax: $0 data-dir build-dir" >&2
+ exit 1
+fi
+
+if [ -z "$PACKAGE_TARNAME" ]; then
+ echo "E: \$PACKAGE_TARNAME undefined"
+ exit 1
+fi
+
+PWD=`pwd`
+data="${PWD}/$1"
+build="${PWD}/$2"
+bundle_dir="$APPBUNDLE_NOLIBS"
+static_bundle_dir="$APPBUNDLE"
+# more sanity checks
+for d in "$data" "$build"; do
+ test -d "$d" && continue
+ echo "E: ${d}: not a directory" >&2
+ exit 1
+done
+if ! test -w "$build"; then
+ echo "E: ${build} is not writeable" >&2
+ exit 1
+fi
+
+plist="${data}/mac/Info.plist.in"
+flwkey_icon="${data}/mac/flwkey.icns"
+for f in "$plist" "$flwkey_icon"; do
+ test -r "$f" && continue
+ echo "E: ${f}: not readable" >&2
+ exit 1
+done
+
+# aaaaaaaaaargh => Aaaaaaaaaargh
+upcase1()
+{
+ sed 'h; s/\(^.\).*/\1/; y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/; G; s/\n.//'
+}
+
+function copy_libs()
+{
+ list="$1"
+ while test "x$list" != "x"; do
+ change="$list"
+ list=""
+
+ for obj in $change; do
+ for lib in `otool -L $obj | \
+ sed -n 's!^.*[[:space:]]\([^[:space:]]*\.dylib\).*$!\1!p' | \
+ grep -Ev '^/(usr/lib|System)'`; do
+ libfn="`basename $lib`"
+ if ! test -f "Frameworks/$libfn"; then
+ cp "$lib" "Frameworks/$libfn"
+ install_name_tool -id "@executable_path/../Frameworks/$libfn" "Frameworks/$libfn"
+ list="$list Frameworks/$libfn"
+ fi
+ install_name_tool -change "$lib" "@executable_path/../Frameworks/$libfn" "$obj"
+ done
+ done
+ done
+}
+
+function bundle()
+{
+ appname="${binary}-${appversion}.app"
+ cd "$build"
+
+ # bundle the binary
+ echo "creating ${build}/$bundle_dir/$appname"
+ $mkinstalldirs "$bundle_dir/$appname/Contents/MacOS" "$bundle_dir/$appname/Contents/Resources"
+ cd "$bundle_dir"
+ $INSTALL_PROGRAM "${build}/$binary" "$appname/Contents/MacOS"
+ test "x$NOSTRIP" = "x" && ${STRIP:-strip} -S "$appname/Contents/MacOS/$binary"
+
+ $INSTALL_DATA "$icon" "$appname/Contents/Resources"
+ echo "APPL${signature}" > "$appname/Contents/PkgInfo"
+ sed -e "s!%%IDENTIFIER%%!${identifier}!g; s!%%NAME%%!${name}!g;\
+ s!%%SIGNATURE%%!${signature}!g; s!%%BINARY%%!${binary}!g;\
+ s!%%VERSION%%!${version}!g; s!%%ICON%%!${icon##*/}!g;" < "$plist" > "$appname/Contents/Info.plist"
+ if grep '%%[A-Z]*%%' "$appname/Contents/Info.plist"; then
+ echo "E: unsubstituted variables in $appname/Contents/Info.plist" >&2
+ exit 1
+ fi
+
+
+ # bundle the binary and its non-standard dependencies
+ echo "creating ${build}/$static_bundle_dir/$appname"
+ cd ..
+ $mkinstalldirs "$static_bundle_dir"
+ cp -pR "$bundle_dir/$appname" "$static_bundle_dir"
+ $mkinstalldirs "$static_bundle_dir/$appname/Contents/Frameworks"
+ cd "$static_bundle_dir/$appname/Contents"
+ copy_libs "MacOS/$binary"
+}
+
+set -e
+
+identifier="com.w1hkj.$PACKAGE_TARNAME"
+name=$(echo "$PACKAGE_TARNAME" | upcase1)
+# we'll use the first four consonants as the signature
+signature="$(echo $PACKAGE_TARNAME | sed 's/[aeiouAEIOU]//g; s/\(^....\).*/\1/')"
+binary="$PACKAGE_TARNAME"
+icon="$flwkey_icon"
+version="${FLWKEY_VERSION_MAJOR}.${FLWKEY_VERSION_MINOR}"
+appversion="$FLWKEY_VERSION"
+
+bundle
+
+cd "$build"
+echo $ECHO_N "creating disk image"
+hdiutil create -ov -srcfolder "$bundle_dir" -format UDZO -tgtimagekey zlib-level=9 "${APPBUNDLE}-nolibs.dmg"
+echo $ECHO_N "creating disk image"
+hdiutil create -ov -srcfolder "$static_bundle_dir" -format UDZO -tgtimagekey zlib-level=9 "${APPBUNDLE}.dmg"
diff --git a/scripts/mknsisinst.sh b/scripts/mknsisinst.sh
new file mode 100755
index 0000000..2c52797
--- /dev/null
+++ b/scripts/mknsisinst.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+### Script to create a win32 installer file
+### 20090510 Stelios Bounanos M0GLD, Dave Freese W1HKJ
+
+### change for the target application
+flwkey_name=flwkey
+flwkey_bin=flwkey.exe
+
+if [ $# -ne 2 ]; then
+ echo "Syntax: $0 data-dir build-dir" >&2
+ exit 1
+fi
+
+if [ -z "$PACKAGE_TARNAME" ]; then
+ echo "E: \$PACKAGE_TARNAME undefined"
+ exit 1
+fi
+
+PWD=`pwd`
+data="${PWD}/$1"
+build="${PWD}/$2"
+
+# more sanity checks
+for d in "$data" "$build"; do
+ test -d "$d" && continue
+ echo "E: ${d}: not a directory" >&2
+ exit 1
+done
+if ! test -w "$build"; then
+ echo "E: ${build} is not writeable" >&2
+ exit 1
+fi
+
+set -e
+
+test "x$NOSTRIP" = "x" && $STRIP -S "$flwkey_bin"
+def="-Dflwkey_NAME=$flwkey_name -Dflwkey_BINARY=$flwkey_bin -Dflwkey_VERSION=$PACKAGE_VERSION"
+
+$MAKENSIS -V2 -NOCD -D"INSTALLER_FILE=$INSTALLER_FILE" -D"LICENSE_FILE=$data/../COPYING" \
+ -D"SUPPORT_URL=$PACKAGE_HOME" -D"UPDATES_URL=$PACKAGE_DL" $def "$data/win32/fl_app.nsi"
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..08ffe14
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,259 @@
+# Copyright (c) 2008 Dave Freese, W1HKJ (w1hkj AT w1hkj DOT com)
+
+bin_PROGRAMS = flwkey
+
+flwkey_CPPFLAGS = @FLWKEY_BUILD_CPPFLAGS@
+flwkey_CXXFLAGS = @FLWKEY_BUILD_CXXFLAGS@
+flwkey_CFLAGS = $(flwkey_CXXFLAGS)
+flwkey_LDFLAGS = @FLWKEY_BUILD_LDFLAGS@
+flwkey_LDADD = @FLWKEY_BUILD_LDADD@
+
+MINGW32_SRC = \
+ flwkey-rc.rc \
+ include/flwkeyrc.h \
+ misc/mingw.c \
+ compat/regex.c \
+ include/compat.h
+
+
+# We distribute these but do not always compile them
+EXTRA_flwkey_SOURCES = $(FLWKEY_WIN32_RES_SRC) $(MINGW32_SRC)
+
+flwkey_SOURCES =
+
+if MINGW32
+if HAVE_WINDRES
+ flwkey_SOURCES += $(MINGW32_SRC)
+endif
+endif
+
+########################################################################
+
+
+FLWKEY_VERSION_MAJOR = @FLWKEY_VERSION_MAJOR@
+FLWKEY_VERSION_MINOR = @FLWKEY_VERSION_MINOR@
+FLWKEY_VERSION_PATCH = @FLWKEY_VERSION_PATCH@
+FLWKEY_VERSION = @FLWKEY_VERSION@
+
+.EXPORT_ALL_VARIABLES: nsisinst appbundle
+
+# Sources that are generated,
+BUILT_SOURCES =
+# not distributed,
+nodist_flwkey_SOURCES = $(BUILT_SOURCES)
+# and deleted by the clean targets
+CLEANFILES = $(BUILT_SOURCES)
+CLEAN_LOCAL =
+
+if MINGW32
+if HAVE_WINDRES
+.rc.o:
+ $(WINDRES) -I$(srcdir)/include -I$(srcdir)/../data/win32 $< -O coff $@
+endif
+endif
+
+install-data-local:
+ if test -f $(srcdir)/../data/flwkey.xpm; then \
+ $(mkinstalldirs) $(DESTDIR)/$(datadir)/pixmaps; \
+ $(INSTALL_DATA) $(srcdir)/../data/flwkey.xpm $(DESTDIR)/$(datadir)/pixmaps; \
+ fi
+ if test -f $(srcdir)/../data/flwkey.desktop; then \
+ $(mkinstalldirs) $(DESTDIR)/$(datadir)/applications; \
+ $(INSTALL_DATA) $(srcdir)/../data/flwkey.desktop $(DESTDIR)/$(datadir)/applications; \
+ fi
+
+uninstall-local:
+ rm -f $(DESTDIR)/$(datadir)/pixmaps/flwkey.xpm
+ rm -f $(DESTDIR)/$(datadir)/applications/flwkey.desktop
+
+FLWKEY_FL_SRC = wkey_dialogs.fl logbook/lgbook.fl
+
+if HAVE_FLUID
+flgen: $(FLWKEY_FL_SRC) $(FLWKEY_FL_LOG)
+ (cd $(srcdir)/include; \
+ for f in $(FLWKEY_FL_SRC); do \
+ c=$${f%.fl}.cxx; \
+ h=$${f%.fl}.h; \
+ h=$${h##*/}; \
+ $(FLUID) -c -o ../$$c -h $$h ../$$f; \
+ done)
+endif
+
+
+INSTALLER_FILE = flwkey-$(FLWKEY_VERSION)_setup.exe
+APPBUNDLE=flwkey-$(FLWKEY_VERSION)
+APPBUNDLE_NOLIBS=$(APPBUNDLE)-nolibs
+
+if HAVE_NSIS
+nsisinst: $(bin_PROGRAMS)
+ sh $(srcdir)/../scripts/mknsisinst.sh "$(srcdir)/../data" .
+ CLEANFILES += $(INSTALLER_FILE)
+endif
+
+if DARWIN
+appbundle: $(bin_PROGRAMS)
+ sh $(srcdir)/../scripts/mkappbundle.sh "$(srcdir)/../data" .
+ CLEAN_LOCAL += $(APPBUNDLE_NOLIBS) $(APPBUNDLE) $(APPBUNDLE)*.dmg
+endif
+
+#if HAVE_ASCIIDOC
+#$(builddir)/../doc/guide.html: $(builddir)/../doc/guide.txt
+# $(MAKE) -C $(builddir)/../doc $(AM_MAKEFLAGS) guide.html
+
+#$(builddir)/dialogs/guide.cxx: $(builddir)/../doc/guide.html
+# mkdir -p $(builddir)/dialogs
+# sed 's/"/\\"/g; s/$$/\\n\\/g; 1 s/.*/const char* szBeginner = "&/; $$ s/.*/&n";/' $< > $@
+#dialogs/htmlstrings.cxx: $(builddir)/dialogs/guide.cxx
+
+#distclean-local:
+# @if test "$(builddir)" != "$(srcdir)"; then \
+# rm -f $(builddir)/dialogs/guide.cxx; \
+# fi
+#endif
+
+clean-local:
+ -rm -rf $(CLEAN_LOCAL)
+
+# Sources that we build. It is OK to have headers here.
+flwkey_SOURCES += \
+ dialogs.cxx \
+ flwkey.cxx \
+ wkey_dialogs.cxx \
+ wkey_io.cxx \
+ logbook/adif_io.cxx \
+ logbook/date.cxx \
+ logbook/logsupport.cxx \
+ logbook/table.cxx \
+ logbook/calendar.cxx \
+ logbook/lgbook.cxx \
+ logbook/logbook.cxx \
+ logbook/qso_db.cxx \
+ logbook/textio.cxx \
+ misc/debug.cxx \
+ misc/pixmaps.cxx \
+ misc/icons.cxx \
+ misc/re.cxx \
+ misc/xmlrpc_log.cxx \
+ misc/serial.cxx \
+ misc/status.cxx \
+ misc/support.cxx \
+ misc/timeops.cxx \
+ misc/util.cxx \
+ widgets/combo.cxx \
+ widgets/flslider2.cxx \
+ widgets/ValueSlider.cxx \
+ widgets/FTextRXTX.cxx \
+ widgets/FTextView.cxx \
+ widgets/Fl_Text_Display_mod.cxx \
+ widgets/Fl_Text_Editor_mod.cxx \
+ widgets/Fl_Native_File_Chooser.cxx \
+ widgets/flinput2.cxx \
+ widgets/fileselect.cxx \
+ xmlrpccpp/XmlRpcClient.cpp \
+ xmlrpccpp/XmlRpcMutex.cpp \
+ xmlrpccpp/XmlRpcServerMethod.cpp \
+ xmlrpccpp/XmlRpcThread.cpp \
+ xmlrpccpp/XmlRpcValue.cpp \
+ xmlrpccpp/XmlRpcDispatch.cpp \
+ xmlrpccpp/XmlRpcServerConnection.cpp \
+ xmlrpccpp/XmlRpcSocket.cpp \
+ xmlrpccpp/XmlRpcServer.cpp \
+ xmlrpccpp/XmlRpcSource.cpp \
+ xmlrpccpp/XmlRpcUtil.cpp
+
+# Additional source files that are distributed
+EXTRA_DIST = \
+ config.h \
+ widgets/flnfc_common.cxx \
+ compat/regex.c \
+ compat/regex.h \
+ widgets/Fl_Native_File_Chooser_FLTK.cxx \
+ widgets/Fl_Native_File_Chooser_MAC.cxx \
+ widgets/Fl_Native_File_Chooser_WIN32.cxx \
+ widgets/Fl_Text_Display_mod_1_1.cxx \
+ widgets/Fl_Text_Display_mod_1_3.cxx \
+ widgets/Fl_Text_Editor_mod_1_1.cxx \
+ widgets/Fl_Text_Editor_mod_1_3.cxx \
+ flwkey_icon.cxx \
+ wkey_dialogs.fl \
+ logbook/lgbook.fl \
+ include/adif_def.h \
+ include/adif_io.h \
+ include/calendar.h \
+ include/date.h \
+ include/field_def.h \
+ include/lgbook.h \
+ include/log.h \
+ include/logbook.h \
+ include/logger.h \
+ include/logsupport.h \
+ include/qso_db.h \
+ include/table.h \
+ include/textio.h \
+ include/combo.h \
+ include/debug.h \
+ include/dialogs.h \
+ include/fileselect.h \
+ include/flwkeyrc.h \
+ include/flslider2.h \
+ include/font_browser.h \
+ include/gettext.h \
+ include/mingw.h \
+ include/flwkey.h \
+ include/wkey_io.h \
+ include/serial.h \
+ include/status.h \
+ include/support.h \
+ include/threads.h \
+ include/re.h \
+ include/util.h \
+ include/ValueSlider.h \
+ include/FTextView.h \
+ include/FTextRXTX.h \
+ include/Fl_Text_Display_mod.H \
+ include/Fl_Text_Display_mod_1_1.H \
+ include/Fl_Text_Display_mod_1_3.H \
+ include/Fl_Text_Editor_mod.H \
+ include/Fl_Text_Editor_mod_1_1.H \
+ include/Fl_Text_Editor_mod_1_3.H \
+ include/flinput2.h \
+ include/pixmaps.h \
+ include/timeops.h \
+ include/icons.h \
+ include/fileselect.h \
+ include/wkey_dialogs.h \
+ include/FL/Fl_Native_File_Chooser.H \
+ include/FL/Fl_Native_File_Chooser_FLTK.H \
+ include/FL/Fl_Native_File_Chooser_MAC.H \
+ include/FL/Fl_Native_File_Chooser_WIN32.H \
+ include/base64.h \
+ include/XmlRpc.h \
+ include/XmlRpcServer.h \
+ include/XmlRpcSource.h \
+ include/XmlRpcUtil.h \
+ include/XmlRpcClient.h \
+ include/XmlRpcMutex.h \
+ include/XmlRpcServerMethod.h \
+ include/XmlRpcValue.h \
+ include/XmlRpcThreadedServer.h \
+ include/XmlRpcDispatch.h \
+ include/XmlRpcServerConnection.h \
+ include/XmlRpcSocket.h \
+ include/XmlRpcThread.h \
+ include/XmlRpcException.h
+
+
+# Additional non-source files that are distributed
+# Additional source files that support non-Linux cross compilation
+EXTRA_DIST += \
+ $(srcdir)/../data/flwkey.desktop \
+ $(srcdir)/../data/flwkey.xpm \
+ $(srcdir)/../data/win32/fl_app.nsi \
+ $(srcdir)/../data/win32/flwkey.ico \
+ $(srcdir)/../scripts/mknsisinst.sh \
+ $(srcdir)/../scripts/build4mingw.sh \
+ $(srcdir)/../data/mac/Info.plist.in \
+ $(srcdir)/../data/mac/flwkey.icns \
+ $(srcdir)/../scripts/mkappbundle.sh \
+ $(FLWKEY_WIN32_SRC) \
+ $(FLWKEY_FL_SRC)
diff --git a/src/Makefile.in b/src/Makefile.in
new file mode 100644
index 0000000..8fdde5c
--- /dev/null
+++ b/src/Makefile.in
@@ -0,0 +1,1483 @@
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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.
+
+ at SET_MAKE@
+
+# Copyright (c) 2008 Dave Freese, W1HKJ (w1hkj AT w1hkj DOT com)
+
+VPATH = @srcdir@
+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@
+target_triplet = @target@
+bin_PROGRAMS = flwkey$(EXEEXT)
+ at HAVE_WINDRES_TRUE@@MINGW32_TRUE at am__append_1 = $(MINGW32_SRC)
+ at HAVE_NSIS_TRUE@am__append_2 = $(INSTALLER_FILE)
+ at DARWIN_TRUE@am__append_3 = $(APPBUNDLE_NOLIBS) $(APPBUNDLE) $(APPBUNDLE)*.dmg
+subdir = src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/config.h.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/build.m4 \
+ $(top_srcdir)/m4/debug.m4 $(top_srcdir)/m4/fltk.m4 \
+ $(top_srcdir)/m4/funcs.m4 $(top_srcdir)/m4/macosx.m4 \
+ $(top_srcdir)/m4/np-compat.m4 $(top_srcdir)/m4/opt.m4 \
+ $(top_srcdir)/m4/pkg-config.m4 $(top_srcdir)/m4/static.m4 \
+ $(top_srcdir)/m4/win32.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+am__flwkey_SOURCES_DIST = flwkey-rc.rc include/flwkeyrc.h misc/mingw.c \
+ compat/regex.c include/compat.h dialogs.cxx flwkey.cxx \
+ wkey_dialogs.cxx wkey_io.cxx logbook/adif_io.cxx \
+ logbook/date.cxx logbook/logsupport.cxx logbook/table.cxx \
+ logbook/calendar.cxx logbook/lgbook.cxx logbook/logbook.cxx \
+ logbook/qso_db.cxx logbook/textio.cxx misc/debug.cxx \
+ misc/pixmaps.cxx misc/icons.cxx misc/re.cxx \
+ misc/xmlrpc_log.cxx misc/serial.cxx misc/status.cxx \
+ misc/support.cxx misc/timeops.cxx misc/util.cxx \
+ widgets/combo.cxx widgets/flslider2.cxx \
+ widgets/ValueSlider.cxx widgets/FTextRXTX.cxx \
+ widgets/FTextView.cxx widgets/Fl_Text_Display_mod.cxx \
+ widgets/Fl_Text_Editor_mod.cxx \
+ widgets/Fl_Native_File_Chooser.cxx widgets/flinput2.cxx \
+ widgets/fileselect.cxx xmlrpccpp/XmlRpcClient.cpp \
+ xmlrpccpp/XmlRpcMutex.cpp xmlrpccpp/XmlRpcServerMethod.cpp \
+ xmlrpccpp/XmlRpcThread.cpp xmlrpccpp/XmlRpcValue.cpp \
+ xmlrpccpp/XmlRpcDispatch.cpp \
+ xmlrpccpp/XmlRpcServerConnection.cpp \
+ xmlrpccpp/XmlRpcSocket.cpp xmlrpccpp/XmlRpcServer.cpp \
+ xmlrpccpp/XmlRpcSource.cpp xmlrpccpp/XmlRpcUtil.cpp
+am__objects_1 = flwkey-rc.$(OBJEXT) flwkey-mingw.$(OBJEXT) \
+ flwkey-regex.$(OBJEXT)
+ at HAVE_WINDRES_TRUE@@MINGW32_TRUE at am__objects_2 = $(am__objects_1)
+am_flwkey_OBJECTS = $(am__objects_2) flwkey-dialogs.$(OBJEXT) \
+ flwkey-flwkey.$(OBJEXT) flwkey-wkey_dialogs.$(OBJEXT) \
+ flwkey-wkey_io.$(OBJEXT) flwkey-adif_io.$(OBJEXT) \
+ flwkey-date.$(OBJEXT) flwkey-logsupport.$(OBJEXT) \
+ flwkey-table.$(OBJEXT) flwkey-calendar.$(OBJEXT) \
+ flwkey-lgbook.$(OBJEXT) flwkey-logbook.$(OBJEXT) \
+ flwkey-qso_db.$(OBJEXT) flwkey-textio.$(OBJEXT) \
+ flwkey-debug.$(OBJEXT) flwkey-pixmaps.$(OBJEXT) \
+ flwkey-icons.$(OBJEXT) flwkey-re.$(OBJEXT) \
+ flwkey-xmlrpc_log.$(OBJEXT) flwkey-serial.$(OBJEXT) \
+ flwkey-status.$(OBJEXT) flwkey-support.$(OBJEXT) \
+ flwkey-timeops.$(OBJEXT) flwkey-util.$(OBJEXT) \
+ flwkey-combo.$(OBJEXT) flwkey-flslider2.$(OBJEXT) \
+ flwkey-ValueSlider.$(OBJEXT) flwkey-FTextRXTX.$(OBJEXT) \
+ flwkey-FTextView.$(OBJEXT) \
+ flwkey-Fl_Text_Display_mod.$(OBJEXT) \
+ flwkey-Fl_Text_Editor_mod.$(OBJEXT) \
+ flwkey-Fl_Native_File_Chooser.$(OBJEXT) \
+ flwkey-flinput2.$(OBJEXT) flwkey-fileselect.$(OBJEXT) \
+ flwkey-XmlRpcClient.$(OBJEXT) flwkey-XmlRpcMutex.$(OBJEXT) \
+ flwkey-XmlRpcServerMethod.$(OBJEXT) \
+ flwkey-XmlRpcThread.$(OBJEXT) flwkey-XmlRpcValue.$(OBJEXT) \
+ flwkey-XmlRpcDispatch.$(OBJEXT) \
+ flwkey-XmlRpcServerConnection.$(OBJEXT) \
+ flwkey-XmlRpcSocket.$(OBJEXT) flwkey-XmlRpcServer.$(OBJEXT) \
+ flwkey-XmlRpcSource.$(OBJEXT) flwkey-XmlRpcUtil.$(OBJEXT)
+am__objects_3 =
+nodist_flwkey_OBJECTS = $(am__objects_3)
+flwkey_OBJECTS = $(am_flwkey_OBJECTS) $(nodist_flwkey_OBJECTS)
+flwkey_DEPENDENCIES =
+flwkey_LINK = $(CXXLD) $(flwkey_CXXFLAGS) $(CXXFLAGS) \
+ $(flwkey_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. at am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
+ -o $@
+SOURCES = $(flwkey_SOURCES) $(EXTRA_flwkey_SOURCES) \
+ $(nodist_flwkey_SOURCES)
+DIST_SOURCES = $(am__flwkey_SOURCES_DIST) $(EXTRA_flwkey_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AC_CONFIG_ARGS = @AC_CONFIG_ARGS@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFD_CFLAGS = @BFD_CFLAGS@
+BFD_LIBS = @BFD_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+EXTRA_LIBS = @EXTRA_LIBS@
+FLTK_CFLAGS = @FLTK_CFLAGS@
+FLTK_CONFIG = @FLTK_CONFIG@
+FLTK_LIBS = @FLTK_LIBS@
+FLUID = @FLUID@
+FLWKEY_BUILD_CPPFLAGS = @FLWKEY_BUILD_CPPFLAGS@
+FLWKEY_BUILD_CXXFLAGS = @FLWKEY_BUILD_CXXFLAGS@
+FLWKEY_BUILD_LDADD = @FLWKEY_BUILD_LDADD@
+FLWKEY_BUILD_LDFLAGS = @FLWKEY_BUILD_LDFLAGS@
+FLWKEY_VERSION = @FLWKEY_VERSION@
+
+########################################################################
+FLWKEY_VERSION_MAJOR = @FLWKEY_VERSION_MAJOR@
+FLWKEY_VERSION_MINOR = @FLWKEY_VERSION_MINOR@
+FLWKEY_VERSION_PATCH = @FLWKEY_VERSION_PATCH@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAC_UNIVERSAL_CFLAGS = @MAC_UNIVERSAL_CFLAGS@
+MAC_UNIVERSAL_LDFLAGS = @MAC_UNIVERSAL_LDFLAGS@
+MAKEINFO = @MAKEINFO@
+MAKENSIS = @MAKENSIS@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+OPT_CFLAGS = @OPT_CFLAGS@
+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@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+POW_LIB = @POW_LIB@
+PTW32_CFLAGS = @PTW32_CFLAGS@
+PTW32_LIBS = @PTW32_LIBS@
+RDYNAMIC = @RDYNAMIC@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+WINDRES = @WINDRES@
+X_CFLAGS = @X_CFLAGS@
+X_LIBS = @X_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+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@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+flwkey_CPPFLAGS = @FLWKEY_BUILD_CPPFLAGS@
+flwkey_CXXFLAGS = @FLWKEY_BUILD_CXXFLAGS@
+flwkey_CFLAGS = $(flwkey_CXXFLAGS)
+flwkey_LDFLAGS = @FLWKEY_BUILD_LDFLAGS@
+flwkey_LDADD = @FLWKEY_BUILD_LDADD@
+MINGW32_SRC = \
+ flwkey-rc.rc \
+ include/flwkeyrc.h \
+ misc/mingw.c \
+ compat/regex.c \
+ include/compat.h
+
+
+# We distribute these but do not always compile them
+EXTRA_flwkey_SOURCES = $(FLWKEY_WIN32_RES_SRC) $(MINGW32_SRC)
+
+# Sources that we build. It is OK to have headers here.
+flwkey_SOURCES = $(am__append_1) dialogs.cxx flwkey.cxx \
+ wkey_dialogs.cxx wkey_io.cxx logbook/adif_io.cxx \
+ logbook/date.cxx logbook/logsupport.cxx logbook/table.cxx \
+ logbook/calendar.cxx logbook/lgbook.cxx logbook/logbook.cxx \
+ logbook/qso_db.cxx logbook/textio.cxx misc/debug.cxx \
+ misc/pixmaps.cxx misc/icons.cxx misc/re.cxx \
+ misc/xmlrpc_log.cxx misc/serial.cxx misc/status.cxx \
+ misc/support.cxx misc/timeops.cxx misc/util.cxx \
+ widgets/combo.cxx widgets/flslider2.cxx \
+ widgets/ValueSlider.cxx widgets/FTextRXTX.cxx \
+ widgets/FTextView.cxx widgets/Fl_Text_Display_mod.cxx \
+ widgets/Fl_Text_Editor_mod.cxx \
+ widgets/Fl_Native_File_Chooser.cxx widgets/flinput2.cxx \
+ widgets/fileselect.cxx xmlrpccpp/XmlRpcClient.cpp \
+ xmlrpccpp/XmlRpcMutex.cpp xmlrpccpp/XmlRpcServerMethod.cpp \
+ xmlrpccpp/XmlRpcThread.cpp xmlrpccpp/XmlRpcValue.cpp \
+ xmlrpccpp/XmlRpcDispatch.cpp \
+ xmlrpccpp/XmlRpcServerConnection.cpp \
+ xmlrpccpp/XmlRpcSocket.cpp xmlrpccpp/XmlRpcServer.cpp \
+ xmlrpccpp/XmlRpcSource.cpp xmlrpccpp/XmlRpcUtil.cpp
+
+# Sources that are generated,
+BUILT_SOURCES =
+# not distributed,
+nodist_flwkey_SOURCES = $(BUILT_SOURCES)
+# and deleted by the clean targets
+CLEANFILES = $(BUILT_SOURCES) $(am__append_2)
+CLEAN_LOCAL = $(am__append_3)
+FLWKEY_FL_SRC = wkey_dialogs.fl logbook/lgbook.fl
+INSTALLER_FILE = flwkey-$(FLWKEY_VERSION)_setup.exe
+APPBUNDLE = flwkey-$(FLWKEY_VERSION)
+APPBUNDLE_NOLIBS = $(APPBUNDLE)-nolibs
+
+# Additional source files that are distributed
+
+# Additional non-source files that are distributed
+# Additional source files that support non-Linux cross compilation
+EXTRA_DIST = config.h widgets/flnfc_common.cxx compat/regex.c \
+ compat/regex.h widgets/Fl_Native_File_Chooser_FLTK.cxx \
+ widgets/Fl_Native_File_Chooser_MAC.cxx \
+ widgets/Fl_Native_File_Chooser_WIN32.cxx \
+ widgets/Fl_Text_Display_mod_1_1.cxx \
+ widgets/Fl_Text_Display_mod_1_3.cxx \
+ widgets/Fl_Text_Editor_mod_1_1.cxx \
+ widgets/Fl_Text_Editor_mod_1_3.cxx flwkey_icon.cxx \
+ wkey_dialogs.fl logbook/lgbook.fl include/adif_def.h \
+ include/adif_io.h include/calendar.h include/date.h \
+ include/field_def.h include/lgbook.h include/log.h \
+ include/logbook.h include/logger.h include/logsupport.h \
+ include/qso_db.h include/table.h include/textio.h \
+ include/combo.h include/debug.h include/dialogs.h \
+ include/fileselect.h include/flwkeyrc.h include/flslider2.h \
+ include/font_browser.h include/gettext.h include/mingw.h \
+ include/flwkey.h include/wkey_io.h include/serial.h \
+ include/status.h include/support.h include/threads.h \
+ include/re.h include/util.h include/ValueSlider.h \
+ include/FTextView.h include/FTextRXTX.h \
+ include/Fl_Text_Display_mod.H \
+ include/Fl_Text_Display_mod_1_1.H \
+ include/Fl_Text_Display_mod_1_3.H include/Fl_Text_Editor_mod.H \
+ include/Fl_Text_Editor_mod_1_1.H \
+ include/Fl_Text_Editor_mod_1_3.H include/flinput2.h \
+ include/pixmaps.h include/timeops.h include/icons.h \
+ include/fileselect.h include/wkey_dialogs.h \
+ include/FL/Fl_Native_File_Chooser.H \
+ include/FL/Fl_Native_File_Chooser_FLTK.H \
+ include/FL/Fl_Native_File_Chooser_MAC.H \
+ include/FL/Fl_Native_File_Chooser_WIN32.H include/base64.h \
+ include/XmlRpc.h include/XmlRpcServer.h include/XmlRpcSource.h \
+ include/XmlRpcUtil.h include/XmlRpcClient.h \
+ include/XmlRpcMutex.h include/XmlRpcServerMethod.h \
+ include/XmlRpcValue.h include/XmlRpcThreadedServer.h \
+ include/XmlRpcDispatch.h include/XmlRpcServerConnection.h \
+ include/XmlRpcSocket.h include/XmlRpcThread.h \
+ include/XmlRpcException.h $(srcdir)/../data/flwkey.desktop \
+ $(srcdir)/../data/flwkey.xpm \
+ $(srcdir)/../data/win32/fl_app.nsi \
+ $(srcdir)/../data/win32/flwkey.ico \
+ $(srcdir)/../scripts/mknsisinst.sh \
+ $(srcdir)/../scripts/build4mingw.sh \
+ $(srcdir)/../data/mac/Info.plist.in \
+ $(srcdir)/../data/mac/flwkey.icns \
+ $(srcdir)/../scripts/mkappbundle.sh $(FLWKEY_WIN32_SRC) \
+ $(FLWKEY_FL_SRC)
+all: $(BUILT_SOURCES) config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .cpp .cxx .o .obj .rc
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+ @if test ! -f $@; then rm -f stamp-h1; else :; fi
+ @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status src/config.h
+$(srcdir)/config.h.in: $(am__configure_deps)
+ ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+ rm -f stamp-h1
+ touch $@
+
+distclean-hdr:
+ -rm -f config.h stamp-h1
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+
+installcheck-binPROGRAMS: $(bin_PROGRAMS)
+ bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \
+ case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \
+ *" $$p "* | *" $(srcdir)/$$p "*) continue;; \
+ esac; \
+ f=`echo "$$p" | \
+ sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ for opt in --help --version; do \
+ if "$(DESTDIR)$(bindir)/$$f" $$opt >c$${pid}_.out \
+ 2>c$${pid}_.err </dev/null \
+ && test -n "`cat c$${pid}_.out`" \
+ && test -z "`cat c$${pid}_.err`"; then :; \
+ else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
+ done; \
+ done; rm -f c$${pid}_.???; exit $$bad
+flwkey$(EXEEXT): $(flwkey_OBJECTS) $(flwkey_DEPENDENCIES) $(EXTRA_flwkey_DEPENDENCIES)
+ @rm -f flwkey$(EXEEXT)
+ $(flwkey_LINK) $(flwkey_OBJECTS) $(flwkey_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-FTextRXTX.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-FTextView.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-Fl_Native_File_Chooser.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-Fl_Text_Display_mod.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-Fl_Text_Editor_mod.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-ValueSlider.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-XmlRpcClient.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-XmlRpcDispatch.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-XmlRpcMutex.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-XmlRpcServer.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-XmlRpcServerConnection.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-XmlRpcServerMethod.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-XmlRpcSocket.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-XmlRpcSource.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-XmlRpcThread.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-XmlRpcUtil.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-XmlRpcValue.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-adif_io.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-calendar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-combo.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-date.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-debug.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-dialogs.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-fileselect.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-flinput2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-flslider2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-flwkey.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-icons.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-lgbook.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-logbook.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-logsupport.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-mingw.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-pixmaps.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-qso_db.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-re.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-regex.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-serial.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-status.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-support.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-table.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-textio.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-timeops.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-util.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-wkey_dialogs.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-wkey_io.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flwkey-xmlrpc_log.Po at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+flwkey-mingw.o: misc/mingw.c
+ at am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CFLAGS) $(CFLAGS) -MT flwkey-mingw.o -MD -MP -MF $(DEPDIR)/flwkey-mingw.Tpo -c -o flwkey-mingw.o `test -f 'misc/mingw.c' || echo '$(srcdir)/'`misc/mingw.c
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/flwkey-mingw.Tpo $(DEPDIR)/flwkey-mingw.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='misc/mingw.c' object='flwkey-mingw.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CFLAGS) $(CFLAGS) -c -o flwkey-mingw.o `test -f 'misc/mingw.c' || echo '$(srcdir)/'`misc/mingw.c
+
+flwkey-mingw.obj: misc/mingw.c
+ at am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CFLAGS) $(CFLAGS) -MT flwkey-mingw.obj -MD -MP -MF $(DEPDIR)/flwkey-mingw.Tpo -c -o flwkey-mingw.obj `if test -f 'misc/mingw.c'; then $(CYGPATH_W) 'misc/mingw.c'; else $(CYGPATH_W) '$(srcdir)/misc/mingw.c'; fi`
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/flwkey-mingw.Tpo $(DEPDIR)/flwkey-mingw.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='misc/mingw.c' object='flwkey-mingw.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CFLAGS) $(CFLAGS) -c -o flwkey-mingw.obj `if test -f 'misc/mingw.c'; then $(CYGPATH_W) 'misc/mingw.c'; else $(CYGPATH_W) '$(srcdir)/misc/mingw.c'; fi`
+
+flwkey-regex.o: compat/regex.c
+ at am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CFLAGS) $(CFLAGS) -MT flwkey-regex.o -MD -MP -MF $(DEPDIR)/flwkey-regex.Tpo -c -o flwkey-regex.o `test -f 'compat/regex.c' || echo '$(srcdir)/'`compat/regex.c
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/flwkey-regex.Tpo $(DEPDIR)/flwkey-regex.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='compat/regex.c' object='flwkey-regex.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CFLAGS) $(CFLAGS) -c -o flwkey-regex.o `test -f 'compat/regex.c' || echo '$(srcdir)/'`compat/regex.c
+
+flwkey-regex.obj: compat/regex.c
+ at am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CFLAGS) $(CFLAGS) -MT flwkey-regex.obj -MD -MP -MF $(DEPDIR)/flwkey-regex.Tpo -c -o flwkey-regex.obj `if test -f 'compat/regex.c'; then $(CYGPATH_W) 'compat/regex.c'; else $(CYGPATH_W) '$(srcdir)/compat/regex.c'; fi`
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/flwkey-regex.Tpo $(DEPDIR)/flwkey-regex.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='compat/regex.c' object='flwkey-regex.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CFLAGS) $(CFLAGS) -c -o flwkey-regex.obj `if test -f 'compat/regex.c'; then $(CYGPATH_W) 'compat/regex.c'; else $(CYGPATH_W) '$(srcdir)/compat/regex.c'; fi`
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+flwkey-dialogs.o: dialogs.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-dialogs.o -MD -MP -MF $(DEPDIR)/flwkey-dialogs.Tpo -c -o flwkey-dialogs.o `test -f 'dialogs.cxx' || echo '$(srcdir)/'`dialogs.cxx
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-dialogs.Tpo $(DEPDIR)/flwkey-dialogs.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dialogs.cxx' object='flwkey-dialogs.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-dialogs.o `test -f 'dialogs.cxx' || echo '$(srcdir)/'`dialogs.cxx
+
+flwkey-dialogs.obj: dialogs.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-dialogs.obj -MD -MP -MF $(DEPDIR)/flwkey-dialogs.Tpo -c -o flwkey-dialogs.obj `if test -f 'dialogs.cxx'; then $(CYGPATH_W) 'dialogs.cxx'; else $(CYGPATH_W) '$(srcdir)/dialogs.cxx'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-dialogs.Tpo $(DEPDIR)/flwkey-dialogs.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dialogs.cxx' object='flwkey-dialogs.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-dialogs.obj `if test -f 'dialogs.cxx'; then $(CYGPATH_W) 'dialogs.cxx'; else $(CYGPATH_W) '$(srcdir)/dialogs.cxx'; fi`
+
+flwkey-flwkey.o: flwkey.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-flwkey.o -MD -MP -MF $(DEPDIR)/flwkey-flwkey.Tpo -c -o flwkey-flwkey.o `test -f 'flwkey.cxx' || echo '$(srcdir)/'`flwkey.cxx
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-flwkey.Tpo $(DEPDIR)/flwkey-flwkey.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='flwkey.cxx' object='flwkey-flwkey.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-flwkey.o `test -f 'flwkey.cxx' || echo '$(srcdir)/'`flwkey.cxx
+
+flwkey-flwkey.obj: flwkey.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-flwkey.obj -MD -MP -MF $(DEPDIR)/flwkey-flwkey.Tpo -c -o flwkey-flwkey.obj `if test -f 'flwkey.cxx'; then $(CYGPATH_W) 'flwkey.cxx'; else $(CYGPATH_W) '$(srcdir)/flwkey.cxx'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-flwkey.Tpo $(DEPDIR)/flwkey-flwkey.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='flwkey.cxx' object='flwkey-flwkey.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-flwkey.obj `if test -f 'flwkey.cxx'; then $(CYGPATH_W) 'flwkey.cxx'; else $(CYGPATH_W) '$(srcdir)/flwkey.cxx'; fi`
+
+flwkey-wkey_dialogs.o: wkey_dialogs.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-wkey_dialogs.o -MD -MP -MF $(DEPDIR)/flwkey-wkey_dialogs.Tpo -c -o flwkey-wkey_dialogs.o `test -f 'wkey_dialogs.cxx' || echo '$(srcdir)/'`wkey_dialogs.cxx
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-wkey_dialogs.Tpo $(DEPDIR)/flwkey-wkey_dialogs.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='wkey_dialogs.cxx' object='flwkey-wkey_dialogs.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-wkey_dialogs.o `test -f 'wkey_dialogs.cxx' || echo '$(srcdir)/'`wkey_dialogs.cxx
+
+flwkey-wkey_dialogs.obj: wkey_dialogs.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-wkey_dialogs.obj -MD -MP -MF $(DEPDIR)/flwkey-wkey_dialogs.Tpo -c -o flwkey-wkey_dialogs.obj `if test -f 'wkey_dialogs.cxx'; then $(CYGPATH_W) 'wkey_dialogs.cxx'; else $(CYGPATH_W) '$(srcdir)/wkey_dialogs.cxx'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-wkey_dialogs.Tpo $(DEPDIR)/flwkey-wkey_dialogs.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='wkey_dialogs.cxx' object='flwkey-wkey_dialogs.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-wkey_dialogs.obj `if test -f 'wkey_dialogs.cxx'; then $(CYGPATH_W) 'wkey_dialogs.cxx'; else $(CYGPATH_W) '$(srcdir)/wkey_dialogs.cxx'; fi`
+
+flwkey-wkey_io.o: wkey_io.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-wkey_io.o -MD -MP -MF $(DEPDIR)/flwkey-wkey_io.Tpo -c -o flwkey-wkey_io.o `test -f 'wkey_io.cxx' || echo '$(srcdir)/'`wkey_io.cxx
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-wkey_io.Tpo $(DEPDIR)/flwkey-wkey_io.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='wkey_io.cxx' object='flwkey-wkey_io.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-wkey_io.o `test -f 'wkey_io.cxx' || echo '$(srcdir)/'`wkey_io.cxx
+
+flwkey-wkey_io.obj: wkey_io.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-wkey_io.obj -MD -MP -MF $(DEPDIR)/flwkey-wkey_io.Tpo -c -o flwkey-wkey_io.obj `if test -f 'wkey_io.cxx'; then $(CYGPATH_W) 'wkey_io.cxx'; else $(CYGPATH_W) '$(srcdir)/wkey_io.cxx'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-wkey_io.Tpo $(DEPDIR)/flwkey-wkey_io.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='wkey_io.cxx' object='flwkey-wkey_io.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-wkey_io.obj `if test -f 'wkey_io.cxx'; then $(CYGPATH_W) 'wkey_io.cxx'; else $(CYGPATH_W) '$(srcdir)/wkey_io.cxx'; fi`
+
+flwkey-adif_io.o: logbook/adif_io.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-adif_io.o -MD -MP -MF $(DEPDIR)/flwkey-adif_io.Tpo -c -o flwkey-adif_io.o `test -f 'logbook/adif_io.cxx' || echo '$(srcdir)/'`logbook/adif_io.cxx
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-adif_io.Tpo $(DEPDIR)/flwkey-adif_io.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='logbook/adif_io.cxx' object='flwkey-adif_io.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-adif_io.o `test -f 'logbook/adif_io.cxx' || echo '$(srcdir)/'`logbook/adif_io.cxx
+
+flwkey-adif_io.obj: logbook/adif_io.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-adif_io.obj -MD -MP -MF $(DEPDIR)/flwkey-adif_io.Tpo -c -o flwkey-adif_io.obj `if test -f 'logbook/adif_io.cxx'; then $(CYGPATH_W) 'logbook/adif_io.cxx'; else $(CYGPATH_W) '$(srcdir)/logbook/adif_io.cxx'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-adif_io.Tpo $(DEPDIR)/flwkey-adif_io.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='logbook/adif_io.cxx' object='flwkey-adif_io.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-adif_io.obj `if test -f 'logbook/adif_io.cxx'; then $(CYGPATH_W) 'logbook/adif_io.cxx'; else $(CYGPATH_W) '$(srcdir)/logbook/adif_io.cxx'; fi`
+
+flwkey-date.o: logbook/date.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-date.o -MD -MP -MF $(DEPDIR)/flwkey-date.Tpo -c -o flwkey-date.o `test -f 'logbook/date.cxx' || echo '$(srcdir)/'`logbook/date.cxx
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-date.Tpo $(DEPDIR)/flwkey-date.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='logbook/date.cxx' object='flwkey-date.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-date.o `test -f 'logbook/date.cxx' || echo '$(srcdir)/'`logbook/date.cxx
+
+flwkey-date.obj: logbook/date.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-date.obj -MD -MP -MF $(DEPDIR)/flwkey-date.Tpo -c -o flwkey-date.obj `if test -f 'logbook/date.cxx'; then $(CYGPATH_W) 'logbook/date.cxx'; else $(CYGPATH_W) '$(srcdir)/logbook/date.cxx'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-date.Tpo $(DEPDIR)/flwkey-date.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='logbook/date.cxx' object='flwkey-date.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-date.obj `if test -f 'logbook/date.cxx'; then $(CYGPATH_W) 'logbook/date.cxx'; else $(CYGPATH_W) '$(srcdir)/logbook/date.cxx'; fi`
+
+flwkey-logsupport.o: logbook/logsupport.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-logsupport.o -MD -MP -MF $(DEPDIR)/flwkey-logsupport.Tpo -c -o flwkey-logsupport.o `test -f 'logbook/logsupport.cxx' || echo '$(srcdir)/'`logbook/logsupport.cxx
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-logsupport.Tpo $(DEPDIR)/flwkey-logsupport.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='logbook/logsupport.cxx' object='flwkey-logsupport.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-logsupport.o `test -f 'logbook/logsupport.cxx' || echo '$(srcdir)/'`logbook/logsupport.cxx
+
+flwkey-logsupport.obj: logbook/logsupport.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-logsupport.obj -MD -MP -MF $(DEPDIR)/flwkey-logsupport.Tpo -c -o flwkey-logsupport.obj `if test -f 'logbook/logsupport.cxx'; then $(CYGPATH_W) 'logbook/logsupport.cxx'; else $(CYGPATH_W) '$(srcdir)/logbook/logsupport.cxx'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-logsupport.Tpo $(DEPDIR)/flwkey-logsupport.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='logbook/logsupport.cxx' object='flwkey-logsupport.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-logsupport.obj `if test -f 'logbook/logsupport.cxx'; then $(CYGPATH_W) 'logbook/logsupport.cxx'; else $(CYGPATH_W) '$(srcdir)/logbook/logsupport.cxx'; fi`
+
+flwkey-table.o: logbook/table.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-table.o -MD -MP -MF $(DEPDIR)/flwkey-table.Tpo -c -o flwkey-table.o `test -f 'logbook/table.cxx' || echo '$(srcdir)/'`logbook/table.cxx
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-table.Tpo $(DEPDIR)/flwkey-table.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='logbook/table.cxx' object='flwkey-table.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-table.o `test -f 'logbook/table.cxx' || echo '$(srcdir)/'`logbook/table.cxx
+
+flwkey-table.obj: logbook/table.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-table.obj -MD -MP -MF $(DEPDIR)/flwkey-table.Tpo -c -o flwkey-table.obj `if test -f 'logbook/table.cxx'; then $(CYGPATH_W) 'logbook/table.cxx'; else $(CYGPATH_W) '$(srcdir)/logbook/table.cxx'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-table.Tpo $(DEPDIR)/flwkey-table.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='logbook/table.cxx' object='flwkey-table.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-table.obj `if test -f 'logbook/table.cxx'; then $(CYGPATH_W) 'logbook/table.cxx'; else $(CYGPATH_W) '$(srcdir)/logbook/table.cxx'; fi`
+
+flwkey-calendar.o: logbook/calendar.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-calendar.o -MD -MP -MF $(DEPDIR)/flwkey-calendar.Tpo -c -o flwkey-calendar.o `test -f 'logbook/calendar.cxx' || echo '$(srcdir)/'`logbook/calendar.cxx
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-calendar.Tpo $(DEPDIR)/flwkey-calendar.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='logbook/calendar.cxx' object='flwkey-calendar.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-calendar.o `test -f 'logbook/calendar.cxx' || echo '$(srcdir)/'`logbook/calendar.cxx
+
+flwkey-calendar.obj: logbook/calendar.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-calendar.obj -MD -MP -MF $(DEPDIR)/flwkey-calendar.Tpo -c -o flwkey-calendar.obj `if test -f 'logbook/calendar.cxx'; then $(CYGPATH_W) 'logbook/calendar.cxx'; else $(CYGPATH_W) '$(srcdir)/logbook/calendar.cxx'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-calendar.Tpo $(DEPDIR)/flwkey-calendar.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='logbook/calendar.cxx' object='flwkey-calendar.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-calendar.obj `if test -f 'logbook/calendar.cxx'; then $(CYGPATH_W) 'logbook/calendar.cxx'; else $(CYGPATH_W) '$(srcdir)/logbook/calendar.cxx'; fi`
+
+flwkey-lgbook.o: logbook/lgbook.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-lgbook.o -MD -MP -MF $(DEPDIR)/flwkey-lgbook.Tpo -c -o flwkey-lgbook.o `test -f 'logbook/lgbook.cxx' || echo '$(srcdir)/'`logbook/lgbook.cxx
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-lgbook.Tpo $(DEPDIR)/flwkey-lgbook.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='logbook/lgbook.cxx' object='flwkey-lgbook.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-lgbook.o `test -f 'logbook/lgbook.cxx' || echo '$(srcdir)/'`logbook/lgbook.cxx
+
+flwkey-lgbook.obj: logbook/lgbook.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-lgbook.obj -MD -MP -MF $(DEPDIR)/flwkey-lgbook.Tpo -c -o flwkey-lgbook.obj `if test -f 'logbook/lgbook.cxx'; then $(CYGPATH_W) 'logbook/lgbook.cxx'; else $(CYGPATH_W) '$(srcdir)/logbook/lgbook.cxx'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-lgbook.Tpo $(DEPDIR)/flwkey-lgbook.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='logbook/lgbook.cxx' object='flwkey-lgbook.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-lgbook.obj `if test -f 'logbook/lgbook.cxx'; then $(CYGPATH_W) 'logbook/lgbook.cxx'; else $(CYGPATH_W) '$(srcdir)/logbook/lgbook.cxx'; fi`
+
+flwkey-logbook.o: logbook/logbook.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-logbook.o -MD -MP -MF $(DEPDIR)/flwkey-logbook.Tpo -c -o flwkey-logbook.o `test -f 'logbook/logbook.cxx' || echo '$(srcdir)/'`logbook/logbook.cxx
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-logbook.Tpo $(DEPDIR)/flwkey-logbook.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='logbook/logbook.cxx' object='flwkey-logbook.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-logbook.o `test -f 'logbook/logbook.cxx' || echo '$(srcdir)/'`logbook/logbook.cxx
+
+flwkey-logbook.obj: logbook/logbook.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-logbook.obj -MD -MP -MF $(DEPDIR)/flwkey-logbook.Tpo -c -o flwkey-logbook.obj `if test -f 'logbook/logbook.cxx'; then $(CYGPATH_W) 'logbook/logbook.cxx'; else $(CYGPATH_W) '$(srcdir)/logbook/logbook.cxx'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-logbook.Tpo $(DEPDIR)/flwkey-logbook.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='logbook/logbook.cxx' object='flwkey-logbook.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-logbook.obj `if test -f 'logbook/logbook.cxx'; then $(CYGPATH_W) 'logbook/logbook.cxx'; else $(CYGPATH_W) '$(srcdir)/logbook/logbook.cxx'; fi`
+
+flwkey-qso_db.o: logbook/qso_db.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-qso_db.o -MD -MP -MF $(DEPDIR)/flwkey-qso_db.Tpo -c -o flwkey-qso_db.o `test -f 'logbook/qso_db.cxx' || echo '$(srcdir)/'`logbook/qso_db.cxx
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-qso_db.Tpo $(DEPDIR)/flwkey-qso_db.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='logbook/qso_db.cxx' object='flwkey-qso_db.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-qso_db.o `test -f 'logbook/qso_db.cxx' || echo '$(srcdir)/'`logbook/qso_db.cxx
+
+flwkey-qso_db.obj: logbook/qso_db.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-qso_db.obj -MD -MP -MF $(DEPDIR)/flwkey-qso_db.Tpo -c -o flwkey-qso_db.obj `if test -f 'logbook/qso_db.cxx'; then $(CYGPATH_W) 'logbook/qso_db.cxx'; else $(CYGPATH_W) '$(srcdir)/logbook/qso_db.cxx'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-qso_db.Tpo $(DEPDIR)/flwkey-qso_db.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='logbook/qso_db.cxx' object='flwkey-qso_db.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-qso_db.obj `if test -f 'logbook/qso_db.cxx'; then $(CYGPATH_W) 'logbook/qso_db.cxx'; else $(CYGPATH_W) '$(srcdir)/logbook/qso_db.cxx'; fi`
+
+flwkey-textio.o: logbook/textio.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-textio.o -MD -MP -MF $(DEPDIR)/flwkey-textio.Tpo -c -o flwkey-textio.o `test -f 'logbook/textio.cxx' || echo '$(srcdir)/'`logbook/textio.cxx
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-textio.Tpo $(DEPDIR)/flwkey-textio.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='logbook/textio.cxx' object='flwkey-textio.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-textio.o `test -f 'logbook/textio.cxx' || echo '$(srcdir)/'`logbook/textio.cxx
+
+flwkey-textio.obj: logbook/textio.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-textio.obj -MD -MP -MF $(DEPDIR)/flwkey-textio.Tpo -c -o flwkey-textio.obj `if test -f 'logbook/textio.cxx'; then $(CYGPATH_W) 'logbook/textio.cxx'; else $(CYGPATH_W) '$(srcdir)/logbook/textio.cxx'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-textio.Tpo $(DEPDIR)/flwkey-textio.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='logbook/textio.cxx' object='flwkey-textio.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-textio.obj `if test -f 'logbook/textio.cxx'; then $(CYGPATH_W) 'logbook/textio.cxx'; else $(CYGPATH_W) '$(srcdir)/logbook/textio.cxx'; fi`
+
+flwkey-debug.o: misc/debug.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-debug.o -MD -MP -MF $(DEPDIR)/flwkey-debug.Tpo -c -o flwkey-debug.o `test -f 'misc/debug.cxx' || echo '$(srcdir)/'`misc/debug.cxx
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-debug.Tpo $(DEPDIR)/flwkey-debug.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='misc/debug.cxx' object='flwkey-debug.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-debug.o `test -f 'misc/debug.cxx' || echo '$(srcdir)/'`misc/debug.cxx
+
+flwkey-debug.obj: misc/debug.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-debug.obj -MD -MP -MF $(DEPDIR)/flwkey-debug.Tpo -c -o flwkey-debug.obj `if test -f 'misc/debug.cxx'; then $(CYGPATH_W) 'misc/debug.cxx'; else $(CYGPATH_W) '$(srcdir)/misc/debug.cxx'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-debug.Tpo $(DEPDIR)/flwkey-debug.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='misc/debug.cxx' object='flwkey-debug.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-debug.obj `if test -f 'misc/debug.cxx'; then $(CYGPATH_W) 'misc/debug.cxx'; else $(CYGPATH_W) '$(srcdir)/misc/debug.cxx'; fi`
+
+flwkey-pixmaps.o: misc/pixmaps.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-pixmaps.o -MD -MP -MF $(DEPDIR)/flwkey-pixmaps.Tpo -c -o flwkey-pixmaps.o `test -f 'misc/pixmaps.cxx' || echo '$(srcdir)/'`misc/pixmaps.cxx
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-pixmaps.Tpo $(DEPDIR)/flwkey-pixmaps.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='misc/pixmaps.cxx' object='flwkey-pixmaps.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-pixmaps.o `test -f 'misc/pixmaps.cxx' || echo '$(srcdir)/'`misc/pixmaps.cxx
+
+flwkey-pixmaps.obj: misc/pixmaps.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-pixmaps.obj -MD -MP -MF $(DEPDIR)/flwkey-pixmaps.Tpo -c -o flwkey-pixmaps.obj `if test -f 'misc/pixmaps.cxx'; then $(CYGPATH_W) 'misc/pixmaps.cxx'; else $(CYGPATH_W) '$(srcdir)/misc/pixmaps.cxx'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-pixmaps.Tpo $(DEPDIR)/flwkey-pixmaps.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='misc/pixmaps.cxx' object='flwkey-pixmaps.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-pixmaps.obj `if test -f 'misc/pixmaps.cxx'; then $(CYGPATH_W) 'misc/pixmaps.cxx'; else $(CYGPATH_W) '$(srcdir)/misc/pixmaps.cxx'; fi`
+
+flwkey-icons.o: misc/icons.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-icons.o -MD -MP -MF $(DEPDIR)/flwkey-icons.Tpo -c -o flwkey-icons.o `test -f 'misc/icons.cxx' || echo '$(srcdir)/'`misc/icons.cxx
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-icons.Tpo $(DEPDIR)/flwkey-icons.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='misc/icons.cxx' object='flwkey-icons.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-icons.o `test -f 'misc/icons.cxx' || echo '$(srcdir)/'`misc/icons.cxx
+
+flwkey-icons.obj: misc/icons.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-icons.obj -MD -MP -MF $(DEPDIR)/flwkey-icons.Tpo -c -o flwkey-icons.obj `if test -f 'misc/icons.cxx'; then $(CYGPATH_W) 'misc/icons.cxx'; else $(CYGPATH_W) '$(srcdir)/misc/icons.cxx'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-icons.Tpo $(DEPDIR)/flwkey-icons.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='misc/icons.cxx' object='flwkey-icons.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-icons.obj `if test -f 'misc/icons.cxx'; then $(CYGPATH_W) 'misc/icons.cxx'; else $(CYGPATH_W) '$(srcdir)/misc/icons.cxx'; fi`
+
+flwkey-re.o: misc/re.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-re.o -MD -MP -MF $(DEPDIR)/flwkey-re.Tpo -c -o flwkey-re.o `test -f 'misc/re.cxx' || echo '$(srcdir)/'`misc/re.cxx
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-re.Tpo $(DEPDIR)/flwkey-re.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='misc/re.cxx' object='flwkey-re.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-re.o `test -f 'misc/re.cxx' || echo '$(srcdir)/'`misc/re.cxx
+
+flwkey-re.obj: misc/re.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-re.obj -MD -MP -MF $(DEPDIR)/flwkey-re.Tpo -c -o flwkey-re.obj `if test -f 'misc/re.cxx'; then $(CYGPATH_W) 'misc/re.cxx'; else $(CYGPATH_W) '$(srcdir)/misc/re.cxx'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-re.Tpo $(DEPDIR)/flwkey-re.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='misc/re.cxx' object='flwkey-re.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-re.obj `if test -f 'misc/re.cxx'; then $(CYGPATH_W) 'misc/re.cxx'; else $(CYGPATH_W) '$(srcdir)/misc/re.cxx'; fi`
+
+flwkey-xmlrpc_log.o: misc/xmlrpc_log.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-xmlrpc_log.o -MD -MP -MF $(DEPDIR)/flwkey-xmlrpc_log.Tpo -c -o flwkey-xmlrpc_log.o `test -f 'misc/xmlrpc_log.cxx' || echo '$(srcdir)/'`misc/xmlrpc_log.cxx
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-xmlrpc_log.Tpo $(DEPDIR)/flwkey-xmlrpc_log.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='misc/xmlrpc_log.cxx' object='flwkey-xmlrpc_log.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-xmlrpc_log.o `test -f 'misc/xmlrpc_log.cxx' || echo '$(srcdir)/'`misc/xmlrpc_log.cxx
+
+flwkey-xmlrpc_log.obj: misc/xmlrpc_log.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-xmlrpc_log.obj -MD -MP -MF $(DEPDIR)/flwkey-xmlrpc_log.Tpo -c -o flwkey-xmlrpc_log.obj `if test -f 'misc/xmlrpc_log.cxx'; then $(CYGPATH_W) 'misc/xmlrpc_log.cxx'; else $(CYGPATH_W) '$(srcdir)/misc/xmlrpc_log.cxx'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-xmlrpc_log.Tpo $(DEPDIR)/flwkey-xmlrpc_log.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='misc/xmlrpc_log.cxx' object='flwkey-xmlrpc_log.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-xmlrpc_log.obj `if test -f 'misc/xmlrpc_log.cxx'; then $(CYGPATH_W) 'misc/xmlrpc_log.cxx'; else $(CYGPATH_W) '$(srcdir)/misc/xmlrpc_log.cxx'; fi`
+
+flwkey-serial.o: misc/serial.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-serial.o -MD -MP -MF $(DEPDIR)/flwkey-serial.Tpo -c -o flwkey-serial.o `test -f 'misc/serial.cxx' || echo '$(srcdir)/'`misc/serial.cxx
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-serial.Tpo $(DEPDIR)/flwkey-serial.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='misc/serial.cxx' object='flwkey-serial.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-serial.o `test -f 'misc/serial.cxx' || echo '$(srcdir)/'`misc/serial.cxx
+
+flwkey-serial.obj: misc/serial.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-serial.obj -MD -MP -MF $(DEPDIR)/flwkey-serial.Tpo -c -o flwkey-serial.obj `if test -f 'misc/serial.cxx'; then $(CYGPATH_W) 'misc/serial.cxx'; else $(CYGPATH_W) '$(srcdir)/misc/serial.cxx'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-serial.Tpo $(DEPDIR)/flwkey-serial.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='misc/serial.cxx' object='flwkey-serial.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-serial.obj `if test -f 'misc/serial.cxx'; then $(CYGPATH_W) 'misc/serial.cxx'; else $(CYGPATH_W) '$(srcdir)/misc/serial.cxx'; fi`
+
+flwkey-status.o: misc/status.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-status.o -MD -MP -MF $(DEPDIR)/flwkey-status.Tpo -c -o flwkey-status.o `test -f 'misc/status.cxx' || echo '$(srcdir)/'`misc/status.cxx
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-status.Tpo $(DEPDIR)/flwkey-status.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='misc/status.cxx' object='flwkey-status.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-status.o `test -f 'misc/status.cxx' || echo '$(srcdir)/'`misc/status.cxx
+
+flwkey-status.obj: misc/status.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-status.obj -MD -MP -MF $(DEPDIR)/flwkey-status.Tpo -c -o flwkey-status.obj `if test -f 'misc/status.cxx'; then $(CYGPATH_W) 'misc/status.cxx'; else $(CYGPATH_W) '$(srcdir)/misc/status.cxx'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-status.Tpo $(DEPDIR)/flwkey-status.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='misc/status.cxx' object='flwkey-status.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-status.obj `if test -f 'misc/status.cxx'; then $(CYGPATH_W) 'misc/status.cxx'; else $(CYGPATH_W) '$(srcdir)/misc/status.cxx'; fi`
+
+flwkey-support.o: misc/support.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-support.o -MD -MP -MF $(DEPDIR)/flwkey-support.Tpo -c -o flwkey-support.o `test -f 'misc/support.cxx' || echo '$(srcdir)/'`misc/support.cxx
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-support.Tpo $(DEPDIR)/flwkey-support.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='misc/support.cxx' object='flwkey-support.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-support.o `test -f 'misc/support.cxx' || echo '$(srcdir)/'`misc/support.cxx
+
+flwkey-support.obj: misc/support.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-support.obj -MD -MP -MF $(DEPDIR)/flwkey-support.Tpo -c -o flwkey-support.obj `if test -f 'misc/support.cxx'; then $(CYGPATH_W) 'misc/support.cxx'; else $(CYGPATH_W) '$(srcdir)/misc/support.cxx'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-support.Tpo $(DEPDIR)/flwkey-support.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='misc/support.cxx' object='flwkey-support.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-support.obj `if test -f 'misc/support.cxx'; then $(CYGPATH_W) 'misc/support.cxx'; else $(CYGPATH_W) '$(srcdir)/misc/support.cxx'; fi`
+
+flwkey-timeops.o: misc/timeops.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-timeops.o -MD -MP -MF $(DEPDIR)/flwkey-timeops.Tpo -c -o flwkey-timeops.o `test -f 'misc/timeops.cxx' || echo '$(srcdir)/'`misc/timeops.cxx
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-timeops.Tpo $(DEPDIR)/flwkey-timeops.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='misc/timeops.cxx' object='flwkey-timeops.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-timeops.o `test -f 'misc/timeops.cxx' || echo '$(srcdir)/'`misc/timeops.cxx
+
+flwkey-timeops.obj: misc/timeops.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-timeops.obj -MD -MP -MF $(DEPDIR)/flwkey-timeops.Tpo -c -o flwkey-timeops.obj `if test -f 'misc/timeops.cxx'; then $(CYGPATH_W) 'misc/timeops.cxx'; else $(CYGPATH_W) '$(srcdir)/misc/timeops.cxx'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-timeops.Tpo $(DEPDIR)/flwkey-timeops.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='misc/timeops.cxx' object='flwkey-timeops.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-timeops.obj `if test -f 'misc/timeops.cxx'; then $(CYGPATH_W) 'misc/timeops.cxx'; else $(CYGPATH_W) '$(srcdir)/misc/timeops.cxx'; fi`
+
+flwkey-util.o: misc/util.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-util.o -MD -MP -MF $(DEPDIR)/flwkey-util.Tpo -c -o flwkey-util.o `test -f 'misc/util.cxx' || echo '$(srcdir)/'`misc/util.cxx
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-util.Tpo $(DEPDIR)/flwkey-util.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='misc/util.cxx' object='flwkey-util.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-util.o `test -f 'misc/util.cxx' || echo '$(srcdir)/'`misc/util.cxx
+
+flwkey-util.obj: misc/util.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-util.obj -MD -MP -MF $(DEPDIR)/flwkey-util.Tpo -c -o flwkey-util.obj `if test -f 'misc/util.cxx'; then $(CYGPATH_W) 'misc/util.cxx'; else $(CYGPATH_W) '$(srcdir)/misc/util.cxx'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-util.Tpo $(DEPDIR)/flwkey-util.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='misc/util.cxx' object='flwkey-util.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-util.obj `if test -f 'misc/util.cxx'; then $(CYGPATH_W) 'misc/util.cxx'; else $(CYGPATH_W) '$(srcdir)/misc/util.cxx'; fi`
+
+flwkey-combo.o: widgets/combo.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-combo.o -MD -MP -MF $(DEPDIR)/flwkey-combo.Tpo -c -o flwkey-combo.o `test -f 'widgets/combo.cxx' || echo '$(srcdir)/'`widgets/combo.cxx
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-combo.Tpo $(DEPDIR)/flwkey-combo.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='widgets/combo.cxx' object='flwkey-combo.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-combo.o `test -f 'widgets/combo.cxx' || echo '$(srcdir)/'`widgets/combo.cxx
+
+flwkey-combo.obj: widgets/combo.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-combo.obj -MD -MP -MF $(DEPDIR)/flwkey-combo.Tpo -c -o flwkey-combo.obj `if test -f 'widgets/combo.cxx'; then $(CYGPATH_W) 'widgets/combo.cxx'; else $(CYGPATH_W) '$(srcdir)/widgets/combo.cxx'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-combo.Tpo $(DEPDIR)/flwkey-combo.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='widgets/combo.cxx' object='flwkey-combo.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-combo.obj `if test -f 'widgets/combo.cxx'; then $(CYGPATH_W) 'widgets/combo.cxx'; else $(CYGPATH_W) '$(srcdir)/widgets/combo.cxx'; fi`
+
+flwkey-flslider2.o: widgets/flslider2.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-flslider2.o -MD -MP -MF $(DEPDIR)/flwkey-flslider2.Tpo -c -o flwkey-flslider2.o `test -f 'widgets/flslider2.cxx' || echo '$(srcdir)/'`widgets/flslider2.cxx
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-flslider2.Tpo $(DEPDIR)/flwkey-flslider2.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='widgets/flslider2.cxx' object='flwkey-flslider2.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-flslider2.o `test -f 'widgets/flslider2.cxx' || echo '$(srcdir)/'`widgets/flslider2.cxx
+
+flwkey-flslider2.obj: widgets/flslider2.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-flslider2.obj -MD -MP -MF $(DEPDIR)/flwkey-flslider2.Tpo -c -o flwkey-flslider2.obj `if test -f 'widgets/flslider2.cxx'; then $(CYGPATH_W) 'widgets/flslider2.cxx'; else $(CYGPATH_W) '$(srcdir)/widgets/flslider2.cxx'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-flslider2.Tpo $(DEPDIR)/flwkey-flslider2.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='widgets/flslider2.cxx' object='flwkey-flslider2.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-flslider2.obj `if test -f 'widgets/flslider2.cxx'; then $(CYGPATH_W) 'widgets/flslider2.cxx'; else $(CYGPATH_W) '$(srcdir)/widgets/flslider2.cxx'; fi`
+
+flwkey-ValueSlider.o: widgets/ValueSlider.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-ValueSlider.o -MD -MP -MF $(DEPDIR)/flwkey-ValueSlider.Tpo -c -o flwkey-ValueSlider.o `test -f 'widgets/ValueSlider.cxx' || echo '$(srcdir)/'`widgets/ValueSlider.cxx
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-ValueSlider.Tpo $(DEPDIR)/flwkey-ValueSlider.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='widgets/ValueSlider.cxx' object='flwkey-ValueSlider.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-ValueSlider.o `test -f 'widgets/ValueSlider.cxx' || echo '$(srcdir)/'`widgets/ValueSlider.cxx
+
+flwkey-ValueSlider.obj: widgets/ValueSlider.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-ValueSlider.obj -MD -MP -MF $(DEPDIR)/flwkey-ValueSlider.Tpo -c -o flwkey-ValueSlider.obj `if test -f 'widgets/ValueSlider.cxx'; then $(CYGPATH_W) 'widgets/ValueSlider.cxx'; else $(CYGPATH_W) '$(srcdir)/widgets/ValueSlider.cxx'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-ValueSlider.Tpo $(DEPDIR)/flwkey-ValueSlider.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='widgets/ValueSlider.cxx' object='flwkey-ValueSlider.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-ValueSlider.obj `if test -f 'widgets/ValueSlider.cxx'; then $(CYGPATH_W) 'widgets/ValueSlider.cxx'; else $(CYGPATH_W) '$(srcdir)/widgets/ValueSlider.cxx'; fi`
+
+flwkey-FTextRXTX.o: widgets/FTextRXTX.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-FTextRXTX.o -MD -MP -MF $(DEPDIR)/flwkey-FTextRXTX.Tpo -c -o flwkey-FTextRXTX.o `test -f 'widgets/FTextRXTX.cxx' || echo '$(srcdir)/'`widgets/FTextRXTX.cxx
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-FTextRXTX.Tpo $(DEPDIR)/flwkey-FTextRXTX.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='widgets/FTextRXTX.cxx' object='flwkey-FTextRXTX.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-FTextRXTX.o `test -f 'widgets/FTextRXTX.cxx' || echo '$(srcdir)/'`widgets/FTextRXTX.cxx
+
+flwkey-FTextRXTX.obj: widgets/FTextRXTX.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-FTextRXTX.obj -MD -MP -MF $(DEPDIR)/flwkey-FTextRXTX.Tpo -c -o flwkey-FTextRXTX.obj `if test -f 'widgets/FTextRXTX.cxx'; then $(CYGPATH_W) 'widgets/FTextRXTX.cxx'; else $(CYGPATH_W) '$(srcdir)/widgets/FTextRXTX.cxx'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-FTextRXTX.Tpo $(DEPDIR)/flwkey-FTextRXTX.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='widgets/FTextRXTX.cxx' object='flwkey-FTextRXTX.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-FTextRXTX.obj `if test -f 'widgets/FTextRXTX.cxx'; then $(CYGPATH_W) 'widgets/FTextRXTX.cxx'; else $(CYGPATH_W) '$(srcdir)/widgets/FTextRXTX.cxx'; fi`
+
+flwkey-FTextView.o: widgets/FTextView.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-FTextView.o -MD -MP -MF $(DEPDIR)/flwkey-FTextView.Tpo -c -o flwkey-FTextView.o `test -f 'widgets/FTextView.cxx' || echo '$(srcdir)/'`widgets/FTextView.cxx
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-FTextView.Tpo $(DEPDIR)/flwkey-FTextView.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='widgets/FTextView.cxx' object='flwkey-FTextView.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-FTextView.o `test -f 'widgets/FTextView.cxx' || echo '$(srcdir)/'`widgets/FTextView.cxx
+
+flwkey-FTextView.obj: widgets/FTextView.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-FTextView.obj -MD -MP -MF $(DEPDIR)/flwkey-FTextView.Tpo -c -o flwkey-FTextView.obj `if test -f 'widgets/FTextView.cxx'; then $(CYGPATH_W) 'widgets/FTextView.cxx'; else $(CYGPATH_W) '$(srcdir)/widgets/FTextView.cxx'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-FTextView.Tpo $(DEPDIR)/flwkey-FTextView.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='widgets/FTextView.cxx' object='flwkey-FTextView.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-FTextView.obj `if test -f 'widgets/FTextView.cxx'; then $(CYGPATH_W) 'widgets/FTextView.cxx'; else $(CYGPATH_W) '$(srcdir)/widgets/FTextView.cxx'; fi`
+
+flwkey-Fl_Text_Display_mod.o: widgets/Fl_Text_Display_mod.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-Fl_Text_Display_mod.o -MD -MP -MF $(DEPDIR)/flwkey-Fl_Text_Display_mod.Tpo -c -o flwkey-Fl_Text_Display_mod.o `test -f 'widgets/Fl_Text_Display_mod.cxx' || echo '$(srcdir)/'`widgets/Fl_Text_Display_mod.cxx
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-Fl_Text_Display_mod.Tpo $(DEPDIR)/flwkey-Fl_Text_Display_mod.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='widgets/Fl_Text_Display_mod.cxx' object='flwkey-Fl_Text_Display_mod.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-Fl_Text_Display_mod.o `test -f 'widgets/Fl_Text_Display_mod.cxx' || echo '$(srcdir)/'`widgets/Fl_Text_Display_mod.cxx
+
+flwkey-Fl_Text_Display_mod.obj: widgets/Fl_Text_Display_mod.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-Fl_Text_Display_mod.obj -MD -MP -MF $(DEPDIR)/flwkey-Fl_Text_Display_mod.Tpo -c -o flwkey-Fl_Text_Display_mod.obj `if test -f 'widgets/Fl_Text_Display_mod.cxx'; then $(CYGPATH_W) 'widgets/Fl_Text_Display_mod.cxx'; else $(CYGPATH_W) '$(srcdir)/widgets/Fl_Text_Display_mod.cxx'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-Fl_Text_Display_mod.Tpo $(DEPDIR)/flwkey-Fl_Text_Display_mod.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='widgets/Fl_Text_Display_mod.cxx' object='flwkey-Fl_Text_Display_mod.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-Fl_Text_Display_mod.obj `if test -f 'widgets/Fl_Text_Display_mod.cxx'; then $(CYGPATH_W) 'widgets/Fl_Text_Display_mod.cxx'; else $(CYGPATH_W) '$(srcdir)/widgets/Fl_Text_Display_mod.cxx'; fi`
+
+flwkey-Fl_Text_Editor_mod.o: widgets/Fl_Text_Editor_mod.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-Fl_Text_Editor_mod.o -MD -MP -MF $(DEPDIR)/flwkey-Fl_Text_Editor_mod.Tpo -c -o flwkey-Fl_Text_Editor_mod.o `test -f 'widgets/Fl_Text_Editor_mod.cxx' || echo '$(srcdir)/'`widgets/Fl_Text_Editor_mod.cxx
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-Fl_Text_Editor_mod.Tpo $(DEPDIR)/flwkey-Fl_Text_Editor_mod.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='widgets/Fl_Text_Editor_mod.cxx' object='flwkey-Fl_Text_Editor_mod.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-Fl_Text_Editor_mod.o `test -f 'widgets/Fl_Text_Editor_mod.cxx' || echo '$(srcdir)/'`widgets/Fl_Text_Editor_mod.cxx
+
+flwkey-Fl_Text_Editor_mod.obj: widgets/Fl_Text_Editor_mod.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-Fl_Text_Editor_mod.obj -MD -MP -MF $(DEPDIR)/flwkey-Fl_Text_Editor_mod.Tpo -c -o flwkey-Fl_Text_Editor_mod.obj `if test -f 'widgets/Fl_Text_Editor_mod.cxx'; then $(CYGPATH_W) 'widgets/Fl_Text_Editor_mod.cxx'; else $(CYGPATH_W) '$(srcdir)/widgets/Fl_Text_Editor_mod.cxx'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-Fl_Text_Editor_mod.Tpo $(DEPDIR)/flwkey-Fl_Text_Editor_mod.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='widgets/Fl_Text_Editor_mod.cxx' object='flwkey-Fl_Text_Editor_mod.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-Fl_Text_Editor_mod.obj `if test -f 'widgets/Fl_Text_Editor_mod.cxx'; then $(CYGPATH_W) 'widgets/Fl_Text_Editor_mod.cxx'; else $(CYGPATH_W) '$(srcdir)/widgets/Fl_Text_Editor_mod.cxx'; fi`
+
+flwkey-Fl_Native_File_Chooser.o: widgets/Fl_Native_File_Chooser.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-Fl_Native_File_Chooser.o -MD -MP -MF $(DEPDIR)/flwkey-Fl_Native_File_Chooser.Tpo -c -o flwkey-Fl_Native_File_Chooser.o `test -f 'widgets/Fl_Native_File_Chooser.cxx' || echo '$(srcdir)/'`widgets/Fl_Native_File_Chooser.cxx
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-Fl_Native_File_Chooser.Tpo $(DEPDIR)/flwkey-Fl_Native_File_Chooser.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='widgets/Fl_Native_File_Chooser.cxx' object='flwkey-Fl_Native_File_Chooser.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-Fl_Native_File_Chooser.o `test -f 'widgets/Fl_Native_File_Chooser.cxx' || echo '$(srcdir)/'`widgets/Fl_Native_File_Chooser.cxx
+
+flwkey-Fl_Native_File_Chooser.obj: widgets/Fl_Native_File_Chooser.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-Fl_Native_File_Chooser.obj -MD -MP -MF $(DEPDIR)/flwkey-Fl_Native_File_Chooser.Tpo -c -o flwkey-Fl_Native_File_Chooser.obj `if test -f 'widgets/Fl_Native_File_Chooser.cxx'; then $(CYGPATH_W) 'widgets/Fl_Native_File_Chooser.cxx'; else $(CYGPATH_W) '$(srcdir)/widgets/Fl_Native_File_Chooser.cxx'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-Fl_Native_File_Chooser.Tpo $(DEPDIR)/flwkey-Fl_Native_File_Chooser.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='widgets/Fl_Native_File_Chooser.cxx' object='flwkey-Fl_Native_File_Chooser.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-Fl_Native_File_Chooser.obj `if test -f 'widgets/Fl_Native_File_Chooser.cxx'; then $(CYGPATH_W) 'widgets/Fl_Native_File_Chooser.cxx'; else $(CYGPATH_W) '$(srcdir)/widgets/Fl_Native_File_Chooser.cxx'; fi`
+
+flwkey-flinput2.o: widgets/flinput2.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-flinput2.o -MD -MP -MF $(DEPDIR)/flwkey-flinput2.Tpo -c -o flwkey-flinput2.o `test -f 'widgets/flinput2.cxx' || echo '$(srcdir)/'`widgets/flinput2.cxx
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-flinput2.Tpo $(DEPDIR)/flwkey-flinput2.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='widgets/flinput2.cxx' object='flwkey-flinput2.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-flinput2.o `test -f 'widgets/flinput2.cxx' || echo '$(srcdir)/'`widgets/flinput2.cxx
+
+flwkey-flinput2.obj: widgets/flinput2.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-flinput2.obj -MD -MP -MF $(DEPDIR)/flwkey-flinput2.Tpo -c -o flwkey-flinput2.obj `if test -f 'widgets/flinput2.cxx'; then $(CYGPATH_W) 'widgets/flinput2.cxx'; else $(CYGPATH_W) '$(srcdir)/widgets/flinput2.cxx'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-flinput2.Tpo $(DEPDIR)/flwkey-flinput2.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='widgets/flinput2.cxx' object='flwkey-flinput2.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-flinput2.obj `if test -f 'widgets/flinput2.cxx'; then $(CYGPATH_W) 'widgets/flinput2.cxx'; else $(CYGPATH_W) '$(srcdir)/widgets/flinput2.cxx'; fi`
+
+flwkey-fileselect.o: widgets/fileselect.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-fileselect.o -MD -MP -MF $(DEPDIR)/flwkey-fileselect.Tpo -c -o flwkey-fileselect.o `test -f 'widgets/fileselect.cxx' || echo '$(srcdir)/'`widgets/fileselect.cxx
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-fileselect.Tpo $(DEPDIR)/flwkey-fileselect.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='widgets/fileselect.cxx' object='flwkey-fileselect.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-fileselect.o `test -f 'widgets/fileselect.cxx' || echo '$(srcdir)/'`widgets/fileselect.cxx
+
+flwkey-fileselect.obj: widgets/fileselect.cxx
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-fileselect.obj -MD -MP -MF $(DEPDIR)/flwkey-fileselect.Tpo -c -o flwkey-fileselect.obj `if test -f 'widgets/fileselect.cxx'; then $(CYGPATH_W) 'widgets/fileselect.cxx'; else $(CYGPATH_W) '$(srcdir)/widgets/fileselect.cxx'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-fileselect.Tpo $(DEPDIR)/flwkey-fileselect.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='widgets/fileselect.cxx' object='flwkey-fileselect.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-fileselect.obj `if test -f 'widgets/fileselect.cxx'; then $(CYGPATH_W) 'widgets/fileselect.cxx'; else $(CYGPATH_W) '$(srcdir)/widgets/fileselect.cxx'; fi`
+
+flwkey-XmlRpcClient.o: xmlrpccpp/XmlRpcClient.cpp
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-XmlRpcClient.o -MD -MP -MF $(DEPDIR)/flwkey-XmlRpcClient.Tpo -c -o flwkey-XmlRpcClient.o `test -f 'xmlrpccpp/XmlRpcClient.cpp' || echo '$(srcdir)/'`xmlrpccpp/XmlRpcClient.cpp
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-XmlRpcClient.Tpo $(DEPDIR)/flwkey-XmlRpcClient.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='xmlrpccpp/XmlRpcClient.cpp' object='flwkey-XmlRpcClient.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-XmlRpcClient.o `test -f 'xmlrpccpp/XmlRpcClient.cpp' || echo '$(srcdir)/'`xmlrpccpp/XmlRpcClient.cpp
+
+flwkey-XmlRpcClient.obj: xmlrpccpp/XmlRpcClient.cpp
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-XmlRpcClient.obj -MD -MP -MF $(DEPDIR)/flwkey-XmlRpcClient.Tpo -c -o flwkey-XmlRpcClient.obj `if test -f 'xmlrpccpp/XmlRpcClient.cpp'; then $(CYGPATH_W) 'xmlrpccpp/XmlRpcClient.cpp'; else $(CYGPATH_W) '$(srcdir)/xmlrpccpp/XmlRpcClient.cpp'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-XmlRpcClient.Tpo $(DEPDIR)/flwkey-XmlRpcClient.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='xmlrpccpp/XmlRpcClient.cpp' object='flwkey-XmlRpcClient.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-XmlRpcClient.obj `if test -f 'xmlrpccpp/XmlRpcClient.cpp'; then $(CYGPATH_W) 'xmlrpccpp/XmlRpcClient.cpp'; else $(CYGPATH_W) '$(srcdir)/xmlrpccpp/XmlRpcClient.cpp'; fi`
+
+flwkey-XmlRpcMutex.o: xmlrpccpp/XmlRpcMutex.cpp
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-XmlRpcMutex.o -MD -MP -MF $(DEPDIR)/flwkey-XmlRpcMutex.Tpo -c -o flwkey-XmlRpcMutex.o `test -f 'xmlrpccpp/XmlRpcMutex.cpp' || echo '$(srcdir)/'`xmlrpccpp/XmlRpcMutex.cpp
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-XmlRpcMutex.Tpo $(DEPDIR)/flwkey-XmlRpcMutex.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='xmlrpccpp/XmlRpcMutex.cpp' object='flwkey-XmlRpcMutex.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-XmlRpcMutex.o `test -f 'xmlrpccpp/XmlRpcMutex.cpp' || echo '$(srcdir)/'`xmlrpccpp/XmlRpcMutex.cpp
+
+flwkey-XmlRpcMutex.obj: xmlrpccpp/XmlRpcMutex.cpp
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-XmlRpcMutex.obj -MD -MP -MF $(DEPDIR)/flwkey-XmlRpcMutex.Tpo -c -o flwkey-XmlRpcMutex.obj `if test -f 'xmlrpccpp/XmlRpcMutex.cpp'; then $(CYGPATH_W) 'xmlrpccpp/XmlRpcMutex.cpp'; else $(CYGPATH_W) '$(srcdir)/xmlrpccpp/XmlRpcMutex.cpp'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-XmlRpcMutex.Tpo $(DEPDIR)/flwkey-XmlRpcMutex.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='xmlrpccpp/XmlRpcMutex.cpp' object='flwkey-XmlRpcMutex.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-XmlRpcMutex.obj `if test -f 'xmlrpccpp/XmlRpcMutex.cpp'; then $(CYGPATH_W) 'xmlrpccpp/XmlRpcMutex.cpp'; else $(CYGPATH_W) '$(srcdir)/xmlrpccpp/XmlRpcMutex.cpp'; fi`
+
+flwkey-XmlRpcServerMethod.o: xmlrpccpp/XmlRpcServerMethod.cpp
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-XmlRpcServerMethod.o -MD -MP -MF $(DEPDIR)/flwkey-XmlRpcServerMethod.Tpo -c -o flwkey-XmlRpcServerMethod.o `test -f 'xmlrpccpp/XmlRpcServerMethod.cpp' || echo '$(srcdir)/'`xmlrpccpp/XmlRpcServerMethod.cpp
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-XmlRpcServerMethod.Tpo $(DEPDIR)/flwkey-XmlRpcServerMethod.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='xmlrpccpp/XmlRpcServerMethod.cpp' object='flwkey-XmlRpcServerMethod.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-XmlRpcServerMethod.o `test -f 'xmlrpccpp/XmlRpcServerMethod.cpp' || echo '$(srcdir)/'`xmlrpccpp/XmlRpcServerMethod.cpp
+
+flwkey-XmlRpcServerMethod.obj: xmlrpccpp/XmlRpcServerMethod.cpp
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-XmlRpcServerMethod.obj -MD -MP -MF $(DEPDIR)/flwkey-XmlRpcServerMethod.Tpo -c -o flwkey-XmlRpcServerMethod.obj `if test -f 'xmlrpccpp/XmlRpcServerMethod.cpp'; then $(CYGPATH_W) 'xmlrpccpp/XmlRpcServerMethod.cpp'; else $(CYGPATH_W) '$(srcdir)/xmlrpccpp/XmlRpcServerMethod.cpp'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-XmlRpcServerMethod.Tpo $(DEPDIR)/flwkey-XmlRpcServerMethod.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='xmlrpccpp/XmlRpcServerMethod.cpp' object='flwkey-XmlRpcServerMethod.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-XmlRpcServerMethod.obj `if test -f 'xmlrpccpp/XmlRpcServerMethod.cpp'; then $(CYGPATH_W) 'xmlrpccpp/XmlRpcServerMethod.cpp'; else $(CYGPATH_W) '$(srcdir)/xmlrpccpp/XmlRpcServerMethod.cpp'; fi`
+
+flwkey-XmlRpcThread.o: xmlrpccpp/XmlRpcThread.cpp
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-XmlRpcThread.o -MD -MP -MF $(DEPDIR)/flwkey-XmlRpcThread.Tpo -c -o flwkey-XmlRpcThread.o `test -f 'xmlrpccpp/XmlRpcThread.cpp' || echo '$(srcdir)/'`xmlrpccpp/XmlRpcThread.cpp
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-XmlRpcThread.Tpo $(DEPDIR)/flwkey-XmlRpcThread.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='xmlrpccpp/XmlRpcThread.cpp' object='flwkey-XmlRpcThread.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-XmlRpcThread.o `test -f 'xmlrpccpp/XmlRpcThread.cpp' || echo '$(srcdir)/'`xmlrpccpp/XmlRpcThread.cpp
+
+flwkey-XmlRpcThread.obj: xmlrpccpp/XmlRpcThread.cpp
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-XmlRpcThread.obj -MD -MP -MF $(DEPDIR)/flwkey-XmlRpcThread.Tpo -c -o flwkey-XmlRpcThread.obj `if test -f 'xmlrpccpp/XmlRpcThread.cpp'; then $(CYGPATH_W) 'xmlrpccpp/XmlRpcThread.cpp'; else $(CYGPATH_W) '$(srcdir)/xmlrpccpp/XmlRpcThread.cpp'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-XmlRpcThread.Tpo $(DEPDIR)/flwkey-XmlRpcThread.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='xmlrpccpp/XmlRpcThread.cpp' object='flwkey-XmlRpcThread.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-XmlRpcThread.obj `if test -f 'xmlrpccpp/XmlRpcThread.cpp'; then $(CYGPATH_W) 'xmlrpccpp/XmlRpcThread.cpp'; else $(CYGPATH_W) '$(srcdir)/xmlrpccpp/XmlRpcThread.cpp'; fi`
+
+flwkey-XmlRpcValue.o: xmlrpccpp/XmlRpcValue.cpp
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-XmlRpcValue.o -MD -MP -MF $(DEPDIR)/flwkey-XmlRpcValue.Tpo -c -o flwkey-XmlRpcValue.o `test -f 'xmlrpccpp/XmlRpcValue.cpp' || echo '$(srcdir)/'`xmlrpccpp/XmlRpcValue.cpp
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-XmlRpcValue.Tpo $(DEPDIR)/flwkey-XmlRpcValue.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='xmlrpccpp/XmlRpcValue.cpp' object='flwkey-XmlRpcValue.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-XmlRpcValue.o `test -f 'xmlrpccpp/XmlRpcValue.cpp' || echo '$(srcdir)/'`xmlrpccpp/XmlRpcValue.cpp
+
+flwkey-XmlRpcValue.obj: xmlrpccpp/XmlRpcValue.cpp
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-XmlRpcValue.obj -MD -MP -MF $(DEPDIR)/flwkey-XmlRpcValue.Tpo -c -o flwkey-XmlRpcValue.obj `if test -f 'xmlrpccpp/XmlRpcValue.cpp'; then $(CYGPATH_W) 'xmlrpccpp/XmlRpcValue.cpp'; else $(CYGPATH_W) '$(srcdir)/xmlrpccpp/XmlRpcValue.cpp'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-XmlRpcValue.Tpo $(DEPDIR)/flwkey-XmlRpcValue.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='xmlrpccpp/XmlRpcValue.cpp' object='flwkey-XmlRpcValue.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-XmlRpcValue.obj `if test -f 'xmlrpccpp/XmlRpcValue.cpp'; then $(CYGPATH_W) 'xmlrpccpp/XmlRpcValue.cpp'; else $(CYGPATH_W) '$(srcdir)/xmlrpccpp/XmlRpcValue.cpp'; fi`
+
+flwkey-XmlRpcDispatch.o: xmlrpccpp/XmlRpcDispatch.cpp
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-XmlRpcDispatch.o -MD -MP -MF $(DEPDIR)/flwkey-XmlRpcDispatch.Tpo -c -o flwkey-XmlRpcDispatch.o `test -f 'xmlrpccpp/XmlRpcDispatch.cpp' || echo '$(srcdir)/'`xmlrpccpp/XmlRpcDispatch.cpp
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-XmlRpcDispatch.Tpo $(DEPDIR)/flwkey-XmlRpcDispatch.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='xmlrpccpp/XmlRpcDispatch.cpp' object='flwkey-XmlRpcDispatch.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-XmlRpcDispatch.o `test -f 'xmlrpccpp/XmlRpcDispatch.cpp' || echo '$(srcdir)/'`xmlrpccpp/XmlRpcDispatch.cpp
+
+flwkey-XmlRpcDispatch.obj: xmlrpccpp/XmlRpcDispatch.cpp
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-XmlRpcDispatch.obj -MD -MP -MF $(DEPDIR)/flwkey-XmlRpcDispatch.Tpo -c -o flwkey-XmlRpcDispatch.obj `if test -f 'xmlrpccpp/XmlRpcDispatch.cpp'; then $(CYGPATH_W) 'xmlrpccpp/XmlRpcDispatch.cpp'; else $(CYGPATH_W) '$(srcdir)/xmlrpccpp/XmlRpcDispatch.cpp'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-XmlRpcDispatch.Tpo $(DEPDIR)/flwkey-XmlRpcDispatch.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='xmlrpccpp/XmlRpcDispatch.cpp' object='flwkey-XmlRpcDispatch.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-XmlRpcDispatch.obj `if test -f 'xmlrpccpp/XmlRpcDispatch.cpp'; then $(CYGPATH_W) 'xmlrpccpp/XmlRpcDispatch.cpp'; else $(CYGPATH_W) '$(srcdir)/xmlrpccpp/XmlRpcDispatch.cpp'; fi`
+
+flwkey-XmlRpcServerConnection.o: xmlrpccpp/XmlRpcServerConnection.cpp
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-XmlRpcServerConnection.o -MD -MP -MF $(DEPDIR)/flwkey-XmlRpcServerConnection.Tpo -c -o flwkey-XmlRpcServerConnection.o `test -f 'xmlrpccpp/XmlRpcServerConnection.cpp' || echo '$(srcdir)/'`xmlrpccpp/XmlRpcServerConnection.cpp
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-XmlRpcServerConnection.Tpo $(DEPDIR)/flwkey-XmlRpcServerConnection.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='xmlrpccpp/XmlRpcServerConnection.cpp' object='flwkey-XmlRpcServerConnection.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-XmlRpcServerConnection.o `test -f 'xmlrpccpp/XmlRpcServerConnection.cpp' || echo '$(srcdir)/'`xmlrpccpp/XmlRpcServerConnection.cpp
+
+flwkey-XmlRpcServerConnection.obj: xmlrpccpp/XmlRpcServerConnection.cpp
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-XmlRpcServerConnection.obj -MD -MP -MF $(DEPDIR)/flwkey-XmlRpcServerConnection.Tpo -c -o flwkey-XmlRpcServerConnection.obj `if test -f 'xmlrpccpp/XmlRpcServerConnection.cpp'; then $(CYGPATH_W) 'xmlrpccpp/XmlRpcServerConnection.cpp'; else $(CYGPATH_W) '$(srcdir)/xmlrpccpp/XmlRpcServerConnection.cpp'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-XmlRpcServerConnection.Tpo $(DEPDIR)/flwkey-XmlRpcServerConnection.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='xmlrpccpp/XmlRpcServerConnection.cpp' object='flwkey-XmlRpcServerConnection.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-XmlRpcServerConnection.obj `if test -f 'xmlrpccpp/XmlRpcServerConnection.cpp'; then $(CYGPATH_W) 'xmlrpccpp/XmlRpcServerConnection.cpp'; else $(CYGPATH_W) '$(srcdir)/xmlrpccpp/XmlRpcServerConnection.cpp'; fi`
+
+flwkey-XmlRpcSocket.o: xmlrpccpp/XmlRpcSocket.cpp
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-XmlRpcSocket.o -MD -MP -MF $(DEPDIR)/flwkey-XmlRpcSocket.Tpo -c -o flwkey-XmlRpcSocket.o `test -f 'xmlrpccpp/XmlRpcSocket.cpp' || echo '$(srcdir)/'`xmlrpccpp/XmlRpcSocket.cpp
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-XmlRpcSocket.Tpo $(DEPDIR)/flwkey-XmlRpcSocket.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='xmlrpccpp/XmlRpcSocket.cpp' object='flwkey-XmlRpcSocket.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-XmlRpcSocket.o `test -f 'xmlrpccpp/XmlRpcSocket.cpp' || echo '$(srcdir)/'`xmlrpccpp/XmlRpcSocket.cpp
+
+flwkey-XmlRpcSocket.obj: xmlrpccpp/XmlRpcSocket.cpp
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-XmlRpcSocket.obj -MD -MP -MF $(DEPDIR)/flwkey-XmlRpcSocket.Tpo -c -o flwkey-XmlRpcSocket.obj `if test -f 'xmlrpccpp/XmlRpcSocket.cpp'; then $(CYGPATH_W) 'xmlrpccpp/XmlRpcSocket.cpp'; else $(CYGPATH_W) '$(srcdir)/xmlrpccpp/XmlRpcSocket.cpp'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-XmlRpcSocket.Tpo $(DEPDIR)/flwkey-XmlRpcSocket.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='xmlrpccpp/XmlRpcSocket.cpp' object='flwkey-XmlRpcSocket.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-XmlRpcSocket.obj `if test -f 'xmlrpccpp/XmlRpcSocket.cpp'; then $(CYGPATH_W) 'xmlrpccpp/XmlRpcSocket.cpp'; else $(CYGPATH_W) '$(srcdir)/xmlrpccpp/XmlRpcSocket.cpp'; fi`
+
+flwkey-XmlRpcServer.o: xmlrpccpp/XmlRpcServer.cpp
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-XmlRpcServer.o -MD -MP -MF $(DEPDIR)/flwkey-XmlRpcServer.Tpo -c -o flwkey-XmlRpcServer.o `test -f 'xmlrpccpp/XmlRpcServer.cpp' || echo '$(srcdir)/'`xmlrpccpp/XmlRpcServer.cpp
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-XmlRpcServer.Tpo $(DEPDIR)/flwkey-XmlRpcServer.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='xmlrpccpp/XmlRpcServer.cpp' object='flwkey-XmlRpcServer.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-XmlRpcServer.o `test -f 'xmlrpccpp/XmlRpcServer.cpp' || echo '$(srcdir)/'`xmlrpccpp/XmlRpcServer.cpp
+
+flwkey-XmlRpcServer.obj: xmlrpccpp/XmlRpcServer.cpp
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-XmlRpcServer.obj -MD -MP -MF $(DEPDIR)/flwkey-XmlRpcServer.Tpo -c -o flwkey-XmlRpcServer.obj `if test -f 'xmlrpccpp/XmlRpcServer.cpp'; then $(CYGPATH_W) 'xmlrpccpp/XmlRpcServer.cpp'; else $(CYGPATH_W) '$(srcdir)/xmlrpccpp/XmlRpcServer.cpp'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-XmlRpcServer.Tpo $(DEPDIR)/flwkey-XmlRpcServer.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='xmlrpccpp/XmlRpcServer.cpp' object='flwkey-XmlRpcServer.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-XmlRpcServer.obj `if test -f 'xmlrpccpp/XmlRpcServer.cpp'; then $(CYGPATH_W) 'xmlrpccpp/XmlRpcServer.cpp'; else $(CYGPATH_W) '$(srcdir)/xmlrpccpp/XmlRpcServer.cpp'; fi`
+
+flwkey-XmlRpcSource.o: xmlrpccpp/XmlRpcSource.cpp
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-XmlRpcSource.o -MD -MP -MF $(DEPDIR)/flwkey-XmlRpcSource.Tpo -c -o flwkey-XmlRpcSource.o `test -f 'xmlrpccpp/XmlRpcSource.cpp' || echo '$(srcdir)/'`xmlrpccpp/XmlRpcSource.cpp
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-XmlRpcSource.Tpo $(DEPDIR)/flwkey-XmlRpcSource.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='xmlrpccpp/XmlRpcSource.cpp' object='flwkey-XmlRpcSource.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-XmlRpcSource.o `test -f 'xmlrpccpp/XmlRpcSource.cpp' || echo '$(srcdir)/'`xmlrpccpp/XmlRpcSource.cpp
+
+flwkey-XmlRpcSource.obj: xmlrpccpp/XmlRpcSource.cpp
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-XmlRpcSource.obj -MD -MP -MF $(DEPDIR)/flwkey-XmlRpcSource.Tpo -c -o flwkey-XmlRpcSource.obj `if test -f 'xmlrpccpp/XmlRpcSource.cpp'; then $(CYGPATH_W) 'xmlrpccpp/XmlRpcSource.cpp'; else $(CYGPATH_W) '$(srcdir)/xmlrpccpp/XmlRpcSource.cpp'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-XmlRpcSource.Tpo $(DEPDIR)/flwkey-XmlRpcSource.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='xmlrpccpp/XmlRpcSource.cpp' object='flwkey-XmlRpcSource.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-XmlRpcSource.obj `if test -f 'xmlrpccpp/XmlRpcSource.cpp'; then $(CYGPATH_W) 'xmlrpccpp/XmlRpcSource.cpp'; else $(CYGPATH_W) '$(srcdir)/xmlrpccpp/XmlRpcSource.cpp'; fi`
+
+flwkey-XmlRpcUtil.o: xmlrpccpp/XmlRpcUtil.cpp
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-XmlRpcUtil.o -MD -MP -MF $(DEPDIR)/flwkey-XmlRpcUtil.Tpo -c -o flwkey-XmlRpcUtil.o `test -f 'xmlrpccpp/XmlRpcUtil.cpp' || echo '$(srcdir)/'`xmlrpccpp/XmlRpcUtil.cpp
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-XmlRpcUtil.Tpo $(DEPDIR)/flwkey-XmlRpcUtil.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='xmlrpccpp/XmlRpcUtil.cpp' object='flwkey-XmlRpcUtil.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-XmlRpcUtil.o `test -f 'xmlrpccpp/XmlRpcUtil.cpp' || echo '$(srcdir)/'`xmlrpccpp/XmlRpcUtil.cpp
+
+flwkey-XmlRpcUtil.obj: xmlrpccpp/XmlRpcUtil.cpp
+ at am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -MT flwkey-XmlRpcUtil.obj -MD -MP -MF $(DEPDIR)/flwkey-XmlRpcUtil.Tpo -c -o flwkey-XmlRpcUtil.obj `if test -f 'xmlrpccpp/XmlRpcUtil.cpp'; then $(CYGPATH_W) 'xmlrpccpp/XmlRpcUtil.cpp'; else $(CYGPATH_W) '$(srcdir)/xmlrpccpp/XmlRpcUtil.cpp'; fi`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/flwkey-XmlRpcUtil.Tpo $(DEPDIR)/flwkey-XmlRpcUtil.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='xmlrpccpp/XmlRpcUtil.cpp' object='flwkey-XmlRpcUtil.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flwkey_CPPFLAGS) $(CPPFLAGS) $(flwkey_CXXFLAGS) $(CXXFLAGS) -c -o flwkey-XmlRpcUtil.obj `if test -f 'xmlrpccpp/XmlRpcUtil.cpp'; then $(CYGPATH_W) 'xmlrpccpp/XmlRpcUtil.cpp'; else $(CYGPATH_W) '$(srcdir)/xmlrpccpp/XmlRpcUtil.cpp'; fi`
+
+.cxx.o:
+ at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+
+.cxx.obj:
+ at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ 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
+CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ 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"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(PROGRAMS) config.h
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+ -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-binPROGRAMS clean-generic clean-local mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-hdr distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-data-local
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+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: installcheck-binPROGRAMS
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-local
+
+.MAKE: all check install install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+ clean-generic clean-local ctags distclean distclean-compile \
+ distclean-generic distclean-hdr distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-binPROGRAMS install-data install-data-am \
+ install-data-local 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 installcheck-binPROGRAMS installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-binPROGRAMS \
+ uninstall-local
+
+
+.EXPORT_ALL_VARIABLES: nsisinst appbundle
+
+ at HAVE_WINDRES_TRUE@@MINGW32_TRUE at .rc.o:
+ at HAVE_WINDRES_TRUE@@MINGW32_TRUE@ $(WINDRES) -I$(srcdir)/include -I$(srcdir)/../data/win32 $< -O coff $@
+
+install-data-local:
+ if test -f $(srcdir)/../data/flwkey.xpm; then \
+ $(mkinstalldirs) $(DESTDIR)/$(datadir)/pixmaps; \
+ $(INSTALL_DATA) $(srcdir)/../data/flwkey.xpm $(DESTDIR)/$(datadir)/pixmaps; \
+ fi
+ if test -f $(srcdir)/../data/flwkey.desktop; then \
+ $(mkinstalldirs) $(DESTDIR)/$(datadir)/applications; \
+ $(INSTALL_DATA) $(srcdir)/../data/flwkey.desktop $(DESTDIR)/$(datadir)/applications; \
+ fi
+
+uninstall-local:
+ rm -f $(DESTDIR)/$(datadir)/pixmaps/flwkey.xpm
+ rm -f $(DESTDIR)/$(datadir)/applications/flwkey.desktop
+
+ at HAVE_FLUID_TRUE@flgen: $(FLWKEY_FL_SRC) $(FLWKEY_FL_LOG)
+ at HAVE_FLUID_TRUE@ (cd $(srcdir)/include; \
+ at HAVE_FLUID_TRUE@ for f in $(FLWKEY_FL_SRC); do \
+ at HAVE_FLUID_TRUE@ c=$${f%.fl}.cxx; \
+ at HAVE_FLUID_TRUE@ h=$${f%.fl}.h; \
+ at HAVE_FLUID_TRUE@ h=$${h##*/}; \
+ at HAVE_FLUID_TRUE@ $(FLUID) -c -o ../$$c -h $$h ../$$f; \
+ at HAVE_FLUID_TRUE@ done)
+
+ at HAVE_NSIS_TRUE@nsisinst: $(bin_PROGRAMS)
+ at HAVE_NSIS_TRUE@ sh $(srcdir)/../scripts/mknsisinst.sh "$(srcdir)/../data" .
+
+ at DARWIN_TRUE@appbundle: $(bin_PROGRAMS)
+ at DARWIN_TRUE@ sh $(srcdir)/../scripts/mkappbundle.sh "$(srcdir)/../data" .
+
+#if HAVE_ASCIIDOC
+#$(builddir)/../doc/guide.html: $(builddir)/../doc/guide.txt
+# $(MAKE) -C $(builddir)/../doc $(AM_MAKEFLAGS) guide.html
+
+#$(builddir)/dialogs/guide.cxx: $(builddir)/../doc/guide.html
+# mkdir -p $(builddir)/dialogs
+# sed 's/"/\\"/g; s/$$/\\n\\/g; 1 s/.*/const char* szBeginner = "&/; $$ s/.*/&n";/' $< > $@
+#dialogs/htmlstrings.cxx: $(builddir)/dialogs/guide.cxx
+
+#distclean-local:
+# @if test "$(builddir)" != "$(srcdir)"; then \
+# rm -f $(builddir)/dialogs/guide.cxx; \
+# fi
+#endif
+
+clean-local:
+ -rm -rf $(CLEAN_LOCAL)
+
+# 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:
diff --git a/src/compat/regex.c b/src/compat/regex.c
new file mode 100644
index 0000000..87b33e4
--- /dev/null
+++ b/src/compat/regex.c
@@ -0,0 +1,4927 @@
+/* Extended regular expression matching and search library,
+ version 0.12.
+ (Implements POSIX draft P10003.2/D11.2, except for
+ internationalization features.)
+
+ Copyright (C) 1993 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* AIX requires this to be the first thing in the file. */
+#if defined (_AIX) && !defined (REGEX_MALLOC)
+ #pragma alloca
+#endif
+
+#define _GNU_SOURCE
+
+/* We need this for `regex.h', and perhaps for the Emacs include files. */
+#include <sys/types.h>
+
+/* We used to test for `BSTRING' here, but only GCC and Emacs define
+ `BSTRING', as far as I know, and neither of them use this code. */
+#include <string.h>
+#ifndef bcmp
+#define bcmp(s1, s2, n) memcmp ((s1), (s2), (n))
+#endif
+#ifndef bcopy
+#define bcopy(s, d, n) memcpy ((d), (s), (n))
+#endif
+#ifndef bzero
+#define bzero(s, n) memset ((s), 0, (n))
+#endif
+
+#include <stdlib.h>
+
+
+/* Define the syntax stuff for \<, \>, etc. */
+
+/* This must be nonzero for the wordchar and notwordchar pattern
+ commands in re_match_2. */
+#ifndef Sword
+#define Sword 1
+#endif
+
+#ifdef SYNTAX_TABLE
+
+extern char *re_syntax_table;
+
+#else /* not SYNTAX_TABLE */
+
+/* How many characters in the character set. */
+#define CHAR_SET_SIZE 256
+
+static char re_syntax_table[CHAR_SET_SIZE];
+
+static void
+init_syntax_once ()
+{
+ register int c;
+ static int done = 0;
+
+ if (done)
+ return;
+
+ bzero (re_syntax_table, sizeof re_syntax_table);
+
+ for (c = 'a'; c <= 'z'; c++)
+ re_syntax_table[c] = Sword;
+
+ for (c = 'A'; c <= 'Z'; c++)
+ re_syntax_table[c] = Sword;
+
+ for (c = '0'; c <= '9'; c++)
+ re_syntax_table[c] = Sword;
+
+ re_syntax_table['_'] = Sword;
+
+ done = 1;
+}
+
+#endif /* not SYNTAX_TABLE */
+
+#define SYNTAX(c) re_syntax_table[c]
+
+
+/* Get the interface, including the syntax bits. */
+#include "regex.h"
+
+/* isalpha etc. are used for the character classes. */
+#include <ctype.h>
+
+#ifndef isascii
+#define isascii(c) 1
+#endif
+
+#ifdef isblank
+#define ISBLANK(c) (isascii (c) && isblank (c))
+#else
+#define ISBLANK(c) ((c) == ' ' || (c) == '\t')
+#endif
+#ifdef isgraph
+#define ISGRAPH(c) (isascii (c) && isgraph (c))
+#else
+#define ISGRAPH(c) (isascii (c) && isprint (c) && !isspace (c))
+#endif
+
+#define ISPRINT(c) (isascii (c) && isprint (c))
+#define ISDIGIT(c) (isascii (c) && isdigit (c))
+#define ISALNUM(c) (isascii (c) && isalnum (c))
+#define ISALPHA(c) (isascii (c) && isalpha (c))
+#define ISCNTRL(c) (isascii (c) && iscntrl (c))
+#define ISLOWER(c) (isascii (c) && islower (c))
+#define ISPUNCT(c) (isascii (c) && ispunct (c))
+#define ISSPACE(c) (isascii (c) && isspace (c))
+#define ISUPPER(c) (isascii (c) && isupper (c))
+#define ISXDIGIT(c) (isascii (c) && isxdigit (c))
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+/* We remove any previous definition of `SIGN_EXTEND_CHAR',
+ since ours (we hope) works properly with all combinations of
+ machines, compilers, `char' and `unsigned char' argument types.
+ (Per Bothner suggested the basic approach.) */
+#undef SIGN_EXTEND_CHAR
+#if __STDC__
+#define SIGN_EXTEND_CHAR(c) ((signed char) (c))
+#else /* not __STDC__ */
+/* As in Harbison and Steele. */
+#define SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128)
+#endif
+
+/* Should we use malloc or alloca? If REGEX_MALLOC is not defined, we
+ use `alloca' instead of `malloc'. This is because using malloc in
+ re_search* or re_match* could cause memory leaks when C-g is used in
+ Emacs; also, malloc is slower and causes storage fragmentation. On
+ the other hand, malloc is more portable, and easier to debug.
+
+ Because we sometimes use alloca, some routines have to be macros,
+ not functions -- `alloca'-allocated space disappears at the end of the
+ function it is called in. */
+
+#ifdef REGEX_MALLOC
+
+#define REGEX_ALLOCATE malloc
+#define REGEX_REALLOCATE(source, osize, nsize) realloc (source, nsize)
+
+#else /* not REGEX_MALLOC */
+
+/* Emacs already defines alloca, sometimes. */
+#ifndef alloca
+
+/* Make alloca work the best possible way. */
+#ifdef __GNUC__
+#define alloca __builtin_alloca
+#else /* not __GNUC__ */
+#if HAVE_ALLOCA_H
+#include <alloca.h>
+#else /* not __GNUC__ or HAVE_ALLOCA_H */
+#ifndef _AIX /* Already did AIX, up at the top. */
+char *alloca ();
+#endif /* not _AIX */
+#endif /* not HAVE_ALLOCA_H */
+#endif /* not __GNUC__ */
+
+#endif /* not alloca */
+
+#define REGEX_ALLOCATE alloca
+
+/* Assumes a `char *destination' variable. */
+#define REGEX_REALLOCATE(source, osize, nsize) \
+ (destination = (char *) alloca (nsize), \
+ bcopy (source, destination, osize), \
+ destination)
+
+#endif /* not REGEX_MALLOC */
+
+
+/* True if `size1' is non-NULL and PTR is pointing anywhere inside
+ `string1' or just past its end. This works if PTR is NULL, which is
+ a good thing. */
+#define FIRST_STRING_P(ptr) \
+ (size1 && string1 <= (ptr) && (ptr) <= string1 + size1)
+
+/* (Re)Allocate N items of type T using malloc, or fail. */
+#define TALLOC(n, t) ((t *) malloc ((n) * sizeof (t)))
+#define RETALLOC(addr, n, t) ((addr) = (t *) realloc (addr, (n) * sizeof (t)))
+#define REGEX_TALLOC(n, t) ((t *) REGEX_ALLOCATE ((n) * sizeof (t)))
+
+#define BYTEWIDTH 8 /* In bits. */
+
+#define STREQ(s1, s2) ((strcmp (s1, s2) == 0))
+
+#define MAX(a, b) ((a) > (b) ? (a) : (b))
+#define MIN(a, b) ((a) < (b) ? (a) : (b))
+
+typedef char boolean;
+#define false 0
+#define true 1
+
+/* These are the command codes that appear in compiled regular
+ expressions. Some opcodes are followed by argument bytes. A
+ command code can specify any interpretation whatsoever for its
+ arguments. Zero bytes may appear in the compiled regular expression.
+
+ The value of `exactn' is needed in search.c (search_buffer) in Emacs.
+ So regex.h defines a symbol `RE_EXACTN_VALUE' to be 1; the value of
+ `exactn' we use here must also be 1. */
+
+typedef enum
+{
+ no_op = 0,
+
+ /* Followed by one byte giving n, then by n literal bytes. */
+ exactn = 1,
+
+ /* Matches any (more or less) character. */
+ anychar,
+
+ /* Matches any one char belonging to specified set. First
+ following byte is number of bitmap bytes. Then come bytes
+ for a bitmap saying which chars are in. Bits in each byte
+ are ordered low-bit-first. A character is in the set if its
+ bit is 1. A character too large to have a bit in the map is
+ automatically not in the set. */
+ charset,
+
+ /* Same parameters as charset, but match any character that is
+ not one of those specified. */
+ charset_not,
+
+ /* Start remembering the text that is matched, for storing in a
+ register. Followed by one byte with the register number, in
+ the range 0 to one less than the pattern buffer's re_nsub
+ field. Then followed by one byte with the number of groups
+ inner to this one. (This last has to be part of the
+ start_memory only because we need it in the on_failure_jump
+ of re_match_2.) */
+ start_memory,
+
+ /* Stop remembering the text that is matched and store it in a
+ memory register. Followed by one byte with the register
+ number, in the range 0 to one less than `re_nsub' in the
+ pattern buffer, and one byte with the number of inner groups,
+ just like `start_memory'. (We need the number of inner
+ groups here because we don't have any easy way of finding the
+ corresponding start_memory when we're at a stop_memory.) */
+ stop_memory,
+
+ /* Match a duplicate of something remembered. Followed by one
+ byte containing the register number. */
+ duplicate,
+
+ /* Fail unless at beginning of line. */
+ begline,
+
+ /* Fail unless at end of line. */
+ endline,
+
+ /* Succeeds if at beginning of buffer (if emacs) or at beginning
+ of string to be matched (if not). */
+ begbuf,
+
+ /* Analogously, for end of buffer/string. */
+ endbuf,
+
+ /* Followed by two byte relative address to which to jump. */
+ jump,
+
+ /* Same as jump, but marks the end of an alternative. */
+ jump_past_alt,
+
+ /* Followed by two-byte relative address of place to resume at
+ in case of failure. */
+ on_failure_jump,
+
+ /* Like on_failure_jump, but pushes a placeholder instead of the
+ current string position when executed. */
+ on_failure_keep_string_jump,
+
+ /* Throw away latest failure point and then jump to following
+ two-byte relative address. */
+ pop_failure_jump,
+
+ /* Change to pop_failure_jump if know won't have to backtrack to
+ match; otherwise change to jump. This is used to jump
+ back to the beginning of a repeat. If what follows this jump
+ clearly won't match what the repeat does, such that we can be
+ sure that there is no use backtracking out of repetitions
+ already matched, then we change it to a pop_failure_jump.
+ Followed by two-byte address. */
+ maybe_pop_jump,
+
+ /* Jump to following two-byte address, and push a dummy failure
+ point. This failure point will be thrown away if an attempt
+ is made to use it for a failure. A `+' construct makes this
+ before the first repeat. Also used as an intermediary kind
+ of jump when compiling an alternative. */
+ dummy_failure_jump,
+
+ /* Push a dummy failure point and continue. Used at the end of
+ alternatives. */
+ push_dummy_failure,
+
+ /* Followed by two-byte relative address and two-byte number n.
+ After matching N times, jump to the address upon failure. */
+ succeed_n,
+
+ /* Followed by two-byte relative address, and two-byte number n.
+ Jump to the address N times, then fail. */
+ jump_n,
+
+ /* Set the following two-byte relative address to the
+ subsequent two-byte number. The address *includes* the two
+ bytes of number. */
+ set_number_at,
+
+ wordchar, /* Matches any word-constituent character. */
+ notwordchar, /* Matches any char that is not a word-constituent. */
+
+ wordbeg, /* Succeeds if at word beginning. */
+ wordend, /* Succeeds if at word end. */
+
+ wordbound, /* Succeeds if at a word boundary. */
+ notwordbound /* Succeeds if not at a word boundary. */
+
+#ifdef emacs
+ ,before_dot, /* Succeeds if before point. */
+ at_dot, /* Succeeds if at point. */
+ after_dot, /* Succeeds if after point. */
+
+ /* Matches any character whose syntax is specified. Followed by
+ a byte which contains a syntax code, e.g., Sword. */
+ syntaxspec,
+
+ /* Matches any character whose syntax is not that specified. */
+ notsyntaxspec
+#endif /* emacs */
+} re_opcode_t;
+
+/* Common operations on the compiled pattern. */
+
+/* Store NUMBER in two contiguous bytes starting at DESTINATION. */
+
+#define STORE_NUMBER(destination, number) \
+ do { \
+ (destination)[0] = (number) & 0377; \
+ (destination)[1] = (number) >> 8; \
+ } while (0)
+
+/* Same as STORE_NUMBER, except increment DESTINATION to
+ the byte after where the number is stored. Therefore, DESTINATION
+ must be an lvalue. */
+
+#define STORE_NUMBER_AND_INCR(destination, number) \
+ do { \
+ STORE_NUMBER (destination, number); \
+ (destination) += 2; \
+ } while (0)
+
+/* Put into DESTINATION a number stored in two contiguous bytes starting
+ at SOURCE. */
+
+#define EXTRACT_NUMBER(destination, source) \
+ do { \
+ (destination) = *(source) & 0377; \
+ (destination) += SIGN_EXTEND_CHAR (*((source) + 1)) << 8; \
+ } while (0)
+
+#ifdef DEBUG
+static void
+extract_number (dest, source)
+ int *dest;
+ unsigned char *source;
+{
+ int temp = SIGN_EXTEND_CHAR (*(source + 1));
+ *dest = *source & 0377;
+ *dest += temp << 8;
+}
+
+#ifndef EXTRACT_MACROS /* To debug the macros. */
+#undef EXTRACT_NUMBER
+#define EXTRACT_NUMBER(dest, src) extract_number (&dest, src)
+#endif /* not EXTRACT_MACROS */
+
+#endif /* DEBUG */
+
+/* Same as EXTRACT_NUMBER, except increment SOURCE to after the number.
+ SOURCE must be an lvalue. */
+
+#define EXTRACT_NUMBER_AND_INCR(destination, source) \
+ do { \
+ EXTRACT_NUMBER (destination, source); \
+ (source) += 2; \
+ } while (0)
+
+#ifdef DEBUG
+static void
+extract_number_and_incr (destination, source)
+ int *destination;
+ unsigned char **source;
+{
+ extract_number (destination, *source);
+ *source += 2;
+}
+
+#ifndef EXTRACT_MACROS
+#undef EXTRACT_NUMBER_AND_INCR
+#define EXTRACT_NUMBER_AND_INCR(dest, src) \
+ extract_number_and_incr (&dest, &src)
+#endif /* not EXTRACT_MACROS */
+
+#endif /* DEBUG */
+
+/* If DEBUG is defined, Regex prints many voluminous messages about what
+ it is doing (if the variable `debug' is nonzero). If linked with the
+ main program in `iregex.c', you can enter patterns and strings
+ interactively. And if linked with the main program in `main.c' and
+ the other test files, you can run the already-written tests. */
+
+#ifdef DEBUG
+
+/* We use standard I/O for debugging. */
+#include <stdio.h>
+
+/* It is useful to test things that ``must'' be true when debugging. */
+#include <assert.h>
+
+static int debug = 0;
+
+#define DEBUG_STATEMENT(e) e
+#define DEBUG_PRINT1(x) if (debug) printf (x)
+#define DEBUG_PRINT2(x1, x2) if (debug) printf (x1, x2)
+#define DEBUG_PRINT3(x1, x2, x3) if (debug) printf (x1, x2, x3)
+#define DEBUG_PRINT4(x1, x2, x3, x4) if (debug) printf (x1, x2, x3, x4)
+#define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) \
+ if (debug) print_partial_compiled_pattern (s, e)
+#define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2) \
+ if (debug) print_double_string (w, s1, sz1, s2, sz2)
+
+
+extern void printchar ();
+
+/* Print the fastmap in human-readable form. */
+
+void
+print_fastmap (fastmap)
+ char *fastmap;
+{
+ unsigned was_a_range = 0;
+ unsigned i = 0;
+
+ while (i < (1 << BYTEWIDTH))
+ {
+ if (fastmap[i++])
+ {
+ was_a_range = 0;
+ printchar (i - 1);
+ while (i < (1 << BYTEWIDTH) && fastmap[i])
+ {
+ was_a_range = 1;
+ i++;
+ }
+ if (was_a_range)
+ {
+ printf ("-");
+ printchar (i - 1);
+ }
+ }
+ }
+ putchar ('\n');
+}
+
+
+/* Print a compiled pattern string in human-readable form, starting at
+ the START pointer into it and ending just before the pointer END. */
+
+void
+print_partial_compiled_pattern (start, end)
+ unsigned char *start;
+ unsigned char *end;
+{
+ int mcnt, mcnt2;
+ unsigned char *p = start;
+ unsigned char *pend = end;
+
+ if (start == NULL)
+ {
+ printf ("(null)\n");
+ return;
+ }
+
+ /* Loop over pattern commands. */
+ while (p < pend)
+ {
+ switch ((re_opcode_t) *p++)
+ {
+ case no_op:
+ printf ("/no_op");
+ break;
+
+ case exactn:
+ mcnt = *p++;
+ printf ("/exactn/%d", mcnt);
+ do
+ {
+ putchar ('/');
+ printchar (*p++);
+ }
+ while (--mcnt);
+ break;
+
+ case start_memory:
+ mcnt = *p++;
+ printf ("/start_memory/%d/%d", mcnt, *p++);
+ break;
+
+ case stop_memory:
+ mcnt = *p++;
+ printf ("/stop_memory/%d/%d", mcnt, *p++);
+ break;
+
+ case duplicate:
+ printf ("/duplicate/%d", *p++);
+ break;
+
+ case anychar:
+ printf ("/anychar");
+ break;
+
+ case charset:
+ case charset_not:
+ {
+ register int c;
+
+ printf ("/charset%s",
+ (re_opcode_t) *(p - 1) == charset_not ? "_not" : "");
+
+ assert (p + *p < pend);
+
+ for (c = 0; c < *p; c++)
+ {
+ unsigned bit;
+ unsigned char map_byte = p[1 + c];
+
+ putchar ('/');
+
+ for (bit = 0; bit < BYTEWIDTH; bit++)
+ if (map_byte & (1 << bit))
+ printchar (c * BYTEWIDTH + bit);
+ }
+ p += 1 + *p;
+ break;
+ }
+
+ case begline:
+ printf ("/begline");
+ break;
+
+ case endline:
+ printf ("/endline");
+ break;
+
+ case on_failure_jump:
+ extract_number_and_incr (&mcnt, &p);
+ printf ("/on_failure_jump/0/%d", mcnt);
+ break;
+
+ case on_failure_keep_string_jump:
+ extract_number_and_incr (&mcnt, &p);
+ printf ("/on_failure_keep_string_jump/0/%d", mcnt);
+ break;
+
+ case dummy_failure_jump:
+ extract_number_and_incr (&mcnt, &p);
+ printf ("/dummy_failure_jump/0/%d", mcnt);
+ break;
+
+ case push_dummy_failure:
+ printf ("/push_dummy_failure");
+ break;
+
+ case maybe_pop_jump:
+ extract_number_and_incr (&mcnt, &p);
+ printf ("/maybe_pop_jump/0/%d", mcnt);
+ break;
+
+ case pop_failure_jump:
+ extract_number_and_incr (&mcnt, &p);
+ printf ("/pop_failure_jump/0/%d", mcnt);
+ break;
+
+ case jump_past_alt:
+ extract_number_and_incr (&mcnt, &p);
+ printf ("/jump_past_alt/0/%d", mcnt);
+ break;
+
+ case jump:
+ extract_number_and_incr (&mcnt, &p);
+ printf ("/jump/0/%d", mcnt);
+ break;
+
+ case succeed_n:
+ extract_number_and_incr (&mcnt, &p);
+ extract_number_and_incr (&mcnt2, &p);
+ printf ("/succeed_n/0/%d/0/%d", mcnt, mcnt2);
+ break;
+
+ case jump_n:
+ extract_number_and_incr (&mcnt, &p);
+ extract_number_and_incr (&mcnt2, &p);
+ printf ("/jump_n/0/%d/0/%d", mcnt, mcnt2);
+ break;
+
+ case set_number_at:
+ extract_number_and_incr (&mcnt, &p);
+ extract_number_and_incr (&mcnt2, &p);
+ printf ("/set_number_at/0/%d/0/%d", mcnt, mcnt2);
+ break;
+
+ case wordbound:
+ printf ("/wordbound");
+ break;
+
+ case notwordbound:
+ printf ("/notwordbound");
+ break;
+
+ case wordbeg:
+ printf ("/wordbeg");
+ break;
+
+ case wordend:
+ printf ("/wordend");
+
+#ifdef emacs
+ case before_dot:
+ printf ("/before_dot");
+ break;
+
+ case at_dot:
+ printf ("/at_dot");
+ break;
+
+ case after_dot:
+ printf ("/after_dot");
+ break;
+
+ case syntaxspec:
+ printf ("/syntaxspec");
+ mcnt = *p++;
+ printf ("/%d", mcnt);
+ break;
+
+ case notsyntaxspec:
+ printf ("/notsyntaxspec");
+ mcnt = *p++;
+ printf ("/%d", mcnt);
+ break;
+#endif /* emacs */
+
+ case wordchar:
+ printf ("/wordchar");
+ break;
+
+ case notwordchar:
+ printf ("/notwordchar");
+ break;
+
+ case begbuf:
+ printf ("/begbuf");
+ break;
+
+ case endbuf:
+ printf ("/endbuf");
+ break;
+
+ default:
+ printf ("?%d", *(p-1));
+ }
+ }
+ printf ("/\n");
+}
+
+
+void
+print_compiled_pattern (bufp)
+ struct re_pattern_buffer *bufp;
+{
+ unsigned char *buffer = bufp->buffer;
+
+ print_partial_compiled_pattern (buffer, buffer + bufp->used);
+ printf ("%d bytes used/%d bytes allocated.\n", bufp->used, bufp->allocated);
+
+ if (bufp->fastmap_accurate && bufp->fastmap)
+ {
+ printf ("fastmap: ");
+ print_fastmap (bufp->fastmap);
+ }
+
+ printf ("re_nsub: %d\t", bufp->re_nsub);
+ printf ("regs_alloc: %d\t", bufp->regs_allocated);
+ printf ("can_be_null: %d\t", bufp->can_be_null);
+ printf ("newline_anchor: %d\n", bufp->newline_anchor);
+ printf ("no_sub: %d\t", bufp->no_sub);
+ printf ("not_bol: %d\t", bufp->not_bol);
+ printf ("not_eol: %d\t", bufp->not_eol);
+ printf ("syntax: %d\n", bufp->syntax);
+ /* Perhaps we should print the translate table? */
+}
+
+
+void
+print_double_string (where, string1, size1, string2, size2)
+ const char *where;
+ const char *string1;
+ const char *string2;
+ int size1;
+ int size2;
+{
+ unsigned this_char;
+
+ if (where == NULL)
+ printf ("(null)");
+ else
+ {
+ if (FIRST_STRING_P (where))
+ {
+ for (this_char = where - string1; this_char < size1; this_char++)
+ printchar (string1[this_char]);
+
+ where = string2;
+ }
+
+ for (this_char = where - string2; this_char < size2; this_char++)
+ printchar (string2[this_char]);
+ }
+}
+
+#else /* not DEBUG */
+
+#undef assert
+#define assert(e)
+
+#define DEBUG_STATEMENT(e)
+#define DEBUG_PRINT1(x)
+#define DEBUG_PRINT2(x1, x2)
+#define DEBUG_PRINT3(x1, x2, x3)
+#define DEBUG_PRINT4(x1, x2, x3, x4)
+#define DEBUG_PRINT_COMPILED_PATTERN(p, s, e)
+#define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2)
+
+#endif /* not DEBUG */
+
+/* Set by `re_set_syntax' to the current regexp syntax to recognize. Can
+ also be assigned to arbitrarily: each pattern buffer stores its own
+ syntax, so it can be changed between regex compilations. */
+reg_syntax_t re_syntax_options = RE_SYNTAX_EMACS;
+
+
+/* Specify the precise syntax of regexps for compilation. This provides
+ for compatibility for various utilities which historically have
+ different, incompatible syntaxes.
+
+ The argument SYNTAX is a bit mask comprised of the various bits
+ defined in regex.h. We return the old syntax. */
+
+reg_syntax_t
+re_set_syntax (syntax)
+ reg_syntax_t syntax;
+{
+ reg_syntax_t ret = re_syntax_options;
+
+ re_syntax_options = syntax;
+ return ret;
+}
+
+/* This table gives an error message for each of the error codes listed
+ in regex.h. Obviously the order here has to be same as there. */
+
+static const char *re_error_msg[] =
+ { NULL, /* REG_NOERROR */
+ "No match", /* REG_NOMATCH */
+ "Invalid regular expression", /* REG_BADPAT */
+ "Invalid collation character", /* REG_ECOLLATE */
+ "Invalid character class name", /* REG_ECTYPE */
+ "Trailing backslash", /* REG_EESCAPE */
+ "Invalid back reference", /* REG_ESUBREG */
+ "Unmatched [ or [^", /* REG_EBRACK */
+ "Unmatched ( or \\(", /* REG_EPAREN */
+ "Unmatched \\{", /* REG_EBRACE */
+ "Invalid content of \\{\\}", /* REG_BADBR */
+ "Invalid range end", /* REG_ERANGE */
+ "Memory exhausted", /* REG_ESPACE */
+ "Invalid preceding regular expression", /* REG_BADRPT */
+ "Premature end of regular expression", /* REG_EEND */
+ "Regular expression too big", /* REG_ESIZE */
+ "Unmatched ) or \\)", /* REG_ERPAREN */
+ };
+
+/* Subroutine declarations and macros for regex_compile. */
+
+static void store_op1 (), store_op2 ();
+static void insert_op1 (), insert_op2 ();
+static boolean at_begline_loc_p (), at_endline_loc_p ();
+static boolean group_in_compile_stack ();
+static reg_errcode_t compile_range ();
+
+/* Fetch the next character in the uncompiled pattern---translating it
+ if necessary. Also cast from a signed character in the constant
+ string passed to us by the user to an unsigned char that we can use
+ as an array index (in, e.g., `translate'). */
+#define PATFETCH(c) \
+ do {if (p == pend) return REG_EEND; \
+ c = (unsigned char) *p++; \
+ if (translate) c = translate[c]; \
+ } while (0)
+
+/* Fetch the next character in the uncompiled pattern, with no
+ translation. */
+#define PATFETCH_RAW(c) \
+ do {if (p == pend) return REG_EEND; \
+ c = (unsigned char) *p++; \
+ } while (0)
+
+/* Go backwards one character in the pattern. */
+#define PATUNFETCH p--
+
+
+/* If `translate' is non-null, return translate[D], else just D. We
+ cast the subscript to translate because some data is declared as
+ `char *', to avoid warnings when a string constant is passed. But
+ when we use a character as a subscript we must make it unsigned. */
+#define TRANSLATE(d) (translate ? translate[(unsigned char) (d)] : (d))
+
+
+/* Macros for outputting the compiled pattern into `buffer'. */
+
+/* If the buffer isn't allocated when it comes in, use this. */
+#define INIT_BUF_SIZE 32
+
+/* Make sure we have at least N more bytes of space in buffer. */
+#define GET_BUFFER_SPACE(n) \
+ while (b - bufp->buffer + (n) > bufp->allocated) \
+ EXTEND_BUFFER ()
+
+/* Make sure we have one more byte of buffer space and then add C to it. */
+#define BUF_PUSH(c) \
+ do { \
+ GET_BUFFER_SPACE (1); \
+ *b++ = (unsigned char) (c); \
+ } while (0)
+
+
+/* Ensure we have two more bytes of buffer space and then append C1 and C2. */
+#define BUF_PUSH_2(c1, c2) \
+ do { \
+ GET_BUFFER_SPACE (2); \
+ *b++ = (unsigned char) (c1); \
+ *b++ = (unsigned char) (c2); \
+ } while (0)
+
+
+/* As with BUF_PUSH_2, except for three bytes. */
+#define BUF_PUSH_3(c1, c2, c3) \
+ do { \
+ GET_BUFFER_SPACE (3); \
+ *b++ = (unsigned char) (c1); \
+ *b++ = (unsigned char) (c2); \
+ *b++ = (unsigned char) (c3); \
+ } while (0)
+
+
+/* Store a jump with opcode OP at LOC to location TO. We store a
+ relative address offset by the three bytes the jump itself occupies. */
+#define STORE_JUMP(op, loc, to) \
+ store_op1 (op, loc, (to) - (loc) - 3)
+
+/* Likewise, for a two-argument jump. */
+#define STORE_JUMP2(op, loc, to, arg) \
+ store_op2 (op, loc, (to) - (loc) - 3, arg)
+
+/* Like `STORE_JUMP', but for inserting. Assume `b' is the buffer end. */
+#define INSERT_JUMP(op, loc, to) \
+ insert_op1 (op, loc, (to) - (loc) - 3, b)
+
+/* Like `STORE_JUMP2', but for inserting. Assume `b' is the buffer end. */
+#define INSERT_JUMP2(op, loc, to, arg) \
+ insert_op2 (op, loc, (to) - (loc) - 3, arg, b)
+
+
+/* This is not an arbitrary limit: the arguments which represent offsets
+ into the pattern are two bytes long. So if 2^16 bytes turns out to
+ be too small, many things would have to change. */
+#define MAX_BUF_SIZE (1L << 16)
+
+
+/* Extend the buffer by twice its current size via realloc and
+ reset the pointers that pointed into the old block to point to the
+ correct places in the new one. If extending the buffer results in it
+ being larger than MAX_BUF_SIZE, then flag memory exhausted. */
+#define EXTEND_BUFFER() \
+ do { \
+ unsigned char *old_buffer = bufp->buffer; \
+ if (bufp->allocated == MAX_BUF_SIZE) \
+ return REG_ESIZE; \
+ bufp->allocated <<= 1; \
+ if (bufp->allocated > MAX_BUF_SIZE) \
+ bufp->allocated = MAX_BUF_SIZE; \
+ bufp->buffer = (unsigned char *) realloc (bufp->buffer, bufp->allocated);\
+ if (bufp->buffer == NULL) \
+ return REG_ESPACE; \
+ /* If the buffer moved, move all the pointers into it. */ \
+ if (old_buffer != bufp->buffer) \
+ { \
+ b = (b - old_buffer) + bufp->buffer; \
+ begalt = (begalt - old_buffer) + bufp->buffer; \
+ if (fixup_alt_jump) \
+ fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer;\
+ if (laststart) \
+ laststart = (laststart - old_buffer) + bufp->buffer; \
+ if (pending_exact) \
+ pending_exact = (pending_exact - old_buffer) + bufp->buffer; \
+ } \
+ } while (0)
+
+
+/* Since we have one byte reserved for the register number argument to
+ {start,stop}_memory, the maximum number of groups we can report
+ things about is what fits in that byte. */
+#define MAX_REGNUM 255
+
+/* But patterns can have more than `MAX_REGNUM' registers. We just
+ ignore the excess. */
+typedef unsigned regnum_t;
+
+
+/* Macros for the compile stack. */
+
+/* Since offsets can go either forwards or backwards, this type needs to
+ be able to hold values from -(MAX_BUF_SIZE - 1) to MAX_BUF_SIZE - 1. */
+typedef int pattern_offset_t;
+
+typedef struct
+{
+ pattern_offset_t begalt_offset;
+ pattern_offset_t fixup_alt_jump;
+ pattern_offset_t inner_group_offset;
+ pattern_offset_t laststart_offset;
+ regnum_t regnum;
+} compile_stack_elt_t;
+
+
+typedef struct
+{
+ compile_stack_elt_t *stack;
+ unsigned size;
+ unsigned avail; /* Offset of next open position. */
+} compile_stack_type;
+
+
+#define INIT_COMPILE_STACK_SIZE 32
+
+#define COMPILE_STACK_EMPTY (compile_stack.avail == 0)
+#define COMPILE_STACK_FULL (compile_stack.avail == compile_stack.size)
+
+/* The next available element. */
+#define COMPILE_STACK_TOP (compile_stack.stack[compile_stack.avail])
+
+
+/* Set the bit for character C in a list. */
+#define SET_LIST_BIT(c) \
+ (b[((unsigned char) (c)) / BYTEWIDTH] \
+ |= 1 << (((unsigned char) c) % BYTEWIDTH))
+
+
+/* Get the next unsigned number in the uncompiled pattern. */
+#define GET_UNSIGNED_NUMBER(num) \
+ { if (p != pend) \
+ { \
+ PATFETCH (c); \
+ while (ISDIGIT (c)) \
+ { \
+ if (num < 0) \
+ num = 0; \
+ num = num * 10 + c - '0'; \
+ if (p == pend) \
+ break; \
+ PATFETCH (c); \
+ } \
+ } \
+ }
+
+#define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */
+
+#define IS_CHAR_CLASS(string) \
+ (STREQ (string, "alpha") || STREQ (string, "upper") \
+ || STREQ (string, "lower") || STREQ (string, "digit") \
+ || STREQ (string, "alnum") || STREQ (string, "xdigit") \
+ || STREQ (string, "space") || STREQ (string, "print") \
+ || STREQ (string, "punct") || STREQ (string, "graph") \
+ || STREQ (string, "cntrl") || STREQ (string, "blank"))
+
+/* `regex_compile' compiles PATTERN (of length SIZE) according to SYNTAX.
+ Returns one of error codes defined in `regex.h', or zero for success.
+
+ Assumes the `allocated' (and perhaps `buffer') and `translate'
+ fields are set in BUFP on entry.
+
+ If it succeeds, results are put in BUFP (if it returns an error, the
+ contents of BUFP are undefined):
+ `buffer' is the compiled pattern;
+ `syntax' is set to SYNTAX;
+ `used' is set to the length of the compiled pattern;
+ `fastmap_accurate' is zero;
+ `re_nsub' is the number of subexpressions in PATTERN;
+ `not_bol' and `not_eol' are zero;
+
+ The `fastmap' and `newline_anchor' fields are neither
+ examined nor set. */
+
+static reg_errcode_t
+regex_compile (pattern, size, syntax, bufp)
+ const char *pattern;
+ int size;
+ reg_syntax_t syntax;
+ struct re_pattern_buffer *bufp;
+{
+ /* We fetch characters from PATTERN here. Even though PATTERN is
+ `char *' (i.e., signed), we declare these variables as unsigned, so
+ they can be reliably used as array indices. */
+ register unsigned char c, c1;
+
+ /* A random tempory spot in PATTERN. */
+ const char *p1;
+
+ /* Points to the end of the buffer, where we should append. */
+ register unsigned char *b;
+
+ /* Keeps track of unclosed groups. */
+ compile_stack_type compile_stack;
+
+ /* Points to the current (ending) position in the pattern. */
+ const char *p = pattern;
+ const char *pend = pattern + size;
+
+ /* How to translate the characters in the pattern. */
+ char *translate = bufp->translate;
+
+ /* Address of the count-byte of the most recently inserted `exactn'
+ command. This makes it possible to tell if a new exact-match
+ character can be added to that command or if the character requires
+ a new `exactn' command. */
+ unsigned char *pending_exact = 0;
+
+ /* Address of start of the most recently finished expression.
+ This tells, e.g., postfix * where to find the start of its
+ operand. Reset at the beginning of groups and alternatives. */
+ unsigned char *laststart = 0;
+
+ /* Address of beginning of regexp, or inside of last group. */
+ unsigned char *begalt;
+
+ /* Place in the uncompiled pattern (i.e., the {) to
+ which to go back if the interval is invalid. */
+ const char *beg_interval;
+
+ /* Address of the place where a forward jump should go to the end of
+ the containing expression. Each alternative of an `or' -- except the
+ last -- ends with a forward jump of this sort. */
+ unsigned char *fixup_alt_jump = 0;
+
+ /* Counts open-groups as they are encountered. Remembered for the
+ matching close-group on the compile stack, so the same register
+ number is put in the stop_memory as the start_memory. */
+ regnum_t regnum = 0;
+
+#ifdef DEBUG
+ DEBUG_PRINT1 ("\nCompiling pattern: ");
+ if (debug)
+ {
+ unsigned debug_count;
+
+ for (debug_count = 0; debug_count < size; debug_count++)
+ printchar (pattern[debug_count]);
+ putchar ('\n');
+ }
+#endif /* DEBUG */
+
+ /* Initialize the compile stack. */
+ compile_stack.stack = TALLOC (INIT_COMPILE_STACK_SIZE, compile_stack_elt_t);
+ if (compile_stack.stack == NULL)
+ return REG_ESPACE;
+
+ compile_stack.size = INIT_COMPILE_STACK_SIZE;
+ compile_stack.avail = 0;
+
+ /* Initialize the pattern buffer. */
+ bufp->syntax = syntax;
+ bufp->fastmap_accurate = 0;
+ bufp->not_bol = bufp->not_eol = 0;
+
+ /* Set `used' to zero, so that if we return an error, the pattern
+ printer (for debugging) will think there's no pattern. We reset it
+ at the end. */
+ bufp->used = 0;
+
+ /* Always count groups, whether or not bufp->no_sub is set. */
+ bufp->re_nsub = 0;
+
+#if !defined (emacs) && !defined (SYNTAX_TABLE)
+ /* Initialize the syntax table. */
+ init_syntax_once ();
+#endif
+
+ if (bufp->allocated == 0)
+ {
+ if (bufp->buffer)
+ { /* If zero allocated, but buffer is non-null, try to realloc
+ enough space. This loses if buffer's address is bogus, but
+ that is the user's responsibility. */
+ RETALLOC (bufp->buffer, INIT_BUF_SIZE, unsigned char);
+ }
+ else
+ { /* Caller did not allocate a buffer. Do it for them. */
+ bufp->buffer = TALLOC (INIT_BUF_SIZE, unsigned char);
+ }
+ if (!bufp->buffer) return REG_ESPACE;
+
+ bufp->allocated = INIT_BUF_SIZE;
+ }
+
+ begalt = b = bufp->buffer;
+
+ /* Loop through the uncompiled pattern until we're at the end. */
+ while (p != pend)
+ {
+ PATFETCH (c);
+
+ switch (c)
+ {
+ case '^':
+ {
+ if ( /* If at start of pattern, it's an operator. */
+ p == pattern + 1
+ /* If context independent, it's an operator. */
+ || syntax & RE_CONTEXT_INDEP_ANCHORS
+ /* Otherwise, depends on what's come before. */
+ || at_begline_loc_p (pattern, p, syntax))
+ BUF_PUSH (begline);
+ else
+ goto normal_char;
+ }
+ break;
+
+
+ case '$':
+ {
+ if ( /* If at end of pattern, it's an operator. */
+ p == pend
+ /* If context independent, it's an operator. */
+ || syntax & RE_CONTEXT_INDEP_ANCHORS
+ /* Otherwise, depends on what's next. */
+ || at_endline_loc_p (p, pend, syntax))
+ BUF_PUSH (endline);
+ else
+ goto normal_char;
+ }
+ break;
+
+
+ case '+':
+ case '?':
+ if ((syntax & RE_BK_PLUS_QM)
+ || (syntax & RE_LIMITED_OPS))
+ goto normal_char;
+ handle_plus:
+ case '*':
+ /* If there is no previous pattern... */
+ if (!laststart)
+ {
+ if (syntax & RE_CONTEXT_INVALID_OPS)
+ return REG_BADRPT;
+ else if (!(syntax & RE_CONTEXT_INDEP_OPS))
+ goto normal_char;
+ }
+
+ {
+ /* Are we optimizing this jump? */
+ boolean keep_string_p = false;
+
+ /* 1 means zero (many) matches is allowed. */
+ char zero_times_ok = 0, many_times_ok = 0;
+
+ /* If there is a sequence of repetition chars, collapse it
+ down to just one (the right one). We can't combine
+ interval operators with these because of, e.g., `a{2}*',
+ which should only match an even number of `a's. */
+
+ for (;;)
+ {
+ zero_times_ok |= c != '+';
+ many_times_ok |= c != '?';
+
+ if (p == pend)
+ break;
+
+ PATFETCH (c);
+
+ if (c == '*'
+ || (!(syntax & RE_BK_PLUS_QM) && (c == '+' || c == '?')))
+ ;
+
+ else if (syntax & RE_BK_PLUS_QM && c == '\\')
+ {
+ if (p == pend) return REG_EESCAPE;
+
+ PATFETCH (c1);
+ if (!(c1 == '+' || c1 == '?'))
+ {
+ PATUNFETCH;
+ PATUNFETCH;
+ break;
+ }
+
+ c = c1;
+ }
+ else
+ {
+ PATUNFETCH;
+ break;
+ }
+
+ /* If we get here, we found another repeat character. */
+ }
+
+ /* Star, etc. applied to an empty pattern is equivalent
+ to an empty pattern. */
+ if (!laststart)
+ break;
+
+ /* Now we know whether or not zero matches is allowed
+ and also whether or not two or more matches is allowed. */
+ if (many_times_ok)
+ { /* More than one repetition is allowed, so put in at the
+ end a backward relative jump from `b' to before the next
+ jump we're going to put in below (which jumps from
+ laststart to after this jump).
+
+ But if we are at the `*' in the exact sequence `.*\n',
+ insert an unconditional jump backwards to the .,
+ instead of the beginning of the loop. This way we only
+ push a failure point once, instead of every time
+ through the loop. */
+ assert (p - 1 > pattern);
+
+ /* Allocate the space for the jump. */
+ GET_BUFFER_SPACE (3);
+
+ /* We know we are not at the first character of the pattern,
+ because laststart was nonzero. And we've already
+ incremented `p', by the way, to be the character after
+ the `*'. Do we have to do something analogous here
+ for null bytes, because of RE_DOT_NOT_NULL? */
+ if (TRANSLATE (*(p - 2)) == TRANSLATE ('.')
+ && zero_times_ok
+ && p < pend && TRANSLATE (*p) == TRANSLATE ('\n')
+ && !(syntax & RE_DOT_NEWLINE))
+ { /* We have .*\n. */
+ STORE_JUMP (jump, b, laststart);
+ keep_string_p = true;
+ }
+ else
+ /* Anything else. */
+ STORE_JUMP (maybe_pop_jump, b, laststart - 3);
+
+ /* We've added more stuff to the buffer. */
+ b += 3;
+ }
+
+ /* On failure, jump from laststart to b + 3, which will be the
+ end of the buffer after this jump is inserted. */
+ GET_BUFFER_SPACE (3);
+ INSERT_JUMP (keep_string_p ? on_failure_keep_string_jump
+ : on_failure_jump,
+ laststart, b + 3);
+ pending_exact = 0;
+ b += 3;
+
+ if (!zero_times_ok)
+ {
+ /* At least one repetition is required, so insert a
+ `dummy_failure_jump' before the initial
+ `on_failure_jump' instruction of the loop. This
+ effects a skip over that instruction the first time
+ we hit that loop. */
+ GET_BUFFER_SPACE (3);
+ INSERT_JUMP (dummy_failure_jump, laststart, laststart + 6);
+ b += 3;
+ }
+ }
+ break;
+
+
+ case '.':
+ laststart = b;
+ BUF_PUSH (anychar);
+ break;
+
+
+ case '[':
+ {
+ boolean had_char_class = false;
+
+ if (p == pend) return REG_EBRACK;
+
+ /* Ensure that we have enough space to push a charset: the
+ opcode, the length count, and the bitset; 34 bytes in all. */
+ GET_BUFFER_SPACE (34);
+
+ laststart = b;
+
+ /* We test `*p == '^' twice, instead of using an if
+ statement, so we only need one BUF_PUSH. */
+ BUF_PUSH (*p == '^' ? charset_not : charset);
+ if (*p == '^')
+ p++;
+
+ /* Remember the first position in the bracket expression. */
+ p1 = p;
+
+ /* Push the number of bytes in the bitmap. */
+ BUF_PUSH ((1 << BYTEWIDTH) / BYTEWIDTH);
+
+ /* Clear the whole map. */
+ bzero (b, (1 << BYTEWIDTH) / BYTEWIDTH);
+
+ /* charset_not matches newline according to a syntax bit. */
+ if ((re_opcode_t) b[-2] == charset_not
+ && (syntax & RE_HAT_LISTS_NOT_NEWLINE))
+ SET_LIST_BIT ('\n');
+
+ /* Read in characters and ranges, setting map bits. */
+ for (;;)
+ {
+ if (p == pend) return REG_EBRACK;
+
+ PATFETCH (c);
+
+ /* \ might escape characters inside [...] and [^...]. */
+ if ((syntax & RE_BACKSLASH_ESCAPE_IN_LISTS) && c == '\\')
+ {
+ if (p == pend) return REG_EESCAPE;
+
+ PATFETCH (c1);
+ SET_LIST_BIT (c1);
+ continue;
+ }
+
+ /* Could be the end of the bracket expression. If it's
+ not (i.e., when the bracket expression is `[]' so
+ far), the ']' character bit gets set way below. */
+ if (c == ']' && p != p1 + 1)
+ break;
+
+ /* Look ahead to see if it's a range when the last thing
+ was a character class. */
+ if (had_char_class && c == '-' && *p != ']')
+ return REG_ERANGE;
+
+ /* Look ahead to see if it's a range when the last thing
+ was a character: if this is a hyphen not at the
+ beginning or the end of a list, then it's the range
+ operator. */
+ if (c == '-'
+ && !(p - 2 >= pattern && p[-2] == '[')
+ && !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^')
+ && *p != ']')
+ {
+ reg_errcode_t ret
+ = compile_range (&p, pend, translate, syntax, b);
+ if (ret != REG_NOERROR) return ret;
+ }
+
+ else if (p[0] == '-' && p[1] != ']')
+ { /* This handles ranges made up of characters only. */
+ reg_errcode_t ret;
+
+ /* Move past the `-'. */
+ PATFETCH (c1);
+
+ ret = compile_range (&p, pend, translate, syntax, b);
+ if (ret != REG_NOERROR) return ret;
+ }
+
+ /* See if we're at the beginning of a possible character
+ class. */
+
+ else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == ':')
+ { /* Leave room for the null. */
+ char str[CHAR_CLASS_MAX_LENGTH + 1];
+
+ PATFETCH (c);
+ c1 = 0;
+
+ /* If pattern is `[[:'. */
+ if (p == pend) return REG_EBRACK;
+
+ for (;;)
+ {
+ PATFETCH (c);
+ if (c == ':' || c == ']' || p == pend
+ || c1 == CHAR_CLASS_MAX_LENGTH)
+ break;
+ str[c1++] = c;
+ }
+ str[c1] = '\0';
+
+ /* If isn't a word bracketed by `[:' and:`]':
+ undo the ending character, the letters, and leave
+ the leading `:' and `[' (but set bits for them). */
+ if (c == ':' && *p == ']')
+ {
+ int ch;
+ boolean is_alnum = STREQ (str, "alnum");
+ boolean is_alpha = STREQ (str, "alpha");
+ boolean is_blank = STREQ (str, "blank");
+ boolean is_cntrl = STREQ (str, "cntrl");
+ boolean is_digit = STREQ (str, "digit");
+ boolean is_graph = STREQ (str, "graph");
+ boolean is_lower = STREQ (str, "lower");
+ boolean is_print = STREQ (str, "print");
+ boolean is_punct = STREQ (str, "punct");
+ boolean is_space = STREQ (str, "space");
+ boolean is_upper = STREQ (str, "upper");
+ boolean is_xdigit = STREQ (str, "xdigit");
+
+ if (!IS_CHAR_CLASS (str)) return REG_ECTYPE;
+
+ /* Throw away the ] at the end of the character
+ class. */
+ PATFETCH (c);
+
+ if (p == pend) return REG_EBRACK;
+
+ for (ch = 0; ch < 1 << BYTEWIDTH; ch++)
+ {
+ if ( (is_alnum && ISALNUM (ch))
+ || (is_alpha && ISALPHA (ch))
+ || (is_blank && ISBLANK (ch))
+ || (is_cntrl && ISCNTRL (ch))
+ || (is_digit && ISDIGIT (ch))
+ || (is_graph && ISGRAPH (ch))
+ || (is_lower && ISLOWER (ch))
+ || (is_print && ISPRINT (ch))
+ || (is_punct && ISPUNCT (ch))
+ || (is_space && ISSPACE (ch))
+ || (is_upper && ISUPPER (ch))
+ || (is_xdigit && ISXDIGIT (ch)))
+ SET_LIST_BIT (ch);
+ }
+ had_char_class = true;
+ }
+ else
+ {
+ c1++;
+ while (c1--)
+ PATUNFETCH;
+ SET_LIST_BIT ('[');
+ SET_LIST_BIT (':');
+ had_char_class = false;
+ }
+ }
+ else
+ {
+ had_char_class = false;
+ SET_LIST_BIT (c);
+ }
+ }
+
+ /* Discard any (non)matching list bytes that are all 0 at the
+ end of the map. Decrease the map-length byte too. */
+ while ((int) b[-1] > 0 && b[b[-1] - 1] == 0)
+ b[-1]--;
+ b += b[-1];
+ }
+ break;
+
+
+ case '(':
+ if (syntax & RE_NO_BK_PARENS)
+ goto handle_open;
+ else
+ goto normal_char;
+
+
+ case ')':
+ if (syntax & RE_NO_BK_PARENS)
+ goto handle_close;
+ else
+ goto normal_char;
+
+
+ case '\n':
+ if (syntax & RE_NEWLINE_ALT)
+ goto handle_alt;
+ else
+ goto normal_char;
+
+
+ case '|':
+ if (syntax & RE_NO_BK_VBAR)
+ goto handle_alt;
+ else
+ goto normal_char;
+
+
+ case '{':
+ if (syntax & RE_INTERVALS && syntax & RE_NO_BK_BRACES)
+ goto handle_interval;
+ else
+ goto normal_char;
+
+
+ case '\\':
+ if (p == pend) return REG_EESCAPE;
+
+ /* Do not translate the character after the \, so that we can
+ distinguish, e.g., \B from \b, even if we normally would
+ translate, e.g., B to b. */
+ PATFETCH_RAW (c);
+
+ switch (c)
+ {
+ case '(':
+ if (syntax & RE_NO_BK_PARENS)
+ goto normal_backslash;
+
+ handle_open:
+ bufp->re_nsub++;
+ regnum++;
+
+ if (COMPILE_STACK_FULL)
+ {
+ RETALLOC (compile_stack.stack, compile_stack.size << 1,
+ compile_stack_elt_t);
+ if (compile_stack.stack == NULL) return REG_ESPACE;
+
+ compile_stack.size <<= 1;
+ }
+
+ /* These are the values to restore when we hit end of this
+ group. They are all relative offsets, so that if the
+ whole pattern moves because of realloc, they will still
+ be valid. */
+ COMPILE_STACK_TOP.begalt_offset = begalt - bufp->buffer;
+ COMPILE_STACK_TOP.fixup_alt_jump
+ = fixup_alt_jump ? fixup_alt_jump - bufp->buffer + 1 : 0;
+ COMPILE_STACK_TOP.laststart_offset = b - bufp->buffer;
+ COMPILE_STACK_TOP.regnum = regnum;
+
+ /* We will eventually replace the 0 with the number of
+ groups inner to this one. But do not push a
+ start_memory for groups beyond the last one we can
+ represent in the compiled pattern. */
+ if (regnum <= MAX_REGNUM)
+ {
+ COMPILE_STACK_TOP.inner_group_offset = b - bufp->buffer + 2;
+ BUF_PUSH_3 (start_memory, regnum, 0);
+ }
+
+ compile_stack.avail++;
+
+ fixup_alt_jump = 0;
+ laststart = 0;
+ begalt = b;
+ /* If we've reached MAX_REGNUM groups, then this open
+ won't actually generate any code, so we'll have to
+ clear pending_exact explicitly. */
+ pending_exact = 0;
+ break;
+
+
+ case ')':
+ if (syntax & RE_NO_BK_PARENS) goto normal_backslash;
+
+ if (COMPILE_STACK_EMPTY)
+ {
+ if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
+ goto normal_backslash;
+ else
+ return REG_ERPAREN;
+ }
+
+ handle_close:
+ if (fixup_alt_jump)
+ { /* Push a dummy failure point at the end of the
+ alternative for a possible future
+ `pop_failure_jump' to pop. See comments at
+ `push_dummy_failure' in `re_match_2'. */
+ BUF_PUSH (push_dummy_failure);
+
+ /* We allocated space for this jump when we assigned
+ to `fixup_alt_jump', in the `handle_alt' case below. */
+ STORE_JUMP (jump_past_alt, fixup_alt_jump, b - 1);
+ }
+
+ /* See similar code for backslashed left paren above. */
+ if (COMPILE_STACK_EMPTY)
+ {
+ if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
+ goto normal_char;
+ else
+ return REG_ERPAREN;
+ }
+
+ /* Since we just checked for an empty stack above, this
+ ``can't happen''. */
+ assert (compile_stack.avail != 0);
+ {
+ /* We don't just want to restore into `regnum', because
+ later groups should continue to be numbered higher,
+ as in `(ab)c(de)' -- the second group is #2. */
+ regnum_t this_group_regnum;
+
+ compile_stack.avail--;
+ begalt = bufp->buffer + COMPILE_STACK_TOP.begalt_offset;
+ fixup_alt_jump
+ = COMPILE_STACK_TOP.fixup_alt_jump
+ ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1
+ : 0;
+ laststart = bufp->buffer + COMPILE_STACK_TOP.laststart_offset;
+ this_group_regnum = COMPILE_STACK_TOP.regnum;
+ /* If we've reached MAX_REGNUM groups, then this open
+ won't actually generate any code, so we'll have to
+ clear pending_exact explicitly. */
+ pending_exact = 0;
+
+ /* We're at the end of the group, so now we know how many
+ groups were inside this one. */
+ if (this_group_regnum <= MAX_REGNUM)
+ {
+ unsigned char *inner_group_loc
+ = bufp->buffer + COMPILE_STACK_TOP.inner_group_offset;
+
+ *inner_group_loc = regnum - this_group_regnum;
+ BUF_PUSH_3 (stop_memory, this_group_regnum,
+ regnum - this_group_regnum);
+ }
+ }
+ break;
+
+
+ case '|': /* `\|'. */
+ if (syntax & RE_LIMITED_OPS || syntax & RE_NO_BK_VBAR)
+ goto normal_backslash;
+ handle_alt:
+ if (syntax & RE_LIMITED_OPS)
+ goto normal_char;
+
+ /* Insert before the previous alternative a jump which
+ jumps to this alternative if the former fails. */
+ GET_BUFFER_SPACE (3);
+ INSERT_JUMP (on_failure_jump, begalt, b + 6);
+ pending_exact = 0;
+ b += 3;
+
+ /* The alternative before this one has a jump after it
+ which gets executed if it gets matched. Adjust that
+ jump so it will jump to this alternative's analogous
+ jump (put in below, which in turn will jump to the next
+ (if any) alternative's such jump, etc.). The last such
+ jump jumps to the correct final destination. A picture:
+ _____ _____
+ | | | |
+ | v | v
+ a | b | c
+
+ If we are at `b', then fixup_alt_jump right now points to a
+ three-byte space after `a'. We'll put in the jump, set
+ fixup_alt_jump to right after `b', and leave behind three
+ bytes which we'll fill in when we get to after `c'. */
+
+ if (fixup_alt_jump)
+ STORE_JUMP (jump_past_alt, fixup_alt_jump, b);
+
+ /* Mark and leave space for a jump after this alternative,
+ to be filled in later either by next alternative or
+ when know we're at the end of a series of alternatives. */
+ fixup_alt_jump = b;
+ GET_BUFFER_SPACE (3);
+ b += 3;
+
+ laststart = 0;
+ begalt = b;
+ break;
+
+
+ case '{':
+ /* If \{ is a literal. */
+ if (!(syntax & RE_INTERVALS)
+ /* If we're at `\{' and it's not the open-interval
+ operator. */
+ || ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
+ || (p - 2 == pattern && p == pend))
+ goto normal_backslash;
+
+ handle_interval:
+ {
+ /* If got here, then the syntax allows intervals. */
+
+ /* At least (most) this many matches must be made. */
+ int lower_bound = -1, upper_bound = -1;
+
+ beg_interval = p - 1;
+
+ if (p == pend)
+ {
+ if (syntax & RE_NO_BK_BRACES)
+ goto unfetch_interval;
+ else
+ return REG_EBRACE;
+ }
+
+ GET_UNSIGNED_NUMBER (lower_bound);
+
+ if (c == ',')
+ {
+ GET_UNSIGNED_NUMBER (upper_bound);
+ if (upper_bound < 0) upper_bound = RE_DUP_MAX;
+ }
+ else
+ /* Interval such as `{1}' => match exactly once. */
+ upper_bound = lower_bound;
+
+ if (lower_bound < 0 || upper_bound > RE_DUP_MAX
+ || lower_bound > upper_bound)
+ {
+ if (syntax & RE_NO_BK_BRACES)
+ goto unfetch_interval;
+ else
+ return REG_BADBR;
+ }
+
+ if (!(syntax & RE_NO_BK_BRACES))
+ {
+ if (c != '\\') return REG_EBRACE;
+
+ PATFETCH (c);
+ }
+
+ if (c != '}')
+ {
+ if (syntax & RE_NO_BK_BRACES)
+ goto unfetch_interval;
+ else
+ return REG_BADBR;
+ }
+
+ /* We just parsed a valid interval. */
+
+ /* If it's invalid to have no preceding re. */
+ if (!laststart)
+ {
+ if (syntax & RE_CONTEXT_INVALID_OPS)
+ return REG_BADRPT;
+ else if (syntax & RE_CONTEXT_INDEP_OPS)
+ laststart = b;
+ else
+ goto unfetch_interval;
+ }
+
+ /* If the upper bound is zero, don't want to succeed at
+ all; jump from `laststart' to `b + 3', which will be
+ the end of the buffer after we insert the jump. */
+ if (upper_bound == 0)
+ {
+ GET_BUFFER_SPACE (3);
+ INSERT_JUMP (jump, laststart, b + 3);
+ b += 3;
+ }
+
+ /* Otherwise, we have a nontrivial interval. When
+ we're all done, the pattern will look like:
+ set_number_at <jump count> <upper bound>
+ set_number_at <succeed_n count> <lower bound>
+ succeed_n <after jump addr> <succed_n count>
+ <body of loop>
+ jump_n <succeed_n addr> <jump count>
+ (The upper bound and `jump_n' are omitted if
+ `upper_bound' is 1, though.) */
+ else
+ { /* If the upper bound is > 1, we need to insert
+ more at the end of the loop. */
+ unsigned nbytes = 10 + (upper_bound > 1) * 10;
+
+ GET_BUFFER_SPACE (nbytes);
+
+ /* Initialize lower bound of the `succeed_n', even
+ though it will be set during matching by its
+ attendant `set_number_at' (inserted next),
+ because `re_compile_fastmap' needs to know.
+ Jump to the `jump_n' we might insert below. */
+ INSERT_JUMP2 (succeed_n, laststart,
+ b + 5 + (upper_bound > 1) * 5,
+ lower_bound);
+ b += 5;
+
+ /* Code to initialize the lower bound. Insert
+ before the `succeed_n'. The `5' is the last two
+ bytes of this `set_number_at', plus 3 bytes of
+ the following `succeed_n'. */
+ insert_op2 (set_number_at, laststart, 5, lower_bound, b);
+ b += 5;
+
+ if (upper_bound > 1)
+ { /* More than one repetition is allowed, so
+ append a backward jump to the `succeed_n'
+ that starts this interval.
+
+ When we've reached this during matching,
+ we'll have matched the interval once, so
+ jump back only `upper_bound - 1' times. */
+ STORE_JUMP2 (jump_n, b, laststart + 5,
+ upper_bound - 1);
+ b += 5;
+
+ /* The location we want to set is the second
+ parameter of the `jump_n'; that is `b-2' as
+ an absolute address. `laststart' will be
+ the `set_number_at' we're about to insert;
+ `laststart+3' the number to set, the source
+ for the relative address. But we are
+ inserting into the middle of the pattern --
+ so everything is getting moved up by 5.
+ Conclusion: (b - 2) - (laststart + 3) + 5,
+ i.e., b - laststart.
+
+ We insert this at the beginning of the loop
+ so that if we fail during matching, we'll
+ reinitialize the bounds. */
+ insert_op2 (set_number_at, laststart, b - laststart,
+ upper_bound - 1, b);
+ b += 5;
+ }
+ }
+ pending_exact = 0;
+ beg_interval = NULL;
+ }
+ break;
+
+ unfetch_interval:
+ /* If an invalid interval, match the characters as literals. */
+ assert (beg_interval);
+ p = beg_interval;
+ beg_interval = NULL;
+
+ /* normal_char and normal_backslash need `c'. */
+ PATFETCH (c);
+
+ if (!(syntax & RE_NO_BK_BRACES))
+ {
+ if (p > pattern && p[-1] == '\\')
+ goto normal_backslash;
+ }
+ goto normal_char;
+
+#ifdef emacs
+ /* There is no way to specify the before_dot and after_dot
+ operators. rms says this is ok. --karl */
+ case '=':
+ BUF_PUSH (at_dot);
+ break;
+
+ case 's':
+ laststart = b;
+ PATFETCH (c);
+ BUF_PUSH_2 (syntaxspec, syntax_spec_code[c]);
+ break;
+
+ case 'S':
+ laststart = b;
+ PATFETCH (c);
+ BUF_PUSH_2 (notsyntaxspec, syntax_spec_code[c]);
+ break;
+#endif /* emacs */
+
+
+ case 'w':
+ laststart = b;
+ BUF_PUSH (wordchar);
+ break;
+
+
+ case 'W':
+ laststart = b;
+ BUF_PUSH (notwordchar);
+ break;
+
+
+ case '<':
+ BUF_PUSH (wordbeg);
+ break;
+
+ case '>':
+ BUF_PUSH (wordend);
+ break;
+
+ case 'b':
+ BUF_PUSH (wordbound);
+ break;
+
+ case 'B':
+ BUF_PUSH (notwordbound);
+ break;
+
+ case '`':
+ BUF_PUSH (begbuf);
+ break;
+
+ case '\'':
+ BUF_PUSH (endbuf);
+ break;
+
+ case '1': case '2': case '3': case '4': case '5':
+ case '6': case '7': case '8': case '9':
+ if (syntax & RE_NO_BK_REFS)
+ goto normal_char;
+
+ c1 = c - '0';
+
+ if (c1 > regnum)
+ return REG_ESUBREG;
+
+ /* Can't back reference to a subexpression if inside of it. */
+ if (group_in_compile_stack (compile_stack, c1))
+ goto normal_char;
+
+ laststart = b;
+ BUF_PUSH_2 (duplicate, c1);
+ break;
+
+
+ case '+':
+ case '?':
+ if (syntax & RE_BK_PLUS_QM)
+ goto handle_plus;
+ else
+ goto normal_backslash;
+
+ default:
+ normal_backslash:
+ /* You might think it would be useful for \ to mean
+ not to translate; but if we don't translate it
+ it will never match anything. */
+ c = TRANSLATE (c);
+ goto normal_char;
+ }
+ break;
+
+
+ default:
+ /* Expects the character in `c'. */
+ normal_char:
+ /* If no exactn currently being built. */
+ if (!pending_exact
+
+ /* If last exactn not at current position. */
+ || pending_exact + *pending_exact + 1 != b
+
+ /* We have only one byte following the exactn for the count. */
+ || *pending_exact == (1 << BYTEWIDTH) - 1
+
+ /* If followed by a repetition operator. */
+ || *p == '*' || *p == '^'
+ || ((syntax & RE_BK_PLUS_QM)
+ ? *p == '\\' && (p[1] == '+' || p[1] == '?')
+ : (*p == '+' || *p == '?'))
+ || ((syntax & RE_INTERVALS)
+ && ((syntax & RE_NO_BK_BRACES)
+ ? *p == '{'
+ : (p[0] == '\\' && p[1] == '{'))))
+ {
+ /* Start building a new exactn. */
+
+ laststart = b;
+
+ BUF_PUSH_2 (exactn, 0);
+ pending_exact = b - 1;
+ }
+
+ BUF_PUSH (c);
+ (*pending_exact)++;
+ break;
+ } /* switch (c) */
+ } /* while p != pend */
+
+
+ /* Through the pattern now. */
+
+ if (fixup_alt_jump)
+ STORE_JUMP (jump_past_alt, fixup_alt_jump, b);
+
+ if (!COMPILE_STACK_EMPTY)
+ return REG_EPAREN;
+
+ free (compile_stack.stack);
+
+ /* We have succeeded; set the length of the buffer. */
+ bufp->used = b - bufp->buffer;
+
+#ifdef DEBUG
+ if (debug)
+ {
+ DEBUG_PRINT1 ("\nCompiled pattern: ");
+ print_compiled_pattern (bufp);
+ }
+#endif /* DEBUG */
+
+ return REG_NOERROR;
+} /* regex_compile */
+
+/* Subroutines for `regex_compile'. */
+
+/* Store OP at LOC followed by two-byte integer parameter ARG. */
+
+static void
+store_op1 (op, loc, arg)
+ re_opcode_t op;
+ unsigned char *loc;
+ int arg;
+{
+ *loc = (unsigned char) op;
+ STORE_NUMBER (loc + 1, arg);
+}
+
+
+/* Like `store_op1', but for two two-byte parameters ARG1 and ARG2. */
+
+static void
+store_op2 (op, loc, arg1, arg2)
+ re_opcode_t op;
+ unsigned char *loc;
+ int arg1, arg2;
+{
+ *loc = (unsigned char) op;
+ STORE_NUMBER (loc + 1, arg1);
+ STORE_NUMBER (loc + 3, arg2);
+}
+
+
+/* Copy the bytes from LOC to END to open up three bytes of space at LOC
+ for OP followed by two-byte integer parameter ARG. */
+
+static void
+insert_op1 (op, loc, arg, end)
+ re_opcode_t op;
+ unsigned char *loc;
+ int arg;
+ unsigned char *end;
+{
+ register unsigned char *pfrom = end;
+ register unsigned char *pto = end + 3;
+
+ while (pfrom != loc)
+ *--pto = *--pfrom;
+
+ store_op1 (op, loc, arg);
+}
+
+
+/* Like `insert_op1', but for two two-byte parameters ARG1 and ARG2. */
+
+static void
+insert_op2 (op, loc, arg1, arg2, end)
+ re_opcode_t op;
+ unsigned char *loc;
+ int arg1, arg2;
+ unsigned char *end;
+{
+ register unsigned char *pfrom = end;
+ register unsigned char *pto = end + 5;
+
+ while (pfrom != loc)
+ *--pto = *--pfrom;
+
+ store_op2 (op, loc, arg1, arg2);
+}
+
+
+/* P points to just after a ^ in PATTERN. Return true if that ^ comes
+ after an alternative or a begin-subexpression. We assume there is at
+ least one character before the ^. */
+
+static boolean
+at_begline_loc_p (pattern, p, syntax)
+ const char *pattern, *p;
+ reg_syntax_t syntax;
+{
+ const char *prev = p - 2;
+ boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\';
+
+ return
+ /* After a subexpression? */
+ (*prev == '(' && (syntax & RE_NO_BK_PARENS || prev_prev_backslash))
+ /* After an alternative? */
+ || (*prev == '|' && (syntax & RE_NO_BK_VBAR || prev_prev_backslash));
+}
+
+
+/* The dual of at_begline_loc_p. This one is for $. We assume there is
+ at least one character after the $, i.e., `P < PEND'. */
+
+static boolean
+at_endline_loc_p (p, pend, syntax)
+ const char *p, *pend;
+ int syntax;
+{
+ const char *next = p;
+ boolean next_backslash = *next == '\\';
+ const char *next_next = p + 1 < pend ? p + 1 : NULL;
+
+ return
+ /* Before a subexpression? */
+ (syntax & RE_NO_BK_PARENS ? *next == ')'
+ : next_backslash && next_next && *next_next == ')')
+ /* Before an alternative? */
+ || (syntax & RE_NO_BK_VBAR ? *next == '|'
+ : next_backslash && next_next && *next_next == '|');
+}
+
+
+/* Returns true if REGNUM is in one of COMPILE_STACK's elements and
+ false if it's not. */
+
+static boolean
+group_in_compile_stack (compile_stack, regnum)
+ compile_stack_type compile_stack;
+ regnum_t regnum;
+{
+ int this_element;
+
+ for (this_element = compile_stack.avail - 1;
+ this_element >= 0;
+ this_element--)
+ if (compile_stack.stack[this_element].regnum == regnum)
+ return true;
+
+ return false;
+}
+
+
+/* Read the ending character of a range (in a bracket expression) from the
+ uncompiled pattern *P_PTR (which ends at PEND). We assume the
+ starting character is in `P[-2]'. (`P[-1]' is the character `-'.)
+ Then we set the translation of all bits between the starting and
+ ending characters (inclusive) in the compiled pattern B.
+
+ Return an error code.
+
+ We use these short variable names so we can use the same macros as
+ `regex_compile' itself. */
+
+static reg_errcode_t
+compile_range (p_ptr, pend, translate, syntax, b)
+ const char **p_ptr, *pend;
+ char *translate;
+ reg_syntax_t syntax;
+ unsigned char *b;
+{
+ unsigned this_char;
+
+ const char *p = *p_ptr;
+ int range_start, range_end;
+
+ if (p == pend)
+ return REG_ERANGE;
+
+ /* Even though the pattern is a signed `char *', we need to fetch
+ with unsigned char *'s; if the high bit of the pattern character
+ is set, the range endpoints will be negative if we fetch using a
+ signed char *.
+
+ We also want to fetch the endpoints without translating them; the
+ appropriate translation is done in the bit-setting loop below. */
+ range_start = ((unsigned char *) p)[-2];
+ range_end = ((unsigned char *) p)[0];
+
+ /* Have to increment the pointer into the pattern string, so the
+ caller isn't still at the ending character. */
+ (*p_ptr)++;
+
+ /* If the start is after the end, the range is empty. */
+ if (range_start > range_end)
+ return syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR;
+
+ /* Here we see why `this_char' has to be larger than an `unsigned
+ char' -- the range is inclusive, so if `range_end' == 0xff
+ (assuming 8-bit characters), we would otherwise go into an infinite
+ loop, since all characters <= 0xff. */
+ for (this_char = range_start; this_char <= range_end; this_char++)
+ {
+ SET_LIST_BIT (TRANSLATE (this_char));
+ }
+
+ return REG_NOERROR;
+}
+
+/* Failure stack declarations and macros; both re_compile_fastmap and
+ re_match_2 use a failure stack. These have to be macros because of
+ REGEX_ALLOCATE. */
+
+
+/* Number of failure points for which to initially allocate space
+ when matching. If this number is exceeded, we allocate more
+ space, so it is not a hard limit. */
+#ifndef INIT_FAILURE_ALLOC
+#define INIT_FAILURE_ALLOC 5
+#endif
+
+/* Roughly the maximum number of failure points on the stack. Would be
+ exactly that if always used MAX_FAILURE_SPACE each time we failed.
+ This is a variable only so users of regex can assign to it; we never
+ change it ourselves. */
+int re_max_failures = 2000;
+
+typedef const unsigned char *fail_stack_elt_t;
+
+typedef struct
+{
+ fail_stack_elt_t *stack;
+ unsigned size;
+ unsigned avail; /* Offset of next open position. */
+} fail_stack_type;
+
+#define FAIL_STACK_EMPTY() (fail_stack.avail == 0)
+#define FAIL_STACK_PTR_EMPTY() (fail_stack_ptr->avail == 0)
+#define FAIL_STACK_FULL() (fail_stack.avail == fail_stack.size)
+#define FAIL_STACK_TOP() (fail_stack.stack[fail_stack.avail])
+
+
+/* Initialize `fail_stack'. Do `return -2' if the alloc fails. */
+
+#define INIT_FAIL_STACK() \
+ do { \
+ fail_stack.stack = (fail_stack_elt_t *) \
+ REGEX_ALLOCATE (INIT_FAILURE_ALLOC * sizeof (fail_stack_elt_t)); \
+ \
+ if (fail_stack.stack == NULL) \
+ return -2; \
+ \
+ fail_stack.size = INIT_FAILURE_ALLOC; \
+ fail_stack.avail = 0; \
+ } while (0)
+
+
+/* Double the size of FAIL_STACK, up to approximately `re_max_failures' items.
+
+ Return 1 if succeeds, and 0 if either ran out of memory
+ allocating space for it or it was already too large.
+
+ REGEX_REALLOCATE requires `destination' be declared. */
+
+#define DOUBLE_FAIL_STACK(fail_stack) \
+ ((fail_stack).size > re_max_failures * MAX_FAILURE_ITEMS \
+ ? 0 \
+ : ((fail_stack).stack = (fail_stack_elt_t *) \
+ REGEX_REALLOCATE ((fail_stack).stack, \
+ (fail_stack).size * sizeof (fail_stack_elt_t), \
+ ((fail_stack).size << 1) * sizeof (fail_stack_elt_t)), \
+ \
+ (fail_stack).stack == NULL \
+ ? 0 \
+ : ((fail_stack).size <<= 1, \
+ 1)))
+
+
+/* Push PATTERN_OP on FAIL_STACK.
+
+ Return 1 if was able to do so and 0 if ran out of memory allocating
+ space to do so. */
+#define PUSH_PATTERN_OP(pattern_op, fail_stack) \
+ ((FAIL_STACK_FULL () \
+ && !DOUBLE_FAIL_STACK (fail_stack)) \
+ ? 0 \
+ : ((fail_stack).stack[(fail_stack).avail++] = pattern_op, \
+ 1))
+
+/* This pushes an item onto the failure stack. Must be a four-byte
+ value. Assumes the variable `fail_stack'. Probably should only
+ be called from within `PUSH_FAILURE_POINT'. */
+#define PUSH_FAILURE_ITEM(item) \
+ fail_stack.stack[fail_stack.avail++] = (fail_stack_elt_t) item
+
+/* The complement operation. Assumes `fail_stack' is nonempty. */
+#define POP_FAILURE_ITEM() fail_stack.stack[--fail_stack.avail]
+
+/* Used to omit pushing failure point id's when we're not debugging. */
+#ifdef DEBUG
+#define DEBUG_PUSH PUSH_FAILURE_ITEM
+#define DEBUG_POP(item_addr) *(item_addr) = POP_FAILURE_ITEM ()
+#else
+#define DEBUG_PUSH(item)
+#define DEBUG_POP(item_addr)
+#endif
+
+
+/* Push the information about the state we will need
+ if we ever fail back to it.
+
+ Requires variables fail_stack, regstart, regend, reg_info, and
+ num_regs be declared. DOUBLE_FAIL_STACK requires `destination' be
+ declared.
+
+ Does `return FAILURE_CODE' if runs out of memory. */
+
+#define PUSH_FAILURE_POINT(pattern_place, string_place, failure_code) \
+ do { \
+ char *destination; \
+ /* Must be int, so when we don't save any registers, the arithmetic \
+ of 0 + -1 isn't done as unsigned. */ \
+ int this_reg; \
+ \
+ DEBUG_STATEMENT (failure_id++); \
+ DEBUG_STATEMENT (nfailure_points_pushed++); \
+ DEBUG_PRINT2 ("\nPUSH_FAILURE_POINT #%u:\n", failure_id); \
+ DEBUG_PRINT2 (" Before push, next avail: %d\n", (fail_stack).avail);\
+ DEBUG_PRINT2 (" size: %d\n", (fail_stack).size);\
+ \
+ DEBUG_PRINT2 (" slots needed: %d\n", NUM_FAILURE_ITEMS); \
+ DEBUG_PRINT2 (" available: %d\n", REMAINING_AVAIL_SLOTS); \
+ \
+ /* Ensure we have enough space allocated for what we will push. */ \
+ while (REMAINING_AVAIL_SLOTS < NUM_FAILURE_ITEMS) \
+ { \
+ if (!DOUBLE_FAIL_STACK (fail_stack)) \
+ return failure_code; \
+ \
+ DEBUG_PRINT2 ("\n Doubled stack; size now: %d\n", \
+ (fail_stack).size); \
+ DEBUG_PRINT2 (" slots available: %d\n", REMAINING_AVAIL_SLOTS);\
+ } \
+ \
+ /* Push the info, starting with the registers. */ \
+ DEBUG_PRINT1 ("\n"); \
+ \
+ for (this_reg = lowest_active_reg; this_reg <= highest_active_reg; \
+ this_reg++) \
+ { \
+ DEBUG_PRINT2 (" Pushing reg: %d\n", this_reg); \
+ DEBUG_STATEMENT (num_regs_pushed++); \
+ \
+ DEBUG_PRINT2 (" start: 0x%x\n", regstart[this_reg]); \
+ PUSH_FAILURE_ITEM (regstart[this_reg]); \
+ \
+ DEBUG_PRINT2 (" end: 0x%x\n", regend[this_reg]); \
+ PUSH_FAILURE_ITEM (regend[this_reg]); \
+ \
+ DEBUG_PRINT2 (" info: 0x%x\n ", reg_info[this_reg]); \
+ DEBUG_PRINT2 (" match_null=%d", \
+ REG_MATCH_NULL_STRING_P (reg_info[this_reg])); \
+ DEBUG_PRINT2 (" active=%d", IS_ACTIVE (reg_info[this_reg])); \
+ DEBUG_PRINT2 (" matched_something=%d", \
+ MATCHED_SOMETHING (reg_info[this_reg])); \
+ DEBUG_PRINT2 (" ever_matched=%d", \
+ EVER_MATCHED_SOMETHING (reg_info[this_reg])); \
+ DEBUG_PRINT1 ("\n"); \
+ PUSH_FAILURE_ITEM (reg_info[this_reg].word); \
+ } \
+ \
+ DEBUG_PRINT2 (" Pushing low active reg: %d\n", lowest_active_reg);\
+ PUSH_FAILURE_ITEM (lowest_active_reg); \
+ \
+ DEBUG_PRINT2 (" Pushing high active reg: %d\n", highest_active_reg);\
+ PUSH_FAILURE_ITEM (highest_active_reg); \
+ \
+ DEBUG_PRINT2 (" Pushing pattern 0x%x: ", pattern_place); \
+ DEBUG_PRINT_COMPILED_PATTERN (bufp, pattern_place, pend); \
+ PUSH_FAILURE_ITEM (pattern_place); \
+ \
+ DEBUG_PRINT2 (" Pushing string 0x%x: `", string_place); \
+ DEBUG_PRINT_DOUBLE_STRING (string_place, string1, size1, string2, \
+ size2); \
+ DEBUG_PRINT1 ("'\n"); \
+ PUSH_FAILURE_ITEM (string_place); \
+ \
+ DEBUG_PRINT2 (" Pushing failure id: %u\n", failure_id); \
+ DEBUG_PUSH (failure_id); \
+ } while (0)
+
+/* This is the number of items that are pushed and popped on the stack
+ for each register. */
+#define NUM_REG_ITEMS 3
+
+/* Individual items aside from the registers. */
+#ifdef DEBUG
+#define NUM_NONREG_ITEMS 5 /* Includes failure point id. */
+#else
+#define NUM_NONREG_ITEMS 4
+#endif
+
+/* We push at most this many items on the stack. */
+#define MAX_FAILURE_ITEMS ((num_regs - 1) * NUM_REG_ITEMS + NUM_NONREG_ITEMS)
+
+/* We actually push this many items. */
+#define NUM_FAILURE_ITEMS \
+ ((highest_active_reg - lowest_active_reg + 1) * NUM_REG_ITEMS \
+ + NUM_NONREG_ITEMS)
+
+/* How many items can still be added to the stack without overflowing it. */
+#define REMAINING_AVAIL_SLOTS ((fail_stack).size - (fail_stack).avail)
+
+
+/* Pops what PUSH_FAIL_STACK pushes.
+
+ We restore into the parameters, all of which should be lvalues:
+ STR -- the saved data position.
+ PAT -- the saved pattern position.
+ LOW_REG, HIGH_REG -- the highest and lowest active registers.
+ REGSTART, REGEND -- arrays of string positions.
+ REG_INFO -- array of information about each subexpression.
+
+ Also assumes the variables `fail_stack' and (if debugging), `bufp',
+ `pend', `string1', `size1', `string2', and `size2'. */
+
+#define POP_FAILURE_POINT(str, pat, low_reg, high_reg, regstart, regend, reg_info)\
+{ \
+ DEBUG_STATEMENT (fail_stack_elt_t failure_id;) \
+ int this_reg; \
+ const unsigned char *string_temp; \
+ \
+ assert (!FAIL_STACK_EMPTY ()); \
+ \
+ /* Remove failure points and point to how many regs pushed. */ \
+ DEBUG_PRINT1 ("POP_FAILURE_POINT:\n"); \
+ DEBUG_PRINT2 (" Before pop, next avail: %d\n", fail_stack.avail); \
+ DEBUG_PRINT2 (" size: %d\n", fail_stack.size); \
+ \
+ assert (fail_stack.avail >= NUM_NONREG_ITEMS); \
+ \
+ DEBUG_POP (&failure_id); \
+ DEBUG_PRINT2 (" Popping failure id: %u\n", failure_id); \
+ \
+ /* If the saved string location is NULL, it came from an \
+ on_failure_keep_string_jump opcode, and we want to throw away the \
+ saved NULL, thus retaining our current position in the string. */ \
+ string_temp = POP_FAILURE_ITEM (); \
+ if (string_temp != NULL) \
+ str = (const char *) string_temp; \
+ \
+ DEBUG_PRINT2 (" Popping string 0x%x: `", str); \
+ DEBUG_PRINT_DOUBLE_STRING (str, string1, size1, string2, size2); \
+ DEBUG_PRINT1 ("'\n"); \
+ \
+ pat = (unsigned char *) POP_FAILURE_ITEM (); \
+ DEBUG_PRINT2 (" Popping pattern 0x%x: ", pat); \
+ DEBUG_PRINT_COMPILED_PATTERN (bufp, pat, pend); \
+ \
+ /* Restore register info. */ \
+ high_reg = (unsigned) POP_FAILURE_ITEM (); \
+ DEBUG_PRINT2 (" Popping high active reg: %d\n", high_reg); \
+ \
+ low_reg = (unsigned) POP_FAILURE_ITEM (); \
+ DEBUG_PRINT2 (" Popping low active reg: %d\n", low_reg); \
+ \
+ for (this_reg = high_reg; this_reg >= low_reg; this_reg--) \
+ { \
+ DEBUG_PRINT2 (" Popping reg: %d\n", this_reg); \
+ \
+ reg_info[this_reg].word = POP_FAILURE_ITEM (); \
+ DEBUG_PRINT2 (" info: 0x%x\n", reg_info[this_reg]); \
+ \
+ regend[this_reg] = (const char *) POP_FAILURE_ITEM (); \
+ DEBUG_PRINT2 (" end: 0x%x\n", regend[this_reg]); \
+ \
+ regstart[this_reg] = (const char *) POP_FAILURE_ITEM (); \
+ DEBUG_PRINT2 (" start: 0x%x\n", regstart[this_reg]); \
+ } \
+ \
+ DEBUG_STATEMENT (nfailure_points_popped++); \
+} /* POP_FAILURE_POINT */
+
+/* re_compile_fastmap computes a ``fastmap'' for the compiled pattern in
+ BUFP. A fastmap records which of the (1 << BYTEWIDTH) possible
+ characters can start a string that matches the pattern. This fastmap
+ is used by re_search to skip quickly over impossible starting points.
+
+ The caller must supply the address of a (1 << BYTEWIDTH)-byte data
+ area as BUFP->fastmap.
+
+ We set the `fastmap', `fastmap_accurate', and `can_be_null' fields in
+ the pattern buffer.
+
+ Returns 0 if we succeed, -2 if an internal error. */
+
+int
+re_compile_fastmap (bufp)
+ struct re_pattern_buffer *bufp;
+{
+ int j, k;
+ fail_stack_type fail_stack;
+#ifndef REGEX_MALLOC
+ char *destination;
+#endif
+ /* We don't push any register information onto the failure stack. */
+ unsigned num_regs = 0;
+
+ register char *fastmap = bufp->fastmap;
+ unsigned char *pattern = bufp->buffer;
+ unsigned long size = bufp->used;
+ const unsigned char *p = pattern;
+ register unsigned char *pend = pattern + size;
+
+ /* Assume that each path through the pattern can be null until
+ proven otherwise. We set this false at the bottom of switch
+ statement, to which we get only if a particular path doesn't
+ match the empty string. */
+ boolean path_can_be_null = true;
+
+ /* We aren't doing a `succeed_n' to begin with. */
+ boolean succeed_n_p = false;
+
+ assert (fastmap != NULL && p != NULL);
+
+ INIT_FAIL_STACK ();
+ bzero (fastmap, 1 << BYTEWIDTH); /* Assume nothing's valid. */
+ bufp->fastmap_accurate = 1; /* It will be when we're done. */
+ bufp->can_be_null = 0;
+
+ while (p != pend || !FAIL_STACK_EMPTY ())
+ {
+ if (p == pend)
+ {
+ bufp->can_be_null |= path_can_be_null;
+
+ /* Reset for next path. */
+ path_can_be_null = true;
+
+ p = fail_stack.stack[--fail_stack.avail];
+ }
+
+ /* We should never be about to go beyond the end of the pattern. */
+ assert (p < pend);
+
+#ifdef SWITCH_ENUM_BUG
+ switch ((int) ((re_opcode_t) *p++))
+#else
+ switch ((re_opcode_t) *p++)
+#endif
+ {
+
+ /* I guess the idea here is to simply not bother with a fastmap
+ if a backreference is used, since it's too hard to figure out
+ the fastmap for the corresponding group. Setting
+ `can_be_null' stops `re_search_2' from using the fastmap, so
+ that is all we do. */
+ case duplicate:
+ bufp->can_be_null = 1;
+ return 0;
+
+
+ /* Following are the cases which match a character. These end
+ with `break'. */
+
+ case exactn:
+ fastmap[p[1]] = 1;
+ break;
+
+
+ case charset:
+ for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--)
+ if (p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH)))
+ fastmap[j] = 1;
+ break;
+
+
+ case charset_not:
+ /* Chars beyond end of map must be allowed. */
+ for (j = *p * BYTEWIDTH; j < (1 << BYTEWIDTH); j++)
+ fastmap[j] = 1;
+
+ for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--)
+ if (!(p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH))))
+ fastmap[j] = 1;
+ break;
+
+
+ case wordchar:
+ for (j = 0; j < (1 << BYTEWIDTH); j++)
+ if (SYNTAX (j) == Sword)
+ fastmap[j] = 1;
+ break;
+
+
+ case notwordchar:
+ for (j = 0; j < (1 << BYTEWIDTH); j++)
+ if (SYNTAX (j) != Sword)
+ fastmap[j] = 1;
+ break;
+
+
+ case anychar:
+ /* `.' matches anything ... */
+ for (j = 0; j < (1 << BYTEWIDTH); j++)
+ fastmap[j] = 1;
+
+ /* ... except perhaps newline. */
+ if (!(bufp->syntax & RE_DOT_NEWLINE))
+ fastmap['\n'] = 0;
+
+ /* Return if we have already set `can_be_null'; if we have,
+ then the fastmap is irrelevant. Something's wrong here. */
+ else if (bufp->can_be_null)
+ return 0;
+
+ /* Otherwise, have to check alternative paths. */
+ break;
+
+
+#ifdef emacs
+ case syntaxspec:
+ k = *p++;
+ for (j = 0; j < (1 << BYTEWIDTH); j++)
+ if (SYNTAX (j) == (enum syntaxcode) k)
+ fastmap[j] = 1;
+ break;
+
+
+ case notsyntaxspec:
+ k = *p++;
+ for (j = 0; j < (1 << BYTEWIDTH); j++)
+ if (SYNTAX (j) != (enum syntaxcode) k)
+ fastmap[j] = 1;
+ break;
+
+
+ /* All cases after this match the empty string. These end with
+ `continue'. */
+
+
+ case before_dot:
+ case at_dot:
+ case after_dot:
+ continue;
+#endif /* not emacs */
+
+
+ case no_op:
+ case begline:
+ case endline:
+ case begbuf:
+ case endbuf:
+ case wordbound:
+ case notwordbound:
+ case wordbeg:
+ case wordend:
+ case push_dummy_failure:
+ continue;
+
+
+ case jump_n:
+ case pop_failure_jump:
+ case maybe_pop_jump:
+ case jump:
+ case jump_past_alt:
+ case dummy_failure_jump:
+ EXTRACT_NUMBER_AND_INCR (j, p);
+ p += j;
+ if (j > 0)
+ continue;
+
+ /* Jump backward implies we just went through the body of a
+ loop and matched nothing. Opcode jumped to should be
+ `on_failure_jump' or `succeed_n'. Just treat it like an
+ ordinary jump. For a * loop, it has pushed its failure
+ point already; if so, discard that as redundant. */
+ if ((re_opcode_t) *p != on_failure_jump
+ && (re_opcode_t) *p != succeed_n)
+ continue;
+
+ p++;
+ EXTRACT_NUMBER_AND_INCR (j, p);
+ p += j;
+
+ /* If what's on the stack is where we are now, pop it. */
+ if (!FAIL_STACK_EMPTY ()
+ && fail_stack.stack[fail_stack.avail - 1] == p)
+ fail_stack.avail--;
+
+ continue;
+
+
+ case on_failure_jump:
+ case on_failure_keep_string_jump:
+ handle_on_failure_jump:
+ EXTRACT_NUMBER_AND_INCR (j, p);
+
+ /* For some patterns, e.g., `(a?)?', `p+j' here points to the
+ end of the pattern. We don't want to push such a point,
+ since when we restore it above, entering the switch will
+ increment `p' past the end of the pattern. We don't need
+ to push such a point since we obviously won't find any more
+ fastmap entries beyond `pend'. Such a pattern can match
+ the null string, though. */
+ if (p + j < pend)
+ {
+ if (!PUSH_PATTERN_OP (p + j, fail_stack))
+ return -2;
+ }
+ else
+ bufp->can_be_null = 1;
+
+ if (succeed_n_p)
+ {
+ EXTRACT_NUMBER_AND_INCR (k, p); /* Skip the n. */
+ succeed_n_p = false;
+ }
+
+ continue;
+
+
+ case succeed_n:
+ /* Get to the number of times to succeed. */
+ p += 2;
+
+ /* Increment p past the n for when k != 0. */
+ EXTRACT_NUMBER_AND_INCR (k, p);
+ if (k == 0)
+ {
+ p -= 4;
+ succeed_n_p = true; /* Spaghetti code alert. */
+ goto handle_on_failure_jump;
+ }
+ continue;
+
+
+ case set_number_at:
+ p += 4;
+ continue;
+
+
+ case start_memory:
+ case stop_memory:
+ p += 2;
+ continue;
+
+
+ default:
+ abort (); /* We have listed all the cases. */
+ } /* switch *p++ */
+
+ /* Getting here means we have found the possible starting
+ characters for one path of the pattern -- and that the empty
+ string does not match. We need not follow this path further.
+ Instead, look at the next alternative (remembered on the
+ stack), or quit if no more. The test at the top of the loop
+ does these things. */
+ path_can_be_null = false;
+ p = pend;
+ } /* while p */
+
+ /* Set `can_be_null' for the last path (also the first path, if the
+ pattern is empty). */
+ bufp->can_be_null |= path_can_be_null;
+ return 0;
+} /* re_compile_fastmap */
+
+/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
+ ENDS. Subsequent matches using PATTERN_BUFFER and REGS will use
+ this memory for recording register information. STARTS and ENDS
+ must be allocated using the malloc library routine, and must each
+ be at least NUM_REGS * sizeof (regoff_t) bytes long.
+
+ If NUM_REGS == 0, then subsequent matches should allocate their own
+ register data.
+
+ Unless this function is called, the first search or match using
+ PATTERN_BUFFER will allocate its own register data, without
+ freeing the old data. */
+
+void
+re_set_registers (bufp, regs, num_regs, starts, ends)
+ struct re_pattern_buffer *bufp;
+ struct re_registers *regs;
+ unsigned num_regs;
+ regoff_t *starts, *ends;
+{
+ if (num_regs)
+ {
+ bufp->regs_allocated = REGS_REALLOCATE;
+ regs->num_regs = num_regs;
+ regs->start = starts;
+ regs->end = ends;
+ }
+ else
+ {
+ bufp->regs_allocated = REGS_UNALLOCATED;
+ regs->num_regs = 0;
+ regs->start = regs->end = (regoff_t) 0;
+ }
+}
+
+/* Searching routines. */
+
+/* Like re_search_2, below, but only one string is specified, and
+ doesn't let you say where to stop matching. */
+
+int
+re_search (bufp, string, size, startpos, range, regs)
+ struct re_pattern_buffer *bufp;
+ const char *string;
+ int size, startpos, range;
+ struct re_registers *regs;
+{
+ return re_search_2 (bufp, NULL, 0, string, size, startpos, range,
+ regs, size);
+}
+
+
+/* Using the compiled pattern in BUFP->buffer, first tries to match the
+ virtual concatenation of STRING1 and STRING2, starting first at index
+ STARTPOS, then at STARTPOS + 1, and so on.
+
+ STRING1 and STRING2 have length SIZE1 and SIZE2, respectively.
+
+ RANGE is how far to scan while trying to match. RANGE = 0 means try
+ only at STARTPOS; in general, the last start tried is STARTPOS +
+ RANGE.
+
+ In REGS, return the indices of the virtual concatenation of STRING1
+ and STRING2 that matched the entire BUFP->buffer and its contained
+ subexpressions.
+
+ Do not consider matching one past the index STOP in the virtual
+ concatenation of STRING1 and STRING2.
+
+ We return either the position in the strings at which the match was
+ found, -1 if no match, or -2 if error (such as failure
+ stack overflow). */
+
+int
+re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
+ struct re_pattern_buffer *bufp;
+ const char *string1, *string2;
+ int size1, size2;
+ int startpos;
+ int range;
+ struct re_registers *regs;
+ int stop;
+{
+ int val;
+ register char *fastmap = bufp->fastmap;
+ register char *translate = bufp->translate;
+ int total_size = size1 + size2;
+ int endpos = startpos + range;
+
+ /* Check for out-of-range STARTPOS. */
+ if (startpos < 0 || startpos > total_size)
+ return -1;
+
+ /* Fix up RANGE if it might eventually take us outside
+ the virtual concatenation of STRING1 and STRING2. */
+ if (endpos < -1)
+ range = -1 - startpos;
+ else if (endpos > total_size)
+ range = total_size - startpos;
+
+ /* If the search isn't to be a backwards one, don't waste time in a
+ search for a pattern that must be anchored. */
+ if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == begbuf && range > 0)
+ {
+ if (startpos > 0)
+ return -1;
+ else
+ range = 1;
+ }
+
+ /* Update the fastmap now if not correct already. */
+ if (fastmap && !bufp->fastmap_accurate)
+ if (re_compile_fastmap (bufp) == -2)
+ return -2;
+
+ /* Loop through the string, looking for a place to start matching. */
+ for (;;)
+ {
+ /* If a fastmap is supplied, skip quickly over characters that
+ cannot be the start of a match. If the pattern can match the
+ null string, however, we don't need to skip characters; we want
+ the first null string. */
+ if (fastmap && startpos < total_size && !bufp->can_be_null)
+ {
+ if (range > 0) /* Searching forwards. */
+ {
+ register const char *d;
+ register int lim = 0;
+ int irange = range;
+
+ if (startpos < size1 && startpos + range >= size1)
+ lim = range - (size1 - startpos);
+
+ d = (startpos >= size1 ? string2 - size1 : string1) + startpos;
+
+ /* Written out as an if-else to avoid testing `translate'
+ inside the loop. */
+ if (translate)
+ while (range > lim
+ && !fastmap[(unsigned char)
+ translate[(unsigned char) *d++]])
+ range--;
+ else
+ while (range > lim && !fastmap[(unsigned char) *d++])
+ range--;
+
+ startpos += irange - range;
+ }
+ else /* Searching backwards. */
+ {
+ register char c = (size1 == 0 || startpos >= size1
+ ? string2[startpos - size1]
+ : string1[startpos]);
+
+ if (!fastmap[(unsigned char) TRANSLATE (c)])
+ goto advance;
+ }
+ }
+
+ /* If can't match the null string, and that's all we have left, fail. */
+ if (range >= 0 && startpos == total_size && fastmap
+ && !bufp->can_be_null)
+ return -1;
+
+ val = re_match_2 (bufp, string1, size1, string2, size2,
+ startpos, regs, stop);
+ if (val >= 0)
+ return startpos;
+
+ if (val == -2)
+ return -2;
+
+ advance:
+ if (!range)
+ break;
+ else if (range > 0)
+ {
+ range--;
+ startpos++;
+ }
+ else
+ {
+ range++;
+ startpos--;
+ }
+ }
+ return -1;
+} /* re_search_2 */
+
+/* Declarations and macros for re_match_2. */
+
+static int bcmp_translate ();
+static boolean alt_match_null_string_p (),
+ common_op_match_null_string_p (),
+ group_match_null_string_p ();
+
+/* Structure for per-register (a.k.a. per-group) information.
+ This must not be longer than one word, because we push this value
+ onto the failure stack. Other register information, such as the
+ starting and ending positions (which are addresses), and the list of
+ inner groups (which is a bits list) are maintained in separate
+ variables.
+
+ We are making a (strictly speaking) nonportable assumption here: that
+ the compiler will pack our bit fields into something that fits into
+ the type of `word', i.e., is something that fits into one item on the
+ failure stack. */
+typedef union
+{
+ fail_stack_elt_t word;
+ struct
+ {
+ /* This field is one if this group can match the empty string,
+ zero if not. If not yet determined, `MATCH_NULL_UNSET_VALUE'. */
+#define MATCH_NULL_UNSET_VALUE 3
+ unsigned match_null_string_p : 2;
+ unsigned is_active : 1;
+ unsigned matched_something : 1;
+ unsigned ever_matched_something : 1;
+ } bits;
+} register_info_type;
+
+#define REG_MATCH_NULL_STRING_P(R) ((R).bits.match_null_string_p)
+#define IS_ACTIVE(R) ((R).bits.is_active)
+#define MATCHED_SOMETHING(R) ((R).bits.matched_something)
+#define EVER_MATCHED_SOMETHING(R) ((R).bits.ever_matched_something)
+
+
+/* Call this when have matched a real character; it sets `matched' flags
+ for the subexpressions which we are currently inside. Also records
+ that those subexprs have matched. */
+#define SET_REGS_MATCHED() \
+ do \
+ { \
+ unsigned r; \
+ for (r = lowest_active_reg; r <= highest_active_reg; r++) \
+ { \
+ MATCHED_SOMETHING (reg_info[r]) \
+ = EVER_MATCHED_SOMETHING (reg_info[r]) \
+ = 1; \
+ } \
+ } \
+ while (0)
+
+
+/* This converts PTR, a pointer into one of the search strings `string1'
+ and `string2' into an offset from the beginning of that string. */
+#define POINTER_TO_OFFSET(ptr) \
+ (FIRST_STRING_P (ptr) ? (ptr) - string1 : (ptr) - string2 + size1)
+
+/* Registers are set to a sentinel when they haven't yet matched. */
+#define REG_UNSET_VALUE ((char *) -1)
+#define REG_UNSET(e) ((e) == REG_UNSET_VALUE)
+
+
+/* Macros for dealing with the split strings in re_match_2. */
+
+#define MATCHING_IN_FIRST_STRING (dend == end_match_1)
+
+/* Call before fetching a character with *d. This switches over to
+ string2 if necessary. */
+#define PREFETCH() \
+ while (d == dend) \
+ { \
+ /* End of string2 => fail. */ \
+ if (dend == end_match_2) \
+ goto fail; \
+ /* End of string1 => advance to string2. */ \
+ d = string2; \
+ dend = end_match_2; \
+ }
+
+
+/* Test if at very beginning or at very end of the virtual concatenation
+ of `string1' and `string2'. If only one string, it's `string2'. */
+#define AT_STRINGS_BEG(d) ((d) == (size1 ? string1 : string2) || !size2)
+#define AT_STRINGS_END(d) ((d) == end2)
+
+
+/* Test if D points to a character which is word-constituent. We have
+ two special cases to check for: if past the end of string1, look at
+ the first character in string2; and if before the beginning of
+ string2, look at the last character in string1. */
+#define WORDCHAR_P(d) \
+ (SYNTAX ((d) == end1 ? *string2 \
+ : (d) == string2 - 1 ? *(end1 - 1) : *(d)) \
+ == Sword)
+
+/* Test if the character before D and the one at D differ with respect
+ to being word-constituent. */
+#define AT_WORD_BOUNDARY(d) \
+ (AT_STRINGS_BEG (d) || AT_STRINGS_END (d) \
+ || WORDCHAR_P (d - 1) != WORDCHAR_P (d))
+
+
+/* Free everything we malloc. */
+#ifdef REGEX_MALLOC
+#define FREE_VAR(var) if (var) free (var); var = NULL
+#define FREE_VARIABLES() \
+ do { \
+ FREE_VAR (fail_stack.stack); \
+ FREE_VAR (regstart); \
+ FREE_VAR (regend); \
+ FREE_VAR (old_regstart); \
+ FREE_VAR (old_regend); \
+ FREE_VAR (best_regstart); \
+ FREE_VAR (best_regend); \
+ FREE_VAR (reg_info); \
+ FREE_VAR (reg_dummy); \
+ FREE_VAR (reg_info_dummy); \
+ } while (0)
+#else /* not REGEX_MALLOC */
+/* Some MIPS systems (at least) want this to free alloca'd storage. */
+#define FREE_VARIABLES() alloca (0)
+#endif /* not REGEX_MALLOC */
+
+
+/* These values must meet several constraints. They must not be valid
+ register values; since we have a limit of 255 registers (because
+ we use only one byte in the pattern for the register number), we can
+ use numbers larger than 255. They must differ by 1, because of
+ NUM_FAILURE_ITEMS above. And the value for the lowest register must
+ be larger than the value for the highest register, so we do not try
+ to actually save any registers when none are active. */
+#define NO_HIGHEST_ACTIVE_REG (1 << BYTEWIDTH)
+#define NO_LOWEST_ACTIVE_REG (NO_HIGHEST_ACTIVE_REG + 1)
+
+/* Matching routines. */
+
+#ifndef emacs /* Emacs never uses this. */
+/* re_match is like re_match_2 except it takes only a single string. */
+
+int
+re_match (bufp, string, size, pos, regs)
+ struct re_pattern_buffer *bufp;
+ const char *string;
+ int size, pos;
+ struct re_registers *regs;
+ {
+ return re_match_2 (bufp, NULL, 0, string, size, pos, regs, size);
+}
+#endif /* not emacs */
+
+
+/* re_match_2 matches the compiled pattern in BUFP against the
+ the (virtual) concatenation of STRING1 and STRING2 (of length SIZE1
+ and SIZE2, respectively). We start matching at POS, and stop
+ matching at STOP.
+
+ If REGS is non-null and the `no_sub' field of BUFP is nonzero, we
+ store offsets for the substring each group matched in REGS. See the
+ documentation for exactly how many groups we fill.
+
+ We return -1 if no match, -2 if an internal error (such as the
+ failure stack overflowing). Otherwise, we return the length of the
+ matched substring. */
+
+int
+re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
+ struct re_pattern_buffer *bufp;
+ const char *string1, *string2;
+ int size1, size2;
+ int pos;
+ struct re_registers *regs;
+ int stop;
+{
+ /* General temporaries. */
+ int mcnt;
+ unsigned char *p1;
+
+ /* Just past the end of the corresponding string. */
+ const char *end1, *end2;
+
+ /* Pointers into string1 and string2, just past the last characters in
+ each to consider matching. */
+ const char *end_match_1, *end_match_2;
+
+ /* Where we are in the data, and the end of the current string. */
+ const char *d, *dend;
+
+ /* Where we are in the pattern, and the end of the pattern. */
+ unsigned char *p = bufp->buffer;
+ register unsigned char *pend = p + bufp->used;
+
+ /* We use this to map every character in the string. */
+ char *translate = bufp->translate;
+
+ /* Failure point stack. Each place that can handle a failure further
+ down the line pushes a failure point on this stack. It consists of
+ restart, regend, and reg_info for all registers corresponding to
+ the subexpressions we're currently inside, plus the number of such
+ registers, and, finally, two char *'s. The first char * is where
+ to resume scanning the pattern; the second one is where to resume
+ scanning the strings. If the latter is zero, the failure point is
+ a ``dummy''; if a failure happens and the failure point is a dummy,
+ it gets discarded and the next next one is tried. */
+ fail_stack_type fail_stack;
+#ifdef DEBUG
+ static unsigned failure_id = 0;
+ unsigned nfailure_points_pushed = 0, nfailure_points_popped = 0;
+#endif
+
+ /* We fill all the registers internally, independent of what we
+ return, for use in backreferences. The number here includes
+ an element for register zero. */
+ unsigned num_regs = bufp->re_nsub + 1;
+
+ /* The currently active registers. */
+ unsigned lowest_active_reg = NO_LOWEST_ACTIVE_REG;
+ unsigned highest_active_reg = NO_HIGHEST_ACTIVE_REG;
+
+ /* Information on the contents of registers. These are pointers into
+ the input strings; they record just what was matched (on this
+ attempt) by a subexpression part of the pattern, that is, the
+ regnum-th regstart pointer points to where in the pattern we began
+ matching and the regnum-th regend points to right after where we
+ stopped matching the regnum-th subexpression. (The zeroth register
+ keeps track of what the whole pattern matches.) */
+ const char **regstart = NULL, **regend = NULL;
+
+ /* If a group that's operated upon by a repetition operator fails to
+ match anything, then the register for its start will need to be
+ restored because it will have been set to wherever in the string we
+ are when we last see its open-group operator. Similarly for a
+ register's end. */
+ const char **old_regstart = NULL, **old_regend = NULL;
+
+ /* The is_active field of reg_info helps us keep track of which (possibly
+ nested) subexpressions we are currently in. The matched_something
+ field of reg_info[reg_num] helps us tell whether or not we have
+ matched any of the pattern so far this time through the reg_num-th
+ subexpression. These two fields get reset each time through any
+ loop their register is in. */
+ register_info_type *reg_info = NULL;
+
+ /* The following record the register info as found in the above
+ variables when we find a match better than any we've seen before.
+ This happens as we backtrack through the failure points, which in
+ turn happens only if we have not yet matched the entire string. */
+ unsigned best_regs_set = false;
+ const char **best_regstart = NULL, **best_regend = NULL;
+
+ /* Logically, this is `best_regend[0]'. But we don't want to have to
+ allocate space for that if we're not allocating space for anything
+ else (see below). Also, we never need info about register 0 for
+ any of the other register vectors, and it seems rather a kludge to
+ treat `best_regend' differently than the rest. So we keep track of
+ the end of the best match so far in a separate variable. We
+ initialize this to NULL so that when we backtrack the first time
+ and need to test it, it's not garbage. */
+ const char *match_end = NULL;
+
+ /* Used when we pop values we don't care about. */
+ const char **reg_dummy = NULL;
+ register_info_type *reg_info_dummy = NULL;
+
+#ifdef DEBUG
+ /* Counts the total number of registers pushed. */
+ unsigned num_regs_pushed = 0;
+#endif
+
+ DEBUG_PRINT1 ("\n\nEntering re_match_2.\n");
+
+ INIT_FAIL_STACK ();
+
+ /* Do not bother to initialize all the register variables if there are
+ no groups in the pattern, as it takes a fair amount of time. If
+ there are groups, we include space for register 0 (the whole
+ pattern), even though we never use it, since it simplifies the
+ array indexing. We should fix this. */
+ if (bufp->re_nsub)
+ {
+ regstart = REGEX_TALLOC (num_regs, const char *);
+ regend = REGEX_TALLOC (num_regs, const char *);
+ old_regstart = REGEX_TALLOC (num_regs, const char *);
+ old_regend = REGEX_TALLOC (num_regs, const char *);
+ best_regstart = REGEX_TALLOC (num_regs, const char *);
+ best_regend = REGEX_TALLOC (num_regs, const char *);
+ reg_info = REGEX_TALLOC (num_regs, register_info_type);
+ reg_dummy = REGEX_TALLOC (num_regs, const char *);
+ reg_info_dummy = REGEX_TALLOC (num_regs, register_info_type);
+
+ if (!(regstart && regend && old_regstart && old_regend && reg_info
+ && best_regstart && best_regend && reg_dummy && reg_info_dummy))
+ {
+ FREE_VARIABLES ();
+ return -2;
+ }
+ }
+#ifdef REGEX_MALLOC
+ else
+ {
+ /* We must initialize all our variables to NULL, so that
+ `FREE_VARIABLES' doesn't try to free them. */
+ regstart = regend = old_regstart = old_regend = best_regstart
+ = best_regend = reg_dummy = NULL;
+ reg_info = reg_info_dummy = (register_info_type *) NULL;
+ }
+#endif /* REGEX_MALLOC */
+
+ /* The starting position is bogus. */
+ if (pos < 0 || pos > size1 + size2)
+ {
+ FREE_VARIABLES ();
+ return -1;
+ }
+
+ /* Initialize subexpression text positions to -1 to mark ones that no
+ start_memory/stop_memory has been seen for. Also initialize the
+ register information struct. */
+ for (mcnt = 1; mcnt < num_regs; mcnt++)
+ {
+ regstart[mcnt] = regend[mcnt]
+ = old_regstart[mcnt] = old_regend[mcnt] = REG_UNSET_VALUE;
+
+ REG_MATCH_NULL_STRING_P (reg_info[mcnt]) = MATCH_NULL_UNSET_VALUE;
+ IS_ACTIVE (reg_info[mcnt]) = 0;
+ MATCHED_SOMETHING (reg_info[mcnt]) = 0;
+ EVER_MATCHED_SOMETHING (reg_info[mcnt]) = 0;
+ }
+
+ /* We move `string1' into `string2' if the latter's empty -- but not if
+ `string1' is null. */
+ if (size2 == 0 && string1 != NULL)
+ {
+ string2 = string1;
+ size2 = size1;
+ string1 = 0;
+ size1 = 0;
+ }
+ end1 = string1 + size1;
+ end2 = string2 + size2;
+
+ /* Compute where to stop matching, within the two strings. */
+ if (stop <= size1)
+ {
+ end_match_1 = string1 + stop;
+ end_match_2 = string2;
+ }
+ else
+ {
+ end_match_1 = end1;
+ end_match_2 = string2 + stop - size1;
+ }
+
+ /* `p' scans through the pattern as `d' scans through the data.
+ `dend' is the end of the input string that `d' points within. `d'
+ is advanced into the following input string whenever necessary, but
+ this happens before fetching; therefore, at the beginning of the
+ loop, `d' can be pointing at the end of a string, but it cannot
+ equal `string2'. */
+ if (size1 > 0 && pos <= size1)
+ {
+ d = string1 + pos;
+ dend = end_match_1;
+ }
+ else
+ {
+ d = string2 + pos - size1;
+ dend = end_match_2;
+ }
+
+ DEBUG_PRINT1 ("The compiled pattern is: ");
+ DEBUG_PRINT_COMPILED_PATTERN (bufp, p, pend);
+ DEBUG_PRINT1 ("The string to match is: `");
+ DEBUG_PRINT_DOUBLE_STRING (d, string1, size1, string2, size2);
+ DEBUG_PRINT1 ("'\n");
+
+ /* This loops over pattern commands. It exits by returning from the
+ function if the match is complete, or it drops through if the match
+ fails at this starting point in the input data. */
+ for (;;)
+ {
+ DEBUG_PRINT2 ("\n0x%x: ", p);
+
+ if (p == pend)
+ { /* End of pattern means we might have succeeded. */
+ DEBUG_PRINT1 ("end of pattern ... ");
+
+ /* If we haven't matched the entire string, and we want the
+ longest match, try backtracking. */
+ if (d != end_match_2)
+ {
+ DEBUG_PRINT1 ("backtracking.\n");
+
+ if (!FAIL_STACK_EMPTY ())
+ { /* More failure points to try. */
+ boolean same_str_p = (FIRST_STRING_P (match_end)
+ == MATCHING_IN_FIRST_STRING);
+
+ /* If exceeds best match so far, save it. */
+ if (!best_regs_set
+ || (same_str_p && d > match_end)
+ || (!same_str_p && !MATCHING_IN_FIRST_STRING))
+ {
+ best_regs_set = true;
+ match_end = d;
+
+ DEBUG_PRINT1 ("\nSAVING match as best so far.\n");
+
+ for (mcnt = 1; mcnt < num_regs; mcnt++)
+ {
+ best_regstart[mcnt] = regstart[mcnt];
+ best_regend[mcnt] = regend[mcnt];
+ }
+ }
+ goto fail;
+ }
+
+ /* If no failure points, don't restore garbage. */
+ else if (best_regs_set)
+ {
+ restore_best_regs:
+ /* Restore best match. It may happen that `dend ==
+ end_match_1' while the restored d is in string2.
+ For example, the pattern `x.*y.*z' against the
+ strings `x-' and `y-z-', if the two strings are
+ not consecutive in memory. */
+ DEBUG_PRINT1 ("Restoring best registers.\n");
+
+ d = match_end;
+ dend = ((d >= string1 && d <= end1)
+ ? end_match_1 : end_match_2);
+
+ for (mcnt = 1; mcnt < num_regs; mcnt++)
+ {
+ regstart[mcnt] = best_regstart[mcnt];
+ regend[mcnt] = best_regend[mcnt];
+ }
+ }
+ } /* d != end_match_2 */
+
+ DEBUG_PRINT1 ("Accepting match.\n");
+
+ /* If caller wants register contents data back, do it. */
+ if (regs && !bufp->no_sub)
+ {
+ /* Have the register data arrays been allocated? */
+ if (bufp->regs_allocated == REGS_UNALLOCATED)
+ { /* No. So allocate them with malloc. We need one
+ extra element beyond `num_regs' for the `-1' marker
+ GNU code uses. */
+ regs->num_regs = MAX (RE_NREGS, num_regs + 1);
+ regs->start = TALLOC (regs->num_regs, regoff_t);
+ regs->end = TALLOC (regs->num_regs, regoff_t);
+ if (regs->start == NULL || regs->end == NULL)
+ return -2;
+ bufp->regs_allocated = REGS_REALLOCATE;
+ }
+ else if (bufp->regs_allocated == REGS_REALLOCATE)
+ { /* Yes. If we need more elements than were already
+ allocated, reallocate them. If we need fewer, just
+ leave it alone. */
+ if (regs->num_regs < num_regs + 1)
+ {
+ regs->num_regs = num_regs + 1;
+ RETALLOC (regs->start, regs->num_regs, regoff_t);
+ RETALLOC (regs->end, regs->num_regs, regoff_t);
+ if (regs->start == NULL || regs->end == NULL)
+ return -2;
+ }
+ }
+ else
+ assert (bufp->regs_allocated == REGS_FIXED);
+
+ /* Convert the pointer data in `regstart' and `regend' to
+ indices. Register zero has to be set differently,
+ since we haven't kept track of any info for it. */
+ if (regs->num_regs > 0)
+ {
+ regs->start[0] = pos;
+ regs->end[0] = (MATCHING_IN_FIRST_STRING ? d - string1
+ : d - string2 + size1);
+ }
+
+ /* Go through the first `min (num_regs, regs->num_regs)'
+ registers, since that is all we initialized. */
+ for (mcnt = 1; mcnt < MIN (num_regs, regs->num_regs); mcnt++)
+ {
+ if (REG_UNSET (regstart[mcnt]) || REG_UNSET (regend[mcnt]))
+ regs->start[mcnt] = regs->end[mcnt] = -1;
+ else
+ {
+ regs->start[mcnt] = POINTER_TO_OFFSET (regstart[mcnt]);
+ regs->end[mcnt] = POINTER_TO_OFFSET (regend[mcnt]);
+ }
+ }
+
+ /* If the regs structure we return has more elements than
+ were in the pattern, set the extra elements to -1. If
+ we (re)allocated the registers, this is the case,
+ because we always allocate enough to have at least one
+ -1 at the end. */
+ for (mcnt = num_regs; mcnt < regs->num_regs; mcnt++)
+ regs->start[mcnt] = regs->end[mcnt] = -1;
+ } /* regs && !bufp->no_sub */
+
+ FREE_VARIABLES ();
+ DEBUG_PRINT4 ("%u failure points pushed, %u popped (%u remain).\n",
+ nfailure_points_pushed, nfailure_points_popped,
+ nfailure_points_pushed - nfailure_points_popped);
+ DEBUG_PRINT2 ("%u registers pushed.\n", num_regs_pushed);
+
+ mcnt = d - pos - (MATCHING_IN_FIRST_STRING
+ ? string1
+ : string2 - size1);
+
+ DEBUG_PRINT2 ("Returning %d from re_match_2.\n", mcnt);
+
+ return mcnt;
+ }
+
+ /* Otherwise match next pattern command. */
+#ifdef SWITCH_ENUM_BUG
+ switch ((int) ((re_opcode_t) *p++))
+#else
+ switch ((re_opcode_t) *p++)
+#endif
+ {
+ /* Ignore these. Used to ignore the n of succeed_n's which
+ currently have n == 0. */
+ case no_op:
+ DEBUG_PRINT1 ("EXECUTING no_op.\n");
+ break;
+
+
+ /* Match the next n pattern characters exactly. The following
+ byte in the pattern defines n, and the n bytes after that
+ are the characters to match. */
+ case exactn:
+ mcnt = *p++;
+ DEBUG_PRINT2 ("EXECUTING exactn %d.\n", mcnt);
+
+ /* This is written out as an if-else so we don't waste time
+ testing `translate' inside the loop. */
+ if (translate)
+ {
+ do
+ {
+ PREFETCH ();
+ if (translate[(unsigned char) *d++] != (char) *p++)
+ goto fail;
+ }
+ while (--mcnt);
+ }
+ else
+ {
+ do
+ {
+ PREFETCH ();
+ if (*d++ != (char) *p++) goto fail;
+ }
+ while (--mcnt);
+ }
+ SET_REGS_MATCHED ();
+ break;
+
+
+ /* Match any character except possibly a newline or a null. */
+ case anychar:
+ DEBUG_PRINT1 ("EXECUTING anychar.\n");
+
+ PREFETCH ();
+
+ if ((!(bufp->syntax & RE_DOT_NEWLINE) && TRANSLATE (*d) == '\n')
+ || (bufp->syntax & RE_DOT_NOT_NULL && TRANSLATE (*d) == '\000'))
+ goto fail;
+
+ SET_REGS_MATCHED ();
+ DEBUG_PRINT2 (" Matched `%d'.\n", *d);
+ d++;
+ break;
+
+
+ case charset:
+ case charset_not:
+ {
+ register unsigned char c;
+ boolean not = (re_opcode_t) *(p - 1) == charset_not;
+
+ DEBUG_PRINT2 ("EXECUTING charset%s.\n", not ? "_not" : "");
+
+ PREFETCH ();
+ c = TRANSLATE (*d); /* The character to match. */
+
+ /* Cast to `unsigned' instead of `unsigned char' in case the
+ bit list is a full 32 bytes long. */
+ if (c < (unsigned) (*p * BYTEWIDTH)
+ && p[1 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH)))
+ not = !not;
+
+ p += 1 + *p;
+
+ if (!not) goto fail;
+
+ SET_REGS_MATCHED ();
+ d++;
+ break;
+ }
+
+
+ /* The beginning of a group is represented by start_memory.
+ The arguments are the register number in the next byte, and the
+ number of groups inner to this one in the next. The text
+ matched within the group is recorded (in the internal
+ registers data structure) under the register number. */
+ case start_memory:
+ DEBUG_PRINT3 ("EXECUTING start_memory %d (%d):\n", *p, p[1]);
+
+ /* Find out if this group can match the empty string. */
+ p1 = p; /* To send to group_match_null_string_p. */
+
+ if (REG_MATCH_NULL_STRING_P (reg_info[*p]) == MATCH_NULL_UNSET_VALUE)
+ REG_MATCH_NULL_STRING_P (reg_info[*p])
+ = group_match_null_string_p (&p1, pend, reg_info);
+
+ /* Save the position in the string where we were the last time
+ we were at this open-group operator in case the group is
+ operated upon by a repetition operator, e.g., with `(a*)*b'
+ against `ab'; then we want to ignore where we are now in
+ the string in case this attempt to match fails. */
+ old_regstart[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p])
+ ? REG_UNSET (regstart[*p]) ? d : regstart[*p]
+ : regstart[*p];
+ DEBUG_PRINT2 (" old_regstart: %d\n",
+ POINTER_TO_OFFSET (old_regstart[*p]));
+
+ regstart[*p] = d;
+ DEBUG_PRINT2 (" regstart: %d\n", POINTER_TO_OFFSET (regstart[*p]));
+
+ IS_ACTIVE (reg_info[*p]) = 1;
+ MATCHED_SOMETHING (reg_info[*p]) = 0;
+
+ /* This is the new highest active register. */
+ highest_active_reg = *p;
+
+ /* If nothing was active before, this is the new lowest active
+ register. */
+ if (lowest_active_reg == NO_LOWEST_ACTIVE_REG)
+ lowest_active_reg = *p;
+
+ /* Move past the register number and inner group count. */
+ p += 2;
+ break;
+
+
+ /* The stop_memory opcode represents the end of a group. Its
+ arguments are the same as start_memory's: the register
+ number, and the number of inner groups. */
+ case stop_memory:
+ DEBUG_PRINT3 ("EXECUTING stop_memory %d (%d):\n", *p, p[1]);
+
+ /* We need to save the string position the last time we were at
+ this close-group operator in case the group is operated
+ upon by a repetition operator, e.g., with `((a*)*(b*)*)*'
+ against `aba'; then we want to ignore where we are now in
+ the string in case this attempt to match fails. */
+ old_regend[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p])
+ ? REG_UNSET (regend[*p]) ? d : regend[*p]
+ : regend[*p];
+ DEBUG_PRINT2 (" old_regend: %d\n",
+ POINTER_TO_OFFSET (old_regend[*p]));
+
+ regend[*p] = d;
+ DEBUG_PRINT2 (" regend: %d\n", POINTER_TO_OFFSET (regend[*p]));
+
+ /* This register isn't active anymore. */
+ IS_ACTIVE (reg_info[*p]) = 0;
+
+ /* If this was the only register active, nothing is active
+ anymore. */
+ if (lowest_active_reg == highest_active_reg)
+ {
+ lowest_active_reg = NO_LOWEST_ACTIVE_REG;
+ highest_active_reg = NO_HIGHEST_ACTIVE_REG;
+ }
+ else
+ { /* We must scan for the new highest active register, since
+ it isn't necessarily one less than now: consider
+ (a(b)c(d(e)f)g). When group 3 ends, after the f), the
+ new highest active register is 1. */
+ unsigned char r = *p - 1;
+ while (r > 0 && !IS_ACTIVE (reg_info[r]))
+ r--;
+
+ /* If we end up at register zero, that means that we saved
+ the registers as the result of an `on_failure_jump', not
+ a `start_memory', and we jumped to past the innermost
+ `stop_memory'. For example, in ((.)*) we save
+ registers 1 and 2 as a result of the *, but when we pop
+ back to the second ), we are at the stop_memory 1.
+ Thus, nothing is active. */
+ if (r == 0)
+ {
+ lowest_active_reg = NO_LOWEST_ACTIVE_REG;
+ highest_active_reg = NO_HIGHEST_ACTIVE_REG;
+ }
+ else
+ highest_active_reg = r;
+ }
+
+ /* If just failed to match something this time around with a
+ group that's operated on by a repetition operator, try to
+ force exit from the ``loop'', and restore the register
+ information for this group that we had before trying this
+ last match. */
+ if ((!MATCHED_SOMETHING (reg_info[*p])
+ || (re_opcode_t) p[-3] == start_memory)
+ && (p + 2) < pend)
+ {
+ boolean is_a_jump_n = false;
+
+ p1 = p + 2;
+ mcnt = 0;
+ switch ((re_opcode_t) *p1++)
+ {
+ case jump_n:
+ is_a_jump_n = true;
+ case pop_failure_jump:
+ case maybe_pop_jump:
+ case jump:
+ case dummy_failure_jump:
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+ if (is_a_jump_n)
+ p1 += 2;
+ break;
+
+ default:
+ /* do nothing */ ;
+ }
+ p1 += mcnt;
+
+ /* If the next operation is a jump backwards in the pattern
+ to an on_failure_jump right before the start_memory
+ corresponding to this stop_memory, exit from the loop
+ by forcing a failure after pushing on the stack the
+ on_failure_jump's jump in the pattern, and d. */
+ if (mcnt < 0 && (re_opcode_t) *p1 == on_failure_jump
+ && (re_opcode_t) p1[3] == start_memory && p1[4] == *p)
+ {
+ /* If this group ever matched anything, then restore
+ what its registers were before trying this last
+ failed match, e.g., with `(a*)*b' against `ab' for
+ regstart[1], and, e.g., with `((a*)*(b*)*)*'
+ against `aba' for regend[3].
+
+ Also restore the registers for inner groups for,
+ e.g., `((a*)(b*))*' against `aba' (register 3 would
+ otherwise get trashed). */
+
+ if (EVER_MATCHED_SOMETHING (reg_info[*p]))
+ {
+ unsigned r;
+
+ EVER_MATCHED_SOMETHING (reg_info[*p]) = 0;
+
+ /* Restore this and inner groups' (if any) registers. */
+ for (r = *p; r < *p + *(p + 1); r++)
+ {
+ regstart[r] = old_regstart[r];
+
+ /* xx why this test? */
+ if ((int) old_regend[r] >= (int) regstart[r])
+ regend[r] = old_regend[r];
+ }
+ }
+ p1++;
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+ PUSH_FAILURE_POINT (p1 + mcnt, d, -2);
+
+ goto fail;
+ }
+ }
+
+ /* Move past the register number and the inner group count. */
+ p += 2;
+ break;
+
+
+ /* \<digit> has been turned into a `duplicate' command which is
+ followed by the numeric value of <digit> as the register number. */
+ case duplicate:
+ {
+ register const char *d2, *dend2;
+ int regno = *p++; /* Get which register to match against. */
+ DEBUG_PRINT2 ("EXECUTING duplicate %d.\n", regno);
+
+ /* Can't back reference a group which we've never matched. */
+ if (REG_UNSET (regstart[regno]) || REG_UNSET (regend[regno]))
+ goto fail;
+
+ /* Where in input to try to start matching. */
+ d2 = regstart[regno];
+
+ /* Where to stop matching; if both the place to start and
+ the place to stop matching are in the same string, then
+ set to the place to stop, otherwise, for now have to use
+ the end of the first string. */
+
+ dend2 = ((FIRST_STRING_P (regstart[regno])
+ == FIRST_STRING_P (regend[regno]))
+ ? regend[regno] : end_match_1);
+ for (;;)
+ {
+ /* If necessary, advance to next segment in register
+ contents. */
+ while (d2 == dend2)
+ {
+ if (dend2 == end_match_2) break;
+ if (dend2 == regend[regno]) break;
+
+ /* End of string1 => advance to string2. */
+ d2 = string2;
+ dend2 = regend[regno];
+ }
+ /* At end of register contents => success */
+ if (d2 == dend2) break;
+
+ /* If necessary, advance to next segment in data. */
+ PREFETCH ();
+
+ /* How many characters left in this segment to match. */
+ mcnt = dend - d;
+
+ /* Want how many consecutive characters we can match in
+ one shot, so, if necessary, adjust the count. */
+ if (mcnt > dend2 - d2)
+ mcnt = dend2 - d2;
+
+ /* Compare that many; failure if mismatch, else move
+ past them. */
+ if (translate
+ ? bcmp_translate (d, d2, mcnt, translate)
+ : bcmp (d, d2, mcnt))
+ goto fail;
+ d += mcnt, d2 += mcnt;
+ }
+ }
+ break;
+
+
+ /* begline matches the empty string at the beginning of the string
+ (unless `not_bol' is set in `bufp'), and, if
+ `newline_anchor' is set, after newlines. */
+ case begline:
+ DEBUG_PRINT1 ("EXECUTING begline.\n");
+
+ if (AT_STRINGS_BEG (d))
+ {
+ if (!bufp->not_bol) break;
+ }
+ else if (d[-1] == '\n' && bufp->newline_anchor)
+ {
+ break;
+ }
+ /* In all other cases, we fail. */
+ goto fail;
+
+
+ /* endline is the dual of begline. */
+ case endline:
+ DEBUG_PRINT1 ("EXECUTING endline.\n");
+
+ if (AT_STRINGS_END (d))
+ {
+ if (!bufp->not_eol) break;
+ }
+
+ /* We have to ``prefetch'' the next character. */
+ else if ((d == end1 ? *string2 : *d) == '\n'
+ && bufp->newline_anchor)
+ {
+ break;
+ }
+ goto fail;
+
+
+ /* Match at the very beginning of the data. */
+ case begbuf:
+ DEBUG_PRINT1 ("EXECUTING begbuf.\n");
+ if (AT_STRINGS_BEG (d))
+ break;
+ goto fail;
+
+
+ /* Match at the very end of the data. */
+ case endbuf:
+ DEBUG_PRINT1 ("EXECUTING endbuf.\n");
+ if (AT_STRINGS_END (d))
+ break;
+ goto fail;
+
+
+ /* on_failure_keep_string_jump is used to optimize `.*\n'. It
+ pushes NULL as the value for the string on the stack. Then
+ `pop_failure_point' will keep the current value for the
+ string, instead of restoring it. To see why, consider
+ matching `foo\nbar' against `.*\n'. The .* matches the foo;
+ then the . fails against the \n. But the next thing we want
+ to do is match the \n against the \n; if we restored the
+ string value, we would be back at the foo.
+
+ Because this is used only in specific cases, we don't need to
+ check all the things that `on_failure_jump' does, to make
+ sure the right things get saved on the stack. Hence we don't
+ share its code. The only reason to push anything on the
+ stack at all is that otherwise we would have to change
+ `anychar's code to do something besides goto fail in this
+ case; that seems worse than this. */
+ case on_failure_keep_string_jump:
+ DEBUG_PRINT1 ("EXECUTING on_failure_keep_string_jump");
+
+ EXTRACT_NUMBER_AND_INCR (mcnt, p);
+ DEBUG_PRINT3 (" %d (to 0x%x):\n", mcnt, p + mcnt);
+
+ PUSH_FAILURE_POINT (p + mcnt, NULL, -2);
+ break;
+
+
+ /* Uses of on_failure_jump:
+
+ Each alternative starts with an on_failure_jump that points
+ to the beginning of the next alternative. Each alternative
+ except the last ends with a jump that in effect jumps past
+ the rest of the alternatives. (They really jump to the
+ ending jump of the following alternative, because tensioning
+ these jumps is a hassle.)
+
+ Repeats start with an on_failure_jump that points past both
+ the repetition text and either the following jump or
+ pop_failure_jump back to this on_failure_jump. */
+ case on_failure_jump:
+ on_failure:
+ DEBUG_PRINT1 ("EXECUTING on_failure_jump");
+
+ EXTRACT_NUMBER_AND_INCR (mcnt, p);
+ DEBUG_PRINT3 (" %d (to 0x%x)", mcnt, p + mcnt);
+
+ /* If this on_failure_jump comes right before a group (i.e.,
+ the original * applied to a group), save the information
+ for that group and all inner ones, so that if we fail back
+ to this point, the group's information will be correct.
+ For example, in \(a*\)*\1, we need the preceding group,
+ and in \(\(a*\)b*\)\2, we need the inner group. */
+
+ /* We can't use `p' to check ahead because we push
+ a failure point to `p + mcnt' after we do this. */
+ p1 = p;
+
+ /* We need to skip no_op's before we look for the
+ start_memory in case this on_failure_jump is happening as
+ the result of a completed succeed_n, as in \(a\)\{1,3\}b\1
+ against aba. */
+ while (p1 < pend && (re_opcode_t) *p1 == no_op)
+ p1++;
+
+ if (p1 < pend && (re_opcode_t) *p1 == start_memory)
+ {
+ /* We have a new highest active register now. This will
+ get reset at the start_memory we are about to get to,
+ but we will have saved all the registers relevant to
+ this repetition op, as described above. */
+ highest_active_reg = *(p1 + 1) + *(p1 + 2);
+ if (lowest_active_reg == NO_LOWEST_ACTIVE_REG)
+ lowest_active_reg = *(p1 + 1);
+ }
+
+ DEBUG_PRINT1 (":\n");
+ PUSH_FAILURE_POINT (p + mcnt, d, -2);
+ break;
+
+
+ /* A smart repeat ends with `maybe_pop_jump'.
+ We change it to either `pop_failure_jump' or `jump'. */
+ case maybe_pop_jump:
+ EXTRACT_NUMBER_AND_INCR (mcnt, p);
+ DEBUG_PRINT2 ("EXECUTING maybe_pop_jump %d.\n", mcnt);
+ {
+ register unsigned char *p2 = p;
+
+ /* Compare the beginning of the repeat with what in the
+ pattern follows its end. If we can establish that there
+ is nothing that they would both match, i.e., that we
+ would have to backtrack because of (as in, e.g., `a*a')
+ then we can change to pop_failure_jump, because we'll
+ never have to backtrack.
+
+ This is not true in the case of alternatives: in
+ `(a|ab)*' we do need to backtrack to the `ab' alternative
+ (e.g., if the string was `ab'). But instead of trying to
+ detect that here, the alternative has put on a dummy
+ failure point which is what we will end up popping. */
+
+ /* Skip over open/close-group commands. */
+ while (p2 + 2 < pend
+ && ((re_opcode_t) *p2 == stop_memory
+ || (re_opcode_t) *p2 == start_memory))
+ p2 += 3; /* Skip over args, too. */
+
+ /* If we're at the end of the pattern, we can change. */
+ if (p2 == pend)
+ {
+ /* Consider what happens when matching ":\(.*\)"
+ against ":/". I don't really understand this code
+ yet. */
+ p[-3] = (unsigned char) pop_failure_jump;
+ DEBUG_PRINT1
+ (" End of pattern: change to `pop_failure_jump'.\n");
+ }
+
+ else if ((re_opcode_t) *p2 == exactn
+ || (bufp->newline_anchor && (re_opcode_t) *p2 == endline))
+ {
+ register unsigned char c
+ = *p2 == (unsigned char) endline ? '\n' : p2[2];
+ p1 = p + mcnt;
+
+ /* p1[0] ... p1[2] are the `on_failure_jump' corresponding
+ to the `maybe_finalize_jump' of this case. Examine what
+ follows. */
+ if ((re_opcode_t) p1[3] == exactn && p1[5] != c)
+ {
+ p[-3] = (unsigned char) pop_failure_jump;
+ DEBUG_PRINT3 (" %c != %c => pop_failure_jump.\n",
+ c, p1[5]);
+ }
+
+ else if ((re_opcode_t) p1[3] == charset
+ || (re_opcode_t) p1[3] == charset_not)
+ {
+ int not = (re_opcode_t) p1[3] == charset_not;
+
+ if (c < (unsigned char) (p1[4] * BYTEWIDTH)
+ && p1[5 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH)))
+ not = !not;
+
+ /* `not' is equal to 1 if c would match, which means
+ that we can't change to pop_failure_jump. */
+ if (!not)
+ {
+ p[-3] = (unsigned char) pop_failure_jump;
+ DEBUG_PRINT1 (" No match => pop_failure_jump.\n");
+ }
+ }
+ }
+ }
+ p -= 2; /* Point at relative address again. */
+ if ((re_opcode_t) p[-1] != pop_failure_jump)
+ {
+ p[-1] = (unsigned char) jump;
+ DEBUG_PRINT1 (" Match => jump.\n");
+ goto unconditional_jump;
+ }
+ /* Note fall through. */
+
+
+ /* The end of a simple repeat has a pop_failure_jump back to
+ its matching on_failure_jump, where the latter will push a
+ failure point. The pop_failure_jump takes off failure
+ points put on by this pop_failure_jump's matching
+ on_failure_jump; we got through the pattern to here from the
+ matching on_failure_jump, so didn't fail. */
+ case pop_failure_jump:
+ {
+ /* We need to pass separate storage for the lowest and
+ highest registers, even though we don't care about the
+ actual values. Otherwise, we will restore only one
+ register from the stack, since lowest will == highest in
+ `pop_failure_point'. */
+ unsigned dummy_low_reg, dummy_high_reg;
+ unsigned char *pdummy;
+ const char *sdummy;
+
+ DEBUG_PRINT1 ("EXECUTING pop_failure_jump.\n");
+ POP_FAILURE_POINT (sdummy, pdummy,
+ dummy_low_reg, dummy_high_reg,
+ reg_dummy, reg_dummy, reg_info_dummy);
+ }
+ /* Note fall through. */
+
+
+ /* Unconditionally jump (without popping any failure points). */
+ case jump:
+ unconditional_jump:
+ EXTRACT_NUMBER_AND_INCR (mcnt, p); /* Get the amount to jump. */
+ DEBUG_PRINT2 ("EXECUTING jump %d ", mcnt);
+ p += mcnt; /* Do the jump. */
+ DEBUG_PRINT2 ("(to 0x%x).\n", p);
+ break;
+
+
+ /* We need this opcode so we can detect where alternatives end
+ in `group_match_null_string_p' et al. */
+ case jump_past_alt:
+ DEBUG_PRINT1 ("EXECUTING jump_past_alt.\n");
+ goto unconditional_jump;
+
+
+ /* Normally, the on_failure_jump pushes a failure point, which
+ then gets popped at pop_failure_jump. We will end up at
+ pop_failure_jump, also, and with a pattern of, say, `a+', we
+ are skipping over the on_failure_jump, so we have to push
+ something meaningless for pop_failure_jump to pop. */
+ case dummy_failure_jump:
+ DEBUG_PRINT1 ("EXECUTING dummy_failure_jump.\n");
+ /* It doesn't matter what we push for the string here. What
+ the code at `fail' tests is the value for the pattern. */
+ PUSH_FAILURE_POINT (0, 0, -2);
+ goto unconditional_jump;
+
+
+ /* At the end of an alternative, we need to push a dummy failure
+ point in case we are followed by a `pop_failure_jump', because
+ we don't want the failure point for the alternative to be
+ popped. For example, matching `(a|ab)*' against `aab'
+ requires that we match the `ab' alternative. */
+ case push_dummy_failure:
+ DEBUG_PRINT1 ("EXECUTING push_dummy_failure.\n");
+ /* See comments just above at `dummy_failure_jump' about the
+ two zeroes. */
+ PUSH_FAILURE_POINT (0, 0, -2);
+ break;
+
+ /* Have to succeed matching what follows at least n times.
+ After that, handle like `on_failure_jump'. */
+ case succeed_n:
+ EXTRACT_NUMBER (mcnt, p + 2);
+ DEBUG_PRINT2 ("EXECUTING succeed_n %d.\n", mcnt);
+
+ assert (mcnt >= 0);
+ /* Originally, this is how many times we HAVE to succeed. */
+ if (mcnt > 0)
+ {
+ mcnt--;
+ p += 2;
+ STORE_NUMBER_AND_INCR (p, mcnt);
+ DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p, mcnt);
+ }
+ else if (mcnt == 0)
+ {
+ DEBUG_PRINT2 (" Setting two bytes from 0x%x to no_op.\n", p+2);
+ p[2] = (unsigned char) no_op;
+ p[3] = (unsigned char) no_op;
+ goto on_failure;
+ }
+ break;
+
+ case jump_n:
+ EXTRACT_NUMBER (mcnt, p + 2);
+ DEBUG_PRINT2 ("EXECUTING jump_n %d.\n", mcnt);
+
+ /* Originally, this is how many times we CAN jump. */
+ if (mcnt)
+ {
+ mcnt--;
+ STORE_NUMBER (p + 2, mcnt);
+ goto unconditional_jump;
+ }
+ /* If don't have to jump any more, skip over the rest of command. */
+ else
+ p += 4;
+ break;
+
+ case set_number_at:
+ {
+ DEBUG_PRINT1 ("EXECUTING set_number_at.\n");
+
+ EXTRACT_NUMBER_AND_INCR (mcnt, p);
+ p1 = p + mcnt;
+ EXTRACT_NUMBER_AND_INCR (mcnt, p);
+ DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p1, mcnt);
+ STORE_NUMBER (p1, mcnt);
+ break;
+ }
+
+ case wordbound:
+ DEBUG_PRINT1 ("EXECUTING wordbound.\n");
+ if (AT_WORD_BOUNDARY (d))
+ break;
+ goto fail;
+
+ case notwordbound:
+ DEBUG_PRINT1 ("EXECUTING notwordbound.\n");
+ if (AT_WORD_BOUNDARY (d))
+ goto fail;
+ break;
+
+ case wordbeg:
+ DEBUG_PRINT1 ("EXECUTING wordbeg.\n");
+ if (WORDCHAR_P (d) && (AT_STRINGS_BEG (d) || !WORDCHAR_P (d - 1)))
+ break;
+ goto fail;
+
+ case wordend:
+ DEBUG_PRINT1 ("EXECUTING wordend.\n");
+ if (!AT_STRINGS_BEG (d) && WORDCHAR_P (d - 1)
+ && (!WORDCHAR_P (d) || AT_STRINGS_END (d)))
+ break;
+ goto fail;
+
+#ifdef emacs
+#ifdef emacs19
+ case before_dot:
+ DEBUG_PRINT1 ("EXECUTING before_dot.\n");
+ if (PTR_CHAR_POS ((unsigned char *) d) >= point)
+ goto fail;
+ break;
+
+ case at_dot:
+ DEBUG_PRINT1 ("EXECUTING at_dot.\n");
+ if (PTR_CHAR_POS ((unsigned char *) d) != point)
+ goto fail;
+ break;
+
+ case after_dot:
+ DEBUG_PRINT1 ("EXECUTING after_dot.\n");
+ if (PTR_CHAR_POS ((unsigned char *) d) <= point)
+ goto fail;
+ break;
+#else /* not emacs19 */
+ case at_dot:
+ DEBUG_PRINT1 ("EXECUTING at_dot.\n");
+ if (PTR_CHAR_POS ((unsigned char *) d) + 1 != point)
+ goto fail;
+ break;
+#endif /* not emacs19 */
+
+ case syntaxspec:
+ DEBUG_PRINT2 ("EXECUTING syntaxspec %d.\n", mcnt);
+ mcnt = *p++;
+ goto matchsyntax;
+
+ case wordchar:
+ DEBUG_PRINT1 ("EXECUTING Emacs wordchar.\n");
+ mcnt = (int) Sword;
+ matchsyntax:
+ PREFETCH ();
+ if (SYNTAX (*d++) != (enum syntaxcode) mcnt)
+ goto fail;
+ SET_REGS_MATCHED ();
+ break;
+
+ case notsyntaxspec:
+ DEBUG_PRINT2 ("EXECUTING notsyntaxspec %d.\n", mcnt);
+ mcnt = *p++;
+ goto matchnotsyntax;
+
+ case notwordchar:
+ DEBUG_PRINT1 ("EXECUTING Emacs notwordchar.\n");
+ mcnt = (int) Sword;
+ matchnotsyntax:
+ PREFETCH ();
+ if (SYNTAX (*d++) == (enum syntaxcode) mcnt)
+ goto fail;
+ SET_REGS_MATCHED ();
+ break;
+
+#else /* not emacs */
+ case wordchar:
+ DEBUG_PRINT1 ("EXECUTING non-Emacs wordchar.\n");
+ PREFETCH ();
+ if (!WORDCHAR_P (d))
+ goto fail;
+ SET_REGS_MATCHED ();
+ d++;
+ break;
+
+ case notwordchar:
+ DEBUG_PRINT1 ("EXECUTING non-Emacs notwordchar.\n");
+ PREFETCH ();
+ if (WORDCHAR_P (d))
+ goto fail;
+ SET_REGS_MATCHED ();
+ d++;
+ break;
+#endif /* not emacs */
+
+ default:
+ abort ();
+ }
+ continue; /* Successfully executed one pattern command; keep going. */
+
+
+ /* We goto here if a matching operation fails. */
+ fail:
+ if (!FAIL_STACK_EMPTY ())
+ { /* A restart point is known. Restore to that state. */
+ DEBUG_PRINT1 ("\nFAIL:\n");
+ POP_FAILURE_POINT (d, p,
+ lowest_active_reg, highest_active_reg,
+ regstart, regend, reg_info);
+
+ /* If this failure point is a dummy, try the next one. */
+ if (!p)
+ goto fail;
+
+ /* If we failed to the end of the pattern, don't examine *p. */
+ assert (p <= pend);
+ if (p < pend)
+ {
+ boolean is_a_jump_n = false;
+
+ /* If failed to a backwards jump that's part of a repetition
+ loop, need to pop this failure point and use the next one. */
+ switch ((re_opcode_t) *p)
+ {
+ case jump_n:
+ is_a_jump_n = true;
+ case maybe_pop_jump:
+ case pop_failure_jump:
+ case jump:
+ p1 = p + 1;
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+ p1 += mcnt;
+
+ if ((is_a_jump_n && (re_opcode_t) *p1 == succeed_n)
+ || (!is_a_jump_n
+ && (re_opcode_t) *p1 == on_failure_jump))
+ goto fail;
+ break;
+ default:
+ /* do nothing */ ;
+ }
+ }
+
+ if (d >= string1 && d <= end1)
+ dend = end_match_1;
+ }
+ else
+ break; /* Matching at this starting point really fails. */
+ } /* for (;;) */
+
+ if (best_regs_set)
+ goto restore_best_regs;
+
+ FREE_VARIABLES ();
+
+ return -1; /* Failure to match. */
+} /* re_match_2 */
+
+/* Subroutine definitions for re_match_2. */
+
+
+/* We are passed P pointing to a register number after a start_memory.
+
+ Return true if the pattern up to the corresponding stop_memory can
+ match the empty string, and false otherwise.
+
+ If we find the matching stop_memory, sets P to point to one past its number.
+ Otherwise, sets P to an undefined byte less than or equal to END.
+
+ We don't handle duplicates properly (yet). */
+
+static boolean
+group_match_null_string_p (p, end, reg_info)
+ unsigned char **p, *end;
+ register_info_type *reg_info;
+{
+ int mcnt;
+ /* Point to after the args to the start_memory. */
+ unsigned char *p1 = *p + 2;
+
+ while (p1 < end)
+ {
+ /* Skip over opcodes that can match nothing, and return true or
+ false, as appropriate, when we get to one that can't, or to the
+ matching stop_memory. */
+
+ switch ((re_opcode_t) *p1)
+ {
+ /* Could be either a loop or a series of alternatives. */
+ case on_failure_jump:
+ p1++;
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+
+ /* If the next operation is not a jump backwards in the
+ pattern. */
+
+ if (mcnt >= 0)
+ {
+ /* Go through the on_failure_jumps of the alternatives,
+ seeing if any of the alternatives cannot match nothing.
+ The last alternative starts with only a jump,
+ whereas the rest start with on_failure_jump and end
+ with a jump, e.g., here is the pattern for `a|b|c':
+
+ /on_failure_jump/0/6/exactn/1/a/jump_past_alt/0/6
+ /on_failure_jump/0/6/exactn/1/b/jump_past_alt/0/3
+ /exactn/1/c
+
+ So, we have to first go through the first (n-1)
+ alternatives and then deal with the last one separately. */
+
+
+ /* Deal with the first (n-1) alternatives, which start
+ with an on_failure_jump (see above) that jumps to right
+ past a jump_past_alt. */
+
+ while ((re_opcode_t) p1[mcnt-3] == jump_past_alt)
+ {
+ /* `mcnt' holds how many bytes long the alternative
+ is, including the ending `jump_past_alt' and
+ its number. */
+
+ if (!alt_match_null_string_p (p1, p1 + mcnt - 3,
+ reg_info))
+ return false;
+
+ /* Move to right after this alternative, including the
+ jump_past_alt. */
+ p1 += mcnt;
+
+ /* Break if it's the beginning of an n-th alternative
+ that doesn't begin with an on_failure_jump. */
+ if ((re_opcode_t) *p1 != on_failure_jump)
+ break;
+
+ /* Still have to check that it's not an n-th
+ alternative that starts with an on_failure_jump. */
+ p1++;
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+ if ((re_opcode_t) p1[mcnt-3] != jump_past_alt)
+ {
+ /* Get to the beginning of the n-th alternative. */
+ p1 -= 3;
+ break;
+ }
+ }
+
+ /* Deal with the last alternative: go back and get number
+ of the `jump_past_alt' just before it. `mcnt' contains
+ the length of the alternative. */
+ EXTRACT_NUMBER (mcnt, p1 - 2);
+
+ if (!alt_match_null_string_p (p1, p1 + mcnt, reg_info))
+ return false;
+
+ p1 += mcnt; /* Get past the n-th alternative. */
+ } /* if mcnt > 0 */
+ break;
+
+
+ case stop_memory:
+ assert (p1[1] == **p);
+ *p = p1 + 2;
+ return true;
+
+
+ default:
+ if (!common_op_match_null_string_p (&p1, end, reg_info))
+ return false;
+ }
+ } /* while p1 < end */
+
+ return false;
+} /* group_match_null_string_p */
+
+
+/* Similar to group_match_null_string_p, but doesn't deal with alternatives:
+ It expects P to be the first byte of a single alternative and END one
+ byte past the last. The alternative can contain groups. */
+
+static boolean
+alt_match_null_string_p (p, end, reg_info)
+ unsigned char *p, *end;
+ register_info_type *reg_info;
+{
+ int mcnt;
+ unsigned char *p1 = p;
+
+ while (p1 < end)
+ {
+ /* Skip over opcodes that can match nothing, and break when we get
+ to one that can't. */
+
+ switch ((re_opcode_t) *p1)
+ {
+ /* It's a loop. */
+ case on_failure_jump:
+ p1++;
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+ p1 += mcnt;
+ break;
+
+ default:
+ if (!common_op_match_null_string_p (&p1, end, reg_info))
+ return false;
+ }
+ } /* while p1 < end */
+
+ return true;
+} /* alt_match_null_string_p */
+
+
+/* Deals with the ops common to group_match_null_string_p and
+ alt_match_null_string_p.
+
+ Sets P to one after the op and its arguments, if any. */
+
+static boolean
+common_op_match_null_string_p (p, end, reg_info)
+ unsigned char **p, *end;
+ register_info_type *reg_info;
+{
+ int mcnt;
+ boolean ret;
+ int reg_no;
+ unsigned char *p1 = *p;
+
+ switch ((re_opcode_t) *p1++)
+ {
+ case no_op:
+ case begline:
+ case endline:
+ case begbuf:
+ case endbuf:
+ case wordbeg:
+ case wordend:
+ case wordbound:
+ case notwordbound:
+#ifdef emacs
+ case before_dot:
+ case at_dot:
+ case after_dot:
+#endif
+ break;
+
+ case start_memory:
+ reg_no = *p1;
+ assert (reg_no > 0 && reg_no <= MAX_REGNUM);
+ ret = group_match_null_string_p (&p1, end, reg_info);
+
+ /* Have to set this here in case we're checking a group which
+ contains a group and a back reference to it. */
+
+ if (REG_MATCH_NULL_STRING_P (reg_info[reg_no]) == MATCH_NULL_UNSET_VALUE)
+ REG_MATCH_NULL_STRING_P (reg_info[reg_no]) = ret;
+
+ if (!ret)
+ return false;
+ break;
+
+ /* If this is an optimized succeed_n for zero times, make the jump. */
+ case jump:
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+ if (mcnt >= 0)
+ p1 += mcnt;
+ else
+ return false;
+ break;
+
+ case succeed_n:
+ /* Get to the number of times to succeed. */
+ p1 += 2;
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+
+ if (mcnt == 0)
+ {
+ p1 -= 4;
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+ p1 += mcnt;
+ }
+ else
+ return false;
+ break;
+
+ case duplicate:
+ if (!REG_MATCH_NULL_STRING_P (reg_info[*p1]))
+ return false;
+ break;
+
+ case set_number_at:
+ p1 += 4;
+
+ default:
+ /* All other opcodes mean we cannot match the empty string. */
+ return false;
+ }
+
+ *p = p1;
+ return true;
+} /* common_op_match_null_string_p */
+
+
+/* Return zero if TRANSLATE[S1] and TRANSLATE[S2] are identical for LEN
+ bytes; nonzero otherwise. */
+
+static int
+bcmp_translate(
+ unsigned char *s1,
+ unsigned char *s2,
+ int len,
+ char *translate
+)
+{
+ register unsigned char *p1 = s1, *p2 = s2;
+ while (len)
+ {
+ if (translate[*p1++] != translate[*p2++]) return 1;
+ len--;
+ }
+ return 0;
+}
+
+/* Entry points for GNU code. */
+
+/* re_compile_pattern is the GNU regular expression compiler: it
+ compiles PATTERN (of length SIZE) and puts the result in BUFP.
+ Returns 0 if the pattern was valid, otherwise an error string.
+
+ Assumes the `allocated' (and perhaps `buffer') and `translate' fields
+ are set in BUFP on entry.
+
+ We call regex_compile to do the actual compilation. */
+
+const char *
+re_compile_pattern (pattern, length, bufp)
+ const char *pattern;
+ int length;
+ struct re_pattern_buffer *bufp;
+{
+ reg_errcode_t ret;
+
+ /* GNU code is written to assume at least RE_NREGS registers will be set
+ (and at least one extra will be -1). */
+ bufp->regs_allocated = REGS_UNALLOCATED;
+
+ /* And GNU code determines whether or not to get register information
+ by passing null for the REGS argument to re_match, etc., not by
+ setting no_sub. */
+ bufp->no_sub = 0;
+
+ /* Match anchors at newline. */
+ bufp->newline_anchor = 1;
+
+ ret = regex_compile (pattern, length, re_syntax_options, bufp);
+
+ return re_error_msg[(int) ret];
+}
+
+/* Entry points compatible with 4.2 BSD regex library. We don't define
+ them if this is an Emacs or POSIX compilation. */
+
+#if !defined (emacs) && !defined (_POSIX_SOURCE)
+
+/* BSD has one and only one pattern buffer. */
+static struct re_pattern_buffer re_comp_buf;
+
+char *
+re_comp (s)
+ const char *s;
+{
+ reg_errcode_t ret;
+
+ if (!s)
+ {
+ if (!re_comp_buf.buffer)
+ return "No previous regular expression";
+ return 0;
+ }
+
+ if (!re_comp_buf.buffer)
+ {
+ re_comp_buf.buffer = (unsigned char *) malloc (200);
+ if (re_comp_buf.buffer == NULL)
+ return "Memory exhausted";
+ re_comp_buf.allocated = 200;
+
+ re_comp_buf.fastmap = (char *) malloc (1 << BYTEWIDTH);
+ if (re_comp_buf.fastmap == NULL)
+ return "Memory exhausted";
+ }
+
+ /* Since `re_exec' always passes NULL for the `regs' argument, we
+ don't need to initialize the pattern buffer fields which affect it. */
+
+ /* Match anchors at newlines. */
+ re_comp_buf.newline_anchor = 1;
+
+ ret = regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf);
+
+ /* Yes, we're discarding `const' here. */
+ return (char *) re_error_msg[(int) ret];
+}
+
+
+int
+re_exec (s)
+ const char *s;
+{
+ const int len = strlen (s);
+ return
+ 0 <= re_search (&re_comp_buf, s, len, 0, len, (struct re_registers *) 0);
+}
+#endif /* not emacs and not _POSIX_SOURCE */
+
+/* POSIX.2 functions. Don't define these for Emacs. */
+
+#ifndef emacs
+
+/* regcomp takes a regular expression as a string and compiles it.
+
+ PREG is a regex_t *. We do not expect any fields to be initialized,
+ since POSIX says we shouldn't. Thus, we set
+
+ `buffer' to the compiled pattern;
+ `used' to the length of the compiled pattern;
+ `syntax' to RE_SYNTAX_POSIX_EXTENDED if the
+ REG_EXTENDED bit in CFLAGS is set; otherwise, to
+ RE_SYNTAX_POSIX_BASIC;
+ `newline_anchor' to REG_NEWLINE being set in CFLAGS;
+ `fastmap' and `fastmap_accurate' to zero;
+ `re_nsub' to the number of subexpressions in PATTERN.
+
+ PATTERN is the address of the pattern string.
+
+ CFLAGS is a series of bits which affect compilation.
+
+ If REG_EXTENDED is set, we use POSIX extended syntax; otherwise, we
+ use POSIX basic syntax.
+
+ If REG_NEWLINE is set, then . and [^...] don't match newline.
+ Also, regexec will try a match beginning after every newline.
+
+ If REG_ICASE is set, then we considers upper- and lowercase
+ versions of letters to be equivalent when matching.
+
+ If REG_NOSUB is set, then when PREG is passed to regexec, that
+ routine will report only success or failure, and nothing about the
+ registers.
+
+ It returns 0 if it succeeds, nonzero if it doesn't. (See regex.h for
+ the return codes and their meanings.) */
+
+int
+regcomp (preg, pattern, cflags)
+ regex_t *preg;
+ const char *pattern;
+ int cflags;
+{
+ reg_errcode_t ret;
+ unsigned syntax
+ = (cflags & REG_EXTENDED) ?
+ RE_SYNTAX_POSIX_EXTENDED : RE_SYNTAX_POSIX_BASIC;
+
+ /* regex_compile will allocate the space for the compiled pattern. */
+ preg->buffer = 0;
+ preg->allocated = 0;
+
+ /* Don't bother to use a fastmap when searching. This simplifies the
+ REG_NEWLINE case: if we used a fastmap, we'd have to put all the
+ characters after newlines into the fastmap. This way, we just try
+ every character. */
+ preg->fastmap = 0;
+
+ if (cflags & REG_ICASE)
+ {
+ unsigned i;
+
+ preg->translate = (char *) malloc (CHAR_SET_SIZE);
+ if (preg->translate == NULL)
+ return (int) REG_ESPACE;
+
+ /* Map uppercase characters to corresponding lowercase ones. */
+ for (i = 0; i < CHAR_SET_SIZE; i++)
+ preg->translate[i] = ISUPPER (i) ? tolower (i) : i;
+ }
+ else
+ preg->translate = NULL;
+
+ /* If REG_NEWLINE is set, newlines are treated differently. */
+ if (cflags & REG_NEWLINE)
+ { /* REG_NEWLINE implies neither . nor [^...] match newline. */
+ syntax &= ~RE_DOT_NEWLINE;
+ syntax |= RE_HAT_LISTS_NOT_NEWLINE;
+ /* It also changes the matching behavior. */
+ preg->newline_anchor = 1;
+ }
+ else
+ preg->newline_anchor = 0;
+
+ preg->no_sub = !!(cflags & REG_NOSUB);
+
+ /* POSIX says a null character in the pattern terminates it, so we
+ can use strlen here in compiling the pattern. */
+ ret = regex_compile (pattern, strlen (pattern), syntax, preg);
+
+ /* POSIX doesn't distinguish between an unmatched open-group and an
+ unmatched close-group: both are REG_EPAREN. */
+ if (ret == REG_ERPAREN) ret = REG_EPAREN;
+
+ return (int) ret;
+}
+
+
+/* regexec searches for a given pattern, specified by PREG, in the
+ string STRING.
+
+ If NMATCH is zero or REG_NOSUB was set in the cflags argument to
+ `regcomp', we ignore PMATCH. Otherwise, we assume PMATCH has at
+ least NMATCH elements, and we set them to the offsets of the
+ corresponding matched substrings.
+
+ EFLAGS specifies `execution flags' which affect matching: if
+ REG_NOTBOL is set, then ^ does not match at the beginning of the
+ string; if REG_NOTEOL is set, then $ does not match at the end.
+
+ We return 0 if we find a match and REG_NOMATCH if not. */
+
+int
+regexec (preg, string, nmatch, pmatch, eflags)
+ const regex_t *preg;
+ const char *string;
+ size_t nmatch;
+ regmatch_t pmatch[];
+ int eflags;
+{
+ int ret;
+ struct re_registers regs;
+ regex_t private_preg;
+ int len = strlen (string);
+ boolean want_reg_info = !preg->no_sub && nmatch > 0;
+
+ private_preg = *preg;
+
+ private_preg.not_bol = !!(eflags & REG_NOTBOL);
+ private_preg.not_eol = !!(eflags & REG_NOTEOL);
+
+ /* The user has told us exactly how many registers to return
+ information about, via `nmatch'. We have to pass that on to the
+ matching routines. */
+ private_preg.regs_allocated = REGS_FIXED;
+
+ if (want_reg_info)
+ {
+ regs.num_regs = nmatch;
+ regs.start = TALLOC (nmatch, regoff_t);
+ regs.end = TALLOC (nmatch, regoff_t);
+ if (regs.start == NULL || regs.end == NULL)
+ return (int) REG_NOMATCH;
+ }
+
+ /* Perform the searching operation. */
+ ret = re_search (&private_preg, string, len,
+ /* start: */ 0, /* range: */ len,
+ want_reg_info ? ®s : (struct re_registers *) 0);
+
+ /* Copy the register information to the POSIX structure. */
+ if (want_reg_info)
+ {
+ if (ret >= 0)
+ {
+ unsigned r;
+
+ for (r = 0; r < nmatch; r++)
+ {
+ pmatch[r].rm_so = regs.start[r];
+ pmatch[r].rm_eo = regs.end[r];
+ }
+ }
+
+ /* If we needed the temporary register info, free the space now. */
+ free (regs.start);
+ free (regs.end);
+ }
+
+ /* We want zero return to mean success, unlike `re_search'. */
+ return ret >= 0 ? (int) REG_NOERROR : (int) REG_NOMATCH;
+}
+
+
+/* Returns a message corresponding to an error code, ERRCODE, returned
+ from either regcomp or regexec. We don't use PREG here. */
+
+size_t
+regerror (errcode, preg, errbuf, errbuf_size)
+ int errcode;
+ const regex_t *preg;
+ char *errbuf;
+ size_t errbuf_size;
+{
+ const char *msg;
+ size_t msg_size;
+
+ if (errcode < 0
+ || errcode >= (sizeof (re_error_msg) / sizeof (re_error_msg[0])))
+ /* Only error codes returned by the rest of the code should be passed
+ to this routine. If we are given anything else, or if other regex
+ code generates an invalid error code, then the program has a bug.
+ Dump core so we can fix it. */
+ abort ();
+
+ msg = re_error_msg[errcode];
+
+ /* POSIX doesn't require that we do anything in this case, but why
+ not be nice. */
+ if (! msg)
+ msg = "Success";
+
+ msg_size = strlen (msg) + 1; /* Includes the null. */
+
+ if (errbuf_size != 0)
+ {
+ if (msg_size > errbuf_size)
+ {
+ strncpy (errbuf, msg, errbuf_size - 1);
+ errbuf[errbuf_size - 1] = 0;
+ }
+ else
+ strcpy (errbuf, msg);
+ }
+
+ return msg_size;
+}
+
+
+/* Free dynamically allocated space used by PREG. */
+
+void
+regfree (preg)
+ regex_t *preg;
+{
+ if (preg->buffer != NULL)
+ free (preg->buffer);
+ preg->buffer = NULL;
+
+ preg->allocated = 0;
+ preg->used = 0;
+
+ if (preg->fastmap != NULL)
+ free (preg->fastmap);
+ preg->fastmap = NULL;
+ preg->fastmap_accurate = 0;
+
+ if (preg->translate != NULL)
+ free (preg->translate);
+ preg->translate = NULL;
+}
+
+#endif /* not emacs */
+
+/*
+Local variables:
+make-backup-files: t
+version-control: t
+trim-versions-without-asking: nil
+End:
+*/
diff --git a/src/compat/regex.h b/src/compat/regex.h
new file mode 100644
index 0000000..2b4796d
--- /dev/null
+++ b/src/compat/regex.h
@@ -0,0 +1,498 @@
+/* Definitions for data structures and routines for the regular
+ expression library, version 0.12.
+
+ Copyright (C) 1985, 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#ifndef __REGEXP_LIBRARY_H__
+#define __REGEXP_LIBRARY_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* POSIX says that <sys/types.h> must be included (by the caller) before
+ <regex.h>. */
+
+#ifdef VMS
+/* VMS doesn't have `size_t' in <sys/types.h>, even though POSIX says it
+ should be there. */
+#include <stddef.h>
+#endif
+
+
+/* The following bits are used to determine the regexp syntax we
+ recognize. The set/not-set meanings are chosen so that Emacs syntax
+ remains the value 0. The bits are given in alphabetical order, and
+ the definitions shifted by one from the previous bit; thus, when we
+ add or remove a bit, only one other definition need change. */
+typedef unsigned reg_syntax_t;
+
+/* If this bit is not set, then \ inside a bracket expression is literal.
+ If set, then such a \ quotes the following character. */
+#define RE_BACKSLASH_ESCAPE_IN_LISTS (1)
+
+/* If this bit is not set, then + and ? are operators, and \+ and \? are
+ literals.
+ If set, then \+ and \? are operators and + and ? are literals. */
+#define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
+
+/* If this bit is set, then character classes are supported. They are:
+ [:alpha:], [:upper:], [:lower:], [:digit:], [:alnum:], [:xdigit:],
+ [:space:], [:print:], [:punct:], [:graph:], and [:cntrl:].
+ If not set, then character classes are not supported. */
+#define RE_CHAR_CLASSES (RE_BK_PLUS_QM << 1)
+
+/* If this bit is set, then ^ and $ are always anchors (outside bracket
+ expressions, of course).
+ If this bit is not set, then it depends:
+ ^ is an anchor if it is at the beginning of a regular
+ expression or after an open-group or an alternation operator;
+ $ is an anchor if it is at the end of a regular expression, or
+ before a close-group or an alternation operator.
+
+ This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
+ POSIX draft 11.2 says that * etc. in leading positions is undefined.
+ We already implemented a previous draft which made those constructs
+ invalid, though, so we haven't changed the code back. */
+#define RE_CONTEXT_INDEP_ANCHORS (RE_CHAR_CLASSES << 1)
+
+/* If this bit is set, then special characters are always special
+ regardless of where they are in the pattern.
+ If this bit is not set, then special characters are special only in
+ some contexts; otherwise they are ordinary. Specifically,
+ * + ? and intervals are only special when not after the beginning,
+ open-group, or alternation operator. */
+#define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)
+
+/* If this bit is set, then *, +, ?, and { cannot be first in an re or
+ immediately after an alternation or begin-group operator. */
+#define RE_CONTEXT_INVALID_OPS (RE_CONTEXT_INDEP_OPS << 1)
+
+/* If this bit is set, then . matches newline.
+ If not set, then it doesn't. */
+#define RE_DOT_NEWLINE (RE_CONTEXT_INVALID_OPS << 1)
+
+/* If this bit is set, then . doesn't match NUL.
+ If not set, then it does. */
+#define RE_DOT_NOT_NULL (RE_DOT_NEWLINE << 1)
+
+/* If this bit is set, nonmatching lists [^...] do not match newline.
+ If not set, they do. */
+#define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)
+
+/* If this bit is set, either \{...\} or {...} defines an
+ interval, depending on RE_NO_BK_BRACES.
+ If not set, \{, \}, {, and } are literals. */
+#define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
+
+/* If this bit is set, +, ? and | aren't recognized as operators.
+ If not set, they are. */
+#define RE_LIMITED_OPS (RE_INTERVALS << 1)
+
+/* If this bit is set, newline is an alternation operator.
+ If not set, newline is literal. */
+#define RE_NEWLINE_ALT (RE_LIMITED_OPS << 1)
+
+/* If this bit is set, then `{...}' defines an interval, and \{ and \}
+ are literals.
+ If not set, then `\{...\}' defines an interval. */
+#define RE_NO_BK_BRACES (RE_NEWLINE_ALT << 1)
+
+/* If this bit is set, (...) defines a group, and \( and \) are literals.
+ If not set, \(...\) defines a group, and ( and ) are literals. */
+#define RE_NO_BK_PARENS (RE_NO_BK_BRACES << 1)
+
+/* If this bit is set, then \<digit> matches <digit>.
+ If not set, then \<digit> is a back-reference. */
+#define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)
+
+/* If this bit is set, then | is an alternation operator, and \| is literal.
+ If not set, then \| is an alternation operator, and | is literal. */
+#define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)
+
+/* If this bit is set, then an ending range point collating higher
+ than the starting range point, as in [z-a], is invalid.
+ If not set, then when ending range point collates higher than the
+ starting range point, the range is ignored. */
+#define RE_NO_EMPTY_RANGES (RE_NO_BK_VBAR << 1)
+
+/* If this bit is set, then an unmatched ) is ordinary.
+ If not set, then an unmatched ) is invalid. */
+#define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES << 1)
+
+/* This global variable defines the particular regexp syntax to use (for
+ some interfaces). When a regexp is compiled, the syntax used is
+ stored in the pattern buffer, so changing this does not affect
+ already-compiled regexps. */
+extern reg_syntax_t re_syntax_options;
+
+/* Define combinations of the above bits for the standard possibilities.
+ (The [[[ comments delimit what gets put into the Texinfo file, so
+ don't delete them!) */
+/* [[[begin syntaxes]]] */
+#define RE_SYNTAX_EMACS 0
+
+#define RE_SYNTAX_AWK \
+ (RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \
+ | RE_NO_BK_PARENS | RE_NO_BK_REFS \
+ | RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \
+ | RE_UNMATCHED_RIGHT_PAREN_ORD)
+
+#define RE_SYNTAX_POSIX_AWK \
+ (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS)
+
+#define RE_SYNTAX_GREP \
+ (RE_BK_PLUS_QM | RE_CHAR_CLASSES \
+ | RE_HAT_LISTS_NOT_NEWLINE | RE_INTERVALS \
+ | RE_NEWLINE_ALT)
+
+#define RE_SYNTAX_EGREP \
+ (RE_CHAR_CLASSES | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_CONTEXT_INDEP_OPS | RE_HAT_LISTS_NOT_NEWLINE \
+ | RE_NEWLINE_ALT | RE_NO_BK_PARENS \
+ | RE_NO_BK_VBAR)
+
+#define RE_SYNTAX_POSIX_EGREP \
+ (RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES)
+
+/* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */
+#define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC
+
+#define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC
+
+/* Syntax bits common to both basic and extended POSIX regex syntax. */
+#define _RE_SYNTAX_POSIX_COMMON \
+ (RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \
+ | RE_INTERVALS | RE_NO_EMPTY_RANGES)
+
+#define RE_SYNTAX_POSIX_BASIC \
+ (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM)
+
+/* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes
+ RE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this
+ isn't minimal, since other operators, such as \`, aren't disabled. */
+#define RE_SYNTAX_POSIX_MINIMAL_BASIC \
+ (_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS)
+
+#define RE_SYNTAX_POSIX_EXTENDED \
+ (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \
+ | RE_NO_BK_PARENS | RE_NO_BK_VBAR \
+ | RE_UNMATCHED_RIGHT_PAREN_ORD)
+
+/* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INVALID_OPS
+ replaces RE_CONTEXT_INDEP_OPS and RE_NO_BK_REFS is added. */
+#define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \
+ (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \
+ | RE_NO_BK_PARENS | RE_NO_BK_REFS \
+ | RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD)
+/* [[[end syntaxes]]] */
+
+/* Maximum number of duplicates an interval can allow. Some systems
+ (erroneously) define this in other header files, but we want our
+ value, so remove any previous define. */
+#ifdef RE_DUP_MAX
+#undef RE_DUP_MAX
+#endif
+#define RE_DUP_MAX ((1 << 15) - 1)
+
+
+/* POSIX `cflags' bits (i.e., information for `regcomp'). */
+
+/* If this bit is set, then use extended regular expression syntax.
+ If not set, then use basic regular expression syntax. */
+#define REG_EXTENDED 1
+
+/* If this bit is set, then ignore case when matching.
+ If not set, then case is significant. */
+#define REG_ICASE (REG_EXTENDED << 1)
+
+/* If this bit is set, then anchors do not match at newline
+ characters in the string.
+ If not set, then anchors do match at newlines. */
+#define REG_NEWLINE (REG_ICASE << 1)
+
+/* If this bit is set, then report only success or fail in regexec.
+ If not set, then returns differ between not matching and errors. */
+#define REG_NOSUB (REG_NEWLINE << 1)
+
+
+/* POSIX `eflags' bits (i.e., information for regexec). */
+
+/* If this bit is set, then the beginning-of-line operator doesn't match
+ the beginning of the string (presumably because it's not the
+ beginning of a line).
+ If not set, then the beginning-of-line operator does match the
+ beginning of the string. */
+#define REG_NOTBOL 1
+
+/* Like REG_NOTBOL, except for the end-of-line. */
+#define REG_NOTEOL (1 << 1)
+
+
+/* If any error codes are removed, changed, or added, update the
+ `re_error_msg' table in regex.c. */
+typedef enum
+{
+ REG_NOERROR = 0, /* Success. */
+ REG_NOMATCH, /* Didn't find a match (for regexec). */
+
+ /* POSIX regcomp return error codes. (In the order listed in the
+ standard.) */
+ REG_BADPAT, /* Invalid pattern. */
+ REG_ECOLLATE, /* Not implemented. */
+ REG_ECTYPE, /* Invalid character class name. */
+ REG_EESCAPE, /* Trailing backslash. */
+ REG_ESUBREG, /* Invalid back reference. */
+ REG_EBRACK, /* Unmatched left bracket. */
+ REG_EPAREN, /* Parenthesis imbalance. */
+ REG_EBRACE, /* Unmatched \{. */
+ REG_BADBR, /* Invalid contents of \{\}. */
+ REG_ERANGE, /* Invalid range end. */
+ REG_ESPACE, /* Ran out of memory. */
+ REG_BADRPT, /* No preceding re for repetition op. */
+
+ /* Error codes we've added. */
+ REG_EEND, /* Premature end. */
+ REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */
+ REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */
+} reg_errcode_t;
+
+/* This data structure represents a compiled pattern. Before calling
+ the pattern compiler, the fields `buffer', `allocated', `fastmap',
+ `translate', and `no_sub' can be set. After the pattern has been
+ compiled, the `re_nsub' field is available. All other fields are
+ private to the regex routines. */
+
+struct re_pattern_buffer
+{
+/* [[[begin pattern_buffer]]] */
+ /* Space that holds the compiled pattern. It is declared as
+ `unsigned char *' because its elements are
+ sometimes used as array indexes. */
+ unsigned char *buffer;
+
+ /* Number of bytes to which `buffer' points. */
+ unsigned long allocated;
+
+ /* Number of bytes actually used in `buffer'. */
+ unsigned long used;
+
+ /* Syntax setting with which the pattern was compiled. */
+ reg_syntax_t syntax;
+
+ /* Pointer to a fastmap, if any, otherwise zero. re_search uses
+ the fastmap, if there is one, to skip over impossible
+ starting points for matches. */
+ char *fastmap;
+
+ /* Either a translate table to apply to all characters before
+ comparing them, or zero for no translation. The translation
+ is applied to a pattern when it is compiled and to a string
+ when it is matched. */
+ char *translate;
+
+ /* Number of subexpressions found by the compiler. */
+ size_t re_nsub;
+
+ /* Zero if this pattern cannot match the empty string, one else.
+ Well, in truth it's used only in `re_search_2', to see
+ whether or not we should use the fastmap, so we don't set
+ this absolutely perfectly; see `re_compile_fastmap' (the
+ `duplicate' case). */
+ unsigned can_be_null : 1;
+
+ /* If REGS_UNALLOCATED, allocate space in the `regs' structure
+ for `max (RE_NREGS, re_nsub + 1)' groups.
+ If REGS_REALLOCATE, reallocate space if necessary.
+ If REGS_FIXED, use what's there. */
+#define REGS_UNALLOCATED 0
+#define REGS_REALLOCATE 1
+#define REGS_FIXED 2
+ unsigned regs_allocated : 2;
+
+ /* Set to zero when `regex_compile' compiles a pattern; set to one
+ by `re_compile_fastmap' if it updates the fastmap. */
+ unsigned fastmap_accurate : 1;
+
+ /* If set, `re_match_2' does not return information about
+ subexpressions. */
+ unsigned no_sub : 1;
+
+ /* If set, a beginning-of-line anchor doesn't match at the
+ beginning of the string. */
+ unsigned not_bol : 1;
+
+ /* Similarly for an end-of-line anchor. */
+ unsigned not_eol : 1;
+
+ /* If true, an anchor at a newline matches. */
+ unsigned newline_anchor : 1;
+
+/* [[[end pattern_buffer]]] */
+};
+
+typedef struct re_pattern_buffer regex_t;
+
+
+/* search.c (search_buffer) in Emacs needs this one opcode value. It is
+ defined both in `regex.c' and here. */
+#define RE_EXACTN_VALUE 1
+
+/* Type for byte offsets within the string. POSIX mandates this. */
+typedef int regoff_t;
+
+
+/* This is the structure we store register match data in. See
+ regex.texinfo for a full description of what registers match. */
+struct re_registers
+{
+ unsigned num_regs;
+ regoff_t *start;
+ regoff_t *end;
+};
+
+
+/* If `regs_allocated' is REGS_UNALLOCATED in the pattern buffer,
+ `re_match_2' returns information about at least this many registers
+ the first time a `regs' structure is passed. */
+#ifndef RE_NREGS
+#define RE_NREGS 30
+#endif
+
+
+/* POSIX specification for registers. Aside from the different names than
+ `re_registers', POSIX uses an array of structures, instead of a
+ structure of arrays. */
+typedef struct
+{
+ regoff_t rm_so; /* Byte offset from string's start to substring's start. */
+ regoff_t rm_eo; /* Byte offset from string's start to substring's end. */
+} regmatch_t;
+
+/* Declarations for routines. */
+
+/* To avoid duplicating every routine declaration -- once with a
+ prototype (if we are ANSI), and once without (if we aren't) -- we
+ use the following macro to declare argument types. This
+ unfortunately clutters up the declarations a bit, but I think it's
+ worth it. */
+
+#if __STDC__
+
+#define _RE_ARGS(args) args
+
+#else /* not __STDC__ */
+
+#define _RE_ARGS(args) ()
+
+#endif /* not __STDC__ */
+
+/* Sets the current default syntax to SYNTAX, and return the old syntax.
+ You can also simply assign to the `re_syntax_options' variable. */
+extern reg_syntax_t re_set_syntax _RE_ARGS ((reg_syntax_t syntax));
+
+/* Compile the regular expression PATTERN, with length LENGTH
+ and syntax given by the global `re_syntax_options', into the buffer
+ BUFFER. Return NULL if successful, and an error string if not. */
+extern const char *re_compile_pattern
+ _RE_ARGS ((const char *pattern, int length,
+ struct re_pattern_buffer *buffer));
+
+
+/* Compile a fastmap for the compiled pattern in BUFFER; used to
+ accelerate searches. Return 0 if successful and -2 if was an
+ internal error. */
+extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer));
+
+
+/* Search in the string STRING (with length LENGTH) for the pattern
+ compiled into BUFFER. Start searching at position START, for RANGE
+ characters. Return the starting position of the match, -1 for no
+ match, or -2 for an internal error. Also return register
+ information in REGS (if REGS and BUFFER->no_sub are nonzero). */
+extern int re_search
+ _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string_,
+ int length, int start, int range, struct re_registers *regs));
+
+
+/* Like `re_search', but search in the concatenation of STRING1 and
+ STRING2. Also, stop searching at index START + STOP. */
+extern int re_search_2
+ _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
+ int length1, const char *string2, int length2,
+ int start, int range, struct re_registers *regs, int stop));
+
+
+/* Like `re_search', but return how many characters in STRING the regexp
+ in BUFFER matched, starting at position START. */
+extern int re_match
+ _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string_,
+ int length, int start, struct re_registers *regs));
+
+
+/* Relates to `re_match' as `re_search_2' relates to `re_search'. */
+extern int re_match_2
+ _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
+ int length1, const char *string2, int length2,
+ int start, struct re_registers *regs, int stop));
+
+
+/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
+ ENDS. Subsequent matches using BUFFER and REGS will use this memory
+ for recording register information. STARTS and ENDS must be
+ allocated with malloc, and must each be at least `NUM_REGS * sizeof
+ (regoff_t)' bytes long.
+
+ If NUM_REGS == 0, then subsequent matches should allocate their own
+ register data.
+
+ Unless this function is called, the first search or match using
+ PATTERN_BUFFER will allocate its own register data, without
+ freeing the old data. */
+extern void re_set_registers
+ _RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs,
+ unsigned num_regs, regoff_t *starts, regoff_t *ends));
+
+/* 4.2 bsd compatibility. */
+extern char *re_comp _RE_ARGS ((const char *));
+extern int re_exec _RE_ARGS ((const char *));
+
+/* POSIX compatibility. */
+extern int regcomp _RE_ARGS ((regex_t *preg, const char *pattern, int cflags));
+extern int regexec
+ _RE_ARGS ((const regex_t *preg, const char *string_, size_t nmatch,
+ regmatch_t pmatch[], int eflags));
+extern size_t regerror
+ _RE_ARGS ((int errcode, const regex_t *preg, char *errbuf,
+ size_t errbuf_size));
+extern void regfree _RE_ARGS ((regex_t *preg));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* not __REGEXP_LIBRARY_H__ */
+
+/*
+Local variables:
+make-backup-files: t
+version-control: t
+trim-versions-without-asking: nil
+End:
+*/
diff --git a/src/config.h b/src/config.h
new file mode 100644
index 0000000..9d1020e
--- /dev/null
+++ b/src/config.h
@@ -0,0 +1,414 @@
+/* src/config.h. Generated from config.h.in by configure. */
+/* src/config.h.in. Generated from configure.ac by autoheader. */
+
+/* Build platform */
+#define BUILD_BUILD_PLATFORM "i686-pc-linux-gnu"
+
+/* Compiler */
+#define BUILD_COMPILER "gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) "
+
+/* Configure arguments */
+#define BUILD_CONFIGURE_ARGS ""
+
+/* Build date */
+#define BUILD_DATE "Wed Sep 24 07:17:09 CDT 2014"
+
+/* Build host */
+#define BUILD_HOST "dave-acer"
+
+/* Host platform */
+#define BUILD_HOST_PLATFORM "i686-pc-linux-gnu"
+
+/* Target platform */
+#define BUILD_TARGET_PLATFORM "i686-pc-linux-gnu"
+
+/* Build user */
+#define BUILD_USER "dave"
+
+/* Define to 1 if the `closedir' function returns void instead of `int'. */
+/* #undef CLOSEDIR_VOID */
+
+/* FLTK version */
+#define FLTK_BUILD_VERSION "1.3.1"
+
+/* FLWKEY compiler flags */
+#define FLWKEY_BUILD_CXXFLAGS "-I$(srcdir) -I$(srcdir)/include -I$(srcdir)/xmlrpcpp -I/usr/local/include -I/usr/include/freetype2 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_THREAD_SAFE -D_REENTRANT -pipe -Wall -fexceptions -O2 -ffast-math -finline-functions -fomit-frame-pointer -DNDEBUG"
+
+/* FLWKEY linker flags */
+#define FLWKEY_BUILD_LDFLAGS "-lm -lX11 -L/usr/local/lib -lfltk_images -lpng -lz -ljpeg -lfltk -lXext -lXft -lfontconfig -lpthread -ldl -lm -lX11 -ldl -lrt -lpthread"
+
+/* FLTK API major version */
+#define FLWKEY_FLTK_API_MAJOR 1
+
+/* FLTK API minor version */
+#define FLWKEY_FLTK_API_MINOR 3
+
+/* version string */
+#define FLWKEY_VERSION "1.1.6"
+
+/* major version number */
+#define FLWKEY_VERSION_MAJOR 1
+
+/* minor version number */
+#define FLWKEY_VERSION_MINOR 1
+
+/* patch/alpha version string */
+#define FLWKEY_VERSION_PATCH ".6"
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#define HAVE_ARPA_INET_H 1
+
+/* Define to 1 if we have clock_gettime */
+#define HAVE_CLOCK_GETTIME 1
+
+/* Define to 0 if not using dbg::stack */
+/* #undef HAVE_DBG_STACK */
+
+/* Define to 1 if you have the <dev/ppbus/ppi.h> header file. */
+/* #undef HAVE_DEV_PPBUS_PPI_H */
+
+/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
+ */
+#define HAVE_DIRENT_H 1
+
+/* Define to 1 if we have dlopen */
+#define HAVE_DLOPEN 1
+
+/* Define to 1 if you have the <execinfo.h> header file. */
+#define HAVE_EXECINFO_H 1
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
+
+/* Define to 1 if you have the `getaddrinfo' function. */
+#define HAVE_GETADDRINFO 1
+
+/* Define to 1 if you have the `gethostbyname' function. */
+#define HAVE_GETHOSTBYNAME 1
+
+/* Define to 1 if you have the `gmtime_r' function. */
+#define HAVE_GMTIME_R 1
+
+/* Define to 1 if you have the `hstrerror' function. */
+#define HAVE_HSTRERROR 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define to 1 if you have the <linux/ppdev.h> header file. */
+#define HAVE_LINUX_PPDEV_H 1
+
+/* Define to 1 if you have the `localtime_r' function. */
+#define HAVE_LOCALTIME_R 1
+
+/* Define to 1 if you have the `memmove' function. */
+#define HAVE_MEMMOVE 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `memset' function. */
+#define HAVE_MEMSET 1
+
+/* Define to 1 if you have the `mkdir' function. */
+#define HAVE_MKDIR 1
+
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
+/* #undef HAVE_NDIR_H */
+
+/* Define to 1 if you have the <netdb.h> header file. */
+#define HAVE_NETDB_H 1
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#define HAVE_NETINET_IN_H 1
+
+/* Define to 1 if you have the <regex.h> header file. */
+#define HAVE_REGEX_H 1
+
+/* Define to 1 if you have the `select' function. */
+#define HAVE_SELECT 1
+
+/* Define to 1 if we have sem_timedwait */
+#define HAVE_SEM_TIMEDWAIT 1
+
+/* Define to 1 if we have sem_unlink */
+#define HAVE_SEM_UNLINK 1
+
+/* Define to 1 if you have the `setenv' function. */
+#define HAVE_SETENV 1
+
+/* Define to 1 if you have the `snprintf' function. */
+#define HAVE_SNPRINTF 1
+
+/* Define to 1 if you have the `socket' function. */
+#define HAVE_SOCKET 1
+
+/* Define to 1 if you have the `socketpair' function. */
+#define HAVE_SOCKETPAIR 1
+
+/* Define to 1 if stdbool.h conforms to C99. */
+#define HAVE_STDBOOL_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the `strcasecmp' function. */
+#define HAVE_STRCASECMP 1
+
+/* Define to 1 if you have the `strcasestr' function. */
+#define HAVE_STRCASESTR 1
+
+/* Define to 1 if you have the `strchr' function. */
+#define HAVE_STRCHR 1
+
+/* Define to 1 if you have the `strdup' function. */
+#define HAVE_STRDUP 1
+
+/* Define to 1 if you have the `strerror' function. */
+#define HAVE_STRERROR 1
+
+/* Define to 1 if you have the `strftime' function. */
+#define HAVE_STRFTIME 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strlcpy' function. */
+/* #undef HAVE_STRLCPY */
+
+/* Define to 1 if you have the `strncasecmp' function. */
+#define HAVE_STRNCASECMP 1
+
+/* Define to 1 if you have the `strrchr' function. */
+#define HAVE_STRRCHR 1
+
+/* Define to 1 if you have the `strstr' function. */
+#define HAVE_STRSTR 1
+
+/* Define to 1 if you have the `strtol' function. */
+#define HAVE_STRTOL 1
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
+ */
+/* #undef HAVE_SYS_DIR_H */
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#define HAVE_SYS_IOCTL_H 1
+
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
+ */
+/* #undef HAVE_SYS_NDIR_H */
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#define HAVE_SYS_PARAM_H 1
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+#define HAVE_SYS_SELECT_H 1
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#define HAVE_SYS_SOCKET_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#define HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <sys/utsname.h> header file. */
+#define HAVE_SYS_UTSNAME_H 1
+
+/* Define to 1 if you have the <termios.h> header file. */
+#define HAVE_TERMIOS_H 1
+
+/* Define to 1 if you have the `uname' function. */
+#define HAVE_UNAME 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if you have the `unsetenv' function. */
+#define HAVE_UNSETENV 1
+
+/* Define to 1 if you have the <values.h> header file. */
+#define HAVE_VALUES_H 1
+
+/* Define to 1 if you have the `vsnprintf' function. */
+#define HAVE_VSNPRINTF 1
+
+/* Define to 1 if the system has the type `_Bool'. */
+#define HAVE__BOOL 1
+
+/* Name of package */
+#define PACKAGE "flwkey"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "w1hkj AT w1hkj DOT com"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "FLWKEY"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "FLWKEY 1.1.6"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "flwkey"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "1.1.6"
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#define RETSIGTYPE void
+
+/* Define to the type of arg 1 for `select'. */
+#define SELECT_TYPE_ARG1 int
+
+/* Define to the type of args 2, 3 and 4 for `select'. */
+#define SELECT_TYPE_ARG234 (fd_set *)
+
+/* Define to the type of arg 5 for `select'. */
+#define SELECT_TYPE_ARG5 (struct timeval *)
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#define TIME_WITH_SYS_TIME 1
+
+/* Define to 1 if your <sys/time.h> declares `struct tm'. */
+/* #undef TM_IN_SYS_TIME */
+
+/* Enable extensions on AIX 3, Interix. */
+#ifndef _ALL_SOURCE
+# define _ALL_SOURCE 1
+#endif
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+/* Enable threading extensions on Solaris. */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# define _POSIX_PTHREAD_SEMANTICS 1
+#endif
+/* Enable extensions on HP NonStop. */
+#ifndef _TANDEM_SOURCE
+# define _TANDEM_SOURCE 1
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# define __EXTENSIONS__ 1
+#endif
+
+
+/* Define to 1 if we are using x */
+/* #undef USE_X */
+
+/* Version number of package */
+#define VERSION "1.1.6"
+
+/* x version */
+/* #undef X_BUILD_VERSION */
+
+/* Define to 1 if on MINIX. */
+/* #undef _MINIX */
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+ this defined. */
+/* #undef _POSIX_1_SOURCE */
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+/* #undef _POSIX_SOURCE */
+
+/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
+ <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+ #define below would cause a syntax error. */
+/* #undef _UINT32_T */
+
+/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
+ <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+ #define below would cause a syntax error. */
+/* #undef _UINT64_T */
+
+/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
+ <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+ #define below would cause a syntax error. */
+/* #undef _UINT8_T */
+
+/* Define to 1 if we are building on mingw */
+/* #undef __WOE32__ */
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+/* Define to the type of a signed integer type of width exactly 16 bits if
+ such a type exists and the standard includes do not define it. */
+/* #undef int16_t */
+
+/* Define to the type of a signed integer type of width exactly 32 bits if
+ such a type exists and the standard includes do not define it. */
+/* #undef int32_t */
+
+/* Define to the type of a signed integer type of width exactly 64 bits if
+ such a type exists and the standard includes do not define it. */
+/* #undef int64_t */
+
+/* Define to the type of a signed integer type of width exactly 8 bits if such
+ a type exists and the standard includes do not define it. */
+/* #undef int8_t */
+
+/* Define to the equivalent of the C99 'restrict' keyword, or to
+ nothing if this is not supported. Do not define if restrict is
+ supported directly. */
+#define restrict __restrict
+/* Work around a bug in Sun C++: it does not support _Restrict or
+ __restrict__, even though the corresponding Sun C compiler ends up with
+ "#define restrict _Restrict" or "#define restrict __restrict__" in the
+ previous line. Perhaps some future version of Sun C++ will work with
+ restrict; if so, hopefully it defines __RESTRICT like Sun C does. */
+#if defined __SUNPRO_CC && !defined __RESTRICT
+# define _Restrict
+# define __restrict__
+#endif
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* #undef size_t */
+
+/* Define to the type of an unsigned integer type of width exactly 16 bits if
+ such a type exists and the standard includes do not define it. */
+/* #undef uint16_t */
+
+/* Define to the type of an unsigned integer type of width exactly 32 bits if
+ such a type exists and the standard includes do not define it. */
+/* #undef uint32_t */
+
+/* Define to the type of an unsigned integer type of width exactly 64 bits if
+ such a type exists and the standard includes do not define it. */
+/* #undef uint64_t */
+
+/* Define to the type of an unsigned integer type of width exactly 8 bits if
+ such a type exists and the standard includes do not define it. */
+/* #undef uint8_t */
+
+/* Define to empty if the keyword `volatile' does not work. Warning: valid
+ code using `volatile' can become incorrect without. Disable with care. */
+/* #undef volatile */
diff --git a/src/config.h.in b/src/config.h.in
new file mode 100644
index 0000000..afeef40
--- /dev/null
+++ b/src/config.h.in
@@ -0,0 +1,413 @@
+/* src/config.h.in. Generated from configure.ac by autoheader. */
+
+/* Build platform */
+#undef BUILD_BUILD_PLATFORM
+
+/* Compiler */
+#undef BUILD_COMPILER
+
+/* Configure arguments */
+#undef BUILD_CONFIGURE_ARGS
+
+/* Build date */
+#undef BUILD_DATE
+
+/* Build host */
+#undef BUILD_HOST
+
+/* Host platform */
+#undef BUILD_HOST_PLATFORM
+
+/* Target platform */
+#undef BUILD_TARGET_PLATFORM
+
+/* Build user */
+#undef BUILD_USER
+
+/* Define to 1 if the `closedir' function returns void instead of `int'. */
+#undef CLOSEDIR_VOID
+
+/* FLTK version */
+#undef FLTK_BUILD_VERSION
+
+/* FLWKEY compiler flags */
+#undef FLWKEY_BUILD_CXXFLAGS
+
+/* FLWKEY linker flags */
+#undef FLWKEY_BUILD_LDFLAGS
+
+/* FLTK API major version */
+#undef FLWKEY_FLTK_API_MAJOR
+
+/* FLTK API minor version */
+#undef FLWKEY_FLTK_API_MINOR
+
+/* version string */
+#undef FLWKEY_VERSION
+
+/* major version number */
+#undef FLWKEY_VERSION_MAJOR
+
+/* minor version number */
+#undef FLWKEY_VERSION_MINOR
+
+/* patch/alpha version string */
+#undef FLWKEY_VERSION_PATCH
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#undef HAVE_ARPA_INET_H
+
+/* Define to 1 if we have clock_gettime */
+#undef HAVE_CLOCK_GETTIME
+
+/* Define to 0 if not using dbg::stack */
+#undef HAVE_DBG_STACK
+
+/* Define to 1 if you have the <dev/ppbus/ppi.h> header file. */
+#undef HAVE_DEV_PPBUS_PPI_H
+
+/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_DIRENT_H
+
+/* Define to 1 if we have dlopen */
+#undef HAVE_DLOPEN
+
+/* Define to 1 if you have the <execinfo.h> header file. */
+#undef HAVE_EXECINFO_H
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define to 1 if you have the `getaddrinfo' function. */
+#undef HAVE_GETADDRINFO
+
+/* Define to 1 if you have the `gethostbyname' function. */
+#undef HAVE_GETHOSTBYNAME
+
+/* Define to 1 if you have the `gmtime_r' function. */
+#undef HAVE_GMTIME_R
+
+/* Define to 1 if you have the `hstrerror' function. */
+#undef HAVE_HSTRERROR
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
+/* Define to 1 if you have the <linux/ppdev.h> header file. */
+#undef HAVE_LINUX_PPDEV_H
+
+/* Define to 1 if you have the `localtime_r' function. */
+#undef HAVE_LOCALTIME_R
+
+/* Define to 1 if you have the `memmove' function. */
+#undef HAVE_MEMMOVE
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `memset' function. */
+#undef HAVE_MEMSET
+
+/* Define to 1 if you have the `mkdir' function. */
+#undef HAVE_MKDIR
+
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
+#undef HAVE_NDIR_H
+
+/* Define to 1 if you have the <netdb.h> header file. */
+#undef HAVE_NETDB_H
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#undef HAVE_NETINET_IN_H
+
+/* Define to 1 if you have the <regex.h> header file. */
+#undef HAVE_REGEX_H
+
+/* Define to 1 if you have the `select' function. */
+#undef HAVE_SELECT
+
+/* Define to 1 if we have sem_timedwait */
+#undef HAVE_SEM_TIMEDWAIT
+
+/* Define to 1 if we have sem_unlink */
+#undef HAVE_SEM_UNLINK
+
+/* Define to 1 if you have the `setenv' function. */
+#undef HAVE_SETENV
+
+/* Define to 1 if you have the `snprintf' function. */
+#undef HAVE_SNPRINTF
+
+/* Define to 1 if you have the `socket' function. */
+#undef HAVE_SOCKET
+
+/* Define to 1 if you have the `socketpair' function. */
+#undef HAVE_SOCKETPAIR
+
+/* Define to 1 if stdbool.h conforms to C99. */
+#undef HAVE_STDBOOL_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the `strcasecmp' function. */
+#undef HAVE_STRCASECMP
+
+/* Define to 1 if you have the `strcasestr' function. */
+#undef HAVE_STRCASESTR
+
+/* Define to 1 if you have the `strchr' function. */
+#undef HAVE_STRCHR
+
+/* Define to 1 if you have the `strdup' function. */
+#undef HAVE_STRDUP
+
+/* Define to 1 if you have the `strerror' function. */
+#undef HAVE_STRERROR
+
+/* Define to 1 if you have the `strftime' function. */
+#undef HAVE_STRFTIME
+
+/* 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 `strlcpy' function. */
+#undef HAVE_STRLCPY
+
+/* Define to 1 if you have the `strncasecmp' function. */
+#undef HAVE_STRNCASECMP
+
+/* Define to 1 if you have the `strrchr' function. */
+#undef HAVE_STRRCHR
+
+/* Define to 1 if you have the `strstr' function. */
+#undef HAVE_STRSTR
+
+/* Define to 1 if you have the `strtol' function. */
+#undef HAVE_STRTOL
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_SYS_DIR_H
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#undef HAVE_SYS_IOCTL_H
+
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_SYS_NDIR_H
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+#undef HAVE_SYS_SELECT_H
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#undef HAVE_SYS_SOCKET_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <sys/utsname.h> header file. */
+#undef HAVE_SYS_UTSNAME_H
+
+/* Define to 1 if you have the <termios.h> header file. */
+#undef HAVE_TERMIOS_H
+
+/* Define to 1 if you have the `uname' function. */
+#undef HAVE_UNAME
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the `unsetenv' function. */
+#undef HAVE_UNSETENV
+
+/* Define to 1 if you have the <values.h> header file. */
+#undef HAVE_VALUES_H
+
+/* Define to 1 if you have the `vsnprintf' function. */
+#undef HAVE_VSNPRINTF
+
+/* Define to 1 if the system has the type `_Bool'. */
+#undef HAVE__BOOL
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#undef RETSIGTYPE
+
+/* Define to the type of arg 1 for `select'. */
+#undef SELECT_TYPE_ARG1
+
+/* Define to the type of args 2, 3 and 4 for `select'. */
+#undef SELECT_TYPE_ARG234
+
+/* Define to the type of arg 5 for `select'. */
+#undef SELECT_TYPE_ARG5
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
+/* Define to 1 if your <sys/time.h> declares `struct tm'. */
+#undef TM_IN_SYS_TIME
+
+/* Enable extensions on AIX 3, Interix. */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris. */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop. */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+
+
+/* Define to 1 if we are using x */
+#undef USE_X
+
+/* Version number of package */
+#undef VERSION
+
+/* x version */
+#undef X_BUILD_VERSION
+
+/* Define to 1 if on MINIX. */
+#undef _MINIX
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+ this defined. */
+#undef _POSIX_1_SOURCE
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+#undef _POSIX_SOURCE
+
+/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
+ <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+ #define below would cause a syntax error. */
+#undef _UINT32_T
+
+/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
+ <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+ #define below would cause a syntax error. */
+#undef _UINT64_T
+
+/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
+ <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+ #define below would cause a syntax error. */
+#undef _UINT8_T
+
+/* Define to 1 if we are building on mingw */
+#undef __WOE32__
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+#undef inline
+#endif
+
+/* Define to the type of a signed integer type of width exactly 16 bits if
+ such a type exists and the standard includes do not define it. */
+#undef int16_t
+
+/* Define to the type of a signed integer type of width exactly 32 bits if
+ such a type exists and the standard includes do not define it. */
+#undef int32_t
+
+/* Define to the type of a signed integer type of width exactly 64 bits if
+ such a type exists and the standard includes do not define it. */
+#undef int64_t
+
+/* Define to the type of a signed integer type of width exactly 8 bits if such
+ a type exists and the standard includes do not define it. */
+#undef int8_t
+
+/* Define to the equivalent of the C99 'restrict' keyword, or to
+ nothing if this is not supported. Do not define if restrict is
+ supported directly. */
+#undef restrict
+/* Work around a bug in Sun C++: it does not support _Restrict or
+ __restrict__, even though the corresponding Sun C compiler ends up with
+ "#define restrict _Restrict" or "#define restrict __restrict__" in the
+ previous line. Perhaps some future version of Sun C++ will work with
+ restrict; if so, hopefully it defines __RESTRICT like Sun C does. */
+#if defined __SUNPRO_CC && !defined __RESTRICT
+# define _Restrict
+# define __restrict__
+#endif
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_t
+
+/* Define to the type of an unsigned integer type of width exactly 16 bits if
+ such a type exists and the standard includes do not define it. */
+#undef uint16_t
+
+/* Define to the type of an unsigned integer type of width exactly 32 bits if
+ such a type exists and the standard includes do not define it. */
+#undef uint32_t
+
+/* Define to the type of an unsigned integer type of width exactly 64 bits if
+ such a type exists and the standard includes do not define it. */
+#undef uint64_t
+
+/* Define to the type of an unsigned integer type of width exactly 8 bits if
+ such a type exists and the standard includes do not define it. */
+#undef uint8_t
+
+/* Define to empty if the keyword `volatile' does not work. Warning: valid
+ code using `volatile' can become incorrect without. Disable with care. */
+#undef volatile
diff --git a/src/dialogs.cxx b/src/dialogs.cxx
new file mode 100644
index 0000000..7ec9c3b
--- /dev/null
+++ b/src/dialogs.cxx
@@ -0,0 +1,704 @@
+#include "dialogs.h"
+#include "util.h"
+#include "debug.h"
+#include "serial.h"
+#include "support.h"
+#include "wkey_dialogs.h"
+#include "font_browser.h"
+#include "status.h"
+
+#include <string>
+
+#include <iostream>
+
+using namespace std;
+
+#include <stdio.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifndef __WIN32__
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include <sys/time.h>
+#include <termios.h>
+#include <glob.h>
+#endif
+
+Fl_Double_Window *dlgSetup = (Fl_Double_Window *)0;
+
+//======================================================================
+// test comm ports
+//======================================================================
+
+void clear_combos()
+{
+ selectCommPort->clear();
+ selectCommPort->add("NONE");
+}
+
+void add_combos(char *port)
+{
+ selectCommPort->add(port);
+}
+
+//======================================================================
+// WIN32 init_port_combos
+//======================================================================
+
+#ifdef __WIN32__
+static bool open_serial(const char* dev)
+{
+ bool ret = false;
+ HANDLE fd = CreateFile(dev, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0);
+ if (fd != INVALID_HANDLE_VALUE) {
+ CloseHandle(fd);
+ ret = true;
+ }
+ return ret;
+}
+
+# define TTY_MAX 255
+void init_port_combos()
+{
+ int retval;
+ clear_combos();
+
+ char ttyname[21];
+ const char tty_fmt[] = "//./COM%u";
+
+ for (unsigned j = 0; j < TTY_MAX; j++) {
+ snprintf(ttyname, sizeof(ttyname), tty_fmt, j);
+ if (!open_serial(ttyname))
+ continue;
+ snprintf(ttyname, sizeof(ttyname), "COM%u", j);
+ LOG_INFO("Found serial port %s", ttyname);
+ add_combos(ttyname);
+ }
+}
+#endif //__WIN32__
+
+//======================================================================
+// Linux init_port_combos
+//======================================================================
+
+#ifdef __linux__
+#ifndef PATH_MAX
+# define PATH_MAX 1024
+#endif
+# define TTY_MAX 8
+
+void init_port_combos()
+{
+ int retval;
+
+
+ struct stat st;
+ char ttyname[PATH_MAX + 1];
+ bool ret = false;
+
+ DIR* sys = NULL;
+ char cwd[PATH_MAX] = { '.', '\0' };
+
+ clear_combos();
+
+ glob_t gbuf;
+ glob("/dev/serial/by-id/*", 0, NULL, &gbuf);
+ for (size_t j = 0; j < gbuf.gl_pathc; j++) {
+ if ( !(stat(gbuf.gl_pathv[j], &st) == 0 && S_ISCHR(st.st_mode)) ||
+ strstr(gbuf.gl_pathv[j], "modem") )
+ continue;
+ LOG_INFO("Found serial port %s", gbuf.gl_pathv[j]);
+ add_combos(gbuf.gl_pathv[j]);
+ }
+ globfree(&gbuf);
+
+ if (getcwd(cwd, sizeof(cwd)) == NULL || chdir("/sys/class/tty") == -1 ||
+ (sys = opendir(".")) == NULL)
+ goto out;
+
+ ssize_t len;
+ struct dirent* dp;
+ while ((dp = readdir(sys))) {
+# ifdef _DIRENT_HAVE_D_TYPE
+ if (dp->d_type != DT_LNK)
+ continue;
+# endif
+ if ((len = readlink(dp->d_name, ttyname, sizeof(ttyname)-1)) == -1)
+ continue;
+ ttyname[len] = '\0';
+ if (!strstr(ttyname, "/devices/virtual/")) {
+ snprintf(ttyname, sizeof(ttyname), "/dev/%s", dp->d_name);
+ if (stat(ttyname, &st) == -1 || !S_ISCHR(st.st_mode))
+ continue;
+ LOG_INFO("Found serial port %s", ttyname);
+ add_combos(ttyname);
+ }
+ }
+ ret = true;
+
+out:
+ if (sys)
+ closedir(sys);
+ retval = chdir(cwd);
+ if (ret) // do we need to fall back to the probe code below?
+ return;
+
+ const char* tty_fmt[] = {
+ "/dev/ttyS%u",
+ "/dev/ttyUSB%u",
+ "/dev/usb/ttyUSB%u"
+ };
+
+ for (size_t i = 0; i < sizeof(tty_fmt)/sizeof(*tty_fmt); i++) {
+ for (unsigned j = 0; j < TTY_MAX; j++) {
+ snprintf(ttyname, sizeof(ttyname), tty_fmt[i], j);
+ if ( !(stat(ttyname, &st) == 0 && S_ISCHR(st.st_mode)) )
+ continue;
+
+ LOG_INFO("Found serial port %s", ttyname);
+ add_combos(ttyname);
+ }
+ }
+
+}
+#endif // __linux__
+
+//======================================================================
+// APPLE init_port_combos
+//======================================================================
+
+#ifdef __APPLE__
+#ifndef PATH_MAX
+# define PATH_MAX 1024
+#endif
+
+void init_port_combos()
+{
+ int retval;
+
+ clear_combos();
+
+ struct stat st;
+
+ const char* tty_fmt[] = {
+ "/dev/cu.*",
+ "/dev/tty.*"
+ };
+
+ glob_t gbuf;
+
+ for (size_t i = 0; i < sizeof(tty_fmt)/sizeof(*tty_fmt); i++) {
+ glob(tty_fmt[i], 0, NULL, &gbuf);
+ for (size_t j = 0; j < gbuf.gl_pathc; j++) {
+ if ( !(stat(gbuf.gl_pathv[j], &st) == 0 && S_ISCHR(st.st_mode)) ||
+ strstr(gbuf.gl_pathv[j], "modem") )
+ continue;
+ LOG_INFO("Found serial port %s", gbuf.gl_pathv[j]);
+ add_combos(gbuf.gl_pathv[j]);
+ }
+ globfree(&gbuf);
+ }
+}
+#endif //__APPLE__
+
+//======================================================================
+// FreeBSD init_port_combos
+//======================================================================
+
+#ifdef __FreeBSD__
+#ifndef PATH_MAX
+# define PATH_MAX 1024
+#endif
+# define TTY_MAX 8
+
+void init_port_combos()
+{
+ int retval;
+ struct stat st;
+ char ttyname[PATH_MAX + 1];
+ const char* tty_fmt[] = {
+ "/dev/ttyd%u"
+ };
+
+ clear_combos();
+
+ for (size_t i = 0; i < sizeof(tty_fmt)/sizeof(*tty_fmt); i++) {
+ for (unsigned j = 0; j < TTY_MAX; j++) {
+ snprintf(ttyname, sizeof(ttyname), tty_fmt[i], j);
+ if ( !(stat(ttyname, &st) == 0 && S_ISCHR(st.st_mode)) )
+ continue;
+ LOG_INFO("Found serial port %s", ttyname);
+ add_combos(ttyname);
+ }
+ }
+}
+#endif //__FreeBSD__
+
+void cbCancelSetupDialog()
+{
+ dlgSetup->hide();
+}
+
+void cbOkSetupDialog()
+{
+ pthread_mutex_lock(&mutex_serial);
+ WKEY_serial.ClosePort();
+ bypass_serial_thread_loop = true;
+ pthread_mutex_unlock(&mutex_serial);
+
+ progStatus.serial_port_name = selectCommPort->value();
+
+ if (!start_wkey_serial()) {
+ if (progStatus.serial_port_name.compare("NONE") == 0) {
+ debug::show();
+ LOG_WARN("No comm port ... test mode");
+ } else {
+ progStatus.serial_port_name = "NONE";
+ selectCommPort->value(progStatus.serial_port_name.c_str());
+ }
+ return;
+ }
+ dlgSetup->hide();
+ Fl::flush();
+ bypass_serial_thread_loop = false;
+ open_wkeyer();
+}
+
+void config_comm_port()
+{
+LOG_INFO("%s", progStatus.serial_port_name.c_str());
+ selectCommPort->value(progStatus.serial_port_name.c_str());
+ dlgSetup->show();
+}
+
+void cb_events()
+{
+ debug::show();
+}
+
+// parameter configuration dialog
+
+Fl_Double_Window *parameter_dialog = (Fl_Double_Window *)0;
+
+void config_parameters()
+{
+ cntr_tail->value(progStatus.tail_time);
+ cntr_leadin->value(progStatus.lead_in_time);
+ cntr_weight->value(progStatus.weight);
+ cntr_sample->value(progStatus.paddle_setpoint);
+ cntr_first_ext->value(progStatus.first_extension);
+ cntr_comp->value(progStatus.key_compensation);
+ cntr_ratio->value(progStatus.dit_dah_ratio * 3 / 50.0);
+ cntr_cmd_wpm->value(progStatus.cmd_wpm);
+ cntr_farnsworth->value(progStatus.farnsworth_wpm);
+ cntr_rng_wpm->value(progStatus.rng_wpm);
+ cntr_min_wpm->value(progStatus.min_wpm);
+
+ choice_keyer_mode->index((progStatus.mode_register & 0x30) >> 4);
+ choice_output_pins->index(((progStatus.pin_configuration & 0x06) >> 2) - 1);
+ choice_hang->index((progStatus.pin_configuration & 0x30) >> 4);
+ choice_sidetone->index((progStatus.sidetone & 0x0F) - 1);
+
+ btn_sidetone_on->value((progStatus.sidetone & 0x80) ? true : false);
+ btn_tone_on->value(progStatus.pin_configuration & 0x02 ? true : false);
+ btn_ptt_on->value(progStatus.pin_configuration & 0x01);
+ btn_cut_zeronine->value(progStatus.cut_zeronine);
+ btn_paddledog->value(progStatus.mode_register & 0x80);
+ btn_ct_space->value(progStatus.mode_register & 0x01);
+ btn_auto_space->value(progStatus.mode_register & 0x02);
+ btn_swap->value(progStatus.mode_register & 0x08);
+ btn_paddle_echo->value(progStatus.mode_register & 0x40);
+ btn_serial_echo->value(progStatus.mode_register & 0x04);
+
+ parameter_dialog->show();
+}
+
+void done_parameters()
+{
+ parameter_dialog->hide();
+}
+
+void change_choice_keyer_mode()
+{
+ int modebits = choice_keyer_mode->index() << 4;
+ progStatus.mode_register = (progStatus.mode_register & 0xCF) | modebits;
+ LOG_WARN("mode reg: %02X", progStatus.mode_register);
+ load_defaults();
+}
+
+void change_choice_output_pins()
+{
+ int pinbits = (choice_output_pins->index() + 1) << 2;
+ progStatus.pin_configuration = (progStatus.pin_configuration & 0xF3) | pinbits;
+ load_defaults();
+}
+
+void change_choice_sidetone()
+{
+ progStatus.sidetone = choice_sidetone->index() + 1;
+ progStatus.sidetone |= (btn_sidetone_on->value() ? 0x80 : 0x00);
+ load_defaults();
+}
+
+void change_btn_tone_on()
+{
+ progStatus.pin_configuration = (progStatus.pin_configuration & 0xFD) | btn_tone_on->value() ? 2 : 0;
+ load_defaults();
+}
+
+void change_btn_ptt_on()
+{
+ progStatus.pin_configuration = (progStatus.pin_configuration & 0xFE) | btn_ptt_on->value() ? 1 : 0;
+ load_defaults();
+}
+
+
+void change_choice_hang()
+{
+ int hangbits = choice_hang->index() << 4;
+ progStatus.pin_configuration = (progStatus.pin_configuration & 0xCF) | hangbits;
+ load_defaults();
+}
+
+void change_cntr_tail()
+{
+ progStatus.tail_time = cntr_tail->value();
+ load_defaults();
+}
+
+void change_cntr_leadin()
+{
+ progStatus.lead_in_time = cntr_leadin->value();
+ load_defaults();
+}
+
+void change_cntr_weight()
+{
+ progStatus.weight = cntr_weight->value();
+ load_defaults();
+}
+
+void change_cntr_sample()
+{
+ progStatus.paddle_setpoint = cntr_sample->value();
+ load_defaults();
+}
+
+void change_cntr_first_ext()
+{
+ progStatus.first_extension = cntr_first_ext->value();
+ load_defaults();
+}
+
+void change_cntr_comp()
+{
+ progStatus.key_compensation = cntr_comp->value();
+ load_defaults();
+}
+
+void change_cntr_ratio()
+{
+ progStatus.dit_dah_ratio = (unsigned char)(cntr_ratio->value() * 50 / 3);
+ load_defaults();
+}
+
+void change_cntr_cmd_wpm()
+{
+ progStatus.cmd_wpm = cntr_cmd_wpm->value();
+}
+
+void change_cntr_farnsworth()
+{
+ progStatus.farnsworth_wpm = cntr_farnsworth->value();
+ load_defaults();
+}
+
+void change_cntr_rng_wpm()
+{
+ progStatus.rng_wpm = cntr_rng_wpm->value();
+ cntr_wpm->minimum(progStatus.min_wpm);
+ cntr_wpm->maximum(progStatus.rng_wpm + progStatus.min_wpm);
+ if (progStatus.speed_wpm > progStatus.min_wpm + progStatus.rng_wpm) {
+ progStatus.speed_wpm = progStatus.min_wpm + progStatus.rng_wpm;
+ cntr_wpm->value(progStatus.speed_wpm);
+ }
+ load_defaults();
+}
+
+void change_cntr_min_wpm()
+{
+ progStatus.min_wpm = cntr_min_wpm->value();
+ cntr_wpm->minimum(progStatus.min_wpm);
+ cntr_wpm->maximum(progStatus.rng_wpm + progStatus.min_wpm);
+ if (progStatus.speed_wpm < progStatus.min_wpm) {
+ progStatus.speed_wpm = progStatus.min_wpm;
+ cntr_wpm->value(progStatus.speed_wpm);
+ }
+ load_defaults();
+}
+
+void change_btn_sidetone_on()
+{
+ change_choice_sidetone();
+}
+
+void change_btn_cut_zeronine()
+{
+ progStatus.cut_zeronine = btn_cut_zeronine->value();
+}
+
+void change_btn_paddledog()
+{
+ progStatus.mode_register &=0x7F;
+ progStatus.mode_register |= btn_paddledog->value() ? 0x80 : 0x00;
+ LOG_WARN("mode reg: %2X", progStatus.mode_register);
+ load_defaults();
+}
+
+void change_btn_ct_space()
+{
+ progStatus.mode_register &= 0xFE;
+ progStatus.mode_register |= btn_ct_space->value();
+ LOG_WARN("mode reg: %2X", progStatus.mode_register);
+ load_defaults();
+}
+
+void change_btn_auto_space()
+{
+ progStatus.mode_register &=0xFD;
+ progStatus.mode_register |= btn_auto_space->value() ? 0x02 : 0x00;
+ LOG_WARN("mode reg: %2X", progStatus.mode_register);
+ load_defaults();
+}
+
+void change_btn_swap()
+{
+ progStatus.mode_register &=0xF7;
+ progStatus.mode_register |= btn_swap->value() ? 0x08 : 0x00;
+ LOG_WARN("mode reg: %2X", progStatus.mode_register);
+ load_defaults();
+}
+
+void change_btn_paddle_echo()
+{
+ progStatus.mode_register &=0xBF;
+ progStatus.mode_register |= btn_paddle_echo->value() ? 0x40 : 0x00;
+ LOG_WARN("mode reg: %2X", progStatus.mode_register);
+ load_defaults();
+}
+
+void change_btn_serial_echo()
+{
+ progStatus.mode_register &=0xFB;
+ progStatus.mode_register |= btn_serial_echo->value() ? 0x04 : 0x00;
+ LOG_WARN("mode reg: %2X", progStatus.mode_register);
+ load_defaults();
+}
+
+// message configuration dialog
+Fl_Double_Window *dialog_messages = (Fl_Double_Window *)0;
+
+void config_messages()
+{
+ label_1->value(progStatus.label_1.c_str());
+ edit_msg1->value(progStatus.edit_msg1.c_str());
+ label_2->value(progStatus.label_2.c_str());
+ edit_msg2->value(progStatus.edit_msg2.c_str());
+ label_3->value(progStatus.label_3.c_str());
+ edit_msg3->value(progStatus.edit_msg3.c_str());
+ label_4->value(progStatus.label_4.c_str());
+ edit_msg4->value(progStatus.edit_msg4.c_str());
+ label_5->value(progStatus.label_5.c_str());
+ edit_msg5->value(progStatus.edit_msg5.c_str());
+ label_6->value(progStatus.label_6.c_str());
+ edit_msg6->value(progStatus.edit_msg6.c_str());
+ label_7->value(progStatus.label_7.c_str());
+ edit_msg7->value(progStatus.edit_msg7.c_str());
+ label_8->value(progStatus.label_8.c_str());
+ edit_msg8->value(progStatus.edit_msg8.c_str());
+ label_9->value(progStatus.label_9.c_str());
+ edit_msg9->value(progStatus.edit_msg9.c_str());
+ label_10->value(progStatus.label_10.c_str());
+ edit_msg10->value(progStatus.edit_msg10.c_str());
+ label_11->value(progStatus.label_11.c_str());
+ edit_msg11->value(progStatus.edit_msg11.c_str());
+ label_12->value(progStatus.label_12.c_str());
+ edit_msg12->value(progStatus.edit_msg12.c_str());
+ dialog_messages->show();
+}
+
+void update_msg_labels()
+{
+ btn_msg1->label(progStatus.label_1.c_str()); btn_msg1->redraw();
+ btn_msg2->label(progStatus.label_2.c_str()); btn_msg2->redraw();
+ btn_msg3->label(progStatus.label_3.c_str()); btn_msg3->redraw();
+ btn_msg4->label(progStatus.label_4.c_str()); btn_msg4->redraw();
+ btn_msg5->label(progStatus.label_5.c_str()); btn_msg5->redraw();
+ btn_msg6->label(progStatus.label_6.c_str()); btn_msg6->redraw();
+ btn_msg7->label(progStatus.label_7.c_str()); btn_msg7->redraw();
+ btn_msg8->label(progStatus.label_8.c_str()); btn_msg8->redraw();
+ btn_msg9->label(progStatus.label_9.c_str()); btn_msg9->redraw();
+ btn_msg10->label(progStatus.label_10.c_str()); btn_msg10->redraw();
+ btn_msg11->label(progStatus.label_11.c_str()); btn_msg11->redraw();
+ btn_msg12->label(progStatus.label_12.c_str()); btn_msg12->redraw();
+}
+
+void apply_edit()
+{
+ progStatus.label_1 = label_1->value();
+ progStatus.edit_msg1 = edit_msg1->value();
+
+ progStatus.label_2 = label_2->value();
+ progStatus.edit_msg2 = edit_msg2->value();
+
+ progStatus.label_3 = label_3->value();
+ progStatus.edit_msg3 = edit_msg3->value();
+
+ progStatus.label_4 = label_4->value();
+ progStatus.edit_msg4 = edit_msg4->value();
+
+ progStatus.label_5 = label_5->value();
+ progStatus.edit_msg5 = edit_msg5->value();
+
+ progStatus.label_6 = label_6->value();
+ progStatus.edit_msg6 = edit_msg6->value();
+
+ progStatus.label_7 = label_7->value();
+ progStatus.edit_msg7 = edit_msg7->value();
+
+ progStatus.label_8 = label_8->value();
+ progStatus.edit_msg8 = edit_msg8->value();
+
+ progStatus.label_9 = label_9->value();
+ progStatus.edit_msg9 = edit_msg9->value();
+
+ progStatus.label_10 = label_10->value();
+ progStatus.edit_msg10 = edit_msg10->value();
+
+ progStatus.label_11 = label_11->value();
+ progStatus.edit_msg11 = edit_msg11->value();
+
+ progStatus.label_12 = label_12->value();
+ progStatus.edit_msg12 = edit_msg12->value();
+
+ update_msg_labels();
+}
+
+void done_edit()
+{
+ apply_edit();
+ dialog_messages->hide();
+}
+
+void cancel_edit()
+{
+ dialog_messages->hide();
+}
+
+// operator setup dialog
+Fl_Double_Window * op_dialog = (Fl_Double_Window *)0;
+
+void change_txt_cll()
+{
+ progStatus.tag_cll = txt_cll->value();
+}
+
+void change_txt_qth()
+{
+ progStatus.tag_qth = txt_qth->value();
+}
+
+void change_txt_loc()
+{
+ progStatus.tag_loc = txt_loc->value();
+}
+
+void change_txt_opr()
+{
+ progStatus.tag_opr = txt_opr->value();
+}
+
+void cb_done_op_dialog()
+{
+ op_dialog->hide();
+}
+
+void open_operator_dialog()
+{
+ txt_cll->value(progStatus.tag_cll.c_str());
+ txt_qth->value(progStatus.tag_qth.c_str());
+ txt_loc->value(progStatus.tag_loc.c_str());
+ txt_opr->value(progStatus.tag_opr.c_str());
+ op_dialog->show();
+}
+
+Fl_Double_Window *contest_dialog = (Fl_Double_Window *)0;
+
+void cb_contest()
+{
+ char snbr[10];
+ snprintf(snbr, sizeof(snbr), "%d", progStatus.serial_nbr);
+ txt_serial_nbr->value(snbr);
+ snprintf(snbr, sizeof(snbr), "%d", progStatus.time_span);
+ txt_time_span->value(snbr);
+ btn_zeros->value(progStatus.zeros);
+ btn_dups->value(progStatus.dups);
+ btn_ck_band->value(progStatus.band);
+ txt_xout->value(progStatus.xout.c_str());
+ if (!contest_dialog->visible())
+ contest_dialog->show();
+}
+
+void close_contest()
+{
+ contest_dialog->hide();
+}
+
+void create_dialogs()
+{
+// configuration parameter dialog
+ parameter_dialog = make_parameters_dialog();
+ choice_keyer_mode->add("Iambic B");
+ choice_keyer_mode->add("Iambic A");
+ choice_keyer_mode->add("Ultimatic");
+ choice_keyer_mode->add("Bug Mode");
+ choice_output_pins->add("Key 1");
+ choice_output_pins->add("Key 2");
+ choice_output_pins->add("Key 1 & 2");
+ choice_sidetone->add("4000");
+ choice_sidetone->add("2000");
+ choice_sidetone->add("1333");
+ choice_sidetone->add("1000");
+ choice_sidetone->add("800");
+ choice_sidetone->add("666");
+ choice_sidetone->add("571");
+ choice_sidetone->add("500");
+ choice_sidetone->add("444");
+ choice_sidetone->add("400");
+ choice_hang->add("Wait 1.0");
+ choice_hang->add("Wait 1.33");
+ choice_hang->add("Wait 1.66");
+ choice_hang->add("Wait 2.0");
+ cntr_tail->minimum(0); cntr_tail->maximum(250); cntr_tail->step(10);
+ cntr_leadin->minimum(0); cntr_leadin->maximum(250); cntr_leadin->step(10);
+ cntr_weight->minimum(10); cntr_weight->maximum(90); cntr_weight->step(1);
+ cntr_sample->minimum(10); cntr_sample->maximum(90); cntr_sample->step(1);
+ cntr_first_ext->minimum(0); cntr_first_ext->maximum(250); cntr_first_ext->step(1);
+ cntr_comp->minimum(0); cntr_comp->maximum(250); cntr_comp->step(1);
+ cntr_ratio->minimum(2.0); cntr_ratio->maximum(4.0); cntr_ratio->step(0.1);
+ cntr_cmd_wpm->minimum(10); cntr_cmd_wpm->maximum(30); cntr_cmd_wpm->step(1);
+ cntr_farnsworth->minimum(10); cntr_farnsworth->maximum(99); cntr_farnsworth->step(1);
+ cntr_rng_wpm->minimum(10); cntr_rng_wpm->maximum(40); cntr_rng_wpm->step(1);
+ cntr_min_wpm->minimum(5); cntr_min_wpm->maximum(89); cntr_min_wpm->step(1);
+// serial port selection dialog
+ dlgSetup = SetupDialog();
+ init_port_combos();
+// message editor dialog
+ dialog_messages = make_message_editor();
+// operator dialog
+ op_dialog = make_operator_dialog();
+// contest dialog
+ contest_dialog = make_contest_dialog();
+}
+
diff --git a/src/flwkey-rc.rc b/src/flwkey-rc.rc
new file mode 100644
index 0000000..aee79b2
--- /dev/null
+++ b/src/flwkey-rc.rc
@@ -0,0 +1,7 @@
+#include <windows.h> // include for version info constants
+#include "flwkeyrc.h"
+
+IDI_ICON ICON DISCARDABLE "flwkey.ico"
+
+//A ICON MOVEABLE PURE LOADONCALL DISCARDABLE "flwkey.ico"
+
diff --git a/src/flwkey.cxx b/src/flwkey.cxx
new file mode 100644
index 0000000..338f42f
--- /dev/null
+++ b/src/flwkey.cxx
@@ -0,0 +1,331 @@
+#include "config.h"
+
+#include <stdlib.h>
+#include <iostream>
+#include <fstream>
+#include <cstring>
+#include <ctime>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+
+#include <FL/Fl.H>
+#include <FL/Enumerations.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Button.H>
+#include <FL/Fl_Group.H>
+#include <FL/Fl_Sys_Menu_Bar.H>
+#include <FL/x.H>
+#include <FL/Fl_Help_Dialog.H>
+#include <FL/Fl_Menu_Item.H>
+
+#ifdef WIN32
+# include "flwkeyrc.h"
+# include "compat.h"
+# define dirent fl_dirent_no_thanks
+#endif
+
+#include <FL/filename.H>
+
+#ifdef __MINGW32__
+# if FLWKEY_FLTK_API_MAJOR == 1 && FLWKEY_FLTK_API_MINOR < 3
+# undef dirent
+# include <dirent.h>
+# endif
+#else
+# include <dirent.h>
+#endif
+
+#include <FL/x.H>
+#include <FL/Fl_Pixmap.H>
+#include <FL/Fl_Image.H>
+
+//#include "images/flwkey.xpm"
+#include "support.h"
+#include "dialogs.h"
+#include "status.h"
+#include "debug.h"
+#include "util.h"
+#include "gettext.h"
+#include "flwkey_icon.cxx"
+#include "wkey_dialogs.h"
+#include "fileselect.h"
+#include "logbook.h"
+
+int parse_args(int argc, char **argv, int& idx);
+
+Fl_Double_Window *mainwindow;
+string WKeyHomeDir;
+string TempDir;
+string defFileName;
+string title;
+
+pthread_t *serial_thread = 0;
+pthread_t *digi_thread = 0;
+
+pthread_mutex_t mutex_serial = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t mutex_xmlrpc = PTHREAD_MUTEX_INITIALIZER;
+
+bool WKEY_DEBUG = 0;
+
+//----------------------------------------------------------------------
+void visit_URL(void* arg)
+{
+ const char* url = reinterpret_cast<const char *>(arg);
+#ifndef __WOE32__
+ const char* browsers[] = {
+# ifdef __APPLE__
+ getenv("FLDIGI_BROWSER"), // valid for any OS - set by user
+ "open" // OS X
+# else
+ "fl-xdg-open", // Puppy Linux
+ "xdg-open", // other Unix-Linux distros
+ getenv("FLDIGI_BROWSER"), // force use of spec'd browser
+ getenv("BROWSER"), // most Linux distributions
+ "sensible-browser",
+ "firefox",
+ "mozilla" // must be something out there!
+# endif
+ };
+ switch (fork()) {
+ case 0:
+# ifndef NDEBUG
+ unsetenv("MALLOC_CHECK_");
+ unsetenv("MALLOC_PERTURB_");
+# endif
+ for (size_t i = 0; i < sizeof(browsers)/sizeof(browsers[0]); i++)
+ if (browsers[i])
+ execlp(browsers[i], browsers[i], url, (char*)0);
+ exit(EXIT_FAILURE);
+ case -1:
+ fl_alert(_("Could not run a web browser:\n%s\n\n"
+ "Open this URL manually:\n%s"),
+ strerror(errno), url);
+ }
+#else
+ if ((int)ShellExecute(NULL, "open", url, NULL, NULL, SW_SHOWNORMAL) <= 32)
+ fl_alert(_("Could not open url:\n%s\n"), url);
+#endif
+}
+
+void about()
+{
+ string msg = "\
+%s\n\
+Version %s\n\
+copyright W1HKJ, 2010\n\
+w1hkj@@w1hkj.com";
+ fl_message(msg.c_str(), PACKAGE_TARNAME, PACKAGE_VERSION);
+}
+
+void on_line_help()
+{
+ visit_URL((void*)"http://www.w1hkj.com/flwkey-help/index.html");
+}
+
+//----------------------------------------------------------------------
+
+extern void saveFreqList();
+
+void * flwkey_terminate(void) {
+ std::cerr << "terminating" << std::endl;
+ fl_message("Closing flwkey");
+ cbExit();
+ return 0;
+}
+
+void showEvents(void *)
+{
+ debug::show();
+}
+
+#if defined(__WIN32__) && defined(PTW32_STATIC_LIB)
+static void ptw32_cleanup(void)
+{
+ (void)pthread_win32_process_detach_np();
+}
+
+void ptw32_init(void)
+{
+ (void)pthread_win32_process_attach_np();
+ atexit(ptw32_cleanup);
+}
+#endif // __WIN32__
+
+#define KNAME "Flwkey"
+#if !defined(__WIN32__) && !defined(__APPLE__)
+Pixmap WKey_icon_pixmap;
+
+void make_pixmap(Pixmap *xpm, const char **data)
+{
+ Fl_Window w(0,0, KNAME);
+ w.xclass(KNAME);
+ w.show();
+ w.make_current();
+ Fl_Pixmap icon(data);
+ int maxd = (icon.w() > icon.h()) ? icon.w() : icon.h();
+ *xpm = fl_create_offscreen(maxd, maxd);
+ fl_begin_offscreen(*xpm);
+ fl_color(FL_BACKGROUND_COLOR);
+ fl_rectf(0, 0, maxd, maxd);
+ icon.draw(maxd - icon.w(), maxd - icon.h());
+ fl_end_offscreen();
+}
+
+#endif
+
+static void checkdirectories(void)
+{
+ struct {
+ string& dir;
+ const char* suffix;
+ void (*new_dir_func)(void);
+ } dirs[] = {
+ { WKeyHomeDir, 0, 0 }
+ };
+
+ int r;
+ for (size_t i = 0; i < sizeof(dirs)/sizeof(*dirs); i++) {
+ if (dirs[i].suffix)
+ dirs[i].dir.assign(WKeyHomeDir).append(dirs[i].suffix).append("/");
+
+ if ((r = mkdir(dirs[i].dir.c_str(), 0777)) == -1 && errno != EEXIST) {
+ cerr << _("Could not make directory") << ' ' << dirs[i].dir
+ << ": " << strerror(errno) << '\n';
+ exit(EXIT_FAILURE);
+ }
+ else if (r == 0 && dirs[i].new_dir_func)
+ dirs[i].new_dir_func();
+ }
+}
+
+void exit_main(Fl_Widget *w)
+{
+ if (Fl::event_key() == FL_Escape)
+ return;
+ cbExit();
+}
+
+void startup(void*)
+{
+ if (!start_wkey_serial()) {
+ if (progStatus.serial_port_name.compare("NONE") == 0) {
+ LOG_WARN("No comm port ... test mode");
+ } else {
+ progStatus.serial_port_name = "NONE";
+ selectCommPort->value(progStatus.serial_port_name.c_str());
+ }
+ } else {
+ bypass_serial_thread_loop = false;
+ open_wkeyer();
+ }
+}
+
+int main (int argc, char *argv[])
+{
+ std::terminate_handler(flwkey_terminate);
+
+ int arg_idx;
+
+ char dirbuf[FL_PATH_MAX + 1];
+#ifdef __WIN32__
+ fl_filename_expand(dirbuf, sizeof(dirbuf) - 1, "$USERPROFILE/flwkey.files/");
+#else
+ fl_filename_expand(dirbuf, sizeof(dirbuf) - 1, "$HOME/.flwkey/");
+#endif
+ WKeyHomeDir = dirbuf;
+ Fl::args(argc, argv, arg_idx, parse_args);
+
+ mainwindow = WKey_window();
+ mainwindow->callback(exit_main);
+ create_dialogs();
+
+ checkdirectories();
+
+ try {
+ debug::start(string(WKeyHomeDir).append("status_log.txt").c_str());
+ time_t t = time(NULL);
+ LOG(debug::WARN_LEVEL, debug::LOG_OTHER, _("%s log started on %s"), PACKAGE_STRING, ctime(&t));
+ }
+ catch (const char* error) {
+ cerr << error << '\n';
+ debug::stop();
+ exit(1);
+ }
+
+ Fl::lock();
+
+#if defined(__WIN32__) && defined(PTW32_STATIC_LIB)
+ ptw32_init();
+#endif
+
+ bypass_serial_thread_loop = true;
+ serial_thread = new pthread_t;
+ if (pthread_create(serial_thread, NULL, serial_thread_loop, NULL)) {
+ perror("pthread_create");
+ exit(EXIT_FAILURE);
+ }
+
+ progStatus.loadLastState();
+
+ mainwindow->resize( progStatus.mainX, progStatus.mainY, mainwindow->w(), mainwindow->h());
+
+ mainwindow->xclass(KNAME);
+ update_msg_labels();
+
+ Fl::add_handler(main_handler);
+
+ start_logbook();
+
+#if defined(__WOE32__)
+# ifndef IDI_ICON
+# define IDI_ICON 101
+# endif
+ mainwindow->icon((char*)LoadIcon(fl_display, MAKEINTRESOURCE(IDI_ICON)));
+ mainwindow->show (argc, argv);
+#elif !defined(__APPLE__)
+ make_pixmap(&WKey_icon_pixmap, flwkey_icon);
+ mainwindow->icon((char *)WKey_icon_pixmap);
+ mainwindow->show(argc, argv);
+#else
+ mainwindow->show(argc, argv);
+#endif
+
+ FSEL::create();
+
+ Fl::add_timeout(0.20, startup);
+
+ return Fl::run();
+
+}
+
+int parse_args(int argc, char **argv, int& idx)
+{
+ if (strcasecmp("--help", argv[1]) == 0) {
+ printf("Usage: \n\
+ --help this help text\n\
+ --version\n\
+ --config-dir [pathname]\n\
+ --debug\n");
+ exit(0);
+ }
+ if (strcasecmp("--version", argv[idx]) == 0) {
+ printf("Version: "VERSION"\n");
+ exit (0);
+ }
+ if (strcasecmp("--debug", argv[idx]) == 0) {
+ WKEY_DEBUG = 1;
+ idx++;
+ return 1;
+ }
+ if (strcasecmp("--config-dir", argv[idx]) == 0) {
+ WKeyHomeDir = argv[idx + 1];
+ if (WKeyHomeDir[WKeyHomeDir.length() -1] != '/')
+ WKeyHomeDir += '/';
+ idx += 2;
+ return 1;
+ }
+ return 0;
+}
diff --git a/src/flwkey_icon.cxx b/src/flwkey_icon.cxx
new file mode 100644
index 0000000..a970868
--- /dev/null
+++ b/src/flwkey_icon.cxx
@@ -0,0 +1,325 @@
+/* XPM */
+const char * flwkey_icon[] = {
+"64 64 256 2",
+" c #010000",
+". c #0B0100",
+"X c #140100",
+"o c #1B0200",
+"O c #130903",
+"+ c #1B0C05",
+"@ c #1C130B",
+"# c #230300",
+"$ c #2C0601",
+"% c #230E04",
+"& c #2C0D05",
+"* c #390801",
+"= c #261007",
+"- c #291206",
+"; c #23150B",
+": c #2E1509",
+"> c #2B1A0D",
+", c #3B1607",
+"< c #331609",
+"1 c #351A0B",
+"2 c #3C1E0D",
+"3 c #2C1C12",
+"4 c #3E200E",
+"5 c #2D2015",
+"6 c #312317",
+"7 c #3C2313",
+"8 c #36281B",
+"9 c #3C2E21",
+"0 c #322E27",
+"q c #3E3228",
+"w c #430D02",
+"e c #490601",
+"r c #590D02",
+"t c #441B0A",
+"y c #4A1708",
+"u c #581706",
+"i c #670D03",
+"p c #780D03",
+"a c #691906",
+"s c #7C1503",
+"d c #771A05",
+"f c #442512",
+"g c #452915",
+"h c #4B2B16",
+"j c #4D2E19",
+"k c #472A18",
+"l c #572713",
+"z c #4C311C",
+"x c #53331C",
+"c c #58381E",
+"v c #5A220E",
+"b c #682409",
+"n c #75240A",
+"m c #7B2A0C",
+"M c #692B12",
+"N c #7A3416",
+"B c #6C391E",
+"V c #433629",
+"C c #49382A",
+"Z c #5C3C22",
+"A c #553A25",
+"S c #483C31",
+"D c #452E22",
+"F c #613F25",
+"G c #4C4137",
+"H c #51453B",
+"J c #5B493A",
+"K c #604126",
+"L c #65452A",
+"P c #69492E",
+"I c #68472D",
+"U c #6D4E33",
+"Y c #634834",
+"T c #715135",
+"R c #75573C",
+"E c #714834",
+"W c #564C44",
+"Q c #5A4E47",
+"! c #5D544F",
+"~ c #765C46",
+"^ c #6F5642",
+"/ c #7B6954",
+"( c #850D02",
+") c #8D0B01",
+"_ c #930A00",
+"` c #9B0C01",
+"' c #8E1A05",
+"] c #A90E02",
+"[ c #BA0E02",
+"{ c #B70C02",
+"} c #AB1402",
+"| c #AD1904",
+" . c #A41806",
+".. c #B21501",
+"X. c #BB1505",
+"o. c #B71D06",
+"O. c #88280B",
+"+. c #992809",
+"@. c #8E3012",
+"#. c #9B3611",
+"$. c #AC2509",
+"%. c #B62704",
+"&. c #A73705",
+"*. c #AD330C",
+"=. c #943F28",
+"-. c #C40E02",
+";. c #C90E01",
+":. c #C51303",
+">. c #CA1402",
+",. c #C41A06",
+"<. c #CB1A05",
+"1. c #C51E08",
+"2. c #CA1E08",
+"3. c #D21600",
+"4. c #D31B02",
+"5. c #DA1D00",
+"6. c #D41904",
+"7. c #C3240A",
+"8. c #CB230A",
+"9. c #C52A0B",
+"0. c #CD2B0D",
+"q. c #CC2703",
+"w. c #D52202",
+"e. c #DC2300",
+"r. c #DA2B03",
+"t. c #D2240A",
+"y. c #D32D0C",
+"u. c #D72A05",
+"i. c #C03700",
+"p. c #CD310E",
+"a. c #C83C01",
+"s. c #D13809",
+"d. c #CD3411",
+"f. c #CA3A12",
+"g. c #D33312",
+"h. c #D43C15",
+"j. c #DA3B14",
+"k. c #D2381C",
+"l. c #CB2C11",
+"z. c #E12500",
+"x. c #E42B00",
+"c. c #E92D00",
+"v. c #E33401",
+"b. c #EC3300",
+"n. c #E73900",
+"m. c #EB3C00",
+"M. c #F33C00",
+"N. c #F03600",
+"B. c #E13816",
+"V. c #AA431B",
+"C. c #B94B1B",
+"Z. c #884925",
+"A. c #B05821",
+"S. c #C94618",
+"D. c #D64016",
+"F. c #D94115",
+"G. c #D5441A",
+"H. c #D9451A",
+"J. c #DB4C1D",
+"K. c #D64A1B",
+"L. c #DE511D",
+"P. c #D44B03",
+"I. c #ED4400",
+"U. c #E94803",
+"Y. c #F54400",
+"T. c #F34C00",
+"R. c #FA4C00",
+"E. c #FB4700",
+"W. c #F55301",
+"Q. c #FB5500",
+"!. c #F55A00",
+"~. c #FD5B00",
+"^. c #F75709",
+"/. c #E14714",
+"(. c #E64C16",
+"). c #E85318",
+"_. c #DB6D1E",
+"`. c #F76500",
+"'. c #FD6203",
+"]. c #FD6C01",
+"[. c #FD6E0B",
+"{. c #FB640A",
+"}. c #FE7B02",
+"|. c #FD720C",
+" X c #FD7705",
+".X c #FD7D19",
+"XX c #FA7715",
+"oX c #ED6717",
+"OX c #DC4D26",
+"+X c #CA5823",
+"@X c #DD5422",
+"#X c #DE5C2B",
+"$X c #DB5B25",
+"%X c #E64927",
+"&X c #E15B25",
+"*X c #E25E29",
+"=X c #E55822",
+"-X c #D86026",
+";X c #E3622B",
+":X c #E5692E",
+">X c #E96A2C",
+",X c #E96529",
+"<X c #F87825",
+"1X c #E26530",
+"2X c #E66B30",
+"3X c #E86D31",
+"4X c #E66038",
+"5X c #EA7334",
+"6X c #ED7B39",
+"7X c #E67331",
+"8X c #F37A36",
+"9X c #F47D39",
+"0X c #F07534",
+"qX c #F16121",
+"wX c #866D56",
+"eX c #96785C",
+"rX c #86705D",
+"tX c #AD7153",
+"yX c #AD6A4C",
+"uX c #877467",
+"iX c #D16642",
+"pX c #E77951",
+"aX c #E36442",
+"sX c #FC821E",
+"dX c #FD820C",
+"fX c #FB8724",
+"gX c #FE8A24",
+"hX c #FC8C2B",
+"jX c #EE813D",
+"kX c #F4833D",
+"lX c #FA8C35",
+"zX c #FB953B",
+"xX c #FD983C",
+"cX c #FC9032",
+"vX c #FD922E",
+"bX c #958478",
+"nX c #CA805D",
+"mX c #F18640",
+"MX c #F18842",
+"NX c #FD9D45",
+"BX c #FEA14C",
+"VX c #FEA859",
+"CX c #ED9777",
+"ZX c #FFAD63",
+"AX c #F4A468",
+"SX c #A39183",
+"DX c #BCAEA0",
+"FX c #FFBC84",
+"GX c #C7BCAE",
+"HX c #D1C9BE",
+"JX c #D5CDC8",
+"KX c #CBD1E4",
+"LX c #FEFDFD",
+"PX c #F7F6F8",
+"IX c #ECECF1",
+"UX c None",
+/* pixels */
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUX4 UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXf UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXh x UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXT UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX1 UXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXc UXUXUXUXUXUXUXUXUXUXUXUXUXh c K I P K c j UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX1 UXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXj c UXUXUXUXUXUXUXUXUXUX2 2 f x c F Z Z x f f 2 UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXh - UXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUX4 x UXUXUXUXUXUXUXUXUXK eXj , f j x x x h f 2 2 1 UXUXUXUXUXUXUXUXUXUXUXUXUXc f UXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXZ UXUXUXUXUXUXUXUX2 + x wXeXU c f g f f 2 7 8 ; 7 UXUXUXUXUXUXUXUXUXUXUXK j UXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXc Z K UXUXUXUXUX2 4 t : % j T ~ T c : < D Y ~ J J J UXUXUXUXUXUXUXUXUXUXF + UXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXh A c UXUXUX2 2 2 2 2 7 1 & % - = + 3 Q J S S G W Q UXUXUXUXUXUXUXUXI 4 UXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXh f A bX2 1 2 2 2 2 2 2 f 2 2 - > 6 8 9 V G H Q ! C UXUXUXUXZ Z c UXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXf KXuX1 < < < 1 2 4 2 4 2 ; ; 3 5 8 V S G H ! W , 4 j c c x UXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXs.%.J IXJXSXrX^ K g 1 4 4 2 = + ; 3 8 8 V S H W 8 E UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXa.{.'.a.R PXLXLXIXSXK 7 1 t 2 = O ; > 5 8 9 V G 6 tXpXp.UXUXUX UXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX[.|.|.[.*.U PXLXLXJXrXD 4 4 4 + . + @ 3 6 9 q 5 tXCXk.h.+.UXUXUXUXUXUXUXUXUX: UXUXUXUXUXUXUX",
+"UXUXUX< 1 UXUXUXUXUXUXUXUXUXUXUXUX.XsXsXXXXX|.+.R PXLXPXDXT f 1 2 % O + > 3 8 0 tXCXk.f.G.h.UXUXUXUXUXUXUXUXx < UXUXUXUXUXUXUX",
+"UXUXUXUXUX1 c K P T P Z x UXUXUX<XvXvXhXfXsXXX|.&.c GXLXIXbXA 4 4 % . O @ @ q yXpXl.k.G.K.G.D.UXUXUXUXUXUXZ j UXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXA x f 1 Z.ZXBXNXxXcXhXgXsXdXP.b R HXJXwXf 2 % ; E nXaXk.k.G.OXOX$XK. at .1 z c Z Z h UXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXAXFXZXVXNXxXvXhXsXdX}.}.%.a U / Z 1 + 3 E yXpXOXy.k.j.OX at X#X#X#X at XM UXh g h UXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXBXZXZXVXVXxXcXgXsXdX}.].].Q.q.s % . & =.iX4X%Xk.t.g.k.*.u +.*X1X1X;XUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXP.gXxXBXBXNXzXfX_.oX}.].].`.!.T.M...e l.%XB.r.u.y.y.g.l.# #.*X1X1X+XUXUXUX UXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUX{.sXvXzXxXzXhXA.l , &.'.`.`.!.T.m.c.} 5.e.r.v.r.r.y.y. . w OX#X;X;XUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUX{..XgXhXhXgX<XB t O * W.~.!.!.T.m.r.} 5.e.r.r.y.t.6.t. . . . S.&X*X>XUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXE.{.|..X.X.X.XXXv % o U.R.T.W.I.n.z...w.e.r.r.w.<.<.<.2.* w H.=X#X:X+XUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXP.~.{.[.|.|.|.].&. a E.Y.Y.I.I.b.z...5.r.r.r.w.<.<.:.t.o.r a f.J. at X&X2X$XUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXf I.~.~.'.'.'.~.~.Q.i.%.Y.M.N.I.I.I.v.e.| 4.w.r.u.4.<.>.>.2.t.y.j.F.J. at X-X2X1XM UXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXZ z &.R.Q.~.~.Q.Q.Q.Q.Q.Q.E.M.M.m.m.I.m.v.e.| 4.w.r.w.<.>.>.2.2.8.g.g.k.J. at X:X2X7XM UXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXK A UXUX^.{.Q.Q.Q.R.R.E.E.Y.M.M.b.b.N.m.n.x.e...<.w.w.w.<.>.>.<.2.0.0.g.D.J.&X;X3X0XN 8 UXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXK I I I Z UXUXi <XXX^.R.T.Y.Y.Y.M.N.N.b.b.c.b.n.v.r.5.| <.w.w.4.>.>.:.<.2.t.g.h.j.J.&X:X5X6Xm 1 c UXUXUXUXUXUXUXUXUXUX",
+"UXUX4 f f f f h 1 UXUXUXUX<X<XQ.Y.M.M.M.N.N.b.c.c.c.x.x.x.z.z.6.| <.w.w.<.>.:.<.2.8.t.g.h.H.J.&X:X5X9XO.UXj K UXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXqXqXY.N.m.m.b.b.b.c.c.c.x.z.x.z.z.5.6.| <.<.6.6.:.<.:.2.8.l.g.h.H. at X*X:X5X9Xm UXUXc I P UXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUX(.).m.m.c.c.c.c.c.c.c.z.z.z.z.5.5.5.;. .:.<.w.<.>.:.<.2.t.l.g.j.K. at X*X2X6XkXb UXUXUXx I L Z UXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXv.U.v.z.z.x.z.z.z.z.z.z.z.5.5.5.3.3.3.} :.<.<.>.>.<.2.8.l.y.k.F.OX$X:X5X9X8Xu UXUXUXUX: UXh x j UXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXe.r.x.z.e.z.z.z.z.z.5.5.5.5.5.6.3.3.;. .:.<.4.2.<.6.2.t.y.g.j.H. at X&X2X5XkX7X, UXUXUXUXUXUXUXUX< < 2 UX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXw.r.r.5.5.e.e.5.z.5.5.5.5.3.6.3.3.;.;.` [ >.<.6.,.s r | g.k.h.H.&X;X3X6XmX-X# UXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXr.r.4.5.5.5.5.5.z.5.6.6.3.3.3.;.;.-.` [ :.2.,.e a g.j.H. at X$X:X5XjXkXC.. UXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXw.e.4.4.4.5.>.' p X.6.3.3.;.;.;.;.-.` { :.6.p & t M f.F.H.=X*X3X6XmX9Xm . UXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUX<.w.<.3.3.3.n 1 - & } 3.;.;.;.;.-.-.` { :.6.p O t l N h.J. at X$X:X5X6XkX:Xw UXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUX| 5.<.>.3.>.v t , % e ;.;.;.;.;.-.-._ { :.2.| 1 l B V.k.OX at X*X3X6XmXkXC.o UXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUX>.>.:.>.>.a f , % $ -.-.-.-.-.;.-._ [ ,.8.t.+.N V.G.J. at X$X2X5X9XMX8Xb X UXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUX] ;.:.;.;...u , w ` ;.:.-.;.;.,.[ _ X.2.8.l.g.g.j.H.L.&X,X5X6XMXlX-X$ UXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX[ [ [ -.;.[ ] :.;.-.:.:.>.,.>.X.) X.8.0.g.g.h.J.J.$X;X>X6XpXkX8Xn X UXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX( -.:.:.:.:.>.:.:.>.>.>.,.2.2.,.) X.8.g.k.j.H.L.=X;X>X5XjXjX8XC.# UXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX} :.:.:.,.:.,.2.2.2.2.2.2.8.X.) ,.l.g.j.J.J. at X$X:X5X6XkX5X;Xw X UXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXe X.,.,.,.,.,.,.2.2.2.8.8.0.X.) %.g.D.H.J. at X*X:X5X5X6X5X,Xn X UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXi ,.,.1.8.8.8.8.8.l.l.l.g.1._ 7.d.J.J.&X;X:X5X0X5X>X=X+.o UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXi 8.1.7.8.8.l.l.l.g.g.g.1._ %.d.OX$X;X:X2X3X>X).).+.o X UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXi 7.8.7.9.l.d.g.f.h.k.o.) 9.f. at X;X;X;X&X).).(.O.o X UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX e $.l.9.9.9.d.f.D.j.%.) 9.s.L.L.L.L.).).D.a O X UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX# s %.8.7.9.p.d.d.o.( 0.h.D.P./.(./.+.w X X UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX * s $.9.9.0.0.o.( s.j./.F.S.+.r o X UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX . $ r s +.$.$.' *.*.O.a * o X X UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX. . . o o $ $ o o X X o X UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX",
+"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX"
+};
diff --git a/src/include/FL/Fl_Native_File_Chooser.H b/src/include/FL/Fl_Native_File_Chooser.H
new file mode 100644
index 0000000..7a13777
--- /dev/null
+++ b/src/include/FL/Fl_Native_File_Chooser.H
@@ -0,0 +1,40 @@
+//
+// Fl_Native_File_Chooser.H -- FLTK native OS file chooser widget
+//
+// Copyright 2004 by Greg Ercolano.
+//
+// This library 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 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+
+#ifndef FL_NATIVE_FILE_CHOOSER_H
+#define FL_NATIVE_FILE_CHOOSER_H
+
+// Use Windows' chooser
+#if defined(_WIN32) || defined(__CYGWIN__)
+#include <FL/Fl_Native_File_Chooser_WIN32.H>
+#endif
+
+// Use Apple's chooser
+#ifdef __APPLE__
+#include <FL/Fl_Native_File_Chooser_MAC.H>
+#endif
+
+// All else falls back to FLTK's own chooser
+#if ! defined(__APPLE__) && !defined(_WIN32) && !defined(__CYGWIN__)
+#include <FL/Fl_Native_File_Chooser_FLTK.H>
+#endif
+
+#endif /*FL_NATIVE_FILE_CHOOSER_H*/
diff --git a/src/include/FL/Fl_Native_File_Chooser_FLTK.H b/src/include/FL/Fl_Native_File_Chooser_FLTK.H
new file mode 100644
index 0000000..e52bc21
--- /dev/null
+++ b/src/include/FL/Fl_Native_File_Chooser_FLTK.H
@@ -0,0 +1,101 @@
+//
+// Fl_Native_File_Chooser_DEFAULT.H -- FLTK native OS file chooser widget
+//
+// Copyright 2005 by Nathan Vander Wilt.
+// March 2005 - wrapper around Fl_File_Chooser
+//
+// This library 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 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+
+#include <FL/Fl_File_Chooser.H>
+#include <FL/Fl_File_Icon.H>
+
+#include <string.h>
+#include "icons.h"
+#include "gettext.h"
+
+class Fl_Native_File_Chooser {
+public:
+ enum Type {
+ BROWSE_FILE = 0,
+ BROWSE_DIRECTORY,
+ BROWSE_MULTI_FILE,
+ BROWSE_MULTI_DIRECTORY,
+ BROWSE_SAVE_FILE,
+ BROWSE_SAVE_DIRECTORY
+ };
+ enum Option {
+ NO_OPTIONS = 0x0000, // no options enabled
+ SAVEAS_CONFIRM = 0x0001, // Show native 'Save As' overwrite
+ // confirm dialog (if supported)
+ NEW_FOLDER = 0x0002, // Show 'New Folder' icon
+ // (if supported)
+ PREVIEW = 0x0004 // enable preview mode
+ };
+private:
+ int _btype; // kind-of browser to show()
+ int _options; // general options
+ char *_filter; // user supplied filter
+ char *_parsedfilt; // parsed filter
+ int _filtvalue; // selected filter
+ char *_preset_file;
+ char *_prevvalue; // Returned filename
+ char *_directory;
+ char *_errmsg; // error message
+ Fl_File_Chooser *file_chooser;
+
+ int exist_dialog() {
+ return(fl_choice2(_("File exists. Are you sure you want to overwrite?"),
+ _("Cancel"), _("OK"), NULL));
+ }
+ void load_system_icons() {
+ Fl_File_Icon::load_system_icons();
+ }
+
+ int _nfilters;
+
+ // Private methods
+ void errmsg(const char *msg);
+ int type_fl_file(int);
+ void parse_filter();
+ void keeplocation();
+
+public:
+ Fl_Native_File_Chooser(int val=BROWSE_FILE);
+ ~Fl_Native_File_Chooser();
+
+ // Public methods
+ void type(int);
+ int type() const;
+ void options(int);
+ int options() const;
+ int count() const;
+ const char *filename() const;
+ const char *filename(int i) const;
+ void directory(const char *val);
+ const char *directory() const;
+ void title(const char *);
+ const char* title() const;
+ const char *filter() const;
+ void filter(const char *);
+ int filters() const { return(_nfilters); }
+ void filter_value(int i);
+ int filter_value() const;
+ void preset_file(const char*);
+ const char* preset_file() const;
+ const char *errmsg() const;
+ int show();
+};
diff --git a/src/include/FL/Fl_Native_File_Chooser_MAC.H b/src/include/FL/Fl_Native_File_Chooser_MAC.H
new file mode 100644
index 0000000..49577c4
--- /dev/null
+++ b/src/include/FL/Fl_Native_File_Chooser_MAC.H
@@ -0,0 +1,138 @@
+//
+// Fl_Native_File_Chooser_MAC.H -- FLTK native OS file chooser widget
+//
+// Copyright 2004 by Greg Ercolano.
+//
+// This library 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 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// 10 20 30 40 50 60 70
+// | | | | | | |
+// 4567890123456789012345678901234567890123456789012345678901234567890123456789
+
+// OSX-SPECIFIC NATIVE BROWSER
+#ifdef __APPLE_CC__
+#include <Carbon/Carbon.h>
+#else
+#include <Carbon.h>
+#endif
+
+#include <FL/filename.H>
+#define MAXFILTERS 80
+
+class Fl_Native_File_Chooser {
+public:
+ enum Type {
+ BROWSE_FILE = 0,
+ BROWSE_DIRECTORY,
+ BROWSE_MULTI_FILE,
+ BROWSE_MULTI_DIRECTORY,
+ BROWSE_SAVE_FILE,
+ BROWSE_SAVE_DIRECTORY
+ };
+ enum Option {
+ NO_OPTIONS = 0x0000, // no options enabled
+ SAVEAS_CONFIRM = 0x0001, // Show native 'Save As' overwrite
+ // confirm dialog (if supported)
+ NEW_FOLDER = 0x0002, // Show 'New Folder' icon
+ // (if supported)
+ PREVIEW = 0x0004, // enable preview mode
+ };
+protected:
+ NavDialogCreationOptions _opts; // file navigation options
+private:
+ int _btype; // kind-of browser to show()
+ int _options; // general options
+ NavDialogRef _ref; // file navigation reference
+ NavActionState _keepstate; // holds button permissions
+ NavMenuItemSpec _tempitem; // Popup menu selection
+ char **_pathnames; // array of pathnames
+ int _tpathnames; // total pathnames
+ char *_directory; // default pathname to use
+ char *_title; // title for window
+ char *_preset_file; // the 'save as' filename
+
+ char *_filter; // user-side search filter, eg:
+ // C Files\t*.[ch]\nText Files\t*.txt"
+
+ char *_filt_names; // filter names (tab delimited)
+ // eg. "C Files\tText Files"
+
+ char *_filt_patt[MAXFILTERS];
+ // array of filter patterns, eg:
+ // _filt_patt[0]="*.{cxx,h}"
+ // _filt_patt[1]="*.txt"
+
+ int _filt_total; // parse_filter() # of filters loaded
+ int _filt_value; // index of the selected filter
+ char *_errmsg; // error message
+
+ // PRIVATE CLASS TO HANDLE NAVIGATION DIALOG REPLY STRUCT
+ // Class-ified, mainly to ensure proper cleanup.
+ //
+ class NavReply {
+ int _valid_reply;
+ NavReplyRecord _reply;
+ public:
+ NavReply();
+ ~NavReply();
+ int get_reply(NavDialogRef& ref);
+ int get_saveas_basename(char *s, int slen);
+ int get_dirname(char *s, int slen);
+ int get_pathnames(char **&pathnames, int& tpathnames);
+ };
+
+ // Private methods
+ void errmsg(const char *msg);
+ void clear_pathnames();
+ void set_single_pathname(const char *s);
+ int get_saveas_basename(NavDialogRef& ref);
+ int get_pathnames(NavDialogRef& ref);
+ static void event_handler(NavEventCallbackMessage callBackSelector,
+ NavCBRecPtr cbparm, void *data);
+
+ void clear_filters();
+ void add_filter(const char *, const char *);
+ void parse_filter(const char *from);
+ static Boolean filter_proc_cb(AEDesc *, void *, void *, NavFilterModes);
+ Boolean filter_proc_cb2(AEDesc*, void*, void*, NavFilterModes);
+ int post();
+
+public:
+ Fl_Native_File_Chooser(int val = BROWSE_FILE);
+ ~Fl_Native_File_Chooser();
+
+ // Public methods
+ void type(int);
+ int type() const;
+ void options(int);
+ int options() const;
+ int count() const;
+ const char *filename() const;
+ const char *filename(int i) const;
+ void directory(const char *);
+ const char *directory() const;
+ void title(const char *);
+ const char *title() const;
+ const char *filter() const;
+ void filter(const char *);
+ void filter_value(int i) { _filt_value = i; }
+ int filter_value() { return(_filt_value); }
+ int filters() { return(_filt_total); }
+ void preset_file(const char *);
+ const char *preset_file();
+ const char *errmsg() const;
+ int show();
+};
diff --git a/src/include/FL/Fl_Native_File_Chooser_WIN32.H b/src/include/FL/Fl_Native_File_Chooser_WIN32.H
new file mode 100644
index 0000000..889b484
--- /dev/null
+++ b/src/include/FL/Fl_Native_File_Chooser_WIN32.H
@@ -0,0 +1,108 @@
+//
+// Fl_Native_File_Chooser_WINDOWS.H -- FLTK native OS file chooser widget
+//
+// Copyright 2004 by Greg Ercolano.
+// April 2005 - API changes, improved filter processing by Nathan Vander Wilt
+//
+// This library 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 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+
+// #define _WIN32_WINNT 0x0501 // needed for OPENFILENAME's 'FlagsEx'
+#include <stdio.h>
+#include <stdlib.h> // malloc
+#include <windows.h>
+#include <commdlg.h> // OPENFILENAME, GetOpenFileName()
+#include <shlobj.h> // BROWSEINFO, SHBrowseForFolder()
+
+class Fl_Native_File_Chooser {
+public:
+ enum Type {
+ BROWSE_FILE = 0,
+ BROWSE_DIRECTORY,
+ BROWSE_MULTI_FILE,
+ BROWSE_MULTI_DIRECTORY,
+ BROWSE_SAVE_FILE,
+ BROWSE_SAVE_DIRECTORY
+ };
+ enum Option {
+ NO_OPTIONS = 0x0000, // no options enabled
+ SAVEAS_CONFIRM = 0x0001, // Show native 'Save As' overwrite
+ // confirm dialog (if supported)
+ NEW_FOLDER = 0x0002, // Show 'New Folder' icon
+ // (if supported)
+ PREVIEW = 0x0004, // enable preview mode
+ };
+private:
+ int _btype; // kind-of browser to show()
+ int _options; // general options
+ OPENFILENAME _ofn; // GetOpenFileName() & GetSaveFileName() struct
+ BROWSEINFO _binf; // SHBrowseForFolder() struct
+ char **_pathnames; // array of pathnames
+ int _tpathnames; // total pathnames
+ char *_directory; // default pathname to use
+ char *_title; // title for window
+ char *_filter; // user-side search filter
+ char *_parsedfilt; // filter parsed for Windows dialog
+ int _nfilters; // number of filters parse_filter counted
+ char *_preset_file; // the file to preselect
+ char *_errmsg; // error message
+
+ // Private methods
+ void errmsg(const char *msg);
+
+ void clear_pathnames();
+ void set_single_pathname(const char *s);
+ void add_pathname(const char *s);
+
+ void FreePIDL(ITEMIDLIST *pidl);
+ void ClearOFN();
+ void ClearBINF();
+ void Win2Unix(char *s);
+ void Unix2Win(char *s);
+ int showfile();
+ static int CALLBACK Dir_CB(HWND win, UINT msg, LPARAM param, LPARAM data);
+ int showdir();
+
+ void parse_filter(const char *);
+ void clear_filters();
+ void add_filter(const char *, const char *);
+
+public:
+ Fl_Native_File_Chooser(int val = BROWSE_FILE);
+ ~Fl_Native_File_Chooser();
+
+ // Public methods
+ void type(int val);
+ int type() const;
+ void options(int);
+ int options() const;
+ int count() const;
+ const char *filename() const;
+ const char *filename(int i) const;
+ void directory(const char *val);
+ const char *directory() const;
+ void title(const char *val);
+ const char *title() const;
+ const char *filter() const;
+ void filter(const char *val);
+ int filters() const { return _nfilters; }
+ void filter_value(int i);
+ int filter_value() const;
+ void preset_file(const char *);
+ const char *preset_file() const;
+ const char *errmsg() const;
+ int show();
+};
diff --git a/src/include/FTextRXTX.h b/src/include/FTextRXTX.h
new file mode 100644
index 0000000..8eb6c5a
--- /dev/null
+++ b/src/include/FTextRXTX.h
@@ -0,0 +1,125 @@
+// ----------------------------------------------------------------------------
+// FTextView.h
+//
+// Copyright (C) 2007-2010
+// Stelios Bounanos, M0GLD
+// Copyright (C) 2007-2010
+// Dave Freese, W1HKJ
+//
+// This file is part of fldigi.
+//
+// fldigi is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// fldigi is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+// ----------------------------------------------------------------------------
+
+#ifndef FTextRXTX_H_
+#define FTextRXTX_H_
+
+#include "FTextView.h"
+
+///
+/// A TextBase subclass to display received & transmitted text
+///
+class FTextRX : public FTextView
+{
+public:
+ FTextRX(int x, int y, int w, int h, const char *l = 0);
+ ~FTextRX();
+
+ virtual int handle(int event);
+
+ virtual void add(unsigned char c, int attr = RECV);
+ virtual void add(const char *s, int attr = RECV)
+ {
+ while (*s)
+ add(*s++, attr);
+ }
+
+ void mark(FTextBase::TEXT_ATTR attr = CLICK_START);
+ void clear(void);
+
+ void setFont(Fl_Font f, int attr = NATTR);
+
+protected:
+ enum {
+ RX_MENU_COPY, RX_MENU_CLEAR, RX_MENU_SELECT_ALL,
+ RX_MENU_SAVE, RX_MENU_WRAP
+ };
+
+ void handle_clickable(int x, int y);
+ void handle_context_menu(void);
+ void menu_cb(size_t item);
+
+private:
+ FTextRX();
+ FTextRX(const FTextRX &t);
+
+protected:
+ static Fl_Menu_Item menu[];
+ struct {
+ bool enabled;
+ float delay;
+ } tooltips;
+};
+
+
+///
+/// A FTextBase subclass to display and edit text to be transmitted
+///
+class FTextTX : public FTextEdit
+{
+public:
+ FTextTX(int x, int y, int w, int h, const char *l = 0);
+
+ virtual int handle(int event);
+
+ void clear(void);
+ void clear_sent(void);
+ int nextChar(void);
+ bool eot(void);
+
+ void setFont(Fl_Font f, int attr = NATTR);
+
+protected:
+ enum { TX_MENU_CUT, TX_MENU_COPY, TX_MENU_PASTE, TX_MENU_CLEAR, TX_MENU_READ,
+ TX_MENU_WRAP
+ };
+ int handle_key(int key);
+ int handle_dnd_drag(int pos);
+ void handle_context_menu(void);
+ void menu_cb(size_t item);
+ void change_keybindings(void);
+ static int kf_default(int c, Fl_Text_Editor_mod* e);
+ static int kf_enter(int c, Fl_Text_Editor_mod* e);
+ static int kf_delete(int c, Fl_Text_Editor_mod* e);
+ static int kf_cut(int c, Fl_Text_Editor_mod* e);
+ static int kf_paste(int c, Fl_Text_Editor_mod* e);
+
+private:
+ FTextTX();
+ FTextTX(const FTextTX &t);
+
+protected:
+ static Fl_Menu_Item menu[];
+ bool PauseBreak;
+ int txpos;
+ static int *ptxpos;
+ int bkspaces;
+};
+
+#endif // FTextRXTX_H_
+
+// Local Variables:
+// mode: c++
+// c-file-style: "linux"
+// End:
diff --git a/src/include/FTextView.h b/src/include/FTextView.h
new file mode 100644
index 0000000..a00f9f4
--- /dev/null
+++ b/src/include/FTextView.h
@@ -0,0 +1,189 @@
+// ----------------------------------------------------------------------------
+// FTextView.h
+//
+// Copyright (C) 2007-2009
+// Stelios Bounanos, M0GLD
+//
+// This file is part of fldigi.
+//
+// fldigi is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// fldigi is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+// ----------------------------------------------------------------------------
+
+#ifndef FTextView_H_
+#define FTextView_H_
+
+#include <stddef.h>
+
+#include <FL/Fl.H>
+#include <FL/Enumerations.H>
+#include <FL/Fl_Menu_Item.H>
+#include <FL/Fl_Tile.H>
+
+#include "Fl_Text_Editor_mod.H"
+
+///
+/// The text widgets base class.
+/// This class implements a basic text editing widget based on Fl_Text_Editor_mod.
+///
+class FTextBase : public Fl_Text_Editor_mod
+{
+public:
+ // CLICK_START: same as first clickable style
+ // NATTR: number of styles (last style + 1)
+ enum TEXT_ATTR { RECV, XMIT, CTRL, SKIP, ALTR,
+ CLICK_START, QSY = CLICK_START, /* FOO, BAR, ..., */
+ NATTR };
+
+ FTextBase(int x, int y, int w, int h, const char *l = 0);
+ virtual ~FTextBase() { delete tbuf; delete sbuf; }
+
+ virtual void add(const char *text, int attr = RECV);
+ virtual void add(unsigned char c, int attr = RECV);
+ void addstr(const char *text, int attr = RECV) { add(text, attr); }
+ void addchr(unsigned char c, int attr = RECV) { add(c, attr); }
+
+ virtual int handle(int event);
+ virtual void handle_context_menu(void) { }
+ virtual void clear(void);//{ tbuf->text(""); sbuf->text(""); }
+
+ void set_word_wrap(bool b);
+ bool get_word_wrap(void) { return wrap; }
+
+ virtual void setFont(Fl_Font f, int attr = NATTR);
+ void setFontSize(int s, int attr = NATTR);
+ void setFontColor(Fl_Color c, int attr = NATTR);
+ // Override Fl_Text_Display, which stores the font number in an unsigned
+ // character and therefore cannot represent all fonts
+ Fl_Font textfont(void) { return styles[0].font; }
+ void textfont(Fl_Font f) { setFont(f); }
+ void textfont(uchar s) { textfont((Fl_Font)s); }
+
+ void cursorON(void) { show_cursor(); }
+ virtual void resize(int X, int Y, int W, int H);
+
+ static bool wheight_mult_tsize(void *arg, int xd, int yd);
+
+protected:
+ void set_style(int attr, Fl_Font f, int s, Fl_Color c,
+ int set = SET_FONT | SET_SIZE | SET_COLOR);
+ int readFile(const char* fn = 0);
+ void saveFile(void);
+#if FLWKEY_FLTK_API_MAJOR == 1 && FLWKEY_FLTK_API_MINOR < 3
+ char* get_word(int x, int y, const char* nwchars = "", bool ontext = true);
+#else
+ char* get_word(int x, int y, bool ontext = true);
+#endif
+ void init_context_menu(void);
+ void show_context_menu(void);
+ virtual void menu_cb(size_t item) { }
+ int reset_wrap_col(void);
+ void reset_styles(int set);
+private:
+ FTextBase();
+ FTextBase(const FTextBase &t);
+
+protected:
+ enum { FTEXT_DEF = 'A' };
+ enum set_style_op_e { SET_FONT = 1 << 0, SET_SIZE = 1 << 1, SET_COLOR = 1 << 2 };
+ Fl_Text_Buffer_mod *tbuf; ///< text buffer
+ Fl_Text_Buffer_mod *sbuf; ///< style buffer
+ Fl_Text_Display_mod::Style_Table_Entry styles[NATTR];
+ Fl_Menu_Item *context_menu;
+ int popx, popy;
+ bool wrap;
+ int wrap_col;
+ int max_lines;
+ bool scroll_hint;
+ bool restore_wrap;
+// bool wrap_restore;
+
+private:
+ int oldw, oldh, olds;
+ Fl_Font oldf;
+};
+
+///
+/// A TextBase subclass to display received & transmitted text
+///
+class FTextView : public FTextBase
+{
+public:
+ FTextView(int x, int y, int w, int h, const char *l = 0);
+ ~FTextView() { }
+
+ virtual int handle(int event);
+
+protected:
+ enum {
+ VIEW_MENU_COPY, VIEW_MENU_CLEAR, VIEW_MENU_SELECT_ALL,
+ VIEW_MENU_SAVE, VIEW_MENU_WRAP
+ };
+
+ virtual void handle_context_menu(void);
+ virtual void menu_cb(size_t item);
+ static void changed_cb(int pos, int nins, int ndel, int nsty,
+ const char *dtext, void *arg);
+ void change_keybindings(void);
+
+private:
+ FTextView();
+ FTextView(const FTextView &t);
+
+protected:
+ static Fl_Menu_Item menu[];
+ bool quick_entry;
+};
+
+
+///
+/// A FTextBase subclass to display and edit text to be transmitted
+///
+class FTextEdit : public FTextBase
+{
+public:
+ FTextEdit(int x, int y, int w, int h, const char *l = 0);
+
+ virtual int handle(int event);
+
+protected:
+ enum {
+ EDIT_MENU_CUT, EDIT_MENU_COPY, EDIT_MENU_PASTE, EDIT_MENU_CLEAR,
+ EDIT_MENU_READ, EDIT_MENU_WRAP
+ };
+ virtual int handle_key(int key);
+ int handle_key_ascii(int key);
+ virtual int handle_dnd_drag(int pos);
+ int handle_dnd_drop(void);
+ virtual void handle_context_menu(void);
+ virtual void menu_cb(size_t item);
+ static void changed_cb(int pos, int nins, int ndel, int nsty,
+ const char *dtext, void *arg);
+
+private:
+ FTextEdit();
+ FTextEdit(const FTextEdit &t);
+
+protected:
+ static Fl_Menu_Item menu[];
+ char ascii_cnt;
+ unsigned ascii_chr;
+ bool dnd_paste;
+};
+
+#endif // FTextView_H_
+
+// Local Variables:
+// mode: c++
+// c-file-style: "linux"
+// End:
diff --git a/src/include/Fl_Text_Display_mod.H b/src/include/Fl_Text_Display_mod.H
new file mode 100644
index 0000000..ad68788
--- /dev/null
+++ b/src/include/Fl_Text_Display_mod.H
@@ -0,0 +1,7 @@
+#include <config.h>
+
+#if FLWKEY_FLTK_API_MAJOR == 1 && FLWKEY_FLTK_API_MINOR < 3
+# include "Fl_Text_Display_mod_1_1.H"
+#elif FLWKEY_FLTK_API_MAJOR == 1 && FLWKEY_FLTK_API_MINOR == 3
+# include "Fl_Text_Display_mod_1_3.H"
+#endif
diff --git a/src/include/Fl_Text_Display_mod_1_1.H b/src/include/Fl_Text_Display_mod_1_1.H
new file mode 100644
index 0000000..48c830c
--- /dev/null
+++ b/src/include/Fl_Text_Display_mod_1_1.H
@@ -0,0 +1,306 @@
+//
+// "$Id: Fl_Text_Display.H 4502 2005-08-10 23:11:51Z matt $"
+//
+// Header file for Fl_Text_Display class.
+//
+// Copyright 2001-2005 by Bill Spitzak and others.
+// Original code Copyright Mark Edel. Permission to distribute under
+// the LGPL for the FLTK library granted by Mark Edel.
+//
+// This library 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 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+// http://www.fltk.org/str.php
+//
+
+#ifndef FL_TEXT_DISPLAY_MOD_H
+#define FL_TEXT_DISPLAY_MOD_H
+
+#include <FL/fl_draw.H>
+#include <FL/Fl_Group.H>
+#include <FL/Fl_Widget.H>
+#include <FL/Fl_Scrollbar.H>
+#include <FL/Fl_Text_Buffer.H>
+
+#define Fl_Text_Buffer_mod Fl_Text_Buffer
+
+class Fl_Text_Display_mod: public Fl_Group {
+ public:
+ enum {
+ NORMAL_CURSOR, CARET_CURSOR, DIM_CURSOR,
+ BLOCK_CURSOR, HEAVY_CURSOR
+ };
+
+ enum {
+ CURSOR_POS, CHARACTER_POS
+ };
+
+ // drag types- they match Fl::event_clicks() so that single clicking to
+ // start a collection selects by character, double clicking selects by
+ // word and triple clicking selects by line.
+ enum {
+ DRAG_CHAR = 0, DRAG_WORD = 1, DRAG_LINE = 2
+ };
+ friend void fl_text_drag_me(int pos, Fl_Text_Display_mod* d);
+
+ typedef void (*Unfinished_Style_Cb)(int, void *);
+
+ // style attributes - currently not implemented!
+ enum {
+ ATTR_NONE = 0,
+ ATTR_UNDERLINE = 1,
+ ATTR_HIDDEN = 2
+ };
+
+ struct Style_Table_Entry {
+ Fl_Color color;
+ Fl_Font font;
+ int size;
+ unsigned attr;
+ };
+
+ Fl_Text_Display_mod(int X, int Y, int W, int H, const char *l = 0);
+ ~Fl_Text_Display_mod();
+
+ virtual int handle(int e);
+ void buffer(Fl_Text_Buffer_mod* buf);
+ void buffer(Fl_Text_Buffer_mod& buf) { buffer(&buf); }
+ Fl_Text_Buffer_mod* buffer() { return mBuffer; }
+ void redisplay_range(int start, int end);
+ void scroll(int topLineNum, int horizOffset);
+ void insert(const char* text);
+ void overstrike(const char* text);
+ void insert_position(int newPos);
+ int insert_position() { return mCursorPos; }
+ int in_selection(int x, int y);
+ void show_insert_position();
+ int move_right();
+ int move_left();
+ int move_up();
+ int move_down();
+ int count_lines(int start, int end, bool start_pos_is_line_start);
+ int line_start(int pos);
+ int line_end(int pos, bool start_pos_is_line_start);
+ int skip_lines(int startPos, int nLines, bool startPosIsLineStart);
+ int rewind_lines(int startPos, int nLines);
+ void next_word(void);
+ void previous_word(void);
+ void show_cursor(int b = 1);
+ void hide_cursor() { show_cursor(0); }
+ void cursor_style(int style);
+ Fl_Color cursor_color() const {return mCursor_color;}
+ void cursor_color(Fl_Color n) {mCursor_color = n;}
+ int scrollbar_width() { return scrollbar_width_; }
+ Fl_Align scrollbar_align() { return scrollbar_align_; }
+ void scrollbar_width(int W) { scrollbar_width_ = W; }
+ void scrollbar_align(Fl_Align a) { scrollbar_align_ = a; }
+ int word_start(int pos) { return buffer()->word_start(pos); }
+ int word_end(int pos) { return buffer()->word_end(pos); }
+
+
+ void highlight_data(Fl_Text_Buffer_mod *styleBuffer,
+ const Style_Table_Entry *styleTable,
+ int nStyles, char unfinishedStyle,
+ Unfinished_Style_Cb unfinishedHighlightCB,
+ void *cbArg);
+
+ int position_style(int lineStartPos, int lineLen, int lineIndex,
+ int dispIndex);
+
+ Fl_Font textfont() const {return textfont_;}
+ void textfont(Fl_Font f) {textfont_ = f;}
+ uchar textsize() const {return textsize_;}
+ void textsize(uchar s) {textsize_ = s;}
+ Fl_Color textcolor() const {return (Fl_Color)textcolor_;}
+ void textcolor(unsigned n) {textcolor_ = n;}
+
+ int wrapped_column(int row, int column);
+ int wrapped_row(int row);
+ void wrap_mode(int wrap, int wrap_margin);
+
+ virtual void resize(int X, int Y, int W, int H);
+
+ protected:
+ // Most (all?) of this stuff should only be called from resize() or
+ // draw().
+ // Anything with "vline" indicates thats it deals with currently
+ // visible lines.
+
+ virtual void draw();
+ void draw_text(int X, int Y, int W, int H);
+ void draw_range(int start, int end);
+ void draw_cursor(int, int);
+
+ void draw_string(int style, int x, int y, int toX, const char *string,
+ int nChars);
+
+ void draw_vline(int visLineNum, int leftClip, int rightClip,
+ int leftCharIndex, int rightCharIndex);
+
+ void draw_line_numbers(bool clearAll);
+
+ void clear_rect(int style, int x, int y, int width, int height);
+ void display_insert();
+
+ void offset_line_starts(int newTopLineNum);
+
+ void calc_line_starts(int startLine, int endLine);
+
+ void update_line_starts(int pos, int charsInserted, int charsDeleted,
+ int linesInserted, int linesDeleted, int *scrolled);
+
+ void calc_last_char();
+
+ int position_to_line( size_t pos, int* lineNum);//int pos, int* lineNum );
+ int string_width(const char* string, int length, int style);
+
+ static void scroll_timer_cb(void*);
+
+ static void buffer_predelete_cb(int pos, int nDeleted, void* cbArg);
+ static void buffer_modified_cb(int pos, int nInserted, int nDeleted,
+ int nRestyled, const char* deletedText,
+ void* cbArg);
+
+ static void h_scrollbar_cb(Fl_Scrollbar* w, Fl_Text_Display_mod* d);
+ static void v_scrollbar_cb( Fl_Scrollbar* w, Fl_Text_Display_mod* d);
+ void update_v_scrollbar();
+ void update_h_scrollbar();
+ int measure_vline(int visLineNum);
+ int longest_vline();
+ int empty_vlines();
+ int vline_length(int visLineNum);
+ int xy_to_position(int x, int y, int PosType = CHARACTER_POS);
+
+ void xy_to_rowcol(int x, int y, int* row, int* column,
+ int PosType = CHARACTER_POS);
+
+ int position_to_xy(int pos, int* x, int* y);
+ void maintain_absolute_top_line_number(int state);
+ int get_absolute_top_line_number();
+ void absolute_top_line_number(int oldFirstChar);
+ int maintaining_absolute_top_line_number();
+ void reset_absolute_top_line_number();
+ int position_to_linecol(int pos, int* lineNum, int* column);
+ void scroll_(int topLineNum, int horizOffset);
+
+ void extend_range_for_styles(int* start, int* end);
+
+ void find_wrap_range(const char *deletedText, int pos, int nInserted,
+ int nDeleted, int *modRangeStart, int *modRangeEnd,
+ int *linesInserted, int *linesDeleted);
+ void measure_deleted_lines(int pos, int nDeleted);
+ void wrapped_line_counter(Fl_Text_Buffer_mod *buf, int startPos, int maxPos,
+ int maxLines, bool startPosIsLineStart,
+ int styleBufOffset, int *retPos, int *retLines,
+ int *retLineStart, int *retLineEnd,
+ bool countLastLineMissingNewLine = true);
+ void find_line_end(int pos, bool start_pos_is_line_start, int *lineEnd,
+ int *nextLineStart);
+ int measure_proportional_character(char c, int colNum, int pos);
+ int wrap_uses_character(int lineEndPos);
+ int range_touches_selection(Fl_Text_Selection *sel, int rangeStart,
+ int rangeEnd);
+
+ static const int DEFAULT_TOP_MARGIN;
+ static const int DEFAULT_BOTTOM_MARGIN;
+ static const int DEFAULT_LEFT_MARGIN;
+ static const int DEFAULT_RIGHT_MARGIN;
+ int TOP_MARGIN, BOTTOM_MARGIN, LEFT_MARGIN, RIGHT_MARGIN;
+
+ int damage_range1_start, damage_range1_end;
+ int damage_range2_start, damage_range2_end;
+ int mCursorPos;
+ int mCursorOn;
+ int mCursorOldY; /* Y pos. of cursor for blanking */
+ int mCursorToHint; /* Tells the buffer modified callback
+ where to move the cursor, to reduce
+ the number of redraw calls */
+ int mCursorStyle; /* One of enum cursorStyles above */
+ int mCursorPreferredCol; /* Column for vert. cursor movement */
+ int mNVisibleLines; /* # of visible (displayed) lines */
+ int mNBufferLines; /* # of newlines in the buffer */
+ Fl_Text_Buffer_mod* mBuffer; /* Contains text to be displayed */
+ Fl_Text_Buffer_mod* mStyleBuffer; /* Optional parallel buffer containing
+ color and font information */
+ int mFirstChar, mLastChar; /* Buffer positions of first and last
+ displayed character (lastChar points
+ either to a newline or one character
+ beyond the end of the buffer) */
+ int mContinuousWrap; /* Wrap long lines when displaying */
+ int mWrapMargin; /* Margin in # of char positions for
+ wrapping in continuousWrap mode */
+ int* mLineStarts;
+ int mTopLineNum; /* Line number of top displayed line
+ of file (first line of file is 1) */
+ int mAbsTopLineNum; /* In continuous wrap mode, the line
+ number of the top line if the text
+ were not wrapped (note that this is
+ only maintained as needed). */
+ int mNeedAbsTopLineNum; /* Externally settable flag to continue
+ maintaining absTopLineNum even if
+ it isn't needed for line # display */
+ int mHorizOffset; /* Horizontal scroll pos. in pixels */
+ int mTopLineNumHint; /* Line number of top displayed line
+ of file (first line of file is 1) */
+ int mHorizOffsetHint; /* Horizontal scroll pos. in pixels */
+ int mNStyles; /* Number of entries in styleTable */
+ const Style_Table_Entry *mStyleTable; /* Table of fonts and colors for
+ coloring/syntax-highlighting */
+ char mUnfinishedStyle; /* Style buffer entry which triggers
+ on-the-fly reparsing of region */
+ Unfinished_Style_Cb mUnfinishedHighlightCB; /* Callback to parse "unfinished" */
+ /* regions */
+ void* mHighlightCBArg; /* Arg to unfinishedHighlightCB */
+
+ int mMaxsize;
+
+ int mFixedFontWidth; /* Font width if all current fonts are
+ fixed and match in width, else -1 */
+ int mSuppressResync; /* Suppress resynchronization of line
+ starts during buffer updates */
+ int mNLinesDeleted; /* Number of lines deleted during
+ buffer modification (only used
+ when resynchronization is suppressed) */
+ int mModifyingTabDistance; /* Whether tab distance is being
+ modified */
+
+ Fl_Color mCursor_color;
+
+ Fl_Scrollbar* mHScrollBar;
+ Fl_Scrollbar* mVScrollBar;
+ int scrollbar_width_;
+ Fl_Align scrollbar_align_;
+ int dragPos, dragType, dragging;
+ int display_insert_position_hint;
+ struct { int x, y, w, h; } text_area;
+
+ Fl_Font textfont_;
+ uchar textsize_;
+ unsigned textcolor_;
+
+ // The following are not presently used from the original NEdit code,
+ // but are being put here so that future versions of Fl_Text_Display
+ // can implement line numbers without breaking binary compatibility.
+ int mLineNumLeft, mLineNumWidth;
+ /* Line number margin and width */
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Text_Display.H 4502 2005-08-10 23:11:51Z matt $".
+//
diff --git a/src/include/Fl_Text_Display_mod_1_3.H b/src/include/Fl_Text_Display_mod_1_3.H
new file mode 100644
index 0000000..72eb38f
--- /dev/null
+++ b/src/include/Fl_Text_Display_mod_1_3.H
@@ -0,0 +1,49 @@
+//
+// "$Id: Fl_Text_Display_mod.H 8306 2011-01-24 17:04:22Z matt $"
+//
+// Header file for Fl_Text_Display_mod class.
+//
+// Copyright 2001-2010 by Bill Spitzak and others.
+// Original code Copyright Mark Edel. Permission to distribute under
+// the LGPL for the FLTK library granted by Mark Edel.
+//
+// This library 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 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+// http://www.fltk.org/str.php
+//
+
+/* \file
+ Fl_Text_Display_mod widget . */
+
+#ifndef FL_TEXT_DISPLAY_MOD_H
+#define FL_TEXT_DISPLAY_MOD_H
+
+#undef Fl_Text_Buffer_mod
+#undef Fl_Text_Display_mod
+#undef Fl_Text_Editor_mod
+
+#define Fl_Text_Buffer_mod Fl_Text_Buffer
+#define Fl_Text_Display_mod Fl_Text_Display
+#define Fl_Text_Editor_mod Fl_Text_Editor
+
+#include <FL/Fl_Text_Display.H>
+
+#endif
+//
+// End of "$Id: Fl_Text_Display_mod.H 8306 2011-01-24 17:04:22Z matt $".
+//
diff --git a/src/include/Fl_Text_Editor_mod.H b/src/include/Fl_Text_Editor_mod.H
new file mode 100644
index 0000000..7cfd27b
--- /dev/null
+++ b/src/include/Fl_Text_Editor_mod.H
@@ -0,0 +1,7 @@
+#include <config.h>
+
+#if FLWKEY_FLTK_API_MAJOR == 1 && FLWKEY_FLTK_API_MINOR < 3
+# include "Fl_Text_Editor_mod_1_1.H"
+#elif FLWKEY_FLTK_API_MAJOR == 1 && FLWKEY_FLTK_API_MINOR == 3
+# include "Fl_Text_Editor_mod_1_3.H"
+#endif
diff --git a/src/include/Fl_Text_Editor_mod_1_1.H b/src/include/Fl_Text_Editor_mod_1_1.H
new file mode 100644
index 0000000..1f03873
--- /dev/null
+++ b/src/include/Fl_Text_Editor_mod_1_1.H
@@ -0,0 +1,110 @@
+//
+// "$Id: Fl_Text_Editor.H 4288 2005-04-16 00:13:17Z mike $"
+//
+// Header file for Fl_Text_Editor class.
+//
+// Copyright 2001-2005 by Bill Spitzak and others.
+// Original code Copyright Mark Edel. Permission to distribute under
+// the LGPL for the FLTK library granted by Mark Edel.
+//
+// This library 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 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+// http://www.fltk.org/str.php
+//
+
+
+#ifndef FL_TEXT_EDITOR_MOD_H
+#define FL_TEXT_EDITOR_MOD_H
+
+#include "Fl_Text_Display_mod.H"
+
+// key will match in any state
+#define FL_TEXT_EDITOR_ANY_STATE (-1L)
+
+class Fl_Text_Editor_mod : public Fl_Text_Display_mod {
+ public:
+ typedef int (*Key_Func)(int key, Fl_Text_Editor_mod* editor);
+
+ struct Key_Binding {
+ int key;
+ int state;
+ Key_Func function;
+ Key_Binding* next;
+ };
+
+ Fl_Text_Editor_mod(int X, int Y, int W, int H, const char* l = 0);
+ ~Fl_Text_Editor_mod() { remove_all_key_bindings(); }
+ virtual int handle(int e);
+ void insert_mode(int b) { insert_mode_ = b; }
+ int insert_mode() { return insert_mode_; }
+
+ void add_key_binding(int key, int state, Key_Func f, Key_Binding** list);
+ void add_key_binding(int key, int state, Key_Func f)
+ { add_key_binding(key, state, f, &key_bindings); }
+ void remove_key_binding(int key, int state, Key_Binding** list);
+ void remove_key_binding(int key, int state)
+ { remove_key_binding(key, state, &key_bindings); }
+ void remove_all_key_bindings(Key_Binding** list);
+ void remove_all_key_bindings() { remove_all_key_bindings(&key_bindings); }
+ void add_default_key_bindings(Key_Binding** list);
+ Key_Func bound_key_function(int key, int state, Key_Binding* list);
+ Key_Func bound_key_function(int key, int state)
+ { return bound_key_function(key, state, key_bindings); }
+ void default_key_function(Key_Func f) { default_key_function_ = f; }
+
+ // functions for the built in default bindings
+ static int kf_default(int c, Fl_Text_Editor_mod* e);
+ static int kf_ignore(int c, Fl_Text_Editor_mod* e);
+ static int kf_backspace(int c, Fl_Text_Editor_mod* e);
+ static int kf_enter(int c, Fl_Text_Editor_mod* e);
+ static int kf_move(int c, Fl_Text_Editor_mod* e);
+ static int kf_shift_move(int c, Fl_Text_Editor_mod* e);
+ static int kf_ctrl_move(int c, Fl_Text_Editor_mod* e);
+ static int kf_c_s_move(int c, Fl_Text_Editor_mod* e);
+ static int kf_home(int, Fl_Text_Editor_mod* e);
+ static int kf_end(int c, Fl_Text_Editor_mod* e);
+ static int kf_left(int c, Fl_Text_Editor_mod* e);
+ static int kf_up(int c, Fl_Text_Editor_mod* e);
+ static int kf_right(int c, Fl_Text_Editor_mod* e);
+ static int kf_down(int c, Fl_Text_Editor_mod* e);
+ static int kf_page_up(int c, Fl_Text_Editor_mod* e);
+ static int kf_page_down(int c, Fl_Text_Editor_mod* e);
+ static int kf_insert(int c, Fl_Text_Editor_mod* e);
+ static int kf_delete(int c, Fl_Text_Editor_mod* e);
+ static int kf_copy(int c, Fl_Text_Editor_mod* e);
+ static int kf_cut(int c, Fl_Text_Editor_mod* e);
+ static int kf_paste(int c, Fl_Text_Editor_mod* e);
+ static int kf_select_all(int c, Fl_Text_Editor_mod* e);
+ static int kf_undo(int c, Fl_Text_Editor_mod* e);
+
+ protected:
+ int handle_key();
+ void maybe_do_callback();
+
+ int insert_mode_;
+ Key_Binding* key_bindings;
+ static Key_Binding* global_key_bindings;
+ Key_Func default_key_function_;
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Text_Editor.H 4288 2005-04-16 00:13:17Z mike $".
+//
+
diff --git a/src/include/Fl_Text_Editor_mod_1_3.H b/src/include/Fl_Text_Editor_mod_1_3.H
new file mode 100644
index 0000000..ad6ec89
--- /dev/null
+++ b/src/include/Fl_Text_Editor_mod_1_3.H
@@ -0,0 +1,51 @@
+//
+// "$Id: Fl_Text_Editor_mod.H 7903 2010-11-28 21:06:39Z matt $"
+//
+// Header file for Fl_Text_Editor_mod class.
+//
+// Copyright 2001-2010 by Bill Spitzak and others.
+// Original code Copyright Mark Edel. Permission to distribute under
+// the LGPL for the FLTK library granted by Mark Edel.
+//
+// This library 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 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+// http://www.fltk.org/str.php
+//
+
+/* \file
+ Fl_Text_Editor_mod widget . */
+
+
+#ifndef FL_TEXT_EDITOR_MOD_H
+#define FL_TEXT_EDITOR_MOD_H
+
+#undef Fl_Text_Buffer_mod
+#undef Fl_Text_Display_mod
+#undef Fl_Text_Editor_mod
+
+#define Fl_Text_Buffer_mod Fl_Text_Buffer
+#define Fl_Text_Display_mod Fl_Text_Display
+#define Fl_Text_Editor_mod Fl_Text_Editor
+
+#include <FL/Fl_Text_Editor.H>
+
+#endif
+//
+// End of "$Id: Fl_Text_Editor_mod.H 7903 2010-11-28 21:06:39Z matt $".
+//
+
diff --git a/src/include/ValueSlider.h b/src/include/ValueSlider.h
new file mode 100644
index 0000000..6f81b16
--- /dev/null
+++ b/src/include/ValueSlider.h
@@ -0,0 +1,31 @@
+//======================================================================
+// clase wheel_slider - based on Fl_Slider
+// class wheel_value_slider - based on Fl_Value_Slider
+//======================================================================
+
+#include <FL/Fl_Slider.H>
+#include <FL/Fl_Value_Slider.H>
+
+class Fl_Wheel_Slider : public Fl_Slider
+{
+private:
+ bool reverse_;
+public:
+ Fl_Wheel_Slider(int x, int y, int w, int h, const char *label = 0)
+ : Fl_Slider(x, y, w, h, label), reverse_(false) { }
+ int handle(int event);
+ void reverse(bool rev) { reverse_ = rev;}
+ bool reverse() { return reverse_;}
+};
+
+class Fl_Wheel_Value_Slider : public Fl_Value_Slider
+{
+private:
+ bool reverse_;
+public:
+ Fl_Wheel_Value_Slider(int x, int y, int w, int h, const char *label = 0)
+ : Fl_Value_Slider(x, y, w, h, label), reverse_(false) { }
+ int handle(int event);
+ void reverse(bool rev) { reverse_ = rev;}
+ bool reverse() { return reverse_;}
+};
diff --git a/src/include/XmlRpc.h b/src/include/XmlRpc.h
new file mode 100644
index 0000000..8ffcba7
--- /dev/null
+++ b/src/include/XmlRpc.h
@@ -0,0 +1,95 @@
+#ifndef _XMLRPC_H_
+#define _XMLRPC_H_
+//
+// XmlRpc++ Copyright (c) 2002-2008 by Chris Morley
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+//
+// The XmlRpc++ home page is http://xmlrpcpp.sourceforge.net/
+//
+
+#if defined(_MSC_VER)
+# pragma warning(disable:4786) // identifier was truncated in debug info
+#endif
+
+
+#include <string>
+
+#include "XmlRpcClient.h"
+#include "XmlRpcException.h"
+#include "XmlRpcServer.h"
+#include "XmlRpcServerMethod.h"
+#include "XmlRpcValue.h"
+#include "XmlRpcUtil.h"
+
+namespace XmlRpc {
+
+
+ //! An interface allowing custom handling of error message reporting.
+ class XmlRpcErrorHandler {
+ public:
+ //! Returns a pointer to the currently installed error handling object.
+ static XmlRpcErrorHandler* getErrorHandler()
+ { return _errorHandler; }
+
+ //! Specifies the error handler.
+ static void setErrorHandler(XmlRpcErrorHandler* eh)
+ { _errorHandler = eh; }
+
+ //! Report an error. Custom error handlers should define this method.
+ virtual void error(const char* msg) = 0;
+
+ protected:
+ static XmlRpcErrorHandler* _errorHandler;
+ };
+
+ //! An interface allowing custom handling of informational message reporting.
+ class XmlRpcLogHandler {
+ public:
+ //! Returns a pointer to the currently installed message reporting object.
+ static XmlRpcLogHandler* getLogHandler()
+ { return _logHandler; }
+
+ //! Specifies the message handler.
+ static void setLogHandler(XmlRpcLogHandler* lh)
+ { _logHandler = lh; }
+
+ //! Returns the level of verbosity of informational messages. 0 is no output, 5 is very verbose.
+ static int getVerbosity()
+ { return _verbosity; }
+
+ //! Specify the level of verbosity of informational messages. 0 is no output, 5 is very verbose.
+ static void setVerbosity(int v)
+ { _verbosity = v; }
+
+ //! Output a message. Custom error handlers should define this method.
+ virtual void log(int level, const char* msg) = 0;
+
+ protected:
+ static XmlRpcLogHandler* _logHandler;
+ static int _verbosity;
+ };
+
+ //! Returns log message verbosity. This is short for XmlRpcLogHandler::getVerbosity()
+ int getVerbosity();
+ //! Sets log message verbosity. This is short for XmlRpcLogHandler::setVerbosity(level)
+ void setVerbosity(int level);
+
+
+ //! Version identifier
+ extern const char XMLRPC_VERSION[];
+
+} // namespace XmlRpc
+
+#endif // _XMLRPC_H_
diff --git a/src/include/XmlRpcClient.h b/src/include/XmlRpcClient.h
new file mode 100644
index 0000000..5954003
--- /dev/null
+++ b/src/include/XmlRpcClient.h
@@ -0,0 +1,135 @@
+
+#ifndef _XMLRPCCLIENT_H_
+#define _XMLRPCCLIENT_H_
+//
+// XmlRpc++ Copyright (c) 2002-2008 by Chris Morley
+//
+#if defined(_MSC_VER)
+# pragma warning(disable:4786) // identifier was truncated in debug info
+#endif
+
+
+#include <string>
+
+#include "XmlRpcDispatch.h"
+#include "XmlRpcSource.h"
+
+namespace XmlRpc {
+
+ // Arguments and results are represented by XmlRpcValues
+ class XmlRpcValue;
+
+ //! A class to send XML RPC requests to a server and return the results.
+ class XmlRpcClient : public XmlRpcSource {
+ public:
+
+ //! Construct a client to connect to the server at the specified host:port address
+ //! @param host The name of the remote machine hosting the server, eg "myserver.mycompany.com"
+ //! @param port The port on the remote machine where the server is listening
+ //! @param uri An optional string to be sent as the URI in the HTTP GET header
+ //! Note that the host is not a URL, do not prepend "http://" or other protocol specifiers.
+ XmlRpcClient(const char* host, int port, const char* uri=0);
+
+ //! Construct a client to connect to the server at the specified host:port address including HTTP authentication
+ //! @param host The name of the remote machine hosting the server
+ //! @param port The port on the remote machine where the server is listening
+ //! @param login The username passed to the server
+ //! @param pass The password passed to the server
+ //! @param uri An optional string to be sent as the URI in the HTTP GET header
+ XmlRpcClient(const char* host, int port, const char* login, const char* password, const char* uri=0);
+
+ //! Destructor
+ virtual ~XmlRpcClient();
+
+ //! Execute the named procedure on the remote server.
+ //! @param method The name of the remote procedure to execute
+ //! @param params An array of the arguments for the method
+ //! @param result The result value to be returned to the client
+ //! @param timeoutSeconds Seconds to wait for a response (defaults to forever)
+ //! @return true if the request was sent and a result received
+ //! (although the result might be a fault).
+ //!
+ //! Currently this is a synchronous (blocking) implementation (execute
+ //! does not return until it receives a response or an error). Use isFault()
+ //! to determine whether the result is a fault response.
+ bool execute(const char* method, XmlRpcValue const& params, XmlRpcValue& result, double timeoutSeconds = -1);
+
+ //! Returns true if the result of the last execute() was a fault response.
+ bool isFault() const { return _isFault; }
+
+ //! Return the host name of the server
+ const char* const host() const { return _host.c_str(); }
+
+ //! Return the port
+ int port() const { return _port; }
+
+ //! Return the URI
+ const char* const uri() const { return _uri.c_str(); }
+
+ // XmlRpcSource interface implementation
+ //! Close the connection
+ virtual void close();
+
+ //! Handle server responses. Called by the event dispatcher during execute.
+ //! @param eventType The type of event that occurred.
+ //! @see XmlRpcDispatch::EventType
+ virtual unsigned handleEvent(unsigned eventType);
+
+ protected:
+ // Execution processing helpers
+ virtual bool doConnect();
+ virtual bool setupConnection();
+
+ virtual bool generateRequest(const char* method, XmlRpcValue const& params);
+ virtual std::string generateHeader(std::string const& body);
+ virtual bool writeRequest();
+ virtual bool readHeader();
+ virtual bool parseHeader();
+ virtual bool readResponse();
+ virtual bool parseResponse(XmlRpcValue& result);
+
+ // Possible IO states for the connection
+ enum ClientConnectionState { NO_CONNECTION, CONNECTING, WRITE_REQUEST, READ_HEADER, READ_RESPONSE, IDLE };
+ ClientConnectionState _connectionState;
+
+ // Server location
+ std::string _host;
+ std::string _uri;
+ int _port;
+
+ // Login information for HTTP authentication
+ std::string _login;
+ std::string _password;
+
+ // The xml-encoded request, http header of response, and response xml
+ std::string _request;
+ std::string _header;
+ std::string _response;
+
+ // Number of times the client has attempted to send the request
+ int _sendAttempts;
+
+ // Number of bytes of the request that have been written to the socket so far
+ int _bytesWritten;
+
+ // True if we are currently executing a request. If you want to multithread,
+ // each thread should have its own client.
+ bool _executing;
+
+ // True if the server closed the connection
+ bool _eof;
+
+ // True if a fault response was returned by the server
+ bool _isFault;
+
+ // Number of bytes expected in the response body (parsed from response header)
+ int _contentLength;
+
+ // Event dispatcher
+ XmlRpcDispatch _disp;
+
+ }; // class XmlRpcClient
+
+} // namespace XmlRpc
+
+#endif // _XMLRPCCLIENT_H_
diff --git a/src/include/XmlRpcDispatch.h b/src/include/XmlRpcDispatch.h
new file mode 100644
index 0000000..1c25096
--- /dev/null
+++ b/src/include/XmlRpcDispatch.h
@@ -0,0 +1,92 @@
+
+#ifndef _XMLRPCDISPATCH_H_
+#define _XMLRPCDISPATCH_H_
+//
+// XmlRpc++ Copyright (c) 2002-2008 by Chris Morley
+//
+#if defined(_MSC_VER)
+# pragma warning(disable:4786) // identifier was truncated in debug info
+#endif
+
+#include <vector>
+
+namespace XmlRpc {
+
+ // An RPC source represents a file descriptor to monitor
+ class XmlRpcSource;
+
+ //! An object which monitors file descriptors for events and performs
+ //! callbacks when interesting events happen.
+ class XmlRpcDispatch {
+ public:
+ //! Constructor
+ XmlRpcDispatch();
+ ~XmlRpcDispatch();
+
+ //! Values indicating the type of events a source is interested in
+ enum EventType {
+ ReadableEvent = 1, //!< data available to read
+ WritableEvent = 2, //!< connected/data can be written without blocking
+ Exception = 4 //!< uh oh
+ };
+
+ //! Monitor this source for the event types specified by the event mask
+ //! and call its event handler when any of the events occur.
+ //! @param source The source to monitor
+ //! @param eventMask Which event types to watch for. \see EventType
+ void addSource(XmlRpcSource* source, unsigned eventMask);
+
+ //! Stop monitoring this source.
+ //! @param source The source to stop monitoring
+ //! The source socket is not closed.
+ void removeSource(XmlRpcSource* source);
+
+ //! Modify the types of events to watch for on this source
+ void setSourceEvents(XmlRpcSource* source, unsigned eventMask);
+
+
+ //! Watch current set of sources and process events for the specified
+ //! duration (in seconds, -1 implies wait forever, or until exit is called)
+ void work(double timeSeconds);
+
+ //! Exit from work routine
+ void exit();
+
+ //! Clear all sources from the monitored sources list. Sources are closed.
+ void clear();
+
+ protected:
+
+ //! Wait for I/O on any source, timeout, or interrupt signal.
+ bool waitForAndProcessEvents(double timeoutSeconds);
+
+
+ //! Returns current time in seconds since something
+ double getTime();
+
+ // A source to monitor and what to monitor it for
+ struct MonitoredSource
+ {
+ MonitoredSource(XmlRpcSource* src, unsigned mask) : _src(src), _mask(mask) {}
+ XmlRpcSource* getSource() const { return _src; }
+ unsigned& getMask() { return _mask; }
+ XmlRpcSource* _src;
+ unsigned _mask;
+ };
+
+ // A list of sources to monitor
+ typedef std::vector< MonitoredSource > SourceList;
+
+ // Sources being monitored
+ SourceList _sources;
+
+ // When work should stop (-1 implies wait forever, or until exit is called)
+ double _endTime;
+
+ bool _doClear;
+ bool _inWork;
+
+ };
+} // namespace XmlRpc
+
+#endif // _XMLRPCDISPATCH_H_
diff --git a/src/include/XmlRpcException.h b/src/include/XmlRpcException.h
new file mode 100644
index 0000000..7024311
--- /dev/null
+++ b/src/include/XmlRpcException.h
@@ -0,0 +1,42 @@
+
+#ifndef _XMLRPCEXCEPTION_H_
+#define _XMLRPCEXCEPTION_H_
+//
+// XmlRpc++ Copyright (c) 2002-2008 by Chris Morley
+//
+#if defined(_MSC_VER)
+# pragma warning(disable:4786) // identifier was truncated in debug info
+#endif
+
+#ifndef MAKEDEPEND
+# include <string>
+#endif
+
+
+namespace XmlRpc {
+
+ //! A class representing an error.
+ //! If server methods throw this exception, a fault response is returned
+ //! to the client.
+ class XmlRpcException {
+ public:
+ //! Constructor
+ //! @param message A descriptive error message
+ //! @param code An integer error code
+ XmlRpcException(const std::string& message, int code=-1) :
+ _message(message), _code(code) {}
+
+ //! Return the error message.
+ const std::string& getMessage() const { return _message; }
+
+ //! Return the error code.
+ int getCode() const { return _code; }
+
+ private:
+ std::string _message;
+ int _code;
+ };
+
+}
+
+#endif // _XMLRPCEXCEPTION_H_
diff --git a/src/include/XmlRpcMutex.h b/src/include/XmlRpcMutex.h
new file mode 100644
index 0000000..f46373d
--- /dev/null
+++ b/src/include/XmlRpcMutex.h
@@ -0,0 +1,46 @@
+#ifndef _XMLRPCMUTEX_H_
+#define _XMLRPCMUTEX_H_
+//
+// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley
+//
+#if defined(_MSC_VER)
+# pragma warning(disable:4786) // identifier was truncated in debug info
+#endif
+
+namespace XmlRpc {
+
+ //! A simple platform-independent mutex API implemented for posix and windows.
+ class XmlRpcMutex {
+ public:
+ //! Construct a Mutex object.
+ XmlRpcMutex() : _pMutex(0) {}
+
+ //! Destroy a Mutex object.
+ ~XmlRpcMutex();
+
+ //! Wait for the mutex to be available and then acquire the lock.
+ void acquire();
+
+ //! Release the mutex.
+ void release();
+
+ //! Utility class to acquire a mutex at construction and release it when destroyed.
+ struct AutoLock {
+ //! Acquire the mutex at construction
+ AutoLock(XmlRpcMutex& m) : _m(m) { _m.acquire(); }
+ //! Release at destruction
+ ~AutoLock() { _m.release(); }
+ //! The mutex being held
+ XmlRpcMutex& _m;
+ };
+
+ private:
+
+ //! Native Mutex object
+ void* _pMutex;
+
+ }; // class XmlRpcMutex
+
+} // namespace XmlRpc
+
+#endif // _XMLRPCMUTEX_H_
diff --git a/src/include/XmlRpcServer.h b/src/include/XmlRpcServer.h
new file mode 100644
index 0000000..7da5d62
--- /dev/null
+++ b/src/include/XmlRpcServer.h
@@ -0,0 +1,157 @@
+
+#ifndef _XMLRPCSERVER_H_
+#define _XMLRPCSERVER_H_
+//
+// XmlRpc++ Copyright (c) 2002-2008 by Chris Morley
+//
+#if defined(_MSC_VER)
+# pragma warning(disable:4786) // identifier was truncated in debug info
+#endif
+
+#include <map>
+#include <string>
+
+
+#include "XmlRpcDispatch.h"
+#include "XmlRpcSource.h"
+
+namespace XmlRpc {
+
+
+ // An abstract class supporting XML RPC methods
+ class XmlRpcServerMethod;
+
+ // Class representing connections to specific clients
+ class XmlRpcServerConnection;
+
+ // Class representing argument and result values
+ class XmlRpcValue;
+
+
+ //! A class to handle XML RPC requests
+ class XmlRpcServer : public XmlRpcSource {
+ public:
+ //! Create a server object.
+ XmlRpcServer();
+ //! Destructor.
+ virtual ~XmlRpcServer();
+
+ //! Specify whether introspection is enabled or not. Default is not enabled.
+ void enableIntrospection(bool enabled=true);
+
+ //! Add a command to the RPC server
+ void addMethod(XmlRpcServerMethod* method);
+
+ //! Remove a command from the RPC server
+ void removeMethod(XmlRpcServerMethod* method);
+
+ //! Remove a command from the RPC server by name
+ void removeMethod(const std::string& methodName);
+
+ //! Look up a method by name
+ XmlRpcServerMethod* findMethod(const std::string& name) const;
+
+ //! Create a socket, bind to the specified port, and
+ //! set it in listen mode to make it available for clients.
+ //! @param port The port to bind and listen on (zero to choose an arbitrary port)
+ bool bindAndListen(int port, int backlog = 5);
+
+ //! Get the port number this server is listening on.
+ int getPort(void) const;
+
+ //! Process client requests for the specified time (in seconds)
+ void work(double timeSeconds);
+
+ //! Temporarily stop processing client requests and exit the work() method.
+ void exit();
+
+ //! Close all connections with clients and the socket file descriptor
+ void shutdown();
+
+ //! Introspection support
+ void listMethods(XmlRpcValue& result);
+
+
+ //! Parses the request xml, runs the method, generates the response (header+xml).
+ //! Returns a fault response if an error occurs during method execution.
+ virtual std::string executeRequest(std::string const& request);
+
+
+ // XmlRpcSource interface implementation
+
+ //! Handle client connection requests
+ virtual unsigned handleEvent(unsigned eventType);
+
+ //! Remove a connection from the dispatcher
+ virtual void removeConnection(XmlRpcServerConnection*);
+
+ protected:
+
+ // Static data
+ static const char METHODNAME_TAG[];
+ static const char PARAMS_TAG[];
+ static const char PARAM_TAG[];
+
+ static const std::string SYSTEM_MULTICALL;
+ static const std::string METHODNAME;
+ static const std::string PARAMS;
+
+ static const std::string FAULTCODE;
+ static const std::string FAULTSTRING;
+
+
+ //! Accept a client connection request
+ virtual void acceptConnection();
+
+ //! Create a new connection object for processing requests from a specific client.
+ //! If the client is not authorized to connect, close the socket and return 0.
+ virtual XmlRpcServerConnection* createConnection(XmlRpcSocket::Socket socket);
+
+ //! Hand off a new connection object to a dispatcher.
+ virtual void dispatchConnection(XmlRpcServerConnection* sc);
+
+
+ //! Parse the methodName and parameters from the request.
+ //! @returns the methodName
+ std::string parseRequest(std::string const& request, XmlRpcValue& params);
+
+ //! Execute a named method with the specified params.
+ bool executeMethod(const std::string& methodName, XmlRpcValue& params, XmlRpcValue& result);
+
+ //! Execute multiple calls and return the results in an array.
+ //! System.multicall implementation
+ bool executeMulticall(const std::string& methodName, XmlRpcValue& params, XmlRpcValue& result);
+
+ //! Construct a response from the result XML.
+ std::string generateResponse(std::string const& resultXml);
+
+ //! Construct a fault response.
+ std::string generateFaultResponse(std::string const& msg, int errorCode = -1);
+
+ //! Return the appropriate headers for the response.
+ std::string generateHeader(std::string const& body);
+
+
+
+ //! Whether the introspection API is supported by this server
+ bool _introspectionEnabled;
+
+ //! Event dispatcher
+ XmlRpcDispatch _disp;
+
+ //! Collection of methods. This could be a set keyed on method name if we wanted...
+ typedef std::map< std::string, XmlRpcServerMethod* > MethodMap;
+
+ //! Registered RPC methods.
+ MethodMap _methods;
+
+ //! List all registered RPC methods (only available if introspection is enabled)
+ XmlRpcServerMethod* _listMethods;
+
+ //! Return help string for a specified method (only available if introspection is enabled)
+ XmlRpcServerMethod* _methodHelp;
+
+ };
+} // namespace XmlRpc
+
+#endif //_XMLRPCSERVER_H_
diff --git a/src/include/XmlRpcServerConnection.h b/src/include/XmlRpcServerConnection.h
new file mode 100644
index 0000000..cefe56b
--- /dev/null
+++ b/src/include/XmlRpcServerConnection.h
@@ -0,0 +1,80 @@
+#ifndef _XMLRPCSERVERCONNECTION_H_
+#define _XMLRPCSERVERCONNECTION_H_
+//
+// XmlRpc++ Copyright (c) 2002-2008 by Chris Morley
+//
+#if defined(_MSC_VER)
+# pragma warning(disable:4786) // identifier was truncated in debug info
+#endif
+
+#include <string>
+
+#include "XmlRpcValue.h"
+#include "XmlRpcSource.h"
+
+namespace XmlRpc {
+
+
+ // The server waits for client connections and provides support for executing methods
+ class XmlRpcServer;
+ class XmlRpcServerMethod;
+
+ //! A class to handle XML RPC requests from a particular client
+ class XmlRpcServerConnection : public XmlRpcSource {
+ public:
+
+ //! Constructor
+ XmlRpcServerConnection(XmlRpcSocket::Socket fd, XmlRpcServer* server, bool deleteOnClose = false);
+ //! Destructor
+ virtual ~XmlRpcServerConnection();
+
+ // XmlRpcSource interface implementation
+ //! Handle IO on the client connection socket.
+ //! @param eventType Type of IO event that occurred. @see XmlRpcDispatch::EventType.
+ virtual unsigned handleEvent(unsigned eventType);
+
+ protected:
+
+ //! Reads the http header
+ bool readHeader();
+
+ //! Reads the request (based on the content-length header value)
+ bool readRequest();
+
+ //! Executes the request and writes the resulting response
+ bool writeResponse();
+
+
+ //! Helper method to execute the client request
+ virtual void executeRequest();
+
+
+ //! The XmlRpc server that accepted this connection
+ XmlRpcServer* _server;
+
+ //! Possible IO states for the connection
+ enum ServerConnectionState { READ_HEADER, READ_REQUEST, WRITE_RESPONSE };
+ //! Current IO state for the connection
+ ServerConnectionState _connectionState;
+
+ //! Request headers
+ std::string _header;
+
+ //! Number of bytes expected in the request body (parsed from header)
+ int _contentLength;
+
+ //! Request body
+ std::string _request;
+
+ //! Response
+ std::string _response;
+
+ //! Number of bytes of the response written so far
+ int _bytesWritten;
+
+ //! Whether to keep the current client connection open for further requests
+ bool _keepAlive;
+ };
+} // namespace XmlRpc
+
+#endif // _XMLRPCSERVERCONNECTION_H_
diff --git a/src/include/XmlRpcServerMethod.h b/src/include/XmlRpcServerMethod.h
new file mode 100644
index 0000000..ab481c8
--- /dev/null
+++ b/src/include/XmlRpcServerMethod.h
@@ -0,0 +1,45 @@
+
+#ifndef _XMLRPCSERVERMETHOD_H_
+#define _XMLRPCSERVERMETHOD_H_
+//
+// XmlRpc++ Copyright (c) 2002-2008 by Chris Morley
+//
+#if defined(_MSC_VER)
+# pragma warning(disable:4786) // identifier was truncated in debug info
+#endif
+
+#include <string>
+
+namespace XmlRpc {
+
+ // Representation of a parameter or result value
+ class XmlRpcValue;
+
+ // The XmlRpcServer processes client requests to call RPCs
+ class XmlRpcServer;
+
+ //! Abstract class representing a single RPC method
+ class XmlRpcServerMethod {
+ public:
+ //! Constructor
+ XmlRpcServerMethod(std::string const& name, XmlRpcServer* server = 0);
+ //! Destructor
+ virtual ~XmlRpcServerMethod();
+
+ //! Returns the name of the method
+ std::string& name() { return _name; }
+
+ //! Execute the method. Subclasses must provide a definition for this method.
+ virtual void execute(XmlRpcValue& params, XmlRpcValue& result) = 0;
+
+ //! Returns a help string for the method.
+ //! Subclasses should define this method if introspection is being used.
+ virtual std::string help() { return std::string(); }
+
+ protected:
+ std::string _name;
+ XmlRpcServer* _server;
+ };
+} // namespace XmlRpc
+
+#endif // _XMLRPCSERVERMETHOD_H_
diff --git a/src/include/XmlRpcSocket.h b/src/include/XmlRpcSocket.h
new file mode 100644
index 0000000..b5d451a
--- /dev/null
+++ b/src/include/XmlRpcSocket.h
@@ -0,0 +1,81 @@
+#ifndef _XMLRPCSOCKET_H_
+#define _XMLRPCSOCKET_H_
+//
+// XmlRpc++ Copyright (c) 2002-2008 by Chris Morley
+//
+#if defined(_MSC_VER)
+# pragma warning(disable:4786) // identifier was truncated in debug info
+#endif
+
+#include <string>
+
+
+namespace XmlRpc {
+
+ //! A platform-independent socket API.
+ class XmlRpcSocket {
+ public:
+
+ // On windows, a socket is an unsigned int large enough to hold a ptr
+ // This should match the definition of SOCKET in winsock2.h
+#if defined(_WINDOWS)
+# if defined(_WIN64)
+ typedef unsigned __int64 Socket;
+# else
+ typedef unsigned int Socket;
+# endif
+#else
+ typedef int Socket;
+#endif
+
+ //! An invalid socket constant.
+ static const Socket Invalid = (Socket) -1;
+
+ //! Creates a stream (TCP) socket. Returns XmlRpcSocket::Invalid on failure.
+ static Socket socket();
+
+ //! Closes a socket.
+ static void close(Socket socket);
+
+
+ //! Sets a stream (TCP) socket to perform non-blocking IO. Returns false on failure.
+ static bool setNonBlocking(Socket socket);
+
+
+ // The next four methods are appropriate for servers.
+
+ //! Allow the port the specified socket is bound to to be re-bound immediately so
+ //! server re-starts are not delayed. Returns false on failure.
+ static bool setReuseAddr(Socket socket);
+
+ //! Bind to a specified port
+ static bool bind(Socket socket, int port);
+
+ //! Set socket in listen mode
+ static bool listen(Socket socket, int backlog);
+
+ //! Accept a client connection request
+ static Socket accept(Socket socket);
+
+ //! Connect a socket to a server (from a client)
+ static bool connect(Socket socket, std::string& host, int port);
+
+ //! Get the port of a bound socket
+ static int getPort(Socket socket);
+
+ //! Returns true if the last error was not a fatal one (eg, EWOULDBLOCK)
+ static bool nonFatalError();
+
+ //! Returns last errno
+ static int getError();
+
+ //! Returns message corresponding to last error
+ static std::string getErrorMsg();
+
+ //! Returns message corresponding to error
+ static std::string getErrorMsg(int error);
+ };
+
+} // namespace XmlRpc
+
+#endif
diff --git a/src/include/XmlRpcSource.h b/src/include/XmlRpcSource.h
new file mode 100644
index 0000000..a124062
--- /dev/null
+++ b/src/include/XmlRpcSource.h
@@ -0,0 +1,84 @@
+
+#ifndef _XMLRPCSOURCE_H_
+#define _XMLRPCSOURCE_H_
+//
+// XmlRpc++ Copyright (c) 2002-2008 by Chris Morley
+//
+#if defined(_MSC_VER)
+# pragma warning(disable:4786) // identifier was truncated in debug info
+#endif
+
+#include "XmlRpcSocket.h"
+
+
+namespace XmlRpc {
+
+ //! Proxy for Ssl data to avoid including headers here.
+ struct SslProxy;
+
+ //! An RPC source represents a file descriptor to monitor
+ class XmlRpcSource {
+ public:
+ //! Constructor
+ //! @param fd The socket file descriptor to monitor.
+ //! @param deleteOnClose If true, the object deletes itself when close is called.
+ XmlRpcSource(XmlRpcSocket::Socket fd = XmlRpcSocket::Invalid, bool deleteOnClose = false);
+
+ //! Destructor
+ virtual ~XmlRpcSource();
+
+ //! Return the file descriptor being monitored.
+ XmlRpcSocket::Socket getfd() const { return _fd; }
+ //! Specify the file descriptor to monitor.
+ void setfd(XmlRpcSocket::Socket fd) { _fd = fd; }
+
+ //! Return whether the file descriptor should be kept open if it is no longer monitored.
+ bool getKeepOpen() const { return _keepOpen; }
+ //! Specify whether the file descriptor should be kept open if it is no longer monitored.
+ void setKeepOpen(bool b=true) { _keepOpen = b; }
+
+ //! Return whether ssl is enabled.
+ bool getSslEnabled() const { return _sslEnabled; }
+ //! Specify whether to enable ssl. Use getSslEnabled() to verify that Ssl is available.
+ void setSslEnabled(bool b=true);
+
+ //! Close the owned fd. If deleteOnClose was specified at construction, the object is deleted.
+ virtual void close();
+
+ //! Return true to continue monitoring this source
+ virtual unsigned handleEvent(unsigned eventType) = 0;
+
+ protected:
+
+ // Execution processing helpers
+ virtual bool doConnect();
+
+ //! Read text from the source. Returns false on error.
+ bool nbRead(std::string& s, bool *eof);
+
+ //! Write text to the source. Returns false on error.
+ bool nbWrite(std::string const& s, int *bytesSoFar);
+
+ private:
+
+ // Socket. This is an int for linux/unix, and unsigned on win32, and unsigned __int64 on win64.
+ // Casting to int/long/unsigned on win64 is a bad idea.
+ XmlRpcSocket::Socket _fd;
+
+ // In the server, a new source (XmlRpcServerConnection) is created
+ // for each connected client. When each connection is closed, the
+ // corresponding source object is deleted.
+ bool _deleteOnClose;
+
+ // In the client, keep connections open if you intend to make multiple calls.
+ bool _keepOpen;
+
+ // Enable use of SSL
+ bool _sslEnabled;
+
+ // SSL data
+ SslProxy *_ssl;
+ };
+} // namespace XmlRpc
+
+#endif //_XMLRPCSOURCE_H_
diff --git a/src/include/XmlRpcThread.h b/src/include/XmlRpcThread.h
new file mode 100644
index 0000000..6f4ec78
--- /dev/null
+++ b/src/include/XmlRpcThread.h
@@ -0,0 +1,60 @@
+#ifndef _XMLRPCTHREAD_H_
+#define _XMLRPCTHREAD_H_
+//
+// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley
+//
+#if defined(_MSC_VER)
+# pragma warning(disable:4786) // identifier was truncated in debug info
+#endif
+
+namespace XmlRpc {
+
+ //! An abstract class providing an interface for objects that can run in a separate thread.
+ class XmlRpcRunnable {
+ public:
+ //! Code to be executed.
+ virtual void run() = 0;
+ }; // class XmlRpcRunnable
+
+
+ //! A simple platform-independent thread API implemented for posix and windows.
+ class XmlRpcThread {
+ public:
+ //! Construct a thread object. Not usable until setRunnable() has been called.
+ XmlRpcThread() : _runner(0), _pThread(0) {}
+
+ //! Construct a thread object.
+ XmlRpcThread(XmlRpcRunnable* runnable) : _runner(runnable), _pThread(0) {}
+
+ //! Destructor. Does not perform a join() (ie, the thread may continue to run).
+ ~XmlRpcThread();
+
+ //! Execute the run method of the runnable object in a separate thread.
+ //! Returns immediately in the calling thread.
+ void start();
+
+ //! Waits until the thread exits.
+ void join();
+
+ //! Access the runnable
+ XmlRpcRunnable* getRunnable() const { return _runner; }
+
+ //! Set the runnable
+ void setRunnable(XmlRpcRunnable* r) { _runner = r; }
+
+ private:
+
+ //! Start the runnable going in a thread
+ static unsigned int __stdcall runInThread(void* pThread);
+
+ //! Code to be executed
+ XmlRpcRunnable* _runner;
+
+ //! Native thread object
+ void* _pThread;
+
+ }; // class XmlRpcThread
+
+} // namespace XmlRpc
+
+#endif // _XMLRPCTHREAD_H_
diff --git a/src/include/XmlRpcThreadedServer.h b/src/include/XmlRpcThreadedServer.h
new file mode 100644
index 0000000..bedbeec
--- /dev/null
+++ b/src/include/XmlRpcThreadedServer.h
@@ -0,0 +1,67 @@
+
+#ifndef _XMLRPCTHREADEDSERVER_H_
+#define _XMLRPCTHREADEDSERVER_H_
+//
+// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley
+//
+#if defined(_MSC_VER)
+# pragma warning(disable:4786) // identifier was truncated in debug info
+#endif
+
+#ifndef MAKEDEPEND
+# include <map>
+# include <vector>
+#endif
+
+
+#include "XmlRpcMutex.h"
+#include "XmlRpcServer.h"
+#include "XmlRpcThread.h"
+
+
+namespace XmlRpc {
+
+ //! A class to handle multiple simultaneous XML RPC requests
+ class XmlRpcThreadedServer : public XmlRpcServer {
+ public:
+
+ //! Create a server object with a specified number of worker threads.
+ XmlRpcThreadedServer(int nWorkers = 6) : _workers(nWorkers) {}
+
+
+ //! Execute a request
+
+ protected:
+
+ //! Each client request is assigned to one worker to handle.
+ //! Workers are executed on separate threads, and one worker may be
+ //! responsible for dispatching events to multiple client connections.
+ class Worker : XmlRpcRunnable {
+ public:
+ //! Constructor. Executes the run method in a separate thread.
+ Worker() { _thread.setRunnable(this); _thread.start(); }
+
+ //! Implement the Runnable interface
+ void run();
+
+ protected:
+
+ //! The thread this worker is running in.
+ XmlRpcThread _thread;
+
+ };
+
+
+ //! The worker pool
+ std::vector<Worker> _workers;
+
+
+ //! Serialize dispatcher access
+ XmlRpcMutex _mutex;
+
+
+ }; // class XmlRpcThreadedServer
+
+}
+
+#endif // _XMLRPCTHREADEDSERVER_H_
diff --git a/src/include/XmlRpcUtil.h b/src/include/XmlRpcUtil.h
new file mode 100644
index 0000000..96b110c
--- /dev/null
+++ b/src/include/XmlRpcUtil.h
@@ -0,0 +1,65 @@
+#ifndef _XMLRPCUTIL_H_
+#define _XMLRPCUTIL_H_
+//
+// XmlRpc++ Copyright (c) 2002-2008 by Chris Morley
+//
+#if defined(_MSC_VER)
+# pragma warning(disable:4786) // identifier was truncated in debug info
+#endif
+
+#include <string>
+
+#if defined(_MSC_VER)
+# define snprintf _snprintf
+# define vsnprintf _vsnprintf
+# define strcasecmp _stricmp
+# define strncasecmp _strnicmp
+#elif defined(__BORLANDC__)
+# define strcasecmp stricmp
+# define strncasecmp strnicmp
+#endif
+
+namespace XmlRpc {
+
+ //! Utilities for XML parsing, encoding, and decoding and message handlers.
+ class XmlRpcUtil {
+ public:
+
+ //! Parses the specified tag. No attributes are parsed, no validation is done.
+ //! Sets val to the contents between <tag> and </tag>, or an empty string if <tag/> is found.
+ //! Returns true if the tag is parsed. Updates offset to char after </tag>
+ static bool parseTag(const char* tag, std::string const& xml, int* offset, std::string &val);
+
+ //! Returns true if the tag is found and updates offset to the char after the tag.
+ //! If the tag is of the form <tag/>, emptyTag is set to true.
+ static bool findTag(const char* tag, std::string const& xml, int* offset, bool* emptyTag);
+
+ //! Returns true if the tag is found at the specified offset (modulo any whitespace)
+ //! and updates offset to the char after the tag. If an empty tag is found (eg,
+ //! <tag/>), true is returned, offset is updated to be after the close of the tag, and
+ //! emptyTag is set to true.
+ static bool nextTagIs(const char* tag, std::string const& xml, int* offset, bool* emptyTag);
+
+ //! Passes over the next tag found at the specified offset is </tag>,
+ //! offset is updated to be after the close of the tag.
+ //! Will skip over all characters until < is seen.
+ static bool nextTagIsEnd(const char* tag, std::string const& xml, int* offset);
+
+
+ //! Convert raw text to encoded xml.
+ static std::string xmlEncode(const std::string& raw);
+
+ //! Convert encoded xml to raw text
+ static std::string xmlDecode(const std::string& encoded);
+
+
+ //! Dump messages somewhere
+ static void log(int level, const char* fmt, ...);
+
+ //! Dump error messages somewhere
+ static void error(const char* fmt, ...);
+
+ };
+} // namespace XmlRpc
+
+#endif // _XMLRPCUTIL_H_
diff --git a/src/include/XmlRpcValue.h b/src/include/XmlRpcValue.h
new file mode 100644
index 0000000..a077e46
--- /dev/null
+++ b/src/include/XmlRpcValue.h
@@ -0,0 +1,277 @@
+
+#ifndef _XMLRPCVALUE_H_
+#define _XMLRPCVALUE_H_
+//
+// XmlRpc++ Copyright (c) 2002-2008 by Chris Morley
+//
+
+#if defined(_MSC_VER)
+# pragma warning(disable:4786) // identifier was truncated in debug info
+#endif
+
+#include <map>
+#include <string>
+#include <vector>
+#include <time.h>
+
+namespace XmlRpc {
+
+ enum xmlrpc_nil_t { nil };
+
+ //! A class to represent RPC arguments and results.
+ //! Each XmlRpcValue object contains a typed value,
+ //! where the type is determined by the initial value
+ //! assigned to the object.
+ // should probably refcount them...
+ class XmlRpcValue {
+ public:
+
+ //! XmlRpcValue types
+ enum Type {
+ TypeInvalid,
+ TypeNil,
+ TypeBoolean,
+ TypeInt,
+ TypeDouble,
+ TypeString,
+ TypeDateTime,
+ TypeBase64,
+ TypeArray,
+ TypeStruct
+ };
+
+ // Non-primitive types
+ typedef std::vector<char> BinaryData;
+ typedef std::vector<XmlRpcValue> ValueArray;
+ typedef std::map<std::string, XmlRpcValue> ValueStruct;
+
+
+ // Constructors
+ //! Construct an empty XmlRpcValue
+ XmlRpcValue() : _type(TypeInvalid) { _value.asBinary = 0; }
+
+ //! Construct an XmlRpcValue with a nil value
+ XmlRpcValue(xmlrpc_nil_t value) : _type(TypeNil) { }
+
+ //! Construct an XmlRpcValue with a bool value
+ XmlRpcValue(bool value) : _type(TypeBoolean) { _value.asBool = value; }
+
+ //! Construct an XmlRpcValue with an int value
+ XmlRpcValue(int value) : _type(TypeInt) { _value.asInt = value; }
+
+ //! Construct an XmlRpcValue with a double value
+ XmlRpcValue(double value) : _type(TypeDouble) { _value.asDouble = value; }
+
+ //! Construct an XmlRpcValue with a string value
+ XmlRpcValue(std::string const& value) : _type(TypeString)
+ { _value.asString = new std::string(value); }
+
+ //! Construct an XmlRpcValue with a string value.
+ //! @param value A null-terminated (C) string.
+ XmlRpcValue(const char* value) : _type(TypeString)
+ { _value.asString = new std::string(value); }
+
+ //! Construct an XmlRpcValue with a date/time value.
+ //! @param value A pointer to a struct tm (see localtime)
+ XmlRpcValue(struct tm* value) : _type(TypeDateTime)
+ { _value.asTime = new struct tm(*value); }
+
+ //! Construct an XmlRpcValue with a binary data value
+ //! @param value A pointer to data
+ //! @param nBytes The length of the data pointed to, in bytes
+ XmlRpcValue(void* value, int nBytes) : _type(TypeBase64)
+ {
+ _value.asBinary = new BinaryData((char*)value, ((char*)value)+nBytes);
+ }
+
+ //! Construct from xml, beginning at *offset chars into the string, updates offset
+ XmlRpcValue(std::string const& xml, int* offset) : _type(TypeInvalid)
+ { if ( ! fromXml(xml,offset)) _type = TypeInvalid; }
+
+ //! Copy constructor
+ XmlRpcValue(XmlRpcValue const& rhs) : _type(TypeInvalid) { *this = rhs; }
+
+ //! Destructor (make virtual if you want to subclass)
+ /*virtual*/ ~XmlRpcValue() { invalidate(); }
+
+ //! Erase the current value
+ void clear() { invalidate(); }
+
+ // Operators
+ //! Assignment from one XmlRpcValue to this one.
+ //! @param rhs The value in rhs is copied to this value.
+ XmlRpcValue& operator=(XmlRpcValue const& rhs);
+
+ //! Assign nil to this XmlRpcValue.
+ XmlRpcValue& operator=(xmlrpc_nil_t const& rhs) { return operator=(XmlRpcValue(rhs)); }
+
+ //! Assign a bool to this XmlRpcValue.
+ XmlRpcValue& operator=(bool const& rhs) { return operator=(XmlRpcValue(rhs)); }
+
+ //! Assign an int to this XmlRpcValue.
+ XmlRpcValue& operator=(int const& rhs) { return operator=(XmlRpcValue(rhs)); }
+
+ //! Assign a double to this XmlRpcValue.
+ XmlRpcValue& operator=(double const& rhs) { return operator=(XmlRpcValue(rhs)); }
+
+ //! Assign a string to this XmlRpcValue.
+ XmlRpcValue& operator=(const char* rhs) { return operator=(XmlRpcValue(std::string(rhs))); }
+
+ //! Tests two XmlRpcValues for equality
+ bool operator==(XmlRpcValue const& other) const;
+
+ //! Tests two XmlRpcValues for inequality
+ bool operator!=(XmlRpcValue const& other) const;
+
+ //! Treat an XmlRpcValue as a bool.
+ //! Throws XmlRpcException if the value is initialized to
+ //! a type that is not TypeBoolean.
+ operator bool&() { assertType(TypeBoolean); return _value.asBool; }
+ operator bool() const { assertType(TypeBoolean); return _value.asBool; }
+
+ //! Treat an XmlRpcValue as an int.
+ //! Throws XmlRpcException if the value is initialized to
+ //! a type that is not TypeInt.
+ operator int&() { assertType(TypeInt); return _value.asInt; }
+ operator int() const { assertType(TypeInt); return _value.asInt; }
+
+ //! Treat an XmlRpcValue as a double.
+ //! Throws XmlRpcException if the value is initialized to
+ //! a type that is not TypeDouble.
+ operator double&() { assertType(TypeDouble); return _value.asDouble; }
+ operator double() const { assertType(TypeDouble); return _value.asDouble; }
+
+ //! Treat an XmlRpcValue as a string.
+ //! Throws XmlRpcException if the value is initialized to
+ //! a type that is not TypeString.
+ operator std::string&() { assertType(TypeString); return *_value.asString; }
+ operator std::string const&() const { assertType(TypeString); return *_value.asString; }
+
+ //! Access the BinaryData value.
+ //! Throws XmlRpcException if the value is initialized to
+ //! a type that is not TypeBase64.
+ operator BinaryData&() { assertType(TypeBase64); return *_value.asBinary; }
+ operator BinaryData const&() const { assertType(TypeBase64); return *_value.asBinary; }
+
+ //! Access the DateTime value.
+ //! Throws XmlRpcException if the value is initialized to
+ //! a type that is not TypeDateTime.
+ operator struct tm&() { assertType(TypeDateTime); return *_value.asTime; }
+ operator struct tm const&() const { assertType(TypeDateTime); return *_value.asTime; }
+
+
+ //! Const array value accessor.
+ //! Access the ith value of the array.
+ //! Throws XmlRpcException if the value is not an array or if the index i is
+ //! not a valid index for the array.
+ XmlRpcValue const& operator[](int i) const { assertArray(i+1); return _value.asArray->at(i); }
+
+ //! Array value accessor.
+ //! Access the ith value of the array, growing the array if necessary.
+ //! Throws XmlRpcException if the value is not an array.
+ XmlRpcValue& operator[](int i) { assertArray(i+1); return _value.asArray->at(i); }
+
+ //! Struct entry accessor.
+ //! Returns the value associated with the given entry, creating one if necessary.
+ XmlRpcValue& operator[](std::string const& k) { assertStruct(); return (*_value.asStruct)[k]; }
+
+ //! Struct entry accessor.
+ //! Returns the value associated with the given entry, creating one if necessary.
+ XmlRpcValue& operator[](const char* k) { assertStruct(); std::string s(k); return (*_value.asStruct)[s]; }
+
+ //! Access the struct value map.
+ //! Can be used to iterate over the entries in the map to find all defined entries.
+ operator ValueStruct const&() { assertStruct(); return *_value.asStruct; }
+
+ // Accessors
+ //! Return true if the value has been set to something.
+ bool valid() const { return _type != TypeInvalid; }
+
+ //! Return the type of the value stored. \see Type.
+ Type const &getType() const { return _type; }
+
+ //! Return the size for string, base64, array, and struct values.
+ int size() const;
+
+ //! Specify the size for array values. Array values will grow beyond this size if needed.
+ void setSize(int size) { assertArray(size); }
+
+ //! Check for the existence of a struct member by name.
+ bool hasMember(const std::string& name) const;
+
+ //! Decode xml. Destroys any existing value.
+ bool fromXml(std::string const& valueXml, int* offset);
+
+ //! Encode the Value in xml
+ std::string toXml() const;
+
+ //! Write the value (no xml encoding)
+ std::ostream& write(std::ostream& os) const;
+
+ // Formatting
+ //! Return the format used to write double values.
+ static std::string const& getDoubleFormat() { return _doubleFormat; }
+
+ //! Specify the format used to write double values.
+ static void setDoubleFormat(const char* f) { _doubleFormat = f; }
+
+
+ protected:
+ // Clean up
+ void invalidate();
+
+ // Type checking. Non-const versions coerce to the desired type if currently un-typed.
+ void assertType(Type t) const;
+ void assertType(Type t);
+ void assertArray(int size) const;
+ void assertArray(int size);
+ void assertStruct();
+
+ // XML decoding
+ bool boolFromXml(std::string const& valueXml, int* offset);
+ bool intFromXml(std::string const& valueXml, int* offset);
+ bool doubleFromXml(std::string const& valueXml, int* offset);
+ bool stringFromXml(std::string const& valueXml, int* offset);
+ bool timeFromXml(std::string const& valueXml, int* offset);
+ bool binaryFromXml(std::string const& valueXml, int* offset);
+ bool arrayFromXml(std::string const& valueXml, int* offset);
+ bool structFromXml(std::string const& valueXml, int* offset);
+
+ // XML encoding
+ std::string nilToXml() const;
+ std::string boolToXml() const;
+ std::string intToXml() const;
+ std::string doubleToXml() const;
+ std::string stringToXml() const;
+ std::string timeToXml() const;
+ std::string binaryToXml() const;
+ std::string arrayToXml() const;
+ std::string structToXml() const;
+
+ // Format strings
+ static std::string _doubleFormat;
+
+ // Type tag and values
+ Type _type;
+
+ // At some point I will split off Arrays and Structs into
+ // separate ref-counted objects for more efficient copying.
+ union {
+ bool asBool;
+ int asInt;
+ double asDouble;
+ struct tm* asTime;
+ std::string* asString;
+ BinaryData* asBinary;
+ ValueArray* asArray;
+ ValueStruct* asStruct;
+ } _value;
+
+ };
+} // namespace XmlRpc
+
+
+std::ostream& operator<<(std::ostream& os, XmlRpc::XmlRpcValue& v);
+
+
+#endif // _XMLRPCVALUE_H_
diff --git a/src/include/adif_def.h b/src/include/adif_def.h
new file mode 100644
index 0000000..3e54da1
--- /dev/null
+++ b/src/include/adif_def.h
@@ -0,0 +1,21 @@
+#ifndef ADIF_DEF
+#define ADIF_DEF
+
+#include <string>
+#include <cstring>
+
+#include <FL/Fl_Check_Button.H>
+
+#include "field_def.h"
+
+using namespace std;
+
+struct FIELD {
+ int type;
+ string *name;
+ Fl_Check_Button **btn;
+};
+
+extern FIELD fields[];
+
+#endif
diff --git a/src/include/adif_io.h b/src/include/adif_io.h
new file mode 100644
index 0000000..ab10f7c
--- /dev/null
+++ b/src/include/adif_io.h
@@ -0,0 +1,81 @@
+#ifndef ADIFIO
+#define ADIFIO
+
+#include <cstdio>
+#include <cstring>
+
+#include "qso_db.h"
+
+#define ADIF_VERS "2.2.3"
+
+/* STATION_CALLSIGN & CREDIT_SUBMITTED are the longest field names
+ * in ADIF v2.2.6 spec
+ */
+const int FieldLabelMaxLen = 16;
+
+class cAdifIO {
+private:
+ bool write_all;
+ cQsoRec adifqso;
+ FILE *adiFile;
+ void fillfield(int, char *);
+ std::string log_checksum;
+ std::string file_checksum;
+public:
+ cAdifIO ();
+ ~cAdifIO () {};
+ int readAdifRec () {return 0;};
+ int writeAdifRec () {return 0;};
+ void add_record (const char *, cQsoDb &);
+ void readFile (const char *, cQsoDb *);
+ int writeFile (const char *, cQsoDb *);
+ int writeLog (const char *, cQsoDb *);
+ bool log_changed(const char *fname);
+ std::string get_checksum() { return log_checksum; }
+ void set_checksum( std::string s ) { log_checksum = s; }
+ std::string get_file_checksum() { return file_checksum; }
+ void do_checksum(cQsoDb &);
+};
+
+// crc 16 cycle redundancy check sum
+
+class Ccrc16 {
+private:
+ unsigned int crcval;
+ char ss[5];
+public:
+ Ccrc16() { crcval = 0xFFFF; }
+ ~Ccrc16() {};
+ void reset() { crcval = 0xFFFF;}
+ unsigned int val() {return crcval;}
+ std::string sval() {
+ snprintf(ss, sizeof(ss), "%04X", crcval);
+ return ss;
+ }
+ void update(char c) {
+ crcval ^= c;
+ for (int i = 0; i < 8; ++i) {
+ if (crcval & 1)
+ crcval = (crcval >> 1) ^ 0xA001;
+ else
+ crcval = (crcval >> 1);
+ }
+ }
+ unsigned int crc16(char c) {
+ update(c);
+ return crcval;
+ }
+ unsigned int crc16(std::string s) {
+ reset();
+ for (size_t i = 0; i < s.length(); i++)
+ update(s[i]);
+ return crcval;
+ }
+ std::string scrc16(std::string s) {
+ crc16(s);
+ return sval();
+ }
+};
+
+
+#endif
diff --git a/src/include/base64.h b/src/include/base64.h
new file mode 100644
index 0000000..f13c6cd
--- /dev/null
+++ b/src/include/base64.h
@@ -0,0 +1,377 @@
+
+
+// base64.hpp
+// Autor Konstantin Pilipchuk
+// mailto:lostd at ukr.net
+//
+//
+
+#if !defined(__BASE64_H_INCLUDED__)
+#define __BASE64_H_INCLUDED__ 1
+
+#include <iterator>
+
+static
+int _base64Chars[]= {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
+ 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',
+ '0','1','2','3','4','5','6','7','8','9',
+ '+','/' };
+
+
+#define _0000_0011 0x03
+#define _1111_1100 0xFC
+#define _1111_0000 0xF0
+#define _0011_0000 0x30
+#define _0011_1100 0x3C
+#define _0000_1111 0x0F
+#define _1100_0000 0xC0
+#define _0011_1111 0x3F
+
+#define _EQUAL_CHAR (-1)
+#define _UNKNOWN_CHAR (-2)
+
+#define _IOS_FAILBIT std::ios_base::failbit
+#define _IOS_EOFBIT std::ios_base::eofbit
+#define _IOS_BADBIT std::ios_base::badbit
+#define _IOS_GOODBIT std::ios_base::goodbit
+
+// TEMPLATE CLASS base64_put
+template<class _E = char, class _Tr = std::char_traits<_E> >
+class base64
+{
+public:
+
+ typedef unsigned char byte_t;
+ typedef _E char_type;
+ typedef _Tr traits_type;
+
+ // base64 requires max line length <= 72 characters
+ // you can fill end of line
+ // it may be crlf, crlfsp, noline or other class like it
+
+
+ struct crlf
+ {
+ template<class _OI>
+ _OI operator()(_OI _To) const{
+ *_To = _Tr::to_char_type('\r'); ++_To;
+ *_To = _Tr::to_char_type('\n'); ++_To;
+
+ return (_To);
+ }
+ };
+
+
+ struct crlfsp
+ {
+ template<class _OI>
+ _OI operator()(_OI _To) const{
+ *_To = _Tr::to_char_type('\r'); ++_To;
+ *_To = _Tr::to_char_type('\n'); ++_To;
+ *_To = _Tr::to_char_type(' '); ++_To;
+
+ return (_To);
+ }
+ };
+
+ struct noline
+ {
+ template<class _OI>
+ _OI operator()(_OI _To) const{
+ return (_To);
+ }
+ };
+
+ struct three2four
+ {
+ void zero()
+ {
+ _data[0] = 0;
+ _data[1] = 0;
+ _data[2] = 0;
+ }
+
+ byte_t get_0() const
+ {
+ return _data[0];
+ }
+ byte_t get_1() const
+ {
+ return _data[1];
+ }
+ byte_t get_2() const
+ {
+ return _data[2];
+ }
+
+ void set_0(byte_t _ch)
+ {
+ _data[0] = _ch;
+ }
+
+ void set_1(byte_t _ch)
+ {
+ _data[1] = _ch;
+ }
+
+ void set_2(byte_t _ch)
+ {
+ _data[2] = _ch;
+ }
+
+ // 0000 0000 1111 1111 2222 2222
+ // xxxx xxxx xxxx xxxx xxxx xxxx
+ // 0000 0011 1111 2222 2233 3333
+
+ int b64_0() const {return (_data[0] & _1111_1100) >> 2;}
+ int b64_1() const {return ((_data[0] & _0000_0011) << 4) + ((_data[1] & _1111_0000)>>4);}
+ int b64_2() const {return ((_data[1] & _0000_1111) << 2) + ((_data[2] & _1100_0000)>>6);}
+ int b64_3() const {return (_data[2] & _0011_1111);}
+
+ void b64_0(int _ch) {_data[0] = ((_ch & _0011_1111) << 2) | (_0000_0011 & _data[0]);}
+
+ void b64_1(int _ch) {
+ _data[0] = ((_ch & _0011_0000) >> 4) | (_1111_1100 & _data[0]);
+ _data[1] = ((_ch & _0000_1111) << 4) | (_0000_1111 & _data[1]); }
+
+ void b64_2(int _ch) {
+ _data[1] = ((_ch & _0011_1100) >> 2) | (_1111_0000 & _data[1]);
+ _data[2] = ((_ch & _0000_0011) << 6) | (_0011_1111 & _data[2]); }
+
+ void b64_3(int _ch){
+ _data[2] = (_ch & _0011_1111) | (_1100_0000 & _data[2]);}
+
+ private:
+ byte_t _data[3];
+
+ };
+
+
+
+
+ template<class _II, class _OI, class _State, class _Endline>
+ _II put(_II _First, _II _Last, _OI _To, _State& _St, _Endline _Endl) const
+ {
+ three2four _3to4;
+ int line_octets = 0;
+
+ while(_First != _Last)
+ {
+ _3to4.zero();
+
+ // ���� �� 3 �������
+ _3to4.set_0(*_First);
+ _First++;
+
+ if(_First == _Last)
+ {
+ *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_0()]); ++_To;
+ *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_1()]); ++_To;
+ *_To = _Tr::to_char_type('='); ++_To;
+ *_To = _Tr::to_char_type('='); ++_To;
+ goto __end;
+ }
+
+ _3to4.set_1(*_First);
+ _First++;
+
+ if(_First == _Last)
+ {
+ *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_0()]); ++_To;
+ *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_1()]); ++_To;
+ *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_2()]); ++_To;
+ *_To = _Tr::to_char_type('='); ++_To;
+ goto __end;
+ }
+
+ _3to4.set_2(*_First);
+ _First++;
+
+ *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_0()]); ++_To;
+ *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_1()]); ++_To;
+ *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_2()]); ++_To;
+ *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_3()]); ++_To;
+
+ if(line_octets == 17) // base64 ��������� ����� ������ �� ����� 72 ��������
+ {
+ //_To = _Endl(_To);
+ *_To = '\n'; ++_To;
+ line_octets = 0;
+ }
+ else
+ ++line_octets;
+ }
+
+ __end: ;
+
+ return (_First);
+
+ }
+
+
+ template<class _II, class _OI, class _State>
+ _II get(_II _First, _II _Last, _OI _To, _State& _St) const
+ {
+ three2four _3to4;
+ int _Char;
+
+ while(_First != _Last)
+ {
+
+ // Take octet
+ _3to4.zero();
+
+ // -- 0 --
+ // Search next valid char...
+ while((_Char = _getCharType(*_First)) < 0 && _Char == _UNKNOWN_CHAR)
+ {
+ if(++_First == _Last)
+ {
+ _St |= _IOS_FAILBIT|_IOS_EOFBIT; return _First; // unexpected EOF
+ }
+ }
+
+ if(_Char == _EQUAL_CHAR){
+ // Error! First character in octet can't be '='
+ _St |= _IOS_FAILBIT;
+ return _First;
+ }
+ else
+ _3to4.b64_0(_Char);
+
+
+ // -- 1 --
+ // Search next valid char...
+ while(++_First != _Last)
+ if((_Char = _getCharType(*_First)) != _UNKNOWN_CHAR)
+ break;
+
+ if(_First == _Last) {
+ _St |= _IOS_FAILBIT|_IOS_EOFBIT; // unexpected EOF
+ return _First;
+ }
+
+ if(_Char == _EQUAL_CHAR){
+ // Error! Second character in octet can't be '='
+ _St |= _IOS_FAILBIT;
+ return _First;
+ }
+ else
+ _3to4.b64_1(_Char);
+
+
+ // -- 2 --
+ // Search next valid char...
+ while(++_First != _Last)
+ if((_Char = _getCharType(*_First)) != _UNKNOWN_CHAR)
+ break;
+
+ if(_First == _Last) {
+ // Error! Unexpected EOF. Must be '=' or base64 character
+ _St |= _IOS_FAILBIT|_IOS_EOFBIT;
+ return _First;
+ }
+
+ if(_Char == _EQUAL_CHAR){
+ // OK!
+ _3to4.b64_2(0);
+ _3to4.b64_3(0);
+
+ // chek for EOF
+ if(++_First == _Last)
+ {
+ // Error! Unexpected EOF. Must be '='. Ignore it.
+ //_St |= _IOS_BADBIT|_IOS_EOFBIT;
+ _St |= _IOS_EOFBIT;
+ }
+ else
+ if(_getCharType(*_First) != _EQUAL_CHAR)
+ {
+ // Error! Must be '='. Ignore it.
+ //_St |= _IOS_BADBIT;
+ }
+ else
+ ++_First; // Skip '='
+
+ // write 1 byte to output
+ *_To = (byte_t) _3to4.get_0();
+ return _First;
+ }
+ else
+ _3to4.b64_2(_Char);
+
+
+ // -- 3 --
+ // Search next valid char...
+ while(++_First != _Last)
+ if((_Char = _getCharType(*_First)) != _UNKNOWN_CHAR)
+ break;
+
+ if(_First == _Last) {
+ // Unexpected EOF. It's error. But ignore it.
+ //_St |= _IOS_FAILBIT|_IOS_EOFBIT;
+ _St |= _IOS_EOFBIT;
+
+ return _First;
+ }
+
+ if(_Char == _EQUAL_CHAR)
+ {
+ // OK!
+ _3to4.b64_3(0);
+
+ // write to output 2 bytes
+ *_To = (byte_t) _3to4.get_0();
+ *_To = (byte_t) _3to4.get_1();
+
+ ++_First; // set position to next character
+
+ return _First;
+ }
+ else
+ _3to4.b64_3(_Char);
+
+
+ // write to output 3 bytes
+ *_To = (byte_t) _3to4.get_0();
+ *_To = (byte_t) _3to4.get_1();
+ *_To = (byte_t) _3to4.get_2();
+
+ ++_First;
+
+
+ } // while(_First != _Last)
+
+ return (_First);
+ }
+
+protected:
+
+ int _getCharType(int _Ch) const
+ {
+ if(_base64Chars[62] == _Ch)
+ return 62;
+
+ if(_base64Chars[63] == _Ch)
+ return 63;
+
+ if((_base64Chars[0] <= _Ch) && (_base64Chars[25] >= _Ch))
+ return _Ch - _base64Chars[0];
+
+ if((_base64Chars[26] <= _Ch) && (_base64Chars[51] >= _Ch))
+ return _Ch - _base64Chars[26] + 26;
+
+ if((_base64Chars[52] <= _Ch) && (_base64Chars[61] >= _Ch))
+ return _Ch - _base64Chars[52] + 52;
+
+ if(_Ch == _Tr::to_int_type('='))
+ return _EQUAL_CHAR;
+
+ return _UNKNOWN_CHAR;
+ }
+
+
+};
+
+
+#endif
diff --git a/src/include/calendar.h b/src/include/calendar.h
new file mode 100644
index 0000000..a329ab0
--- /dev/null
+++ b/src/include/calendar.h
@@ -0,0 +1,151 @@
+/* -*-C++-*-
+
+ "$Id: Fl_Calendar.H,v 1.4 2000/02/13 04:43:56 jamespalmer Exp $"
+
+ Copyright 1999-2000 by the Flek development team.
+
+ This library 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 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+
+ Please report all bugs and problems to "flek-devel at sourceforge.net".
+
+*/
+
+#ifndef _FL_CALENDAR_H
+#define _FL_CALENDAR_H
+
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Group.H>
+#include <FL/Fl_Button.H>
+#include <FL/Fl_Box.H>
+
+#include "flinput2.h"
+#include "date.h"
+
+class Fl_Calendar_Base : public Fl_Group , public Date
+{
+ private:
+
+ protected:
+
+ int cal_x;
+ int cal_y;
+ int cal_w;
+ int cal_h;
+
+ Fl_Button * days[6*7];
+
+public:
+ Fl_Widget *target;
+ int calfmt;
+
+ /**
+ * The constructor for an empty Fl_Calendar_Base.
+ */
+ Fl_Calendar_Base (int x, int y, int w = (7*20), int h = (6*20),
+ const char *l = 0);
+
+ Fl_Button * day_button (int i);
+
+ void update ();
+ void csize (int cx, int cy, int cw, int ch);
+ void setTarget (Fl_Widget *tgt);
+};
+
+class Fl_Calendar : public Fl_Calendar_Base
+{
+public:
+ /**
+ * The constructor for an empty Fl_Calendar.
+ */
+ Fl_Calendar (int x, int y, int w = (7*20), int h = (8*20),
+ const char *l = 0);
+
+ void today ();
+ void previous_month ();
+ void next_month ();
+ void previous_year ();
+ void next_year ();
+ void setDate (int, int, int);
+
+ void update ();
+ void csize (int cx, int cy, int cw, int ch);
+ int handle (int);
+
+protected:
+// Fl_Button * weekdays[7];
+// Fl_Button * caption;
+ Fl_Box * weekdays[7];
+ Fl_Box * caption;
+ Fl_Button * nxt_month;
+ Fl_Button * prv_month;
+ Fl_Button * nxt_year;
+ Fl_Button * prv_year;
+};
+
+class Fl_PopCal : public Fl_Window {
+
+ friend void popcal_cb(Fl_Widget *, long);
+
+ protected:
+ int popcalfmt_;
+// Fl_Window popcal_form;
+ Fl_Calendar *popcal;
+ Fl_Input2 *target;
+ public:
+ Fl_PopCal (int x, int y, int w, int h, Fl_Input2 *inp = 0);
+ ~Fl_PopCal ();
+ void popposition (int, int);
+ void popshow ();
+ void pophide ();
+ void popcal_cb_i (Fl_Widget *, long);
+ void popcalfmt (int);
+ int popcalfmt ();
+ int handle (int);
+ void setDate (int, int, int);
+};
+
+class Fl_DateInput : public Fl_Group {
+
+ protected:
+ Fl_Button *Btn;
+ Fl_Input2 *Input;
+ Fl_PopCal *Cal;
+
+ Fl_Window *popcal_form;
+ Fl_Calendar *popcal;
+ int popcalfmt_;
+
+ void makepopcal();
+
+ public:
+ Fl_DateInput (int x, int y, int w, int h, const char * = 0);
+
+ void format (int);
+ const char *value ();
+ void value (const char *);
+ void textfont (int);
+ void textsize (int);
+ void labelfont (int);
+ void labelsize (int);
+ void labelcolor (int);
+ void align (Fl_Align);
+ void fl_popcal();
+ void take_focus();
+
+};
+
+
+#endif
diff --git a/src/include/combo.h b/src/include/combo.h
new file mode 100644
index 0000000..d6f8140
--- /dev/null
+++ b/src/include/combo.h
@@ -0,0 +1,127 @@
+/* -*-C++-*-
+
+ "$Id: Fl_Combobox.H,v 1.4 2000/02/13 04:43:56 dhfreese Exp $"
+
+ Copyright 1999-2010 by the Dave Freese.
+
+ This library 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 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+
+ Please report all bugs and problems to "flek-devel at sourceforge.net".
+
+*/
+
+#ifndef _FL_COMBOBOX_H
+#define _FL_COMBOBOX_H
+
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Group.H>
+#include <FL/Fl_Button.H>
+#include <FL/Fl_Select_Browser.H>
+#include <FL/Fl_Input.H>
+
+#define FL_COMBO_UNIQUE 1
+#define FL_COMBO_UNIQUE_NOCASE 2
+#define FL_COMBO_LIST_INCR 100
+
+class Fl_ComboBox;
+
+struct datambr {
+ char *s;
+ void *d;
+};
+
+struct retvals {
+ Fl_Input *Inp;
+ void * retval;
+ int * idx;};
+
+class Fl_PopBrowser : public Fl_Window {
+
+ friend void popbrwsr_cb(Fl_Widget *, long);
+
+ protected:
+ Fl_Select_Browser *popbrwsr;
+ retvals Rvals;
+ int hRow;
+ int wRow;
+ public:
+ Fl_PopBrowser (int x, int y, int w, int h, retvals R);
+ ~Fl_PopBrowser ();
+ void popshow (int, int);
+ void pophide ();
+ void popbrwsr_cb_i (Fl_Widget *, long);
+
+ void add (char *s, void *d = 0);
+ void clear ();
+ void sort ();
+ int handle (int);
+
+ Fl_ComboBox *parent;
+
+};
+
+class Fl_ComboBox : public Fl_Group {
+ friend int DataCompare (const void *, const void *);
+ friend class Fl_PopBrowser;
+
+ protected:
+ Fl_Button *Btn;
+ Fl_Input *Output;
+ Fl_PopBrowser *Brwsr;
+ datambr **datalist;
+ int listsize;
+ int maxsize;
+ int listtype;
+ int numrows_;
+
+ private:
+ int width;
+ int height;
+ void *retdata;
+ int idx;
+ retvals R;
+ Fl_Color _color;
+
+ public:
+
+ Fl_ComboBox (int x, int y, int w, int h, const char * = 0);
+ ~Fl_ComboBox();
+
+ const char *value ();
+ void value (const char *);
+ void put_value( const char *);
+ void fl_popbrwsr(Fl_Widget *);
+
+ void type (int = 0);
+ void add (const char *s, void *d = 0);
+ void clear ();
+ void sort ();
+ int index ();
+ void index (int i);
+ void *data ();
+ void textfont (int);
+ void textsize (uchar);
+ void textcolor (Fl_Color c);
+ void color (Fl_Color c);
+ void readonly();
+ int numrows() { return numrows_; }
+ void numrows(int n) { numrows_ = n; }
+ int lsize() { return listsize; }
+
+};
+
+
+#endif
diff --git a/src/include/compat.h b/src/include/compat.h
new file mode 100644
index 0000000..c86c731
--- /dev/null
+++ b/src/include/compat.h
@@ -0,0 +1,67 @@
+#ifndef COMPAT_H
+#define COMPAT_H
+
+/* adapted from compat.h in git-1.6.1.2 */
+
+#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && !defined(_M_UNIX)
+# define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
+# define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
+#endif
+#define _ALL_SOURCE 1
+#define _GNU_SOURCE 1
+#define _BSD_SOURCE 1
+
+#include <config.h>
+
+#include <unistd.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <errno.h>
+#include <limits.h>
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+#include <signal.h>
+#include <assert.h>
+
+#ifdef __WIN32__
+# define dirent fl_dirent_no_thanks
+# else
+# include <dirent.h>
+# include <sys/utsname.h>
+# include <sys/ipc.h>
+# include <sys/msg.h>
+#endif
+
+#include "mingw.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined(__WOE32__) && (!defined(__GNUC__) || __GNUC__ < 4)
+# define SNPRINTF_RETURNS_BOGUS 1
+#else
+# define SNPRINTF_RETURNS_BOGUS 0
+#endif
+
+#if SNPRINTF_RETURNS_BOGUS
+#define snprintf git_snprintf
+extern int git_snprintf(char *str, size_t maxsize,
+ const char *format, ...);
+#define vsnprintf git_vsnprintf
+extern int git_vsnprintf(char *str, size_t maxsize,
+ const char *format, va_list ap);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // MINGW32_H
diff --git a/src/include/date.h b/src/include/date.h
new file mode 100644
index 0000000..434164a
--- /dev/null
+++ b/src/include/date.h
@@ -0,0 +1,132 @@
+/* -*-C++-*-
+
+ "$Id: Fl_Date.H,v 1.4 2000/03/30 04:43:56 davefreese Exp $"
+
+ Copyright 1999-2000 by the Dave Freese & the Flek development team.
+
+ This library 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 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+
+ Please report all bugs and problems to "flek-devel at sourceforge.net".
+
+*/
+#ifndef DATE_H
+#define DATE_H
+
+#include <iosfwd>
+
+typedef enum {
+ SUNDAY,
+ MONDAY,
+ TUESDAY,
+ WEDNESDAY,
+ THURSDAY,
+ FRIDAY,
+ SATURDAY
+} weekday_t;
+
+typedef enum {
+ JANUARY = 1,
+ FEBRUARY,
+ MARCH,
+ APRIL,
+ MAY,
+ JUNE,
+ JULY,
+ AUGUST,
+ SEPTEMBER,
+ OCTOBER,
+ NOVEMBER,
+ DECEMBER
+} month_t;
+
+class Date {
+ friend std::ostream &operator<<(std::ostream &, Date &);
+
+protected:
+ int year;
+ int month;
+ int day;
+ int fmt;
+ static const int mdays[];
+ static const int jdays[][13];
+ static const char *month_name[];
+ void helpIncrement();
+
+public:
+ Date();
+ Date( int m, int d, int y );
+
+ void setDate( int, int, int ); // set the date
+ void setDate( Date & );
+ void setFormat (int);
+ void today(); // set date to the present day
+ void Year( int );
+ int Year();
+ void Month( int );
+ int Month();
+ void Day( int );
+ int Day();
+
+ void previous_month ();
+ void next_month ();
+ void previous_year ();
+ void next_year ();
+
+ bool endOfMonth( int );
+
+ bool leapYear (int);
+ bool leapYear () { return leapYear (year); }
+ bool isleapyear (int year) { return leapYear (year); }
+ bool isleapyear () { return isleapyear (year); }
+
+ int daysinmonth (int, int);
+ int daysinmonth ()
+ { return daysinmonth (month, isleapyear (year)); }
+
+ bool isvalid (int, int, int);
+ bool datevalid (int year, int mon, int day)
+ { return isvalid (mon, day, year); }
+ bool datevalid ()
+ { return isvalid (month, day, year); }
+
+ int dayofyear (int, int, int);
+ int dayofyear ()
+ { return dayofyear (year, month, day); }
+
+ int dayofepoch (int, int, int);
+ int dayofepoch ()
+ { return dayofepoch (year, month, day); }
+
+ int dayofweek (int, int, int);
+ int dayofweek ()
+ { return dayofweek (year, month, day); }
+
+ char *szDate (int);
+ char *szDate ();
+ double dJulian ();
+
+ bool operator==( const Date & );
+ bool operator!=( const Date & );
+ bool operator<( const Date & );
+ bool operator>( const Date & );
+ void operator=( const Date & );
+ const Date &operator+=( int); // add days, modify object
+ Date &operator++(); // pre-increment operator
+ Date operator++( int ); // post-increment operator
+
+};
+
+#endif
diff --git a/src/include/debug.h b/src/include/debug.h
new file mode 100644
index 0000000..e062267
--- /dev/null
+++ b/src/include/debug.h
@@ -0,0 +1,101 @@
+// ----------------------------------------------------------------------------
+// debug.h
+//
+// Copyright (C) 2008, 2012
+// Stelios Bounanos, M0GLD; Dave Freese, W1HKJ
+//
+// This file is part of fldigi.
+//
+// fldigi is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// fldigi is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+// ----------------------------------------------------------------------------
+
+#ifndef _DEBUG_H_
+#define _DEBUG_H_
+
+#include "util.h"
+
+class debug
+{
+public:
+ enum level_e { QUIET_LEVEL, ERROR_LEVEL, WARN_LEVEL, INFO_LEVEL, DEBUG_LEVEL, LOG_NLEVELS };
+ enum source_e {
+ LOG_RIGCONTROL = 1 << 0, LOG_RPC = 1 << 1, LOG_OTHER = 1 << 2
+ };
+ static void start(const char* filename);
+ static void stop(void);
+ static void log(level_e level, const char* func, const char* srcf, int line,
+ const char* format, ...) format__(printf, 5, 6);
+ static void slog(level_e level, const char* func, const char* srcf, int line,
+ const char* format, ...) format__(printf, 5, 6);
+
+ static void elog(const char* func, const char* srcf, int line, const char* text);
+ static void show(void);
+ static level_e level;
+ static uint32_t mask;
+private:
+ static void sync_text(void*);
+ debug(const char* filename);
+ debug(const debug&);
+ debug& operator=(const debug&);
+ ~debug();
+ static debug* inst;
+};
+
+#define LOG(level__, source__, ...) \
+ do { \
+ if (level__ <= debug::level && source__ & debug::mask) \
+ debug::log(level__, __func__, __FILE__, __LINE__, __VA_ARGS__); \
+ } while (0)
+
+#define LOG_DEBUG(...) LOG(debug::DEBUG_LEVEL, log_source_, __VA_ARGS__)
+#define LOG_INFO(...) LOG(debug::INFO_LEVEL, log_source_, __VA_ARGS__)
+#define LOG_WARN(...) LOG(debug::WARN_LEVEL, log_source_, __VA_ARGS__)
+#define LOG_ERROR(...) LOG(debug::ERROR_LEVEL, log_source_, __VA_ARGS__)
+#define LOG_QUIET(...) LOG(debug::QUIET_LEVEL, log_source_, __VA_ARGS__)
+
+#define SLOG(level__, source__, ...) \
+ do { \
+ if (level__ <= debug::level && source__ & debug::mask) \
+ debug::slog(level__, __func__, __FILE__, __LINE__, __VA_ARGS__); \
+ } while (0)
+
+#define SLOG_DEBUG(...) SLOG(debug::DEBUG_LEVEL, log_source_, __VA_ARGS__)
+#define SLOG_INFO(...) SLOG(debug::INFO_LEVEL, log_source_, __VA_ARGS__)
+#define SLOG_WARN(...) SLOG(debug::WARN_LEVEL, log_source_, __VA_ARGS__)
+#define SLOG_ERROR(...) SLOG(debug::ERROR_LEVEL, log_source_, __VA_ARGS__)
+#define SLOG_QUIET(...) SLOG(debug::QUIET_LEVEL, log_source_, __VA_ARGS__)
+
+#define LOG_PERROR(msg__) \
+ do { \
+ if (debug::ERROR_LEVEL <= debug::level && log_source_ & debug::mask) \
+ debug::elog(__func__, __FILE__, __LINE__, msg__); \
+ } while (0)
+
+unused__ static uint32_t log_source_ = debug::LOG_OTHER;
+#if defined(__GNUC__) && (__GNUC__ >= 3)
+# define LOG_FILE_SOURCE(source__) \
+ __attribute__((constructor)) \
+ static void log_set_source_(void) { log_source_ = source__; }
+#else
+# define LOG_FILE_SOURCE(source__)
+#endif
+
+#define LOG_SET_SOURCE(source__) log_source_ = source__
+
+#endif // _DEBUG_H_
+
+// Local Variables:
+// mode: c++
+// c-file-style: "linux"
+// End:
diff --git a/src/include/dialogs.h b/src/include/dialogs.h
new file mode 100644
index 0000000..50f8206
--- /dev/null
+++ b/src/include/dialogs.h
@@ -0,0 +1,14 @@
+#ifndef DIALOGS_H
+#define DIALOGS_H
+
+#include <string>
+
+#include "font_browser.h"
+#include "support.h"
+
+extern void create_dialogs();
+
+#endif
+
+
+
diff --git a/src/include/field_def.h b/src/include/field_def.h
new file mode 100644
index 0000000..6545ce5
--- /dev/null
+++ b/src/include/field_def.h
@@ -0,0 +1,55 @@
+#ifndef FIELD_DEFS
+#define FIELD_DEFS
+
+enum ADIF_FIELD_POS {
+ ADDRESS = 0,
+ AGE,
+ ARRL_SECT,
+ BAND,
+ CALL,
+ CNTY,
+ COMMENT,
+ CONT,
+ CONTEST_ID,
+ COUNTRY,
+ CQZ,
+ DXCC,
+ EXPORT, // flag used internally in fldigi's logbook
+ FREQ,
+ GRIDSQUARE,
+ IOTA,
+ ITUZ,
+ MODE,
+ MYXCHG, // contest exchange field #3
+ NAME,
+ NOTES,
+ OPERATOR,
+ PFX,
+ PROP_MODE,
+ QSLRDATE,
+ QSLSDATE,
+ QSL_MSG,
+ QSL_RCVD,
+ QSL_SENT,
+ QSL_VIA,
+ QSO_DATE,
+ QSO_DATE_OFF,
+ QTH,
+ RST_RCVD,
+ RST_SENT,
+ RX_PWR,
+ SAT_MODE,
+ SAT_NAME,
+ SRX,
+ STATE,
+ STX,
+ TEN_TEN,
+ TIME_OFF,
+ TIME_ON,
+ TX_PWR,
+ VE_PROV,
+ XCHG1, // contest exchange field
+ NUMFIELDS // counter for number of fields in enum
+};
+
+#endif
diff --git a/src/include/fileselect.h b/src/include/fileselect.h
new file mode 100644
index 0000000..854d284
--- /dev/null
+++ b/src/include/fileselect.h
@@ -0,0 +1,31 @@
+#ifndef FILESELECT_H
+#define FILESELECT_H
+
+#include <config.h>
+
+//#ifdef __WIN32__
+//# define FSEL_THREAD 1
+//#endif
+//#define FSEL_THREAD 0
+
+#if FLMSG_FLTK_API_MAJOR == 1 && FLMSG_FLTK_API_MINOR < 3
+ class Fl_Native_File_Chooser;
+#else
+ #ifdef __WIN_32
+ class Fl_Native_File_Chooser;
+ #else
+ #include <FL/Fl_Native_File_Chooser.H>
+ #endif
+#endif
+
+namespace FSEL {
+
+ void create(void);
+ void destroy(void);
+ const char* select(const char* title, const char* filter, const char* def = 0);
+ const char* saveas(const char* title, const char* filter, const char* def = 0);
+ const char* dir_select(const char* title, const char* filter, const char* def = 0);
+
+}
+
+#endif // FILESELECT_H
diff --git a/src/include/flinput2.h b/src/include/flinput2.h
new file mode 100644
index 0000000..0545bcf
--- /dev/null
+++ b/src/include/flinput2.h
@@ -0,0 +1,13 @@
+#ifndef FL_INPUT2_
+#define FL_INPUT2_
+
+#include <FL/Fl_Input.H>
+
+class Fl_Input2 : public Fl_Input
+{
+public:
+ Fl_Input2(int x, int y, int w, int h, const char* l = 0);
+ int handle(int event);
+};
+
+#endif // FL_INPUT2_
diff --git a/src/include/flslider2.h b/src/include/flslider2.h
new file mode 100644
index 0000000..043cf06
--- /dev/null
+++ b/src/include/flslider2.h
@@ -0,0 +1,72 @@
+// ----------------------------------------------------------------------------
+// flslider2.h
+//
+// Copyright (C) 2010
+// Stelios Bounanos, M0GLD
+//
+// This file is part of fldigi.
+//
+// fldigi is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// fldigi is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+// ----------------------------------------------------------------------------
+
+#ifndef FL_SLIDER2_
+#define FL_SLIDER2_
+
+#include <FL/Fl_Slider.H>
+#include <FL/Fl_Value_Slider.H>
+#include <FL/Fl_Counter.H>
+#include <FL/Fl_Value_Input.H>
+#include <FL/Fl_Spinner.H>
+
+class Fl_Slider2 : public Fl_Slider
+{
+public:
+ Fl_Slider2(int x, int y, int w, int h, const char* l = 0)
+ : Fl_Slider(x, y, w, h, l) { }
+ int handle(int event);
+};
+
+class Fl_Value_Slider2 : public Fl_Value_Slider
+{
+public:
+ Fl_Value_Slider2(int x, int y, int w, int h, const char* l = 0)
+ : Fl_Value_Slider(x, y, w, h, l) { }
+ int handle(int event);
+};
+
+class Fl_Counter2 : public Fl_Counter
+{
+public:
+ Fl_Counter2(int x, int y, int w, int h, const char* l = 0)
+ : Fl_Counter(x, y, w, h, l) { }
+ int handle(int event);
+};
+
+class Fl_Value_Input2 : public Fl_Value_Input
+{
+public:
+ Fl_Value_Input2(int x, int y, int w, int h, const char* l = 0)
+ : Fl_Value_Input(x, y, w, h, l) { }
+ int handle(int event);
+};
+
+class Fl_Spinner2 : public Fl_Spinner
+{
+public:
+ Fl_Spinner2(int x, int y, int w, int h, const char* l = 0)
+ : Fl_Spinner(x, y, w, h, l) { }
+ int handle(int event);
+};
+
+#endif // FL_SLIDER2_
diff --git a/src/include/flwkey.h b/src/include/flwkey.h
new file mode 100644
index 0000000..0f6f1e2
--- /dev/null
+++ b/src/include/flwkey.h
@@ -0,0 +1,38 @@
+#ifndef _Rig_H
+#define _Rig_H
+
+#include <string>
+#include <sys/types.h>
+#include <pthread.h>
+
+#include <FL/Fl.H>
+#include <FL/Fl_Double_Window.H>
+#include <FL/Enumerations.H>
+
+#ifndef WIN32
+#include <unistd.h>
+#include <pwd.h>
+#endif
+
+#include <FL/fl_ask.H>
+#include <FL/Fl_File_Chooser.H>
+#include <FL/Fl_Color_Chooser.H>
+#include <FL/fl_draw.H>
+
+#include "config.h"
+
+#include "serial.h"
+#include "support.h"
+
+extern Fl_Double_Window *mainwindow;
+extern string WKeyHomeDir;
+
+extern string defFileName;
+extern string title;
+
+extern pthread_t *serial_thread;
+extern pthread_mutex_t mutex_serial;
+
+extern bool WKEY_DEBUG;
+
+#endif
diff --git a/src/include/flwkeyrc.h b/src/include/flwkeyrc.h
new file mode 100644
index 0000000..fa5ecdf
--- /dev/null
+++ b/src/include/flwkeyrc.h
@@ -0,0 +1,3 @@
+// MS include file for application icon
+
+#define IDI_ICON 101
diff --git a/src/include/font_browser.h b/src/include/font_browser.h
new file mode 100644
index 0000000..2f1d95b
--- /dev/null
+++ b/src/include/font_browser.h
@@ -0,0 +1,100 @@
+// ----------------------------------------------------------------------------
+// Font_Browser.h v 0.0.1 2005-10-17
+//
+// for the Fast Light Tool Kit (FLTK) 1.1.x .
+//
+// David Freese, w1hkj at w1hkj.com
+// based on similar widget by Mariwan Jalal
+//
+// This file is part of fldigi.
+//
+// Fldigi is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Fldigi 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 fldigi. If not, see <http://www.gnu.org/licenses/>.
+// ----------------------------------------------------------------------------
+
+
+#ifndef FONTBROWSER_H
+#define FONTBROWSER_H
+
+#include <FL/Enumerations.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Widget.H>
+#include <FL/Fl_Browser.H>
+#include <FL/Fl_Button.H>
+#include <FL/Fl_Return_Button.H>
+#include "flslider2.h"
+
+// Preview box for showing font
+class Preview_Box : public Fl_Widget
+{
+private:
+ int fontName;
+ int fontSize;
+ Fl_Color fontColor;
+
+ void draw();
+public:
+ Preview_Box(int x, int y, int w, int h, const char* l);
+ void SetFont( int fontname, int fontsize, Fl_Color c);
+};
+
+// Font browser widget
+class Font_Browser : public Fl_Window
+{
+public:
+ enum filter_t { FIXED_WIDTH, VARIABLE_WIDTH, ALL_TYPES };
+
+private:
+ int numfonts;
+ Fl_Font fontnbr;
+ int fontsize;
+ Fl_Color fontcolor;
+ filter_t filter;
+ void *data_;
+
+ Fl_Browser *lst_Font;
+ Fl_Browser *lst_Size;
+ Fl_Value_Input2 *txt_Size;
+ Fl_Return_Button *btn_OK;
+ Fl_Button *btn_Cancel;
+ Fl_Button *btn_Color;
+ Preview_Box *box_Example;
+
+ void FontSort();
+ Fl_Callback* callback_;
+
+public:
+ Font_Browser(int x = 100, int y = 100, int w = 400, int h = 225, const char *lbl = "Font Browser");
+ void callback(Fl_Callback* cb, void *d = 0) { callback_ = cb; data_ = d; }
+ static void fb_callback(Fl_Widget* w, void* arg);
+ void FontNameSelect();
+ void ColorSelect();
+
+ int numFonts() { return numfonts; }
+ void fontNumber(Fl_Font n);
+ Fl_Font fontNumber() { return fontnbr; }
+ void fontSize(int s);
+ int fontSize() { return fontsize; }
+ void fontColor(Fl_Color c);
+ Fl_Color fontColor() { return fontcolor; };
+
+ const char *fontName() { return lst_Font->text(lst_Font->value()); }
+ void fontName(const char* n);
+
+ static bool fixed_width(Fl_Font f);
+ void fontFilter(filter_t filter);
+};
+
+extern Font_Browser* font_browser;
+
+#endif
diff --git a/src/include/gettext.h b/src/include/gettext.h
new file mode 100644
index 0000000..4cbdc38
--- /dev/null
+++ b/src/include/gettext.h
@@ -0,0 +1,285 @@
+/* Convenience header for conditional use of GNU <libintl.h>.
+ Copyright (C) 1995-1998, 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 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 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 _LIBGETTEXT_H
+#define _LIBGETTEXT_H 1
+
+
+/* NLS can be disabled through the configure --disable-nls option. */
+#if ENABLE_NLS
+
+/* Get declarations of GNU message catalog functions. */
+# include <libintl.h>
+
+/* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by
+ the gettext() and ngettext() macros. This is an alternative to calling
+ textdomain(), and is useful for libraries. */
+# ifdef DEFAULT_TEXT_DOMAIN
+# undef gettext
+# define gettext(Msgid) \
+ dgettext (DEFAULT_TEXT_DOMAIN, Msgid)
+# undef ngettext
+# define ngettext(Msgid1, Msgid2, N) \
+ dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N)
+# endif
+
+#else
+
+/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which
+ chokes if dcgettext is defined as a macro. So include it now, to make
+ later inclusions of <locale.h> a NOP. We don't include <libintl.h>
+ as well because people using "gettext.h" will not include <libintl.h>,
+ and also including <libintl.h> would fail on SunOS 4, whereas <locale.h>
+ is OK. */
+#if defined(__sun)
+# include <locale.h>
+#endif
+
+/* Many header files from the libstdc++ coming with g++ 3.3 or newer include
+ <libintl.h>, which chokes if dcgettext is defined as a macro. So include
+ it now, to make later inclusions of <libintl.h> a NOP. */
+#if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3)
+# include <cstdlib>
+# if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H
+# include <libintl.h>
+# endif
+#endif
+
+/* Disabled NLS.
+ The casts to 'const char *' serve the purpose of producing warnings
+ for invalid uses of the value returned from these functions.
+ On pre-ANSI systems without 'const', the config.h file is supposed to
+ contain "#define const". */
+# define gettext(Msgid) ((const char *) (Msgid))
+# define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid))
+# define dcgettext(Domainname, Msgid, Category) \
+ ((void) (Category), dgettext (Domainname, Msgid))
+# define ngettext(Msgid1, Msgid2, N) \
+ ((N) == 1 \
+ ? ((void) (Msgid2), (const char *) (Msgid1)) \
+ : ((void) (Msgid1), (const char *) (Msgid2)))
+# define dngettext(Domainname, Msgid1, Msgid2, N) \
+ ((void) (Domainname), ngettext (Msgid1, Msgid2, N))
+# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
+ ((void) (Category), dngettext(Domainname, Msgid1, Msgid2, N))
+# define textdomain(Domainname) ((const char *) (Domainname))
+# define bindtextdomain(Domainname, Dirname) \
+ ((void) (Domainname), (const char *) (Dirname))
+# define bind_textdomain_codeset(Domainname, Codeset) \
+ ((void) (Domainname), (const char *) (Codeset))
+
+#endif
+
+/* A pseudo function call that serves as a marker for the automated
+ extraction of messages, but does not call gettext(). The run-time
+ translation is done at a different place in the code.
+ The argument, String, should be a literal string. Concatenated strings
+ and other string expressions won't work.
+ The macro's expansion is not parenthesized, so that it is suitable as
+ initializer for static 'char[]' or 'const char[]' variables. */
+#define gettext_noop(String) String
+
+/* The separator between msgctxt and msgid in a .mo file. */
+#define GETTEXT_CONTEXT_GLUE "\004"
+
+/* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a
+ MSGID. MSGCTXT and MSGID must be string literals. MSGCTXT should be
+ short and rarely need to change.
+ The letter 'p' stands for 'particular' or 'special'. */
+#ifdef DEFAULT_TEXT_DOMAIN
+# define pgettext(Msgctxt, Msgid) \
+ pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
+#else
+# define pgettext(Msgctxt, Msgid) \
+ pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
+#endif
+#define dpgettext(Domainname, Msgctxt, Msgid) \
+ pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
+#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \
+ pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category)
+#ifdef DEFAULT_TEXT_DOMAIN
+# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
+ npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
+#else
+# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
+ npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
+#endif
+#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
+ npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
+#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \
+ npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, Category)
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static const char *
+pgettext_aux (const char *domain,
+ const char *msg_ctxt_id, const char *msgid,
+ int category)
+{
+ const char *translation = dcgettext (domain, msg_ctxt_id, category);
+ if (translation == msg_ctxt_id)
+ return msgid;
+ else
+ return translation;
+}
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static const char *
+npgettext_aux (const char *domain,
+ const char *msg_ctxt_id, const char *msgid,
+ const char *msgid_plural, unsigned long int n,
+ int category)
+{
+ const char *translation =
+ dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
+ if (translation == msg_ctxt_id || translation == msgid_plural)
+ return (n == 1 ? msgid : msgid_plural);
+ else
+ return translation;
+}
+
+/* The same thing extended for non-constant arguments. Here MSGCTXT and MSGID
+ can be arbitrary expressions. But for string literals these macros are
+ less efficient than those above. */
+
+#include <string.h>
+
+#define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \
+ (((__GNUC__ >= 3 || __GNUG__ >= 2) && !__STRICT_ANSI__) \
+ /* || __STDC_VERSION__ >= 199901L */ )
+
+#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+#include <stdlib.h>
+#endif
+
+#define pgettext_expr(Msgctxt, Msgid) \
+ dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES)
+#define dpgettext_expr(Domainname, Msgctxt, Msgid) \
+ dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES)
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static const char *
+dcpgettext_expr (const char *domain,
+ const char *msgctxt, const char *msgid,
+ int category)
+{
+ size_t msgctxt_len = strlen (msgctxt) + 1;
+ size_t msgid_len = strlen (msgid) + 1;
+ const char *translation;
+#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+ char msg_ctxt_id[msgctxt_len + msgid_len];
+#else
+ char buf[1024];
+ char *msg_ctxt_id =
+ (msgctxt_len + msgid_len <= sizeof (buf)
+ ? buf
+ : (char *) malloc (msgctxt_len + msgid_len));
+ if (msg_ctxt_id != NULL)
+#endif
+ {
+ memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
+ msg_ctxt_id[msgctxt_len - 1] = '\004';
+ memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
+ translation = dcgettext (domain, msg_ctxt_id, category);
+#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+ if (msg_ctxt_id != buf)
+ free (msg_ctxt_id);
+#endif
+ if (translation != msg_ctxt_id)
+ return translation;
+ }
+ return msgid;
+}
+
+#define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \
+ dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
+#define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
+ dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static const char *
+dcnpgettext_expr (const char *domain,
+ const char *msgctxt, const char *msgid,
+ const char *msgid_plural, unsigned long int n,
+ int category)
+{
+ size_t msgctxt_len = strlen (msgctxt) + 1;
+ size_t msgid_len = strlen (msgid) + 1;
+ const char *translation;
+#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+ char msg_ctxt_id[msgctxt_len + msgid_len];
+#else
+ char buf[1024];
+ char *msg_ctxt_id =
+ (msgctxt_len + msgid_len <= sizeof (buf)
+ ? buf
+ : (char *) malloc (msgctxt_len + msgid_len));
+ if (msg_ctxt_id != NULL)
+#endif
+ {
+ memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
+ msg_ctxt_id[msgctxt_len - 1] = '\004';
+ memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
+ translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
+#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+ if (msg_ctxt_id != buf)
+ free (msg_ctxt_id);
+#endif
+ if (!(translation == msg_ctxt_id || translation == msgid_plural))
+ return translation;
+ }
+ return (n == 1 ? msgid : msgid_plural);
+}
+
+#if ENABLE_NLS
+ #define _(String) gettext (String)
+ #define N_(String) gettext_noop (String)
+#else
+ #define _(String) (String)
+ #define N_(String) String
+#endif
+
+#if ENABLE_NLS
+int setup_nls(void);
+unused__ static const int nls_init_ = setup_nls();
+#endif
+
+#endif /* _LIBGETTEXT_H */
diff --git a/src/include/icons.h b/src/include/icons.h
new file mode 100644
index 0000000..1687d07
--- /dev/null
+++ b/src/include/icons.h
@@ -0,0 +1,35 @@
+#ifndef ICONS_H_
+#define ICONS_H_
+
+#define USE_IMAGE_LABELS 1
+
+#include <FL/Fl_Widget.H>
+#include <FL/Fl_Menu_Item.H>
+#include <FL/fl_ask.H>
+#include "pixmaps.h"
+
+const char* make_icon_label(const char* text, const char** pixmap = 0);
+
+void set_icon_label(Fl_Menu_Item* item);
+void set_icon_label(Fl_Widget* w);
+
+void toggle_icon_labels(void);
+
+const char* get_icon_label_text(Fl_Menu_Item* item);
+const char* get_icon_label_text(Fl_Widget* w);
+
+void free_icon_label(Fl_Menu_Item* item);
+void free_icon_label(Fl_Widget* w);
+
+void set_active(Fl_Menu_Item* item, bool v);
+void set_active(Fl_Widget* w, bool v);
+
+// fltk message dialogs with nicer icons
+void set_message_icon(const char** pixmap);
+#define fl_input2(...) ({ set_message_icon(dialog_question_48_icon); fl_input(__VA_ARGS__); })
+#define fl_choice2(...) ({ set_message_icon(dialog_question_48_icon); fl_choice(__VA_ARGS__); })
+#define fl_message2(...) ({ set_message_icon(dialog_information_48_icon); fl_message(__VA_ARGS__); })
+#define fl_alert2(...) ({ set_message_icon(dialog_warning_48_icon); fl_alert(__VA_ARGS__); })
+#define fl_warn_choice2(...) ({ set_message_icon(dialog_warning_48_icon); fl_choice(__VA_ARGS__); })
+
+#endif // ICONS_H_
diff --git a/src/include/lgbook.h b/src/include/lgbook.h
new file mode 100644
index 0000000..9c9c974
--- /dev/null
+++ b/src/include/lgbook.h
@@ -0,0 +1,120 @@
+// generated by Fast Light User Interface Designer (fluid) version 1.0302
+
+#ifndef lgbook_h
+#define lgbook_h
+#include <FL/Fl.H>
+#include "flinput2.h"
+#include <FL/Fl_Double_Window.H>
+extern Fl_Double_Window *dlgLogbook;
+#include <FL/Fl_Group.H>
+extern Fl_Group *editGroup;
+#include "calendar.h"
+extern Fl_DateInput *inpDate_log;
+extern Fl_Input2 *inpTimeOn_log;
+extern Fl_DateInput *inpDateOff_log;
+extern Fl_Input2 *inpTimeOff_log;
+extern Fl_Input2 *inpCall_log;
+extern Fl_Input2 *inpName_log;
+extern Fl_Input2 *inpFreq_log;
+extern Fl_Input2 *inpMode_log;
+extern Fl_Input2 *inpRstR_log;
+extern Fl_Input2 *inpRstS_log;
+extern Fl_Input2 *inpTX_pwr_log;
+extern Fl_DateInput *inpQSLrcvddate_log;
+extern Fl_DateInput *inpQSLsentdate_log;
+extern Fl_Input2 *inpCONT_log;
+extern Fl_Input2 *inpDXCC_log;
+extern Fl_Input2 *inpQth_log;
+extern Fl_Input2 *inpState_log;
+extern Fl_Input2 *inpVE_Prov_log;
+extern Fl_Input2 *inpCountry_log;
+extern Fl_Input2 *inpLoc_log;
+extern Fl_Input2 *inpIOTA_log;
+extern Fl_Input2 *inpCQZ_log;
+extern Fl_Input2 *inpITUZ_log;
+extern Fl_Input2 *inpNotes_log;
+#include <FL/Fl_Button.H>
+extern void cb_btnNewSave(Fl_Button*, void*);
+extern Fl_Button *bNewSave;
+extern void cb_btnUpdateCancel(Fl_Button*, void*);
+extern Fl_Button *bUpdateCancel;
+extern void cb_btnDelete(Fl_Button*, void*);
+extern Fl_Button *bDelete;
+extern Fl_Input2 *txtNbrRecs_log;
+extern Fl_Input2 *inpSerNoOut_log;
+extern Fl_Input2 *inpMyXchg_log;
+extern Fl_Input2 *inpSerNoIn_log;
+extern Fl_Input2 *inpXchgIn_log;
+extern Fl_Input2 *inpSearchString;
+extern void cb_search(Fl_Button*, void*);
+extern Fl_Button *bSearchPrev;
+extern Fl_Button *bSearchNext;
+#include "table.h"
+extern Table *wBrowser;
+extern Fl_Double_Window *wExport;
+#include <FL/Fl_Check_Browser.H>
+extern Fl_Check_Browser *chkExportBrowser;
+extern Fl_Button *btnClearAll;
+extern Fl_Button *btnCheckAll;
+#include <FL/Fl_Return_Button.H>
+extern Fl_Return_Button *btnOK;
+extern Fl_Button *btnCancel;
+extern Fl_Button *btnClearAllFields;
+extern Fl_Button *btnCheckAllFields;
+#include <FL/Fl_Check_Button.H>
+extern Fl_Check_Button *btnSelectCall;
+extern Fl_Check_Button *btnSelectName;
+extern Fl_Check_Button *btnSelectFreq;
+extern Fl_Check_Button *btnSelectBand;
+extern Fl_Check_Button *btnSelectMode;
+extern Fl_Check_Button *btnSelectQSOdateOn;
+extern Fl_Check_Button *btnSelectTimeON;
+extern Fl_Check_Button *btnSelectQSOdateOff;
+extern Fl_Check_Button *btnSelectTimeOFF;
+extern Fl_Check_Button *btnSelectTX_pwr;
+extern Fl_Check_Button *btnSelectRSTsent;
+extern Fl_Check_Button *btnSelectRSTrcvd;
+extern Fl_Check_Button *btnSelectQth;
+extern Fl_Check_Button *btnSelectLOC;
+extern Fl_Check_Button *btnSelectState;
+extern Fl_Check_Button *btnSelectProvince;
+extern Fl_Check_Button *btnSelectCountry;
+extern Fl_Check_Button *btnSelectNotes;
+extern Fl_Check_Button *btnSelectQSLrcvd;
+extern Fl_Check_Button *btnSelectQSLsent;
+extern Fl_Check_Button *btnSelectSerialIN;
+extern Fl_Check_Button *btnSelectSerialOUT;
+extern Fl_Check_Button *btnSelectXchgIn;
+extern Fl_Check_Button *btnSelectMyXchg;
+extern Fl_Check_Button *btnSelectCONT;
+extern Fl_Check_Button *btnSelectCQZ;
+extern Fl_Check_Button *btnSelectDXCC;
+extern Fl_Check_Button *btnSelectIOTA;
+extern Fl_Check_Button *btnSelectITUZ;
+extern Fl_Button *btnSetFieldDefaults;
+extern Fl_Double_Window *wCabrillo;
+extern Fl_Check_Browser *chkCabBrowser;
+extern Fl_Button *btnCabClearAll;
+extern Fl_Button *btnCabCheckAll;
+extern Fl_Return_Button *btnCabOK;
+extern Fl_Button *btnCabCancel;
+#include "combo.h"
+extern void setContestType();
+extern Fl_ComboBox *cboContest;
+extern Fl_Check_Button *btnCabCall;
+extern Fl_Check_Button *btnCabFreq;
+extern Fl_Check_Button *btnCabMode;
+extern Fl_Check_Button *btnCabQSOdateOn;
+extern Fl_Check_Button *btnCabTimeOn;
+extern Fl_Check_Button *btnCabQSOdateOff;
+extern Fl_Check_Button *btnCabTimeOff;
+extern Fl_Check_Button *btnCabRSTsent;
+extern Fl_Check_Button *btnCabRSTrcvd;
+extern Fl_Check_Button *btnCabSerialIN;
+extern Fl_Check_Button *btnCabSerialOUT;
+extern Fl_Check_Button *btnCabXchgIn;
+extern Fl_Check_Button *btnCabMyXchg;
+extern Fl_Button *btnCabClearAllFields;
+extern Fl_Button *btnCabCheckAllFields;
+void create_logbook_dialogs();
+#endif
diff --git a/src/include/log.h b/src/include/log.h
new file mode 100644
index 0000000..c833e28
--- /dev/null
+++ b/src/include/log.h
@@ -0,0 +1,23 @@
+#ifndef _LOG_H
+#define _LOG_H
+
+#include <cstdio>
+#include <string>
+
+class cLogfile {
+public:
+ enum log_t { LOG_RX, LOG_TX, LOG_START, LOG_STOP };
+private:
+ FILE* logfile;
+ bool retflag;
+ log_t logtype;
+
+public:
+ cLogfile(const std::string& fname);
+ ~cLogfile();
+ void log_to_file(log_t type, const std::string& s);
+ void log_to_file_start();
+ void log_to_file_stop();
+};
+
+#endif
diff --git a/src/include/logbook.h b/src/include/logbook.h
new file mode 100644
index 0000000..75cceb3
--- /dev/null
+++ b/src/include/logbook.h
@@ -0,0 +1,21 @@
+#ifndef FL_LOGBOOK_H
+#define FL_LOGBOOK_H
+
+
+#include <cstring>
+
+#include "flwkey.h"
+
+#include "lgbook.h"
+#include "logsupport.h"
+
+extern std::string log_checksum;
+
+extern pthread_t logbook_thread;
+extern pthread_mutex_t logbook_mutex;
+
+extern void start_logbook();
+extern void close_logbook();
+
+
+#endif
diff --git a/src/include/logger.h b/src/include/logger.h
new file mode 100644
index 0000000..88c518a
--- /dev/null
+++ b/src/include/logger.h
@@ -0,0 +1,45 @@
+// ----------------------------------------------------------------------------
+// logger.h Remote Log Interface for fldigi
+//
+// Copyright W1HKJ, Dave Freese 2006
+//
+// This file is part of fldigi.
+//
+// Fldigi is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Fldigi 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 fldigi. If not, see <http://www.gnu.org/licenses/>.
+// ----------------------------------------------------------------------------
+
+#ifndef _LOGGER_H
+#define _LOGGER_H
+
+// IPC interface to Xlog and fl_logbook
+
+#define LOG_MVERSION "1"
+#define LOG_MKEY 1238
+#define LOG_MTYPE 88
+
+#define LOG_MSG_LEN 1024
+
+typedef struct {
+ long mtype;
+ char mtext[LOG_MSG_LEN];
+} msgtype;
+
+extern void submit_log();
+
+extern char logdate[];
+extern char logtime[];
+extern char adifdate[];
+extern const char *logmode;
+
+#endif
diff --git a/src/include/logsupport.h b/src/include/logsupport.h
new file mode 100644
index 0000000..90896ff
--- /dev/null
+++ b/src/include/logsupport.h
@@ -0,0 +1,68 @@
+#ifndef LOG_SUPPORT_H
+#define LOG_SUPPORT_h
+
+#include <string>
+
+#include <FL/Fl_Widget.H>
+#include <FL/Fl_Menu_.H>
+
+#include "qso_db.h"
+#include "adif_io.h"
+
+#include "lgbook.h"
+
+#ifdef __WOE32__
+ #define ADIF_SUFFIX "adi"
+#else
+ #define ADIF_SUFFIX "adif"
+#endif
+
+enum savetype {ADIF, CSV, TEXT, LO};
+
+extern cQsoDb qsodb;
+extern cAdifIO adifFile;
+extern std::string logbook_filename;
+extern std::string sDate_on;
+
+extern void loadBrowser(bool keep_pos = false);
+
+extern void Export_log();
+extern void cb_SortByCall();
+extern void cb_SortByDate();
+extern void cb_SortByMode();
+extern void cb_SortByFreq();
+extern void cb_browser(Fl_Widget *, void *);
+
+extern void cb_mnuNewLogbook(Fl_Menu_* m, void* d);
+extern void cb_mnuOpenLogbook(Fl_Menu_* m, void* d);
+extern void cb_mnuSaveLogbook(Fl_Menu_*m, void* d);
+extern void cb_mnuMergeADIF_log(Fl_Menu_* m, void* d);
+extern void cb_mnuExportADIF_log(Fl_Menu_* m, void* d);
+extern void cb_mnuExportCSV_log(Fl_Menu_* m, void* d);
+extern void cb_mnuExportTEXT_log(Fl_Menu_* m, void* d);
+extern void cb_Export_Cabrillo(Fl_Menu_* m, void* d);
+
+extern void saveLogbook();
+extern void cb_mnuShowLogbook(Fl_Menu_ *m, void* d);
+
+extern void activateButtons();
+extern void saveRecord ();
+extern void clearRecord ();
+extern void updateRecord ();
+extern void deleteRecord ();
+extern void AddRecord ();
+extern void SearchLastQSO (const char *);
+extern cQsoRec* SearchLog(const char *callsign);
+extern void DupCheck();
+extern void cb_search(Fl_Widget* w, void*);
+extern int log_search_handler(int);
+extern void restore_sort();
+
+extern void cb_doExport();
+
+extern void WriteCabrillo();
+
+extern void dxcc_entity_cache_enable(bool v);
+bool qsodb_dxcc_entity_find(const char* country);
+
+#endif
diff --git a/src/include/mingw.h b/src/include/mingw.h
new file mode 100644
index 0000000..cef70d1
--- /dev/null
+++ b/src/include/mingw.h
@@ -0,0 +1,97 @@
+#ifndef MINGW_H_
+#define MINGW_H_
+
+#include <sys/types.h>
+#include <pthread.h>
+#include <winsock2.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef int pid_t;
+typedef long suseconds_t;
+#define hstrerror strerror
+
+#ifndef SIGUSR2
+# define SIGUSR2 100
+#endif
+
+/*
+ * simple adaptors
+ */
+
+static inline int mingw_mkdir(const char *path, int mode)
+{
+ return mkdir(path);
+}
+#define mkdir mingw_mkdir
+
+static inline int mingw_unlink(const char *pathname)
+{
+ /* read-only files cannot be removed */
+ chmod(pathname, 0666);
+ return unlink(pathname);
+}
+#define unlink mingw_unlink
+
+/*
+ * implementations of missing functions
+ */
+
+unsigned int sleep (unsigned int seconds);
+char *mingw_getcwd(char *pointer, int len);
+#define getcwd mingw_getcwd
+char *mingw_getenv(const char *name);
+#define getenv mingw_getenv
+int mingw_rename(const char*, const char*);
+#define rename mingw_rename
+
+#ifndef SHUT_WR
+# define SHUT_WR SD_SEND
+#endif
+#ifndef SHUT_RD
+# define SHUT_RD SD_RECEIVE
+#endif
+#ifndef SHUT_RDWR
+# define SHUT_RDWR SD_BOTH
+#endif
+#ifndef EADDRINUSE
+# define EADDRINUSE WSAEADDRINUSE
+#endif
+
+int nanosleep (const struct timespec *req, struct timespec *rem);
+int socketpair(int family, int type, int protocol, int *sv);
+
+/* uname */
+#define UTSNAME_MAX_ 257
+struct utsname
+{
+ char sysname[UTSNAME_MAX_];
+ char nodename[UTSNAME_MAX_];
+ char release[UTSNAME_MAX_];
+ char version[UTSNAME_MAX_];
+ char machine[UTSNAME_MAX_];
+};
+int uname(struct utsname *name);
+
+/* getrusage */
+#define RUSAGE_SELF 0
+#define RUSAGE_CHILDREN (-1)
+struct rusage
+{
+ struct timeval ru_utime;
+ struct timeval ru_stime;
+};
+int getrusage(int who, struct rusage *usage);
+
+/* fsync, fdatasync */
+#include <io.h>
+#define fsync _commit
+#define fdatasync fsync
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/include/pixmaps.h b/src/include/pixmaps.h
new file mode 100644
index 0000000..82aa9f3
--- /dev/null
+++ b/src/include/pixmaps.h
@@ -0,0 +1,90 @@
+// =====================================================================
+//
+// pixmaps.h
+//
+// Author: Dave Freese, W1HKJ
+// Copyright: 2010
+//
+// This software 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. It is
+// copyright under the GNU General Public License.
+//
+// You should have received a copy of the GNU General Public License
+// along with the program; if not, write to the Free Software
+// Foundation, Inc.
+// 59 Temple Place, Suite 330
+// Boston, MA 02111-1307 USA
+//
+// =====================================================================
+
+#ifndef PIXMAPS_H_
+#define PIXMAPS_H_
+
+extern const char *address_book_icon[];
+extern const char *edit_undo_icon[];
+extern const char *edit_select_all_icon[];
+extern const char *edit_clear_icon[];
+extern const char *edit_copy_icon[];
+extern const char *edit_cut_icon[];
+extern const char *edit_paste_icon[];
+extern const char *file_open_icon[];
+extern const char *format_indent_more_icon[];
+extern const char *left_arrow_icon[];
+extern const char *log_out_icon[];
+extern const char *minus_icon[];
+extern const char *net_icon[];
+extern const char *plus_icon[];
+extern const char *process_stop_icon[];
+extern const char *right_arrow_icon[];
+extern const char *save_as_icon[];
+extern const char *save_icon[];
+extern const char *time_icon[];
+extern const char *trash_icon[];
+extern const char *image_icon[];
+extern const char *weather_clear_icon[];
+extern const char *start_here_icon[];
+extern const char *help_browser_icon[];
+extern const char *system_search_icon[];
+extern const char *system_software_update_icon[];
+extern const char *utilities_terminal_icon[];
+extern const char *emblem_symbolic_link_icon[];
+extern const char *emblems_system_icon[];
+extern const char *dialog_information_icon[];
+extern const char *executable_icon[];
+extern const char *other_icon[];
+extern const char *folder_open_icon[];
+extern const char *preferences_system_icon[];
+extern const char *preferences_desktop_font_icon[];
+extern const char *system_users_icon[];
+extern const char *utilities_system_monitor_icon[];
+extern const char *multimedia_player_icon[];
+extern const char *chat_icon[];
+extern const char *dialog_information_48_icon[];
+extern const char *dialog_warning_48_icon[];
+extern const char *refresh_icon[];
+extern const char *text_editor_icon[];
+extern const char *text_icon[];
+extern const char *shutdown_icon[];
+extern const char *applications_system_icon[];
+extern const char *audio_card_icon[];
+extern const char *help_about_icon[];
+extern const char *insert_link_icon[];
+extern const char *close_icon[];
+extern const char *enter_key_icon[];
+extern const char *dialog_question_48_icon[];
+extern const char *clear_sq_icon[];
+extern const char *clear_row_icon[];
+extern const char *rx1_icon[];
+extern const char *tx1_icon[];
+extern const char *rx2_icon[];
+extern const char *tx2_icon[];
+extern const char *rx_icon[];
+extern const char *tx_icon[];
+extern const char *fldigi_icon[];
+extern const char *flarq_icon[];
+extern const char *waterfall_icon[];
+extern const char *dice_icon[];
+extern const char *pskr_icon[];
+
+#endif // PIXMAPS_H_
diff --git a/src/include/qso_db.h b/src/include/qso_db.h
new file mode 100644
index 0000000..b7a6142
--- /dev/null
+++ b/src/include/qso_db.h
@@ -0,0 +1,99 @@
+#ifndef QSO_DB
+#define QSO_DB
+
+#include <iosfwd>
+#include <string>
+#include <cstring>
+
+#include "adif_def.h"
+
+using namespace std;
+
+enum COMPTYPE {COMPTIME, COMPDATE, COMPCALL, COMPFREQ, COMPMODE};
+
+class cQsoRec {
+
+friend int compareCalls (const cQsoRec &, const cQsoRec &);
+friend int compareDates (const cQsoRec &, const cQsoRec &);
+friend int compareTimes (const cQsoRec &, const cQsoRec &);
+friend int compareModes (const cQsoRec &, const cQsoRec &);
+friend int compareFreqs (const cQsoRec &, const cQsoRec &);
+friend std::ostream &operator<<( std::ostream &, const cQsoRec &);
+friend std::istream &operator>>( std::istream &, cQsoRec & );
+
+private:
+ string qsofield[NUMFIELDS];
+ bool normal; // sort ordering
+public:
+ cQsoRec ();
+ ~cQsoRec ();
+ void putField (int, const char *);
+ void putField (int, const char *, int);
+ void addtoField (int, const char *);
+ const char *getField (int);
+ void trimFields();
+ void clearRec ();
+ int validRec();
+ void checkBand();
+// operator overloads
+ const cQsoRec &operator=(const cQsoRec &);
+ bool operator==(const cQsoRec &) const;
+ bool operator<(const cQsoRec &) const;
+ bool operator!=(const cQsoRec &right) const {
+ return !( *this == right);
+ }
+ bool operator<=(const cQsoRec &right) const {
+ if (*this < right || *this == right)
+ return true;
+ return false;
+ }
+ bool operator>(const cQsoRec &right) const {
+ return !(*this <= right);
+ }
+};
+
+class cQsoDb {
+private:
+ cQsoRec * qsorec;
+ int maxrecs;
+ int nbrrecs;
+ int dirty;
+
+ static const int jdays[][13];
+ bool isleapyear( int y );
+ int dayofyear (int year, int mon, int mday);
+ unsigned int epoch_minutes (const char *szdate, const char *sztime);
+public:
+ cQsoDb ();
+ ~cQsoDb ();
+ static bool reverse;
+ void deleteRecs();
+ void clearDatabase();
+ void isdirty(int n) {dirty = n;}
+ int isdirty() {return dirty;}
+ void qsoNewRec (cQsoRec *);
+ void qsoDelRec (int);
+ void qsoUpdRec (int, cQsoRec *);
+ int qsoFindRec (cQsoRec *);
+ cQsoRec *getRec (int n) {return &qsorec[n];};
+ int nbrRecs () {return nbrrecs;};
+ bool qsoIsValidFile(const char *);
+ int qsoReadFile (const char *);
+ int qsoWriteFile (const char *);
+ void SortByDate();
+ void SortByCall ();
+ void SortByMode ();
+ void SortByFreq ();
+ void sort_reverse(bool rev) { reverse = rev;}
+
+ bool duplicate(
+ const char *callsign,
+ const char *date, const char *time, unsigned int interval, bool chkdatetime,
+ const char *freq, bool chkfreq,
+ const char *state, bool chkstate,
+ const char *mode, bool chkmode,
+ const char *xchg1, bool chkxchg1 );
+
+};
+
+#endif
diff --git a/src/include/re.h b/src/include/re.h
new file mode 100644
index 0000000..47ddc10
--- /dev/null
+++ b/src/include/re.h
@@ -0,0 +1,79 @@
+// ----------------------------------------------------------------------------
+// re.h
+//
+// Copyright (C) 2008-2009
+// Stelios Bounanos, M0GLD
+//
+// This file is part of fldigi.
+//
+// fldigi is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// fldigi is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+// ----------------------------------------------------------------------------
+
+#ifndef RE_H_
+#define RE_H_
+
+#if HAVE_REGEX_H
+# include <regex.h>
+#else
+# include "compat/regex.h"
+#endif
+#include <string>
+#include <vector>
+
+class re_t
+{
+public:
+ re_t(const char* pattern_ = "", int cflags_ = 0);
+ re_t(const re_t& re);
+ ~re_t();
+ re_t& operator=(const re_t& rhs);
+ void recompile(const char* pattern_);
+ operator bool(void) const { return !error; }
+ bool operator==(const re_t& o) const { return o.cflags == cflags && o.pattern == pattern; }
+
+ bool match(const char* str, int eflags_ = 0);
+ const std::string& submatch(size_t n) const;
+ void suboff(size_t n, int* start, int* end) const;
+ const std::vector<regmatch_t>& suboff(void) const { return suboffsets; }
+
+ size_t nsub(void) const { return suboffsets.size(); }
+ const std::string& re(void) const { return pattern; }
+ int cf(void) const { return cflags; }
+
+ size_t hash(void) const;
+protected:
+ void compile(void);
+
+ std::string pattern;
+ int cflags, eflags;
+ regex_t preg;
+ std::vector<regmatch_t> suboffsets;
+ std::vector<std::string> substrings;
+ bool error;
+ bool need_substr;
+};
+
+class fre_t : public re_t
+{
+public:
+ fre_t(const char* pattern_, int cflags_ = 0);
+ bool match(const char* str, int eflags_ = 0);
+};
+
+#endif // RE_H_
+
+// Local Variables:
+// mode: c++
+// c-file-style: "linux"
+// End:
diff --git a/src/include/serial.h b/src/include/serial.h
new file mode 100644
index 0000000..7e1dd6d
--- /dev/null
+++ b/src/include/serial.h
@@ -0,0 +1,211 @@
+// SerialComm.h: interface for the Cserial class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#ifndef SERIAL_H
+#define SERIAL_H
+
+#include <string>
+
+using namespace std;
+
+#ifndef __WIN32__
+
+#include <termios.h>
+
+class Cserial {
+public:
+ Cserial();
+ ~Cserial();
+
+//Methods
+ bool OpenPort();
+ bool CheckPort(string);
+
+ bool IsOpen() { return fd < 0 ? 0 : 1; };
+ void ClosePort();
+
+ void Device (std::string dev) { device = dev;};
+ std::string Device() { return device;};
+
+ void Baud(int b) { baud = b;};
+ int Baud() { return baud;};
+
+ void Timeout(int tm) { timeout = tm;}
+ int Timeout() { return timeout; }
+
+ void Retries(int r) { retries = r;}
+ int Retries() { return retries;}
+
+ void RTS(bool r){rts = r;}
+ bool RTS(){return rts;}
+ void setRTS(bool r);
+
+ void RTSptt(bool b){rtsptt = b;}
+ bool RTSptt(){return rtsptt;}
+
+ void DTR(bool d){dtr = d;}
+ bool DTR(){return dtr;}
+ void setDTR(bool d);
+
+ void DTRptt(bool b){dtrptt = b;}
+ bool DTRptt(){return dtrptt;}
+
+ void RTSCTS(bool b){rtscts = b;}
+ bool RTSCTS(){return rtscts;}
+ void SetPTT(bool b);
+
+ void Stopbits(int n) {stopbits = (n == 1 ? 1 : 2);}
+ int Stopbits() { return stopbits;}
+
+ bool ReadByte(unsigned char &resp);
+ int ReadBuffer (char *b, int nbr);
+ int WriteBuffer(const char *str, int nbr);
+ void FlushBuffer();
+
+
+private:
+//Members
+ std::string device;
+ int fd;
+ int baud;
+ int speed;
+ struct termios oldtio, newtio;
+ int timeout;
+ int retries;
+ int status, origstatus;
+ bool dtr;
+ bool dtrptt;
+ bool rts;
+ bool rtsptt;
+ bool rtscts;
+ int stopbits;
+ char bfr[2048];
+//Methods
+ bool IOselect();
+};
+
+//=============================================================================
+// MINGW serial port implemenation
+//=============================================================================
+
+#else //__WIN32__
+
+#include <windows.h>
+
+class Cserial {
+public:
+ Cserial() {
+ rts = dtr = false;
+ rtsptt = dtrptt = false;
+ rtscts = false;
+ baud = CBR_9600;
+ stopbits = 2;
+ hComm = 0;
+ };
+ Cserial( std::string portname) {
+ device = portname;
+ Cserial();
+// OpenPort();
+ };
+ virtual ~Cserial() {};
+
+//Methods
+ bool OpenPort();
+ bool IsOpen();
+ bool CheckPort(string);
+ void ClosePort();
+ bool ConfigurePort(DWORD BaudRate,BYTE ByteSize,DWORD fParity,BYTE Parity,BYTE StopBits);
+
+ bool IsBusy() { return busyflag; };
+ void IsBusy(bool val) { busyflag = val; };
+
+ bool ReadByte(unsigned char &resp);
+ int ReadData (char *b, int nbr);
+ int ReadBuffer (char *b, int nbr) {
+ return ReadData (b,nbr);
+ }
+ int ReadChars (char *b, int nbr, int msec);
+ DWORD GetBytesRead();
+
+ bool WriteByte(char bybyte);
+ DWORD GetBytesWritten();
+ int WriteBuffer(const char *str, int nbr);
+
+ bool SetCommunicationTimeouts(DWORD ReadIntervalTimeout,DWORD ReadTotalTimeoutMultiplier,DWORD ReadTotalTimeoutConstant,DWORD WriteTotalTimeoutMultiplier,DWORD WriteTotalTimeoutConstant);
+ bool SetCommTimeout();
+
+ void Timeout(int tm) { timeout = tm; return; };
+ int Timeout() { return timeout; };
+ void FlushBuffer();
+
+ void Device (std::string dev) { device = dev;};
+ std::string Device() { return device;};
+
+ void Baud(int b) { baud = b;};
+ int Baud() { return baud;};
+
+ void Retries(int r) { retries = r;}
+ int Retries() { return retries;}
+
+ void RTS(bool r){rts = r;}
+ bool RTS(){return rts;}
+ void setRTS(bool b);
+
+ void RTSptt(bool b){rtsptt = b;}
+ bool RTSptt(){return rtsptt;}
+
+ void DTR(bool d){dtr = d;}
+ bool DTR(){return dtr;}
+ void setDTR(bool b);
+
+ void DTRptt(bool b){dtrptt = b;}
+ bool DTRptt(){return dtrptt;}
+
+ void RTSCTS(bool b){rtscts = b;}
+ bool RTSCTS(){return rtscts;}
+ void SetPTT(bool b);
+
+ void Stopbits(int n) {stopbits = (n == 1 ? 1 : 2);}
+ int Stopbits() { return stopbits;}
+
+//Members
+private:
+ std::string device;
+ //For use by CreateFile
+ HANDLE hComm;
+
+ //DCB Defined in WinBase.h
+ DCB dcb;
+ COMMTIMEOUTS CommTimeoutsSaved;
+ COMMTIMEOUTS CommTimeouts;
+
+ //Is the Port Ready?
+ bool bPortReady;
+
+ //Number of Bytes Written to port
+ DWORD nBytesWritten;
+
+ //Number of Bytes Read from port
+ DWORD nBytesRead;
+
+ //Number of bytes Transmitted in the cur session
+ DWORD nBytesTxD;
+
+ int timeout;
+ bool busyflag;
+
+ int baud;
+ int retries;
+
+ bool dtr;
+ bool dtrptt;
+ bool rts;
+ bool rtsptt;
+ bool rtscts;
+ int stopbits;
+};
+
+#endif // __WIN32__
+
+#endif // SERIAL_H
diff --git a/src/include/status.h b/src/include/status.h
new file mode 100644
index 0000000..2b7124e
--- /dev/null
+++ b/src/include/status.h
@@ -0,0 +1,101 @@
+#ifndef _status_H
+#define _status_H
+
+#include <string>
+#include <FL/Fl.H>
+#include <FL/Enumerations.H>
+
+#include "flwkey.h"
+
+using namespace std;
+
+struct status {
+ int mainX;
+ int mainY;
+ string serial_port_name;
+ int comm_baudrate;
+ int stopbits;
+ int comm_retries;
+ int comm_wait;
+ int comm_timeout;
+ bool comm_echo;
+// bool comm.rtscts;
+// bool comm.rts;
+// bool comm.dtr;
+
+ int serloop_timing;
+
+// wkeyer values
+ unsigned char mode_register;
+ unsigned char speed_wpm;
+ unsigned char sidetone;
+ unsigned char weight;
+ unsigned char lead_in_time;
+ unsigned char tail_time;
+ unsigned char min_wpm;
+ unsigned char rng_wpm;
+ unsigned char first_extension;
+ unsigned char key_compensation;
+ unsigned char farnsworth_wpm;
+ unsigned char paddle_setpoint;
+ unsigned char dit_dah_ratio;
+ unsigned char pin_configuration;
+ unsigned char dont_care;
+
+ bool cut_zeronine;
+ unsigned char cmd_wpm;
+ bool use_pot;
+
+// message store
+ string label_1;
+ string edit_msg1;
+ string label_2;
+ string edit_msg2;
+ string label_3;
+ string edit_msg3;
+ string label_4;
+ string edit_msg4;
+ string label_5;
+ string edit_msg5;
+ string label_6;
+ string edit_msg6;
+ string label_7;
+ string edit_msg7;
+ string label_8;
+ string edit_msg8;
+ string label_9;
+ string edit_msg9;
+ string label_10;
+ string edit_msg10;
+ string label_11;
+ string edit_msg11;
+ string label_12;
+ string edit_msg12;
+
+// message tags
+ string tag_cll;
+ string tag_qth;
+ string tag_loc;
+ string tag_opr;
+
+// logbook entries
+ string logbookfilename;
+ bool xml_logbook;
+ string log_address;
+ string log_port;
+
+// contest data
+ int serial_nbr;
+ int time_span;
+ bool band;
+ bool zeros;
+ bool dups;
+ string xout;
+
+ void saveLastState();
+ void loadLastState();
+};
+
+extern status progStatus;
+
+#endif
diff --git a/src/include/support.h b/src/include/support.h
new file mode 100644
index 0000000..01ce175
--- /dev/null
+++ b/src/include/support.h
@@ -0,0 +1,135 @@
+#ifndef SUPPORT_H
+#define SUPPORT_H
+
+#include <fstream>
+#include <vector>
+#include <string>
+
+#include <math.h>
+#ifndef WIN32
+#include <sys/ipc.h>
+#include <sys/msg.h>
+#include <sys/shm.h>
+#endif
+
+#include "flwkey.h"
+#include "wkey_io.h"
+#include "serial.h"
+#include "status.h"
+
+#include <FL/fl_show_colormap.H>
+#include <FL/fl_ask.H>
+
+extern Cserial WKEY_serial;
+
+extern bool bypass_serial_thread_loop;
+
+extern void * serial_thread_loop(void *);
+extern void cb_events();
+extern void cbExit();
+extern int main_handler(int);
+
+extern void config_comm_port();
+extern void cbCancelSetupDialog();
+extern void cbOkSetupDialog();
+
+extern void open_wkeyer();
+
+extern void cb_clear_text_to_send();
+extern void send_char(void *);
+extern void cb_cancel_transmit();
+extern void cb_transmit_text();
+extern void cb_send_button();
+extern void set_wpm();
+extern void use_pot_changed();
+extern void load_defaults();
+extern void check_call();
+
+extern void config_parameters();
+extern void config_messages();
+extern void done_parameters();
+
+extern void update_msg_labels();
+extern void apply_edit();
+extern void done_edit();
+extern void cancel_edit();
+
+extern void change_choice_keyer_mode();
+extern void change_choice_output_pins();
+extern void change_choice_sidetone();
+extern void change_choice_hang();
+extern void change_cntr_tail();
+extern void change_cntr_leadin();
+extern void change_cntr_weight();
+extern void change_cntr_sample();
+extern void change_cntr_first_ext();
+extern void change_cntr_comp();
+extern void change_cntr_ratio();
+extern void change_cntr_cmd_wpm();
+extern void change_cntr_farnsworth();
+extern void change_cntr_rng_wpm();
+extern void change_cntr_min_wpm();
+extern void change_btn_sidetone_on();
+extern void change_btn_tone_on();
+extern void change_btn_ptt_on();
+extern void change_btn_cut_zeronine();
+extern void change_btn_paddledog();
+extern void change_btn_ct_space();
+extern void change_btn_auto_space();
+extern void change_btn_swap();
+extern void change_btn_paddle_echo();
+extern void change_btn_serial_echo();
+
+extern void cb_tune();
+
+extern void exec_msg1();
+extern void exec_msg2();
+extern void exec_msg3();
+extern void exec_msg4();
+extern void exec_msg5();
+extern void exec_msg6();
+extern void exec_msg7();
+extern void exec_msg8();
+extern void exec_msg9();
+extern void exec_msg10();
+extern void exec_msg11();
+extern void exec_msg12();
+
+extern void open_operator_dialog();
+extern void cb_done_op_dialog();
+extern void change_txt_cll();
+extern void change_txt_qth();
+extern void change_txt_loc();
+extern void change_txt_opr();
+
+extern void cb_mnuNewLogbook();
+extern void cb_mnuOpenLogbook();
+extern void cb_mnuSaveLogbook();
+extern void cb_mnuMergeADIF_log();
+extern void cb_mnuExportADIF_log();
+extern void cb_mnuExportTEXT_log();
+extern void cb_mnuExportCSV_log();
+extern void cb_Export_Cabrillo();
+extern void cb_mnuShowLogbook();
+
+extern void serial_nbr();
+extern void zeros();
+extern void dups();
+extern void time_span();
+extern void ck_band();
+
+extern void AddRecord();
+extern void about();
+extern void on_line_help();
+
+extern void cb_contest();
+extern void close_contest();
+extern void connect_to_server();
+extern void xml_get_record(const char *callsign);
+extern void xml_add_record();
+extern void xml_check_dup();
+
+extern char *szTime(int);
+extern char *szDate(int);
+
+#endif
diff --git a/src/include/table.h b/src/include/table.h
new file mode 100644
index 0000000..b431653
--- /dev/null
+++ b/src/include/table.h
@@ -0,0 +1,219 @@
+/*
+ Copyright (c) 2004 Markus Niemist�
+
+ 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 AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+*/
+
+#ifndef __TABLE_HH
+#define __TABLE_HH
+
+#include <FL/Enumerations.H>
+#include <FL/Fl_Widget.H>
+#include <FL/Fl_Scrollbar.H>
+#include <FL/Fl_Menu_Item.H>
+#include <FL/Fl_Group.H>
+#include <vector>
+
+#define TABLE_WHEN_DCLICK 16
+
+enum SCROLLS {always, never, var};
+
+struct ColumnInfo {
+ bool hidden;
+ const char *title;
+ int width;
+ Fl_Align align;
+ Fl_Align hdr_align;
+ int (*comparator)(const char*, const char*);
+ void (*callback)();
+};
+
+int compareInt(const char *val1, const char *val2);
+
+
+class Table : public Fl_Group {
+private:
+ // Scrollbars
+ Fl_Scrollbar *hScroll, *vScroll;
+ SCROLLS Vscroll;
+ SCROLLS Hscroll;
+
+ // Popup menu
+ const Fl_Menu_Item *popupMenu;
+ bool menuAlloc;
+
+ // Column data
+ std::vector<struct ColumnInfo> header;
+
+ // Cell data
+ std::vector<char**> data;
+ bool (*highlighter)(int, char **, Fl_Color *);
+
+ // Table dimensions
+ int tableHeight, tableWidth;
+ int oX, oY, oW, oH; // Outer dimensions (widget - box)
+ int iX, iY, iW, iH; /*
+ * Table area dimensions
+ * (outer dimension - header - scrollbars)
+ */
+
+ // For optimization
+ int topRow, bottomRow, leftCol, rightCol;
+ int topRowY, leftColX;
+
+ int nCols, nRows; // Number of rows and columns
+ int cPos; // Column where new entry is added.
+
+ int resizing, dragX;
+ int pushed;
+ int sortColumn;
+
+ // Object sizes
+ int scrollbarSize;
+ int headerHeight;
+ int rowHeight;
+
+ int selected;
+ char **curRow;
+
+ // Various flags
+ bool ascent;
+ bool canResize, canSort;
+ bool noMoreColumns;
+ bool toBeSorted;
+ bool dimensionsChanged;
+ bool headerEnabled;
+
+ bool withGrid;
+
+ void dSort(int start, int end, int (*compare)(const char *, const char*));
+ void aSort(int start, int end, int (*compare)(const char *, const char*));
+
+protected:
+ virtual int handle(int event);
+
+ virtual void drawHeader(int x, int y);
+ virtual void drawRow(int row, char *rowData[], int x, int y);
+
+ virtual void draw();
+ virtual void resize(int x, int y, int w, int h);
+
+ void calcDimensions();
+ void scrolled();
+ void resized();
+
+ static void scrollCallback(Fl_Widget *widget, void *data);
+
+public:
+ Table(int x, int y, int w, int h, char *label = NULL);
+ ~Table();
+
+ bool headerOn() const;
+ void headerOn(bool enabled);
+ bool allowResize() const;
+ void allowResize(bool allow);
+ bool allowSort() const;
+ void allowSort(bool allow);
+ bool gridEnabled() const;
+ void gridEnabled(bool enable);
+
+ int headerSize() const;
+ void headerSize(int height);
+ int rowSize() const;
+ void rowSize(int height);
+ int scrollbSize() const;
+ void scrollbSize(int size);
+
+ Fl_Align headerAlign(int column) const;
+ void headerAlign(int column, Fl_Align align);
+
+ Fl_Align columnAlign(int column) const;
+ void columnAlign(int column, Fl_Align align);
+
+ int columnWidth(int column) const;
+ void columnWidth(int column, int width);
+
+ const char *columnTitle(int column);
+ void columnTitle(int column, const char *title);
+
+ bool columnHidden(int column);
+ void columnHidden(int column, bool hidden);
+
+ void sort();
+ void sort(int column, bool ascent);
+ void getSort(int &sortColumn, bool &ascent);
+
+ void setHighlighter(bool (*highlighter)(int, char **, Fl_Color *));
+
+ void addColumn(const char *label, int width = 150,
+ Fl_Align align = (Fl_Align)(FL_ALIGN_LEFT | FL_ALIGN_CLIP),
+ int (*comparator)(const char*, const char*) = NULL);
+
+ void colcomparator (int column,
+ int (*comparator)(const char*, const char*) = NULL);
+
+ void colcallback (int column,
+ void (*callback)() = NULL);
+
+ void addHiddenColumn(const char *label);
+
+ void addCell(char *data);
+ void addRow(int cols, ...);
+ void addFromTSV(const char *data);
+ void removeRow(int row);
+ void clear(bool removeColumns = false);
+
+ void where(int x, int y, int &row, int &column, int &resize);
+ void scrollTo(int pos);
+ int scrollPos() const;
+
+ int columns();
+ int rows();
+ void value(int selection);
+ int value();
+ char *valueAt(int row, int column);
+ int intValueAt(int row, int column);
+ void valueAt(int row, int column, char *data);
+ void valueAt(int row, int column, int data);
+
+ const char **getRow(int row);
+
+ const Fl_Menu_Item *menu();
+ void menu(const Fl_Menu_Item *m);
+ void menuCopy(const Fl_Menu_Item *m);
+ void menuClear();
+
+ void allowVscroll(SCROLLS when) {Vscroll = when;}
+ void allowHscroll(SCROLLS when) {Hscroll = when;}
+
+ void FirstRow ();
+ void PrevRow ();
+ void NextRow ();
+ void LastRow ();
+ void PrevPage ();
+ void NextPage ();
+ void GotoRow (int);
+
+ bool search(int& row, int& col, bool rev, const char* re);
+};
+
+#endif
diff --git a/src/include/textio.h b/src/include/textio.h
new file mode 100644
index 0000000..109f0c3
--- /dev/null
+++ b/src/include/textio.h
@@ -0,0 +1,21 @@
+#ifndef MULTIPSK_H
+#define MULTIPSK_H
+
+#include "qso_db.h"
+
+class cTextFile {
+private:
+ char header[120];
+ void makeHeader();
+ char *adif_to_date( char *s);
+ char *adif_to_time( char *s);
+public:
+ cTextFile () {};
+ ~cTextFile () {};
+ void writeCSVHeader(FILE *);
+ int writeCSVFile (const char *, cQsoDb *);
+ void writeTXTHeader(FILE *);
+ int writeTXTFile (const char *, cQsoDb *);
+};
+
+#endif
diff --git a/src/include/threads.h b/src/include/threads.h
new file mode 100644
index 0000000..888be21
--- /dev/null
+++ b/src/include/threads.h
@@ -0,0 +1,95 @@
+#ifndef THREADS_H_
+#define THREADS_H_
+
+#include <config.h>
+
+#include <pthread.h>
+#include <stdint.h>
+
+#include <semaphore.h>
+#if !HAVE_SEM_TIMEDWAIT
+# include <time.h>
+int sem_timedwait(sem_t* sem, const struct timespec* abs_timeout);
+#endif
+
+int sem_timedwait_rel(sem_t* sem, double rel_timeout);
+int pthread_cond_timedwait_rel(pthread_cond_t* cond, pthread_mutex_t* mutex, double rel_timeout);
+
+enum {
+ INVALID_TID = -1,
+ TRX_TID, QRZ_TID, RIGCTL_TID, NORIGCTL_TID,
+#if USE_XMLRPC
+ XMLRPC_TID,
+#endif
+ ARQ_TID, ARQSOCKET_TID,
+ FLMAIN_TID,
+ NUM_THREADS, NUM_QRUNNER_THREADS = NUM_THREADS - 1
+};
+
+#ifdef __linux__
+void linux_log_tid(void);
+# define LOG_THREAD_ID() linux_log_tid()
+#else
+# define LOG_THREAD_ID() /* nothing */
+#endif
+
+#if USE_TLS
+# define THREAD_ID_TYPE __thread intptr_t
+# define CREATE_THREAD_ID() thread_id_ = INVALID_TID
+# define SET_THREAD_ID(x) do { thread_id_ = (x); LOG_THREAD_ID(); } while (0)
+# define GET_THREAD_ID() thread_id_
+#else
+# define THREAD_ID_TYPE pthread_key_t
+# define CREATE_THREAD_ID() pthread_key_create(&thread_id_, NULL)
+# define SET_THREAD_ID(x) do { pthread_setspecific(thread_id_, (const void *)(x + 1)); LOG_THREAD_ID(); } while (0)
+# define GET_THREAD_ID() ((intptr_t)pthread_getspecific(thread_id_) - 1)
+#endif // USE_TLS
+extern THREAD_ID_TYPE thread_id_;
+
+
+#ifndef NDEBUG
+# include "debug.h"
+bool thread_in_list(int id, const int* list);
+# define ENSURE_THREAD(...) \
+ do { \
+ int id_ = GET_THREAD_ID(); \
+ int t_[] = { __VA_ARGS__, INVALID_TID }; \
+ if (!thread_in_list(id_, t_)) \
+ LOG_ERROR("bad thread context: %d", id_); \
+ } while (0)
+# define ENSURE_NOT_THREAD(...) \
+ do { \
+ int id_ = GET_THREAD_ID(); \
+ int t_[] = { __VA_ARGS__, INVALID_TID }; \
+ if (thread_in_list(id_, t_)) \
+ LOG_ERROR("bad thread context: %d", id_); \
+ } while (0)
+#else
+# define ENSURE_THREAD(...) ((void)0)
+# define ENSURE_NOT_THREAD(...) ((void)0)
+#endif // ! NDEBUG
+
+
+// On POSIX systems we cancel threads by sending them SIGUSR2,
+// which will also interrupt blocking calls. On woe32 we use
+// pthread_cancel and there is no good/sane way to interrupt.
+#ifndef __WOE32__
+# define SET_THREAD_CANCEL() \
+ do { \
+ sigset_t usr2; \
+ sigemptyset(&usr2); \
+ sigaddset(&usr2, SIGUSR2); \
+ pthread_sigmask(SIG_UNBLOCK, &usr2, NULL); \
+ } while (0)
+# define TEST_THREAD_CANCEL() /* nothing */
+# define CANCEL_THREAD(t__) pthread_kill(t__, SIGUSR2)
+#else
+// threads have PTHREAD_CANCEL_ENABLE, PTHREAD_CANCEL_DEFERRED when created
+# define SET_THREAD_CANCEL() /* nothing */
+# define TEST_THREAD_CANCEL() pthread_testcancel()
+# define CANCEL_THREAD(t__) pthread_cancel(t__);
+#endif
+
+#include "fl_lock.h"
+
+#endif // !THREADS_H_
diff --git a/src/include/timeops.h b/src/include/timeops.h
new file mode 100644
index 0000000..ee2588d
--- /dev/null
+++ b/src/include/timeops.h
@@ -0,0 +1,33 @@
+#ifndef TIMEOPS_H_
+#define TIMEOPS_H_
+
+#include <config.h>
+#include <time.h>
+#include <sys/time.h>
+#ifdef __MINGW32__
+# include <pthread.h>
+#endif
+
+#if !HAVE_CLOCK_GETTIME
+enum clockid_t { CLOCK_REALTIME, CLOCK_MONOTONIC };
+int clock_gettime(clockid_t clock_id, struct timespec* tp);
+#endif
+
+struct timespec operator+(const struct timespec &t0, const double &t);
+struct timespec operator-(const struct timespec &t0, const struct timespec &t1);
+struct timespec& operator-=(struct timespec &t0, const struct timespec &t1);
+bool operator>(const struct timespec &t0, const struct timespec &t1);
+bool operator==(const struct timespec &t0, const struct timespec &t1);
+
+struct timeval operator+(const struct timeval &t0, const double &t);
+struct timeval operator-(const struct timeval &t0, const struct timeval &t1);
+struct timeval& operator-=(struct timeval &t0, const struct timeval &t1);
+bool operator>(const struct timeval &t0, const struct timeval &t1);
+bool operator==(const struct timeval &t0, const struct timeval &t1);
+
+#ifndef GMTIME_R
+extern struct tm *gmtime_r(const time_t *timer, struct tm *tmbuf);
+extern struct tm *localtime_r(const time_t *_Time,struct tm *_Tm);
+#endif
+
+#endif // TIMEOPS_H_
diff --git a/src/include/util.h b/src/include/util.h
new file mode 100644
index 0000000..66a3b1e
--- /dev/null
+++ b/src/include/util.h
@@ -0,0 +1,186 @@
+/* This file is included by config.h */
+
+#ifndef UTIL_H
+#define UTIL_H
+
+#include "config.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef __STDC_FORMAT_MACROS
+# define __STDC_FORMAT_MACROS 1
+#endif
+#include <inttypes.h>
+
+#ifndef powerof2
+# define powerof2(n) ((((n) - 1) & (n)) == 0)
+#endif
+#ifndef MAX
+# define MAX(a, b) (((a) > (b)) ? (a) : (b))
+#endif
+#ifndef MIN
+# define MIN(a, b) (((a) < (b)) ? (a) : (b))
+#endif
+#ifndef CLAMP
+# define CLAMP(x, low, high) (((x)>(high))?(high):(((x)<(low))?(low):(x)))
+#endif
+#define WCLAMP(x, low, high) (((x)>(high))?(low):(((x)<(low))?(high):(x)))
+
+#ifdef __GNUC__
+# if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)
+# define full_memory_barrier() __sync_synchronize()
+# define read_memory_barrier() full_memory_barrier()
+# define write_memory_barrier() full_memory_barrier()
+# elif defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__) || defined(__x86_64__)
+# define full_memory_barrier() asm volatile ("lock; addl $0,0(%%esp)":::"memory")
+# define read_memory_barrier() full_memory_barrier()
+# define write_memory_barrier() full_memory_barrier()
+/*
+ These would be faster on SSE2-capable processors:
+# define full_memory_barrier() asm volatile ("mfence":::"memory")
+# define read_memory_barrier() asm volatile ("lfence":::"memory")
+# define write_memory_barrier() asm volatile ("sfence":::"memory")
+*/
+# elif defined(__ppc__) || defined(__powerpc__) || defined(__PPC__)
+# define full_memory_barrier() asm volatile("sync":::"memory")
+# define read_memory_barrier() full_memory_barrier()
+# define write_memory_barrier() full_memory_barrier()
+# else
+# warning Memory barriers not defined on this system
+# define full_memory_barrier() ((void)0)
+# define read_memory_barrier() full_memory_barrier()
+# define write_memory_barrier() full_memory_barrier()
+# endif
+#else
+# warning Memory barriers not defined on this system
+# define full_memory_barrier() ((void)0)
+# define read_memory_barrier() full_memory_barrier()
+# define write_memory_barrier() full_memory_barrier()
+#endif
+
+/* http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html */
+#if defined(__GNUC__) && (__GNUC__ >= 3)
+# define likely(x) __builtin_expect (!!(x), 1)
+# define unlikely(x) __builtin_expect (!!(x), 0)
+# define used__ __attribute__ ((__used__))
+# define unused__ __attribute__ ((__unused__))
+# define must_check__ __attribute__ ((__warn_unused_result__))
+# define deprecated__ __attribute__ ((__deprecated__))
+# define noreturn__ __attribute__ ((__noreturn__))
+# define pure__ __attribute__ ((__pure__))
+# define const__ __attribute__ ((__const__))
+# define malloc__ __attribute__ ((__malloc__))
+# define packed__ __attribute__ ((__packed__))
+# define inline__ inline __attribute__ ((__always_inline__))
+# define noinline__ __attribute__ ((__noinline__))
+# define nonnull__(x) __attribute__ ((__nonnull__(x)))
+# define format__(type_, index_, first_) __attribute__ ((format(type_, index_, first_)))
+#else
+# define likely(x) (x)
+# define unlikely(x) (x)
+# define used__
+# define unused__
+# define must_check__
+# define deprecated__
+# define noreturn__
+# define pure__
+# define const__
+# define malloc__
+# define packed__
+# define inline__
+# define noinline__
+# define nonnull__(x)
+# define format__(type_, index_, first_)
+#endif
+
+#if defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
+# define hot__ __attribute__ ((__hot__))
+# define cold__ __attribute__ ((__cold__))
+#else
+# define hot__
+# define cold__
+#endif
+
+#include <stddef.h>
+
+const__ uint32_t ceil2(uint32_t n);
+const__ uint32_t floor2(uint32_t n);
+
+#if !HAVE_STRCASESTR || __WIN32__
+char* strcasestr(const char* haystack, const char* needle);
+#endif
+
+#if !HAVE_STRLCPY || __WIN32__
+size_t strlcpy(char* dest, const char* src, size_t size);
+#endif
+
+int set_cloexec(int fd, unsigned char v);
+int set_nonblock(int fd, unsigned char v);
+int set_nodelay(int fd, unsigned char v);
+int get_bufsize(int fd, int dir, int* len);
+int set_bufsize(int fd, int dir, int len);
+
+unsigned long ver2int(const char* version);
+
+void save_signals(void);
+void restore_signals(void);
+
+void MilliSleep(long msecs);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#ifdef __cplusplus
+uint32_t simple_hash_data(const unsigned char* buf, size_t len, uint32_t code = 0);
+uint32_t simple_hash_str(const unsigned char* str, uint32_t code = 0);
+#endif
+
+#ifdef __cplusplus
+const char* str2hex(const unsigned char* str, size_t len);
+const char* str2hex(const char* str, size_t len = 0);
+#else
+const char* str2hex(const unsigned* str, size_t len);
+#endif
+
+const char* uint2bin(unsigned u, size_t len);
+void MilliSleep(long msecs);
+
+#if !defined(NDEBUG) && defined(deprecated__) && defined(__GNUC__) && !defined(__WIN32__)
+#include <stdio.h>
+#include <string.h>
+deprecated__ typeof(sprintf) sprintf;
+/* there are far too many of these in the qrz code
+deprecated__ typeof(strcpy) strcpy;
+deprecated__ typeof(strcat) strcat;
+*/
+#endif
+
+#ifdef __WIN32__
+# define NOMINMAX 1
+#endif
+
+#ifndef __WIN32__
+# define PRIuSZ "zu"
+# define PRIdSZ "zd"
+#else
+# define PRIuSZ "Iu"
+# define PRIdSZ "Id"
+#endif
+
+#ifndef __WIN32__
+# define PATH_SEP "/"
+#else
+# define PATH_SEP "\\"
+#endif
+
+#endif /* UTIL_H */
+
+/*
+Local Variables:
+mode: c++
+c-file-style: "linux"
+End:
+*/
diff --git a/src/include/wkey_dialogs.h b/src/include/wkey_dialogs.h
new file mode 100644
index 0000000..55951af
--- /dev/null
+++ b/src/include/wkey_dialogs.h
@@ -0,0 +1,152 @@
+// generated by Fast Light User Interface Designer (fluid) version 1.0302
+
+#ifndef wkey_dialogs_h
+#define wkey_dialogs_h
+#include <FL/Fl.H>
+#include <FL/Fl_Double_Window.H>
+#include "combo.h"
+extern Fl_ComboBox *selectCommPort;
+#include <FL/Fl_Input.H>
+extern Fl_Input *inpXmlAddress;
+extern Fl_Input *inpXmlPort;
+#include <FL/Fl_Return_Button.H>
+extern Fl_Return_Button *btn_ser_port_ok;
+#include <FL/Fl_Button.H>
+extern Fl_Button *btn_serial_port_cancel;
+Fl_Double_Window* SetupDialog();
+#include <FL/Fl_Menu_Bar.H>
+#include "FTextView.h"
+extern FTextView *txt_sent;
+#include "FTextRXTX.h"
+extern FTextTX *txt_to_send;
+#include <FL/Fl_Light_Button.H>
+extern Fl_Light_Button *btn_send;
+extern Fl_Light_Button *btn_tune;
+extern Fl_Button *btn_cancel;
+#include <FL/Fl_Box.H>
+extern Fl_Box *box_busy;
+extern Fl_Box *box_keydown;
+extern Fl_Box *box_break_in;
+extern Fl_Box *box_xoff;
+extern Fl_Box *box_wait;
+#include <FL/Fl_Output.H>
+extern Fl_Output *txt_wpm;
+#include <FL/Fl_Counter.H>
+extern Fl_Counter *cntr_wpm;
+#include <FL/Fl_Check_Button.H>
+extern Fl_Check_Button *btn_use_pot;
+extern Fl_Button *btn_msg1;
+extern Fl_Button *btn_msg2;
+extern Fl_Button *btn_msg3;
+extern Fl_Button *btn_msg4;
+extern Fl_Button *btn_msg5;
+extern Fl_Button *btn_msg6;
+extern Fl_Button *btn_msg7;
+extern Fl_Button *btn_msg8;
+extern Fl_Button *btn_msg9;
+extern Fl_Button *btn_msg10;
+extern Fl_Button *btn_msg11;
+extern Fl_Button *btn_msg12;
+#include "flinput2.h"
+extern Fl_Input2 *txt_sta;
+extern Fl_Input2 *txt_name;
+extern Fl_Input2 *txt_xchg;
+extern Fl_Button *btn_log_it;
+extern Fl_Button *btn_clear;
+extern Fl_Input *txt_freq;
+Fl_Double_Window* WKey_window();
+extern unsigned char menu__i18n_done;
+extern Fl_Menu_Item menu_[];
+#define mnu_exit (menu_+1)
+#define mnu_sel_port (menu_+4)
+#define mnu_parameters (menu_+5)
+#define mnu_messages (menu_+6)
+#define mnu_operator (menu_+7)
+#define mnu_Logbook (menu_+9)
+#define mnu_display_log (menu_+10)
+#define mnu_new_log (menu_+11)
+#define mnu_open_logbook (menu_+12)
+#define mnu_save_logbook (menu_+13)
+#define mnu_merge_logbook (menu_+14)
+#define mnu_export_adif (menu_+15)
+#define mnu_export_logbook_text (menu_+16)
+#define mnu_export_logbook_csv (menu_+17)
+#define mnu_export_cabrillo (menu_+18)
+#define mnu_log_client (menu_+19)
+#define mnu_contest (menu_+21)
+#define mnu_events (menu_+22)
+#define mnu_about (menu_+24)
+#define mnu_on_line_help (menu_+25)
+#include <FL/Fl_Group.H>
+extern Fl_Check_Button *btn_swap;
+extern Fl_Check_Button *btn_auto_space;
+extern Fl_Check_Button *btn_ct_space;
+extern Fl_Check_Button *btn_paddledog;
+extern Fl_Check_Button *btn_cut_zeronine;
+extern Fl_Check_Button *btn_paddle_echo;
+extern Fl_Check_Button *btn_serial_echo;
+extern Fl_Check_Button *btn_sidetone_on;
+extern Fl_Check_Button *btn_tone_on;
+extern Fl_Check_Button *btn_ptt_on;
+extern Fl_Counter *cntr_min_wpm;
+extern Fl_Counter *cntr_rng_wpm;
+extern Fl_Counter *cntr_farnsworth;
+extern Fl_Counter *cntr_cmd_wpm;
+extern Fl_Counter *cntr_ratio;
+extern Fl_Counter *cntr_comp;
+extern Fl_Counter *cntr_first_ext;
+extern Fl_Counter *cntr_sample;
+extern Fl_Counter *cntr_weight;
+extern Fl_Counter *cntr_leadin;
+extern Fl_Counter *cntr_tail;
+extern Fl_ComboBox *choice_keyer_mode;
+extern Fl_ComboBox *choice_hang;
+extern Fl_ComboBox *choice_sidetone;
+extern Fl_ComboBox *choice_output_pins;
+extern Fl_Button *btn_done_parameters;
+Fl_Double_Window* make_parameters_dialog();
+extern Fl_Input2 *label_1;
+extern Fl_Input2 *edit_msg1;
+extern Fl_Input2 *label_2;
+extern Fl_Input2 *edit_msg2;
+extern Fl_Input2 *label_3;
+extern Fl_Input2 *edit_msg3;
+extern Fl_Input2 *label_4;
+extern Fl_Input2 *edit_msg4;
+extern Fl_Input2 *label_5;
+extern Fl_Input2 *edit_msg5;
+extern Fl_Input2 *label_6;
+extern Fl_Input2 *edit_msg6;
+extern Fl_Input2 *label_7;
+extern Fl_Input2 *edit_msg7;
+extern Fl_Input2 *label_8;
+extern Fl_Input2 *edit_msg8;
+extern Fl_Input2 *label_9;
+extern Fl_Input2 *edit_msg9;
+extern Fl_Input2 *label_10;
+extern Fl_Input2 *edit_msg10;
+extern Fl_Button *btn_done_edit;
+extern Fl_Button *btn_cancel_edit;
+extern Fl_Button *btn_apply_edit;
+extern Fl_Input2 *label_11;
+extern Fl_Input2 *edit_msg11;
+extern Fl_Input2 *label_12;
+extern Fl_Input2 *edit_msg12;
+Fl_Double_Window* make_message_editor();
+extern Fl_Input2 *txt_cll;
+extern Fl_Input2 *txt_opr;
+extern Fl_Input2 *txt_qth;
+extern Fl_Input2 *txt_loc;
+extern Fl_Button *btn_done_op_dialog;
+Fl_Double_Window* make_operator_dialog();
+#include <FL/Fl_Int_Input.H>
+extern Fl_Int_Input *txt_serial_nbr;
+extern Fl_Int_Input *txt_time_span;
+extern Fl_Check_Button *btn_zeros;
+extern Fl_Check_Button *btn_ck_band;
+extern Fl_Check_Button *btn_ck_time_span;
+extern Fl_Check_Button *btn_dups;
+extern Fl_Button *btn_close_contest;
+extern Fl_Input *txt_xout;
+Fl_Double_Window* make_contest_dialog();
+#endif
diff --git a/src/include/wkey_io.h b/src/include/wkey_io.h
new file mode 100644
index 0000000..b4af817
--- /dev/null
+++ b/src/include/wkey_io.h
@@ -0,0 +1,27 @@
+#ifndef _WKEY_IO_H
+#define _WKEY_IO_H
+
+#include <cstring>
+#include <cmath>
+
+#include <FL/Fl.H>
+
+using namespace std;
+
+enum BAUDS {
+ BR300, BR600, BR1200, BR2400, BR4800, BR9600, BR19200,
+ BR38400, BR57600, BR115200, BR230400, BR460800 };
+
+extern const char *szBaudRates[];
+
+extern bool start_wkey_serial();
+
+extern int readString();
+extern unsigned char readByte();
+extern int sendString(string &s, bool loghex = false);
+
+extern void clearSerialPort();
+extern char replybuff[];
+extern string replystr;
+
+#endif
diff --git a/src/logbook/adif_io.cxx b/src/logbook/adif_io.cxx
new file mode 100644
index 0000000..eedb3d5
--- /dev/null
+++ b/src/logbook/adif_io.cxx
@@ -0,0 +1,424 @@
+#include <FL/Fl.H>
+#include <FL/filename.H>
+#include <FL/fl_ask.H>
+
+#include <string>
+#include <cstring>
+#include <cstdlib>
+#include <string>
+
+#include "adif_io.h"
+#include "config.h"
+#include "lgbook.h"
+#include "icons.h"
+#include "gettext.h"
+#include "debug.h"
+#include "util.h"
+#include "date.h"
+
+#ifdef __WOE32__
+static const char *szEOL = "\r\n";
+#else
+static const char *szEOL = "\n";
+#endif
+static const char *szEOR = "<EOR>";
+
+// These ADIF fields define the QSO database
+
+const char *fieldnames[] = {
+ "ADDRESS", "AGE", "ARRL_SECT", "BAND", "CALL", "CNTY", "COMMENT",
+ "CONT", "CONTEST_ID", "COUNTRY", "CQZ", "DXCC", "EXPORT", "FREQ",
+ "GRIDSQUARE", "IOTA", "ITUZ", "MODE", "STX_STRING",
+ "NAME", "NOTES", "OPERATOR", "PFX", "PROP_MODE",
+ "QSLRDATE", "QSLSDATE", "QSL_MSG", "QSL_RCVD", "QSL_SENT", "QSL_VIA", "QSO_DATE", "QSO_DATE_OFF",
+ "QTH",
+ "RST_RCVD", "RST_SENT", "RX_PWR",
+ "SAT_MODE", "SAT_NAME", "SRX",
+ "STATE", "STX", "TEN_TEN",
+ "TIME_OFF", "TIME_ON", "TX_PWR", "VE_PROV", "SRX_STRING"
+};
+
+FIELD fields[] = {
+// TYPE, NAME, WIDGET
+ {ADDRESS, 0, NULL}, // contacted stations mailing address
+ {AGE, 0, NULL}, // contacted operators age in years
+ {ARRL_SECT, 0, NULL}, // contacted stations ARRL section
+ {BAND, 0, &btnSelectBand}, // QSO band
+ {CALL, 0, &btnSelectCall}, // contacted stations CALLSIGN
+ {CNTY, 0, NULL}, // secondary political subdivision, ie: county
+ {COMMENT, 0, NULL}, // comment field for QSO
+ {CONT, 0, &btnSelectCONT}, // contacted stations continent
+ {CONTEST_ID, 0, NULL}, // QSO contest identifier
+ {COUNTRY, 0, &btnSelectCountry}, // contacted stations DXCC entity name
+ {CQZ, 0, &btnSelectCQZ}, // contacted stations CQ Zone
+ {DXCC, 0, &btnSelectDXCC}, // contacted stations Country Code
+ {EXPORT, 0, NULL}, // used to indicate record is to be exported
+ {FREQ, 0, &btnSelectFreq}, // QSO frequency in Mhz
+ {GRIDSQUARE, 0, &btnSelectLOC}, // contacted stations Maidenhead Grid Square
+ {IOTA, 0, &btnSelectIOTA}, // Islands on the air
+ {ITUZ, 0, &btnSelectITUZ}, // ITU zone
+ {MODE, 0, &btnSelectMode}, // QSO mode
+ {MYXCHG, 0, &btnSelectMyXchg}, // contest exchange sent
+ {NAME, 0, &btnSelectName}, // contacted operators NAME
+ {NOTES, 0, &btnSelectNotes}, // QSO notes
+ {OPERATOR, 0, NULL}, // Callsign of person logging the QSO
+ {PFX, 0, NULL}, // WPA prefix
+ {PROP_MODE, 0, NULL}, // propogation mode
+ {QSLRDATE, 0, &btnSelectQSLrcvd}, // QSL received date
+ {QSLSDATE, 0, &btnSelectQSLsent}, // QSL sent date
+ {QSL_MSG, 0, NULL}, // personal message to appear on qsl card
+ {QSL_RCVD, 0, NULL}, // QSL received status
+ {QSL_SENT, 0, NULL}, // QSL sent status
+ {QSL_VIA, 0, NULL},
+ {QSO_DATE, 0, &btnSelectQSOdateOn}, // QSO data
+ {QSO_DATE_OFF, 0, &btnSelectQSOdateOff},// QSO data OFF, according to ADIF 2.2.6
+ {QTH, 0, &btnSelectQth}, // contacted stations city
+ {RST_RCVD, 0, &btnSelectRSTrcvd}, // received signal report
+ {RST_SENT, 0, &btnSelectRSTsent}, // sent signal report
+ {RX_PWR, 0, NULL}, // power of other station in watts
+ {SAT_MODE, 0, NULL}, // satellite mode
+ {SAT_NAME, 0, NULL}, // satellite name
+ {SRX, 0, &btnSelectSerialIN}, // received serial number for a contest QSO
+ {STATE, 0, &btnSelectState}, // contacted stations STATE
+ {STX, 0, &btnSelectSerialOUT}, // QSO transmitted serial number
+ {TEN_TEN, 0, NULL}, // ten ten # of other station
+ {TIME_OFF, 0, &btnSelectTimeOFF}, // HHMM or HHMMSS in UTC
+ {TIME_ON, 0, &btnSelectTimeON}, // HHMM or HHMMSS in UTC
+ {TX_PWR, 0, &btnSelectTX_pwr}, // power transmitted by this station
+ {VE_PROV, 0, &btnSelectProvince}, // 2 letter abbreviation for Canadian Province
+ {XCHG1, 0, &btnSelectXchgIn} // contest exchange #1 / free1 in xlog
+};
+
+void initfields()
+{
+ for (int i = 0; i < NUMFIELDS; i++)
+ fields[i].name = new string(fieldnames[i]);
+}
+
+int findfield( char *p )
+{
+ int m;
+ int test;
+
+ if (strncasecmp (p, "EOR>", 4) == 0)
+ return -1;
+
+// following two tests are for backward compatibility with older
+// fldigi fields
+// changed to comply with ADIF 2.2.3
+
+ if (strncasecmp (p, "XCHG1>", 6) == 0)
+ return XCHG1;
+ if (strncasecmp (p, "MYXCHG>", 7) == 0)
+ return MYXCHG;
+
+ string tststr;
+ for (m = 0; m < NUMFIELDS; m++) {
+ tststr = *(fields[m].name);
+ tststr += ':';
+ if ( (test = strncasecmp( p, tststr.c_str(), tststr.length() )) == 0)
+ return fields[m].type;
+ }
+ return -2; //search key not found
+}
+
+cAdifIO::cAdifIO ()
+{
+ initfields();
+}
+
+void cAdifIO::fillfield (int fieldnum, char *buff){
+const char *p = buff;
+int fldsize;
+ while (*p != ':' && *p != '>') p++;
+ if (*p == '>') return; // bad ADIF specifier ---> no ':' after field name
+// found first ':'
+ p++;
+ fldsize = 0;
+ const char *p2 = strchr(buff,'>');
+ if (!p2) return;
+ while (p != p2) {
+ if (*p >= '0' && *p <= '9') {
+ fldsize = fldsize * 10 + *p - '0';
+ }
+ p++;
+ }
+ adifqso.putField (fieldnum, p2+1, fldsize);
+}
+
+void cAdifIO::readFile (const char *fname, cQsoDb *db) {
+ long filesize = 0;
+ char *buff;
+ int found;
+ int retval;
+
+// open the adif file
+ adiFile = fopen (fname, "r");
+ if (!adiFile)
+ return;
+// determine its size for buffer creation
+ fseek (adiFile, 0, SEEK_END);
+ filesize = ftell (adiFile);
+
+ if (filesize == 0) {
+// fl_alert2(_("Empty ADIF logbook file"));
+ return;
+ }
+
+ buff = new char[filesize + 1];
+// read the entire file into the buffer
+ fseek (adiFile, 0, SEEK_SET);
+ retval = fread (buff, filesize, 1, adiFile);
+ fclose (adiFile);
+
+// relaxed file integrity test to all importing from non conforming log programs
+ if ((strcasestr(buff, "<ADIF_VER:") != 0) &&
+ (strcasestr(buff, "<CALL:") == 0)) {
+// fl_alert2(_("No records in ADIF logbook file"));
+ delete [] buff;
+ return;
+ }
+ if (strcasestr(buff, "<CALL:") == 0) {
+ fl_alert2(_("Not an ADIF file"));
+ delete [] buff;
+ return;
+ }
+ char *p = strcasestr(buff, "<DATA CHECKSUM:");
+ if (p) {
+ p = strchr(p + 1, '>');
+ if (p) {
+ p++;
+ file_checksum.clear();
+ for (int i = 0; i < 4; i++, p++) file_checksum += *p;
+ }
+ }
+
+ char *p1 = buff, *p2;
+ if (*p1 != '<') { // yes, skip over header to start of records
+ p1 = strchr(buff, '<');
+ while (strncasecmp (p1+1,"EOH>", 4) != 0) {
+ p1 = strchr(p1+1, '<'); // find next <> field
+ }
+ if (!p1) {
+ delete [] buff;
+ return; // must not be an ADIF compliant file
+ }
+ p1 += 1;
+ }
+
+ p2 = strchr(p1,'<'); // find first ADIF specifier
+ adifqso.clearRec();
+
+ while (p2) {
+ found = findfield(p2+1);
+ if (found > -1)
+ fillfield (found, p2+1);
+ else if (found == -1) { // <eor> reached; add this record to db
+//update fields for older db
+ if (adifqso.getField(TIME_OFF)[0] == 0)
+ adifqso.putField(TIME_OFF, adifqso.getField(TIME_ON));
+
+ if (adifqso.getField(TIME_ON)[0] == 0)
+ adifqso.putField(TIME_ON, adifqso.getField(TIME_OFF));
+
+ if ((strlen(adifqso.getField(QSO_DATE)) > 7) &&
+ (adifqso.getField(QSO_DATE_OFF)[0] == 0)) {
+ char d_str[20];
+ int d, m, y, t_on, t_off;
+ strcpy(d_str, adifqso.getField(QSO_DATE));
+ d = atoi(&d_str[6]); d_str[6] = 0;
+ m = atoi(&d_str[4]); d_str[4] = 0;
+ y = atoi(d_str);
+ t_on = atoi(adifqso.getField(TIME_ON));
+ t_off = atoi(adifqso.getField(TIME_OFF));
+ Date dt(m, d, y);
+ if (t_off < t_on) dt++;
+ adifqso.putField(QSO_DATE_OFF, dt.szDate(2));
+ }
+ db->qsoNewRec (&adifqso);
+ adifqso.clearRec();
+ }
+ p1 = p2 + 1;
+ p2 = strchr(p1,'<');
+ }
+
+ log_checksum = file_checksum;
+ db->SortByDate();
+ delete [] buff;
+}
+
+static const char *adifmt = "<%s:%d>";
+
+// write ALL or SELECTED records to the designated file
+
+int cAdifIO::writeFile (const char *fname, cQsoDb *db)
+{
+ string ADIFHEADER;
+ ADIFHEADER = "File: %s";
+ ADIFHEADER.append(szEOL);
+ ADIFHEADER.append("<ADIF_VER:%d>%s");
+ ADIFHEADER.append(szEOL);
+ ADIFHEADER.append("<PROGRAMID:%d>%s");
+ ADIFHEADER.append(szEOL);
+ ADIFHEADER.append("<PROGRAMVERSION:%d>%s");
+ ADIFHEADER.append(szEOL);
+ ADIFHEADER.append("<EOH>");
+ ADIFHEADER.append(szEOL);
+// open the adif file
+ cQsoRec *rec;
+ string sFld;
+ adiFile = fopen (fname, "w");
+ if (!adiFile)
+ return 1;
+ fprintf (adiFile, ADIFHEADER.c_str(),
+ fl_filename_name(fname),
+ strlen(ADIF_VERS), ADIF_VERS,
+ strlen(PACKAGE_NAME), PACKAGE_NAME,
+ strlen(PACKAGE_VERSION), PACKAGE_VERSION);
+// db->SortByDate();
+ for (int i = 0; i < db->nbrRecs(); i++) {
+ rec = db->getRec(i);
+ if (rec->getField(EXPORT)[0] == 'E') {
+ for (int j = 0; j < NUMFIELDS; j++) {
+ if (fields[j].btn != NULL)
+ if ((*fields[j].btn)->value()) {
+ sFld = rec->getField(fields[j].type);
+ if (!sFld.empty())
+ fprintf(adiFile, adifmt,
+ fields[j].name->c_str(),
+ sFld.length());
+ fprintf(adiFile, "%s", sFld.c_str());
+ }
+ }
+ rec->putField(EXPORT,"");
+ db->qsoUpdRec(i, rec);
+ fprintf(adiFile, "%s", szEOR);
+ fprintf(adiFile, "%s", szEOL);
+ }
+ }
+ fclose (adiFile);
+ return 0;
+}
+
+// write ALL records to the common log
+
+int cAdifIO::writeLog (const char *fname, cQsoDb *db) {
+
+ string ADIFHEADER;
+ ADIFHEADER = "File: %s";
+ ADIFHEADER.append(szEOL);
+ ADIFHEADER.append("<ADIF_VER:%d>%s");
+ ADIFHEADER.append(szEOL);
+ ADIFHEADER.append("<PROGRAMID:%d>%s");
+ ADIFHEADER.append(szEOL);
+ ADIFHEADER.append("<PROGRAMVERSION:%d>%s");
+ ADIFHEADER.append(szEOL);
+ ADIFHEADER.append("<DATA CHECKSUM:%d>%s");
+ ADIFHEADER.append(szEOL);
+ ADIFHEADER.append("<EOH>");
+ ADIFHEADER.append(szEOL);
+
+// open the adif file
+ string sFld;
+ cQsoRec *rec;
+ Ccrc16 checksum;
+ string s_checksum;
+
+ adiFile = fopen (fname, "w");
+ if (!adiFile) {
+ LOG_ERROR("Cannot write to %s", fname);
+ return 1;
+ }
+
+ string records;
+ string record;
+ char recfield[200];
+
+ records.clear();
+ for (int i = 0; i < db->nbrRecs(); i++) {
+ rec = db->getRec(i);
+ record.clear();
+ for (int j = 0; j < NUMFIELDS; j++) {
+ sFld = rec->getField(j);
+ if (!sFld.empty()) {
+ snprintf(recfield, sizeof(recfield), adifmt,
+ fields[j].name->c_str(), sFld.length());
+ record.append(recfield).append(sFld);
+ }
+ }
+ record.append(szEOR);
+ record.append(szEOL);
+ records.append(record);
+ db->qsoUpdRec(i, rec);
+ }
+
+ s_checksum = checksum.scrc16(records);
+
+ fprintf (adiFile, ADIFHEADER.c_str(),
+ fl_filename_name(fname),
+ strlen(ADIF_VERS), ADIF_VERS,
+ strlen(PACKAGE_NAME), PACKAGE_NAME,
+ strlen(PACKAGE_VERSION), PACKAGE_VERSION,
+ s_checksum.length(), s_checksum.c_str()
+ );
+ fprintf (adiFile, "%s", records.c_str());
+
+ fclose (adiFile);
+ log_checksum = s_checksum;
+
+ return 0;
+}
+
+void cAdifIO::do_checksum(cQsoDb &db)
+{
+ Ccrc16 checksum;
+ string sFld;
+ cQsoRec *rec;
+ string records;
+ string record;
+ char recfield[200];
+
+ records.clear();
+ for (int i = 0; i < db.nbrRecs(); i++) {
+ rec = db.getRec(i);
+ record.clear();
+ for (int j = 0; j < NUMFIELDS; j++) {
+ sFld = rec->getField(j);
+ if (!sFld.empty()) {
+ snprintf(recfield, sizeof(recfield), adifmt,
+ fields[j].name->c_str(), sFld.length());
+ record.append(recfield).append(sFld);
+ }
+ }
+ record.append(szEOR);
+ record.append(szEOL);
+ records.append(record);
+ }
+ log_checksum = checksum.scrc16(records);
+}
+
+bool cAdifIO::log_changed (const char *fname)
+{
+ int retval;
+// open the adif file
+ FILE *adiFile = fopen (fname, "r");
+ if (!adiFile)
+ return false;
+
+// read first 2048 chars
+ char buff[2048];
+ retval = fread (buff, 2048, 1, adiFile);
+ fclose (adiFile);
+
+ if (retval) {
+ string sbuff = buff;
+ size_t p = sbuff.find("<DATA CHECKSUM:");
+ if (p == string::npos) return false;
+ p = sbuff.find(">", p);
+ if (p == string::npos) return false;
+ p++;
+ if (log_checksum != sbuff.substr(p, 4))
+ return true;
+ }
+ return false;
+}
diff --git a/src/logbook/calendar.cxx b/src/logbook/calendar.cxx
new file mode 100644
index 0000000..9f48673
--- /dev/null
+++ b/src/logbook/calendar.cxx
@@ -0,0 +1,585 @@
+#include <config.h>
+
+#include <cstring>
+#include <cstdio>
+#include <cstdlib>
+
+#include <FL/Fl.H>
+#include <FL/Fl_Pixmap.H>
+
+#include "pixmaps.h"
+#include "calendar.h"
+
+void popcal_cb (Fl_Widget *v, long d);
+
+static void fl_calendar_button_cb (Fl_Button *a, void *b)
+{
+ long j=0;
+ Fl_Calendar *c = (Fl_Calendar *)b;
+ Fl_Button *sb;
+ int numdays = c->daysinmonth () + 1;
+ for (int i=1; i < numdays; i++) {
+ sb = c->day_button(i);
+ sb->color (52);
+ if (a == sb) {
+ c->Day (i);
+ j = i;
+ sb->color (sb->selection_color());
+ if (c->target) {
+ ((Fl_Input2 *)(c->target))->value(c->szDate(c->calfmt));
+ (c->target)->redraw();
+ }
+ }
+ }
+ c->redraw();
+ c->do_callback(c, j);
+}
+
+void
+Fl_Calendar_Base::setTarget (Fl_Widget *tgt)
+{
+ target = tgt;
+}
+
+Fl_Calendar_Base::Fl_Calendar_Base (int x, int y, int w, int h,
+ const char *l) : Fl_Group (x, y, w, h, l), Date ()
+{
+ int i;
+
+ for (i = 0; i<(7*6); i++)
+ {
+ days[i] = new Fl_Button ((w/7)*(i%7) + x,
+ (h/6)*(i/7) + y,
+ (w/7),
+ (h/6));
+ days[i]->down_box (FL_THIN_DOWN_BOX);
+ days[i]->labelsize (10);
+ days[i]->box (FL_THIN_UP_BOX);
+ days[i]->color (52);
+ days[i]->callback ((Fl_Callback*)&fl_calendar_button_cb, (void *)this);
+ }
+ calfmt = 0;
+}
+
+void Fl_Calendar_Base::csize (int cx, int cy, int cw, int ch)
+{
+ int i;
+ for (i = 0; i<(7*6); i++)
+ {
+ days[i]->resize ((cw/7)*(i%7) + cx,
+ (ch/6)*(i/7) + cy,
+ (cw/7),
+ (ch/6));
+ }
+}
+
+
+void
+Fl_Calendar_Base::update ()
+{
+ int dow = dayofweek (Year(), Month(), 1);
+ int dim = daysinmonth (Month(), isleapyear (Year()));
+ int i;
+
+ for (i=0; i<dow; i++)
+ {
+ days[i]->hide ();
+ }
+
+ for (i=(dim+dow); i<(6*7); i++)
+ {
+ days[i]->hide ();
+ }
+
+ for (i=dow; i<(dim+dow); i++)
+ {
+ char t[8];
+ snprintf (t, sizeof(t), "%d", (i-dow+1));
+ days[i]->label (strdup(t));
+ days[i]->color (52);
+ if ((i-dow+1) == Day())
+ days[i]->color (selection_color());
+ days[i]->show ();
+ }
+}
+
+Fl_Button *
+Fl_Calendar_Base::day_button (int i)
+{
+ if ((i > 0) && (i <= daysinmonth ()))
+ return days[i + dayofweek (Year(), Month(), 1) - 1];
+ return 0;
+}
+
+
+
+static void
+fl_calendar_prv_month_cb (Fl_Button *, void *b)
+{
+ Fl_Calendar *c = (Fl_Calendar *)b;
+ c->previous_month ();
+ c->do_callback(c, (long)0);
+}
+
+static void
+fl_calendar_nxt_month_cb (Fl_Button *, void *b)
+{
+ Fl_Calendar *c = (Fl_Calendar *)b;
+ c->next_month ();
+ c->do_callback(c, (long)0);
+}
+
+static void
+fl_calendar_prv_year_cb (Fl_Button *, void *b)
+{
+ Fl_Calendar *c = (Fl_Calendar *)b;
+ c->previous_year ();
+ c->do_callback(c, (long)0);
+}
+
+static void
+fl_calendar_nxt_year_cb (Fl_Button *, void *b)
+{
+ Fl_Calendar *c = (Fl_Calendar *)b;
+ c->next_year ();
+ c->do_callback(c, (long)0);
+}
+
+Fl_Calendar::Fl_Calendar (int x, int y, int w, int h,
+ const char *l) : Fl_Calendar_Base (x, y, w, h, l)
+{
+ int i, bw;
+ for (i = 0; i<7; i++) {
+// weekdays[i] = new Fl_Button ((w/7)*(i%7) + x,
+ weekdays[i] = new Fl_Box ((w/7)*(i%7) + x,
+ (h/8)*((i/7)+1) + y,
+ (w/7),
+ (h/8));
+ weekdays[i]->box (FL_THIN_UP_BOX);
+ weekdays[i]->labelsize (10);
+ weekdays[i]->color (52);
+ }
+
+ weekdays[SUNDAY]->label ("S");
+ weekdays[MONDAY]->label ("M");
+ weekdays[TUESDAY]->label ("T");
+ weekdays[WEDNESDAY]->label ("W");
+ weekdays[THURSDAY]->label ("T");
+ weekdays[FRIDAY]->label ("F");
+ weekdays[SATURDAY]->label ("S");
+
+ bw = w/10 < 16 ? 16 : w/10;
+ prv_year = new Fl_Button (x, y, bw, (h/8), "@<<");
+ prv_year->box (FL_THIN_UP_BOX);
+ prv_year->labeltype (FL_SYMBOL_LABEL);
+ prv_year->labelsize (10);
+ prv_year->down_box (FL_THIN_DOWN_BOX);
+ prv_year->callback ((Fl_Callback*)&fl_calendar_prv_year_cb, (void *)this);
+
+ prv_month = new Fl_Button (x + bw, y, bw, (h/8), "@<");
+ prv_month->box (FL_THIN_UP_BOX);
+ prv_month->labeltype (FL_SYMBOL_LABEL);
+ prv_month->labelsize (10);
+ prv_month->down_box (FL_THIN_DOWN_BOX);
+ prv_month->callback ((Fl_Callback*)&fl_calendar_prv_month_cb, (void *)this);
+
+ nxt_month = new Fl_Button (x + w - 2*bw, y, bw, (h/8), "@>");
+ nxt_month->box (FL_THIN_UP_BOX);
+ nxt_month->labeltype (FL_SYMBOL_LABEL);
+ nxt_month->labelsize (10);
+ nxt_month->down_box (FL_THIN_DOWN_BOX);
+ nxt_month->callback ((Fl_Callback*)&fl_calendar_nxt_month_cb, (void *)this);
+
+ nxt_year = new Fl_Button (x + w - bw, y, bw, (h/8), "@>>");
+ nxt_year->box (FL_THIN_UP_BOX);
+ nxt_year->labeltype (FL_SYMBOL_LABEL);
+ nxt_year->labelsize (10);
+ nxt_year->down_box (FL_THIN_DOWN_BOX);
+ nxt_year->callback ((Fl_Callback*)&fl_calendar_nxt_year_cb, (void *)this);
+
+// caption = new Fl_Button (x + (w/10)*2, y, (6*w/10), (h/8));
+ caption = new Fl_Box (x + 2*bw, y, w - 4*bw, (h/8));
+ caption->box (FL_THIN_UP_BOX);
+ caption->labeltype (FL_SYMBOL_LABEL);
+ caption->labelfont (1);
+ if (bw < 20)
+ caption->labelsize (9);
+ else
+ caption->labelsize (11);
+// caption->down_box (FL_THIN_DOWN_BOX);
+
+ Fl_Calendar_Base::csize (x, y + (2*h/8), w, (6*h/8));
+
+ target = 0;
+
+ update ();
+}
+
+void
+Fl_Calendar::csize (int cx, int cy, int cw, int ch)
+{
+ int i;
+ for (i = 0; i<7; i++)
+ {
+// weekdays[i] = new Fl_Button ((cw/7)*(i%7) + cx,
+ weekdays[i] = new Fl_Box ((cw/7)*(i%7) + cx,
+ (ch/8)*((i/7)+1) + cy,
+ (cw/7),
+ (ch/8));
+ }
+
+ prv_month->resize (cx + (cw/10), cy, (cw/10), (ch/8));
+ nxt_month->resize (cx + (cw/10)*8, cy, (cw/10), (ch/8));
+ prv_year->resize (cx, cy, (cw/10), (ch/8));
+ nxt_year->resize (cx + (cw/10)*9, cy, (cw/10), (ch/8));
+ caption->resize (cx + (cw/10)*2, cy, (cw/10)*6, (ch/8));
+
+ Fl_Calendar_Base::csize (cx, cy + (2*ch/8), cw, (6*ch/8));
+}
+
+void
+Fl_Calendar::update ()
+{
+ int dow = dayofweek (Year(), Month(), 1);
+ int dim = daysinmonth (Month(), isleapyear (Year()));
+ int i;
+
+ for (i=dow; i<(dim+dow); i++)
+ {
+ char t[8];
+ snprintf (t, sizeof(t), "%d", (i-dow+1));
+ days[i]->label (strdup(t));
+ }
+
+ char tmp[32];
+ snprintf (tmp, sizeof(tmp), "%s %d", month_name[Month()-1], Year());
+ Fl_Calendar_Base::update ();
+ if (caption->label ())
+ free ((void *) caption->label ());
+ caption->label (strdup(tmp));
+ redraw ();
+}
+
+void Fl_Calendar::today ()
+{
+ Date::today();
+ update ();
+}
+
+void Fl_Calendar::previous_month ()
+{
+ Date::previous_month();
+ update ();
+}
+
+void
+Fl_Calendar::next_month ()
+{
+ Date::next_month();
+ update ();
+}
+
+void
+Fl_Calendar::previous_year ()
+{
+ Date::previous_year();
+ update ();
+}
+
+void Fl_Calendar::next_year ()
+{
+ Date::next_year();
+ update ();
+}
+
+void Fl_Calendar::setDate(int m, int d, int y)
+{
+ Date::setDate(m,d,y);
+}
+
+int
+Fl_Calendar::handle (int event)
+{
+ int m, d, y, o, md;
+
+ switch (event)
+ {
+ case FL_FOCUS:
+ case FL_UNFOCUS:
+ return 1;
+
+ case FL_KEYBOARD:
+ m = Month ();
+ d = Day ();
+ y = Year ();
+ switch(Fl::event_key ())
+ {
+ case FL_Enter:
+ do_callback(this, d);
+ return 1;
+ break;
+ case FL_Up:
+ o = -7;
+ break;
+ case FL_Down:
+ o = 7;
+ break;
+ case FL_Right:
+ o = 1;
+ break;
+ case FL_Left:
+ o = -1;
+ break;
+ case FL_Page_Up:
+ previous_month ();
+ return 1;
+ case FL_Page_Down:
+ next_month ();
+ return 1;
+ default:
+ return Fl_Group::handle (event);
+ }
+ if (datevalid (y, m, d + o))
+ setDate (m, d + o, y);
+ else
+ {
+ if (o < 0)
+ {
+ previous_month ();
+ m = Month ();
+ y = Year ();
+ md = daysinmonth (m, isleapyear (y));
+ d = d + o + md;
+ setDate (m, d, y);
+ }
+ else
+ {
+ md = daysinmonth (m, isleapyear (y));
+ next_month ();
+ m = Month ();
+ y = Year ();
+ d = d + o - md;
+ setDate (m, d, y);
+ }
+ }
+ return 1;
+ }
+ return Fl_Group::handle (event);
+}
+
+
+// Popup Calendar class
+
+Fl_PopCal::Fl_PopCal (int X, int Y, int W, int H, Fl_Input2 * tgt)
+ : Fl_Window (X, Y, W, H, "")
+{
+ target = tgt;
+ clear_border();
+ box(FL_UP_BOX);
+// popcal = new Fl_Calendar(2, 2);
+ popcal = new Fl_Calendar(2, 2, W-4, H-4);
+ popcal->callback ( (Fl_Callback*)popcal_cb);
+ end();
+}
+
+
+Fl_PopCal::~Fl_PopCal ()
+{
+}
+
+void Fl_PopCal::popcalfmt (int i)
+{
+ popcalfmt_ = i;
+}
+
+int Fl_PopCal::popcalfmt ()
+{
+ return popcalfmt_;
+}
+
+void Fl_PopCal::setDate (int m, int d, int y)
+{
+ popcal->setDate (m,d,y);
+ popcal->update();
+}
+
+int Fl_PopCal::handle(int event)
+{
+ int ex = Fl::event_x_root(),
+ ey = Fl::event_y_root();
+ if (event == FL_PUSH) {
+ if ( ex < x() || ex > (x() + w()) ||
+ ey < y() || ey > (y() + h()) ) {
+ pophide();
+ return 1;
+ }
+ }
+ if (Fl_Group::handle(event)) return 1;
+ return 0;
+}
+
+void Fl_PopCal::popposition (int x, int y)
+{
+ position (x, y);
+}
+
+void Fl_PopCal::popshow ()
+{
+ show ();
+ Fl::grab(this);
+}
+
+void Fl_PopCal::pophide ()
+{
+ hide ();
+ Fl::release();
+}
+
+void Fl_PopCal::popcal_cb_i (Fl_Widget *v, long d)
+{
+ int ey = Fl::event_y_root();
+ Fl_PopCal *me = (Fl_PopCal *)(v->parent());
+ Fl_Input2 *tgt = me->target;
+ if (ey > me->y() + 40) {
+ if (d && tgt)
+ tgt->value (((Fl_Calendar *)v)->szDate (me->popcalfmt_));
+ me->pophide();
+ }
+ return;
+}
+
+void popcal_cb (Fl_Widget *v, long d)
+{
+ ((Fl_PopCal *)(v))->popcal_cb_i (v, d);
+ return;
+}
+
+void
+Fl_DateInput::fl_popcal()
+{
+ Fl_Widget *who = this, *parent;
+ int xpos = who->x(), ypos = who->h() + who->y();
+ int w = who->w(), h;
+ int m = 0, d = 0, y = 0;
+
+ w = w < 140 ? 140 : w;
+ w = w - (w % 7);
+ h = 8*(w/7);
+ w += 4; h += 4;
+ parent = who;
+ while (parent) {
+ who = parent;
+ parent = parent->parent();
+ if (parent == 0) {
+ xpos += who->x();
+ ypos += who->y();
+ }
+ }
+ if (!Cal)
+// Cal = new Fl_PopCal(xpos, ypos, 7*20+4, 8*20+4, Input);
+ Cal = new Fl_PopCal(xpos, ypos, w, h, Input);
+ else
+ Cal->popposition(xpos, ypos);
+
+ if (popcalfmt_ < 3) {
+ switch (popcalfmt_) {
+ case 0:
+ case 1:
+ sscanf(Input->value(), "%d/%d/%d", &m, &d, &y);
+ break;
+ case 2:
+ default:
+ sscanf(Input->value(),"%4d%2d%2d", &y, &m, &d);
+ break;
+ }
+ if (y < 10) y+=2000;
+ if (y < 100) y+=1900;
+ Cal->setDate (m,d,y);
+ }
+ Cal->popcalfmt (popcalfmt_);
+
+ Cal->popshow();
+ return;
+}
+
+void btnDateInput_cb (Fl_Widget *v, void *d)
+{
+ ((Fl_DateInput *)(v->parent()))->fl_popcal ();
+ return;
+}
+
+
+Fl_DateInput::Fl_DateInput (int X,int Y,int W,int H, const char *L)
+ : Fl_Group (X, Y, W, H, 0)
+{
+ Btn = new Fl_Button (X + W - H + 1, Y + 1, H - 2, H - 2);
+ (new Fl_Pixmap (time_icon))->label (Btn);
+ Btn->callback ((Fl_Callback *)btnDateInput_cb, 0);
+ Input = new Fl_Input2 (X, Y, W-H, H, L);
+
+ popcalfmt_ = 0;
+ Cal = 0;
+ end();
+}
+
+void Fl_DateInput::align (Fl_Align how)
+{
+ Input->align(how);
+}
+
+// DateInput value is contained in the Input widget
+
+void Fl_DateInput::value( const char *s )
+{
+ Input->value (s);
+}
+
+const char *Fl_DateInput::value()
+{
+ return (Input->value ());
+}
+
+
+void Fl_DateInput::textfont(int tf)
+{
+ Input->textfont (tf);
+}
+
+void Fl_DateInput::textsize(int sz)
+{
+ Input->textsize (sz);
+}
+
+void Fl_DateInput::labelfont(int fnt)
+{
+ Input->labelfont(fnt);
+}
+
+void Fl_DateInput::labelsize(int size)
+{
+ Input->labelsize(size);
+}
+
+void Fl_DateInput::labelcolor(int clr)
+{
+ Input->labelcolor(clr);
+}
+
+void Fl_DateInput::format (int fmt)
+{
+ switch (fmt) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ popcalfmt_ = fmt;
+ break;
+ default :
+ popcalfmt_ = 0;
+ }
+}
+
+void Fl_DateInput::take_focus() {
+ Input->take_focus();
+}
diff --git a/src/logbook/date.cxx b/src/logbook/date.cxx
new file mode 100644
index 0000000..6164819
--- /dev/null
+++ b/src/logbook/date.cxx
@@ -0,0 +1,378 @@
+// ----------------------------------------------------------------------------
+//
+// Date.cxx date class for Fast Light Took Kit
+//
+// Copyright (C) 1998 David Freese
+//
+// This file is part of fldigi.
+//
+// Fldigi is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Fldigi 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 fldigi. If not, see <http://www.gnu.org/licenses/>.
+// ----------------------------------------------------------------------------
+
+#include <config.h>
+
+#include <iostream>
+#include <cstring>
+#include <ctime>
+#include <cstdio>
+
+#include "date.h"
+
+using namespace std;
+
+const int Date::mdays[] =
+ { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
+
+const int Date::jdays[2][13] = {
+ { 0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 },
+ { 0, 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335 }
+};
+
+const char *Date::month_name[] =
+{
+ "January",
+ "Febuary",
+ "March",
+ "April",
+ "May",
+ "June",
+ "July",
+ "August",
+ "September",
+ "October",
+ "November",
+ "December"
+};
+
+void Date::today()
+{
+ time_t t;
+ struct tm *now;
+ time( &t );
+ now = localtime( &t );
+ year = now->tm_year + 1900;
+ month = now->tm_mon + 1;
+ day = now->tm_mday;
+}
+
+Date::Date()
+{
+ today();
+ fmt = 0;
+}
+
+Date::Date( int m, int d, int y )
+{
+ setDate( m, d, y );
+ fmt = 1;
+}
+
+void Date::setDate( int mm, int dd, int yy )
+{
+ if( isvalid( mm, dd, yy ) ) {
+ year = yy; month = mm; day = dd;
+ } else
+ today();
+}
+
+void Date::setDate( Date &dt )
+{
+ year = dt.year;
+ month = dt.month;
+ day = dt.day;
+}
+
+void Date::setFormat( int iFmt )
+{
+ fmt = iFmt;
+}
+
+void Date::Year( int y )
+{
+ year = y;
+}
+
+int Date::Year()
+{
+ return year;
+}
+
+void Date::Month( int m )
+{
+ month = m;
+}
+
+int Date::Month()
+{
+ return month;
+}
+
+void Date::Day( int d )
+{
+ day = d;
+}
+
+int Date::Day()
+{
+ return day;
+}
+
+bool Date::leapYear( int y )
+{
+ if( y % 400 == 0 || ( y % 100 != 0 && y % 4 == 0 ) )
+ return true;
+ return false;
+}
+
+
+bool Date::isvalid( int m, int d, int y )
+{
+ if( y > 2035 ) return false;
+ if( m < 1 || m > 12 ) return false;
+ if( d < 1 ) return false;
+ if( leapYear( y ) ){
+ if( m == 2 && d > 29 )
+ return false;
+ else
+ return true;
+ }
+ if( d > mdays[m] ) return false;
+ return true;
+}
+
+int Date::daysinmonth (int month, int leap)
+{
+ /* Validate the month. */
+ if (month < JANUARY || month > DECEMBER)
+ return -1;
+
+ /* Return 28, 29, 30, or 31 based on month/leap. */
+ switch (month) {
+ case FEBRUARY:
+ return leap ? 29 : 28;
+ default:
+ return mdays[month];
+ }
+}
+
+
+int Date::dayofyear (int year, int mon, int mday)
+{
+ /* Return day of year. */
+ return mday + jdays[isleapyear (year) ? 1 : 0][mon];
+}
+
+int Date::dayofepoch (int year, int mon, int mday)
+{
+ int doe;
+ int era, cent, quad, rest;
+
+ /* break down the year into 400, 100, 4, and 1 year multiples */
+ rest = year - 1;
+ quad = rest / 4; rest %= 4;
+ cent = quad / 25; quad %= 25;
+ era = cent / 4; cent %= 4;
+
+ /* set up doe */
+ doe = dayofyear (year, mon, mday);
+ doe += era * (400 * 365 + 97);
+ doe += cent * (100 * 365 + 24);
+ doe += quad * (4 * 365 + 1);
+ doe += rest * 365;
+
+ return doe;
+}
+
+int Date::dayofweek (int year, int mon, int mday)
+{
+ return dayofepoch (year, mon, mday) % 7;
+}
+
+void Date::previous_month ()
+{
+ if (month == 1)
+ {
+ month = 12;
+ year--;
+ }
+ else
+ month--;
+
+ while ((day >= 1) && (!datevalid ()))
+ day--;
+}
+
+void Date::next_month ()
+{
+ if (month == 12)
+ {
+ month = 1;
+ year++;
+ }
+ else
+ month++;
+
+ while ((day >= 1) && (!datevalid ()))
+ day--;
+}
+
+void Date::previous_year ()
+{
+ if (month == 2 && day == 29)
+ day = 28;
+ year--;
+}
+
+void Date::next_year ()
+{
+ if (month == 2 && day == 29)
+ day = 28;
+ year++;
+}
+
+
+char *Date::szDate (int fmt)
+{
+ static char temp[20];
+ char szMonth[10];
+ switch (fmt) {
+ case 1 :
+ snprintf (temp, sizeof(temp), "%02d/%02d/%02d",
+ month,
+ day,
+ year > 1999 ? year - 2000 : year - 1900);
+ break;
+ case 2 :
+ snprintf (temp, sizeof(temp), "%4d%02d%02d", year, month, day);
+ break;
+ case 3 :
+ snprintf (temp, sizeof(temp), "%s %2d, %4d",
+ month_name[month - 1],
+ day,
+ year);
+ break;
+ case 4 :
+ strcpy (szMonth, month_name [month - 1]);
+ szMonth[3] = 0;
+ snprintf (temp, sizeof(temp), "%s %2d, %4d", szMonth, day, year);
+ break;
+ case 0 :
+ default :
+ snprintf (temp, sizeof(temp), "%02d/%02d/%04d",
+ month,
+ day,
+ year);
+ break;
+ }
+ return temp;
+}
+
+char *Date::szDate ()
+{
+ return szDate (fmt);
+}
+
+// operator functions
+
+ostream &operator<<( ostream &output, Date &d )
+{
+ output << d.szDate ();
+ return output;
+}
+
+bool Date::endOfMonth( int d )
+{
+ if( month == 2 && leapYear( year ) )
+ return (d == 29 ); // last day of Feb in leap year
+ else
+ return (d == mdays[ month ] );
+}
+
+void Date::helpIncrement()
+{
+ if( endOfMonth( day ) && month == 12 ) { // end year
+ day = 1;
+ month = 1;
+ ++year;
+ } else if ( endOfMonth( day ) ) {
+ day = 1;
+ ++month;
+ } else
+ ++day;
+}
+
+Date &Date::operator++()
+{
+ helpIncrement();
+ return *this; // reference return to create an lvalue
+}
+
+Date Date::operator++( int )
+{
+ Date temp = *this;
+ helpIncrement();
+ return temp; // return non-increment, saved temporary object
+}
+
+const Date &Date::operator+=( int ndays )
+{
+ for( int i = 0; i < ndays; i++ )
+ helpIncrement();
+ return *this; // enables cascading
+}
+
+
+bool Date::operator==( const Date &d )
+{
+ if( this->year != d.year ) return false;
+ if( this->month != d.month ) return false;
+ if( this->day != d.day ) return false;
+ return true;
+}
+
+bool Date::operator!=( const Date &d )
+{
+ return ( !( *this == d ) );
+}
+
+bool Date::operator<( const Date &d )
+{
+ if( this->year < d.year ) return true;
+ if( this->year > d.year ) return false;
+ if( this->month < d.month ) return true;
+ if( this->month > d.month ) return false;
+ if( this->day < d.day ) return true;
+ return false;
+}
+
+bool Date::operator>( const Date &d )
+{
+ if( *this < d ) return false;
+ if( *this == d ) return false;
+ return true;
+}
+
+void Date::operator=( const Date &d )
+{
+ this->year = d.year;
+ this->month = d.month;
+ this->day = d.day;
+}
+
+double Date::dJulian ()
+{
+ int DaysInYear = 365;
+ if (leapYear ()) DaysInYear++;
+ return ( year + 1.0 * (dayofyear (year, month, day) - 1) / DaysInYear);
+}
diff --git a/src/logbook/lgbook.cxx b/src/logbook/lgbook.cxx
new file mode 100644
index 0000000..0d2c17c
--- /dev/null
+++ b/src/logbook/lgbook.cxx
@@ -0,0 +1,1050 @@
+// generated by Fast Light User Interface Designer (fluid) version 1.0302
+
+#include "gettext.h"
+#include "lgbook.h"
+#include <config.h>
+#include <FL/Fl_Pixmap.H>
+#include "logsupport.h"
+#include "pixmaps.h"
+
+Fl_Double_Window *dlgLogbook=(Fl_Double_Window *)0;
+
+Fl_Group *editGroup=(Fl_Group *)0;
+
+Fl_DateInput *inpDate_log=(Fl_DateInput *)0;
+
+Fl_Input2 *inpTimeOn_log=(Fl_Input2 *)0;
+
+Fl_DateInput *inpDateOff_log=(Fl_DateInput *)0;
+
+Fl_Input2 *inpTimeOff_log=(Fl_Input2 *)0;
+
+Fl_Input2 *inpCall_log=(Fl_Input2 *)0;
+
+Fl_Input2 *inpName_log=(Fl_Input2 *)0;
+
+Fl_Input2 *inpFreq_log=(Fl_Input2 *)0;
+
+Fl_Input2 *inpMode_log=(Fl_Input2 *)0;
+
+Fl_Input2 *inpRstR_log=(Fl_Input2 *)0;
+
+Fl_Input2 *inpRstS_log=(Fl_Input2 *)0;
+
+Fl_Input2 *inpTX_pwr_log=(Fl_Input2 *)0;
+
+Fl_DateInput *inpQSLrcvddate_log=(Fl_DateInput *)0;
+
+Fl_DateInput *inpQSLsentdate_log=(Fl_DateInput *)0;
+
+Fl_Input2 *inpCONT_log=(Fl_Input2 *)0;
+
+Fl_Input2 *inpDXCC_log=(Fl_Input2 *)0;
+
+Fl_Input2 *inpQth_log=(Fl_Input2 *)0;
+
+Fl_Input2 *inpState_log=(Fl_Input2 *)0;
+
+Fl_Input2 *inpVE_Prov_log=(Fl_Input2 *)0;
+
+Fl_Input2 *inpCountry_log=(Fl_Input2 *)0;
+
+Fl_Input2 *inpLoc_log=(Fl_Input2 *)0;
+
+Fl_Input2 *inpIOTA_log=(Fl_Input2 *)0;
+
+Fl_Input2 *inpCQZ_log=(Fl_Input2 *)0;
+
+Fl_Input2 *inpITUZ_log=(Fl_Input2 *)0;
+
+Fl_Input2 *inpNotes_log=(Fl_Input2 *)0;
+
+Fl_Button *bNewSave=(Fl_Button *)0;
+
+Fl_Button *bUpdateCancel=(Fl_Button *)0;
+
+Fl_Button *bDelete=(Fl_Button *)0;
+
+Fl_Input2 *txtNbrRecs_log=(Fl_Input2 *)0;
+
+Fl_Input2 *inpSerNoOut_log=(Fl_Input2 *)0;
+
+Fl_Input2 *inpMyXchg_log=(Fl_Input2 *)0;
+
+Fl_Input2 *inpSerNoIn_log=(Fl_Input2 *)0;
+
+Fl_Input2 *inpXchgIn_log=(Fl_Input2 *)0;
+
+Fl_Input2 *inpSearchString=(Fl_Input2 *)0;
+
+Fl_Button *bSearchPrev=(Fl_Button *)0;
+
+Fl_Button *bSearchNext=(Fl_Button *)0;
+
+Table *wBrowser=(Table *)0;
+
+Fl_Double_Window *wExport=(Fl_Double_Window *)0;
+
+Fl_Check_Browser *chkExportBrowser=(Fl_Check_Browser *)0;
+
+Fl_Button *btnClearAll=(Fl_Button *)0;
+
+static void cb_btnClearAll(Fl_Button*, void*) {
+ chkExportBrowser->check_none();
+}
+
+Fl_Button *btnCheckAll=(Fl_Button *)0;
+
+static void cb_btnCheckAll(Fl_Button*, void*) {
+ chkExportBrowser->check_all();
+}
+
+Fl_Return_Button *btnOK=(Fl_Return_Button *)0;
+
+static void cb_btnOK(Fl_Return_Button*, void*) {
+ wExport->hide();
+Export_log();
+}
+
+Fl_Button *btnCancel=(Fl_Button *)0;
+
+static void cb_btnCancel(Fl_Button*, void*) {
+ wExport->hide();
+}
+
+Fl_Button *btnClearAllFields=(Fl_Button *)0;
+
+static void cb_btnClearAllFields(Fl_Button*, void*) {
+ btnSelectCall->value(0);
+btnSelectName->value(0);
+btnSelectFreq->value(0);
+btnSelectBand->value(0);
+btnSelectMode->value(0);
+btnSelectQSOdateOn->value(0);
+btnSelectQSOdateOff->value(0);
+btnSelectTimeON->value(0);
+btnSelectTimeOFF->value(0);
+btnSelectQth->value(0);
+btnSelectLOC->value(0);
+btnSelectState->value(0);
+btnSelectProvince->value(0);
+btnSelectCountry->value(0);
+btnSelectQSLrcvd->value(0);
+btnSelectQSLsent->value(0);
+btnSelectSerialIN->value(0);
+btnSelectSerialOUT->value(0);
+btnSelectXchgIn->value(0);
+btnSelectMyXchg->value(0);
+btnSelectRSTsent->value(0);
+btnSelectRSTrcvd->value(0);
+btnSelectIOTA->value(0);
+btnSelectCONT->value(0);
+btnSelectCQZ->value(0);
+btnSelectITUZ->value(0);
+btnSelectTX_pwr->value(0);
+btnSelectNotes->value(0);
+}
+
+Fl_Button *btnCheckAllFields=(Fl_Button *)0;
+
+static void cb_btnCheckAllFields(Fl_Button*, void*) {
+ btnSelectCall->value(1);
+btnSelectName->value(1);
+btnSelectFreq->value(1);
+btnSelectBand->value(1);
+btnSelectMode->value(1);
+btnSelectQSOdateOn->value(1);
+btnSelectQSOdateOff->value(1);
+btnSelectTimeON->value(1);
+btnSelectTimeOFF->value(1);
+btnSelectQth->value(1);
+btnSelectLOC->value(1);
+btnSelectState->value(1);
+btnSelectProvince->value(1);
+btnSelectCountry->value(1);
+btnSelectQSLrcvd->value(1);
+btnSelectQSLsent->value(1);
+btnSelectSerialIN->value(1);
+btnSelectSerialOUT->value(1);
+btnSelectXchgIn->value(1);
+btnSelectMyXchg->value(1);
+btnSelectRSTsent->value(1);
+btnSelectRSTrcvd->value(1);
+btnSelectIOTA->value(1);
+btnSelectDXCC->value(1);
+btnSelectCONT->value(1);
+btnSelectCQZ->value(1);
+btnSelectITUZ->value(1);
+btnSelectTX_pwr->value(1);
+btnSelectNotes->value(1);
+}
+
+Fl_Check_Button *btnSelectCall=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnSelectName=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnSelectFreq=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnSelectBand=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnSelectMode=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnSelectQSOdateOn=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnSelectTimeON=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnSelectQSOdateOff=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnSelectTimeOFF=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnSelectTX_pwr=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnSelectRSTsent=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnSelectRSTrcvd=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnSelectQth=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnSelectLOC=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnSelectState=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnSelectProvince=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnSelectCountry=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnSelectNotes=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnSelectQSLrcvd=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnSelectQSLsent=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnSelectSerialIN=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnSelectSerialOUT=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnSelectXchgIn=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnSelectMyXchg=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnSelectCONT=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnSelectCQZ=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnSelectDXCC=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnSelectIOTA=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnSelectITUZ=(Fl_Check_Button *)0;
+
+Fl_Button *btnSetFieldDefaults=(Fl_Button *)0;
+
+static void cb_btnSetFieldDefaults(Fl_Button*, void*) {
+ btnSelectCall->value(1);
+btnSelectName->value(1);
+btnSelectFreq->value(1);
+btnSelectBand->value(1);
+btnSelectMode->value(1);
+btnSelectQSOdateOn->value(1);
+btnSelectQSOdateOff->value(1);
+btnSelectTimeON->value(1);
+btnSelectTimeOFF->value(1);
+btnSelectQth->value(0);
+btnSelectLOC->value(1);
+btnSelectState->value(0);
+btnSelectProvince->value(0);
+btnSelectCountry->value(0);
+btnSelectQSLrcvd->value(0);
+btnSelectQSLsent->value(0);
+btnSelectSerialIN->value(0);
+btnSelectSerialOUT->value(0);
+btnSelectXchgIn->value(0);
+btnSelectMyXchg->value(0);
+btnSelectRSTsent->value(0);
+btnSelectRSTrcvd->value(1);
+btnSelectNotes->value(0);
+btnSelectIOTA->value(0);
+btnSelectDXCC->value(0);
+btnSelectTX_pwr->value(0);
+}
+
+Fl_Double_Window *wCabrillo=(Fl_Double_Window *)0;
+
+Fl_Check_Browser *chkCabBrowser=(Fl_Check_Browser *)0;
+
+Fl_Button *btnCabClearAll=(Fl_Button *)0;
+
+static void cb_btnCabClearAll(Fl_Button*, void*) {
+ chkCabBrowser->check_none();
+}
+
+Fl_Button *btnCabCheckAll=(Fl_Button *)0;
+
+static void cb_btnCabCheckAll(Fl_Button*, void*) {
+ chkCabBrowser->check_all();
+}
+
+Fl_Return_Button *btnCabOK=(Fl_Return_Button *)0;
+
+static void cb_btnCabOK(Fl_Return_Button*, void*) {
+ wCabrillo->hide();
+WriteCabrillo();
+}
+
+Fl_Button *btnCabCancel=(Fl_Button *)0;
+
+static void cb_btnCabCancel(Fl_Button*, void*) {
+ wCabrillo->hide();
+}
+
+Fl_ComboBox *cboContest=(Fl_ComboBox *)0;
+
+static void cb_cboContest(Fl_ComboBox*, void*) {
+ setContestType();
+}
+
+Fl_Check_Button *btnCabCall=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnCabFreq=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnCabMode=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnCabQSOdateOn=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnCabTimeOn=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnCabQSOdateOff=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnCabTimeOff=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnCabRSTsent=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnCabRSTrcvd=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnCabSerialIN=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnCabSerialOUT=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnCabXchgIn=(Fl_Check_Button *)0;
+
+Fl_Check_Button *btnCabMyXchg=(Fl_Check_Button *)0;
+
+Fl_Button *btnCabClearAllFields=(Fl_Button *)0;
+
+static void cb_btnCabClearAllFields(Fl_Button*, void*) {
+ btnCabCall->value(0);
+btnCabFreq->value(0);
+btnCabMode->value(0);
+btnCabQSOdateOn->value(0);
+btnCabTimeOn->value(0);
+btnCabQSOdateOff->value(0);
+btnCabTimeOff->value(0);
+btnCabSerialIN->value(0);
+btnCabSerialOUT->value(0);
+btnCabXchgIn->value(0);
+btnCabMyXchg->value(0);
+btnCabRSTsent->value(0);
+btnCabRSTrcvd->value(0);
+}
+
+Fl_Button *btnCabCheckAllFields=(Fl_Button *)0;
+
+static void cb_btnCabCheckAllFields(Fl_Button*, void*) {
+ btnCabCall->value(1);
+btnCabFreq->value(1);
+btnCabMode->value(1);
+btnCabQSOdateOn->value(1);
+btnCabTimeOn->value(1);
+btnCabQSOdateOff->value(1);
+btnCabTimeOff->value(1);
+btnCabSerialIN->value(1);
+btnCabSerialOUT->value(1);
+btnCabXchgIn->value(1);
+btnCabMyXchg->value(1);
+btnCabRSTsent->value(1);
+btnCabRSTrcvd->value(1);
+}
+
+void create_logbook_dialogs() {
+ { dlgLogbook = new Fl_Double_Window(589, 366, _("Logbook"));
+ dlgLogbook->color(FL_DARK1);
+ { editGroup = new Fl_Group(4, 3, 580, 242);
+ editGroup->box(FL_ENGRAVED_FRAME);
+ editGroup->color(FL_LIGHT2);
+ { inpDate_log = new Fl_DateInput(9, 21, 100, 22, _("On Date"));
+ inpDate_log->tooltip(_("Date QSO started"));
+ inpDate_log->box(FL_DOWN_BOX);
+ inpDate_log->color(FL_BACKGROUND2_COLOR);
+ inpDate_log->selection_color(FL_SELECTION_COLOR);
+ inpDate_log->labeltype(FL_NORMAL_LABEL);
+ inpDate_log->labelfont(0);
+ inpDate_log->labelsize(12);
+ inpDate_log->labelcolor(FL_FOREGROUND_COLOR);
+ inpDate_log->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ inpDate_log->when(FL_WHEN_RELEASE);
+ inpDate_log->format(2);
+ } // Fl_DateInput* inpDate_log
+ { inpTimeOn_log = new Fl_Input2(110, 21, 40, 22, _("Time"));
+ inpTimeOn_log->tooltip(_("Time QSO started"));
+ inpTimeOn_log->box(FL_DOWN_BOX);
+ inpTimeOn_log->color(FL_BACKGROUND2_COLOR);
+ inpTimeOn_log->selection_color(FL_SELECTION_COLOR);
+ inpTimeOn_log->labeltype(FL_NORMAL_LABEL);
+ inpTimeOn_log->labelfont(0);
+ inpTimeOn_log->labelsize(12);
+ inpTimeOn_log->labelcolor(FL_FOREGROUND_COLOR);
+ inpTimeOn_log->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ inpTimeOn_log->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* inpTimeOn_log
+ { inpDateOff_log = new Fl_DateInput(152, 21, 100, 22, _("Off Date"));
+ inpDateOff_log->tooltip(_("Date QSO Ended"));
+ inpDateOff_log->box(FL_DOWN_BOX);
+ inpDateOff_log->color(FL_BACKGROUND2_COLOR);
+ inpDateOff_log->selection_color(FL_SELECTION_COLOR);
+ inpDateOff_log->labeltype(FL_NORMAL_LABEL);
+ inpDateOff_log->labelfont(0);
+ inpDateOff_log->labelsize(12);
+ inpDateOff_log->labelcolor(FL_FOREGROUND_COLOR);
+ inpDateOff_log->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ inpDateOff_log->when(FL_WHEN_RELEASE);
+ inpDateOff_log->format(2);
+ } // Fl_DateInput* inpDateOff_log
+ { inpTimeOff_log = new Fl_Input2(253, 21, 40, 22, _("Time"));
+ inpTimeOff_log->tooltip(_("Time QSO ended"));
+ inpTimeOff_log->box(FL_DOWN_BOX);
+ inpTimeOff_log->color(FL_BACKGROUND2_COLOR);
+ inpTimeOff_log->selection_color(FL_SELECTION_COLOR);
+ inpTimeOff_log->labeltype(FL_NORMAL_LABEL);
+ inpTimeOff_log->labelfont(0);
+ inpTimeOff_log->labelsize(12);
+ inpTimeOff_log->labelcolor(FL_FOREGROUND_COLOR);
+ inpTimeOff_log->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ inpTimeOff_log->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* inpTimeOff_log
+ { inpCall_log = new Fl_Input2(296, 21, 100, 22, _("Call"));
+ inpCall_log->tooltip(_("Call sign worked"));
+ inpCall_log->box(FL_DOWN_BOX);
+ inpCall_log->color(FL_BACKGROUND2_COLOR);
+ inpCall_log->selection_color(FL_SELECTION_COLOR);
+ inpCall_log->labeltype(FL_NORMAL_LABEL);
+ inpCall_log->labelfont(0);
+ inpCall_log->labelsize(12);
+ inpCall_log->labelcolor(FL_FOREGROUND_COLOR);
+ inpCall_log->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ inpCall_log->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* inpCall_log
+ { inpName_log = new Fl_Input2(398, 21, 96, 22, _("Name"));
+ inpName_log->tooltip(_("Operator worked"));
+ inpName_log->box(FL_DOWN_BOX);
+ inpName_log->color(FL_BACKGROUND2_COLOR);
+ inpName_log->selection_color(FL_SELECTION_COLOR);
+ inpName_log->labeltype(FL_NORMAL_LABEL);
+ inpName_log->labelfont(0);
+ inpName_log->labelsize(12);
+ inpName_log->labelcolor(FL_FOREGROUND_COLOR);
+ inpName_log->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ inpName_log->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* inpName_log
+ { inpFreq_log = new Fl_Input2(497, 21, 80, 22, _("Freq."));
+ inpFreq_log->tooltip(_("Frequency in MHz"));
+ inpFreq_log->box(FL_DOWN_BOX);
+ inpFreq_log->color(FL_BACKGROUND2_COLOR);
+ inpFreq_log->selection_color(FL_SELECTION_COLOR);
+ inpFreq_log->labeltype(FL_NORMAL_LABEL);
+ inpFreq_log->labelfont(0);
+ inpFreq_log->labelsize(12);
+ inpFreq_log->labelcolor(FL_FOREGROUND_COLOR);
+ inpFreq_log->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ inpFreq_log->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* inpFreq_log
+ { inpMode_log = new Fl_Input2(9, 57, 115, 22, _("Mode"));
+ inpMode_log->tooltip(_("Mode in use"));
+ inpMode_log->box(FL_DOWN_BOX);
+ inpMode_log->color(FL_BACKGROUND2_COLOR);
+ inpMode_log->selection_color(FL_SELECTION_COLOR);
+ inpMode_log->labeltype(FL_NORMAL_LABEL);
+ inpMode_log->labelfont(0);
+ inpMode_log->labelsize(12);
+ inpMode_log->labelcolor(FL_FOREGROUND_COLOR);
+ inpMode_log->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ inpMode_log->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* inpMode_log
+ { inpRstR_log = new Fl_Input2(127, 57, 35, 22, _("In"));
+ inpRstR_log->tooltip(_("Rst received"));
+ inpRstR_log->box(FL_DOWN_BOX);
+ inpRstR_log->color(FL_BACKGROUND2_COLOR);
+ inpRstR_log->selection_color(FL_SELECTION_COLOR);
+ inpRstR_log->labeltype(FL_NORMAL_LABEL);
+ inpRstR_log->labelfont(0);
+ inpRstR_log->labelsize(12);
+ inpRstR_log->labelcolor(FL_FOREGROUND_COLOR);
+ inpRstR_log->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ inpRstR_log->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* inpRstR_log
+ { inpRstS_log = new Fl_Input2(164, 57, 35, 22, _("Out"));
+ inpRstS_log->tooltip(_("Rst sent"));
+ inpRstS_log->box(FL_DOWN_BOX);
+ inpRstS_log->color(FL_BACKGROUND2_COLOR);
+ inpRstS_log->selection_color(FL_SELECTION_COLOR);
+ inpRstS_log->labeltype(FL_NORMAL_LABEL);
+ inpRstS_log->labelfont(0);
+ inpRstS_log->labelsize(12);
+ inpRstS_log->labelcolor(FL_FOREGROUND_COLOR);
+ inpRstS_log->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ inpRstS_log->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* inpRstS_log
+ { inpTX_pwr_log = new Fl_Input2(201, 57, 60, 22, _("Tx Power"));
+ inpTX_pwr_log->tooltip(_("Transmit power used"));
+ inpTX_pwr_log->box(FL_DOWN_BOX);
+ inpTX_pwr_log->color(FL_BACKGROUND2_COLOR);
+ inpTX_pwr_log->selection_color(FL_SELECTION_COLOR);
+ inpTX_pwr_log->labeltype(FL_NORMAL_LABEL);
+ inpTX_pwr_log->labelfont(0);
+ inpTX_pwr_log->labelsize(12);
+ inpTX_pwr_log->labelcolor(FL_FOREGROUND_COLOR);
+ inpTX_pwr_log->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ inpTX_pwr_log->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* inpTX_pwr_log
+ { Fl_DateInput* o = inpQSLrcvddate_log = new Fl_DateInput(264, 57, 100, 22, _("QSL-rcvd"));
+ inpQSLrcvddate_log->tooltip(_("QSL received on this date"));
+ inpQSLrcvddate_log->box(FL_DOWN_BOX);
+ inpQSLrcvddate_log->color(FL_BACKGROUND2_COLOR);
+ inpQSLrcvddate_log->selection_color(FL_SELECTION_COLOR);
+ inpQSLrcvddate_log->labeltype(FL_NORMAL_LABEL);
+ inpQSLrcvddate_log->labelfont(0);
+ inpQSLrcvddate_log->labelsize(12);
+ inpQSLrcvddate_log->labelcolor(FL_FOREGROUND_COLOR);
+ inpQSLrcvddate_log->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ inpQSLrcvddate_log->when(FL_WHEN_RELEASE);
+ o->format(2);
+ } // Fl_DateInput* inpQSLrcvddate_log
+ { Fl_DateInput* o = inpQSLsentdate_log = new Fl_DateInput(368, 57, 100, 22, _("QSL-sent"));
+ inpQSLsentdate_log->tooltip(_("QSL sent on this date"));
+ inpQSLsentdate_log->box(FL_DOWN_BOX);
+ inpQSLsentdate_log->color(FL_BACKGROUND2_COLOR);
+ inpQSLsentdate_log->selection_color(FL_SELECTION_COLOR);
+ inpQSLsentdate_log->labeltype(FL_NORMAL_LABEL);
+ inpQSLsentdate_log->labelfont(0);
+ inpQSLsentdate_log->labelsize(12);
+ inpQSLsentdate_log->labelcolor(FL_FOREGROUND_COLOR);
+ inpQSLsentdate_log->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ inpQSLsentdate_log->when(FL_WHEN_RELEASE);
+ o->format(2);
+ } // Fl_DateInput* inpQSLsentdate_log
+ { inpCONT_log = new Fl_Input2(472, 57, 50, 22, _("CONT"));
+ inpCONT_log->tooltip(_("Continent"));
+ inpCONT_log->box(FL_DOWN_BOX);
+ inpCONT_log->color(FL_BACKGROUND2_COLOR);
+ inpCONT_log->selection_color(FL_SELECTION_COLOR);
+ inpCONT_log->labeltype(FL_NORMAL_LABEL);
+ inpCONT_log->labelfont(0);
+ inpCONT_log->labelsize(12);
+ inpCONT_log->labelcolor(FL_FOREGROUND_COLOR);
+ inpCONT_log->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ inpCONT_log->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* inpCONT_log
+ { inpDXCC_log = new Fl_Input2(527, 57, 50, 22, _("DXCC"));
+ inpDXCC_log->tooltip(_("DXCC designator"));
+ inpDXCC_log->box(FL_DOWN_BOX);
+ inpDXCC_log->color(FL_BACKGROUND2_COLOR);
+ inpDXCC_log->selection_color(FL_SELECTION_COLOR);
+ inpDXCC_log->labeltype(FL_NORMAL_LABEL);
+ inpDXCC_log->labelfont(0);
+ inpDXCC_log->labelsize(12);
+ inpDXCC_log->labelcolor(FL_FOREGROUND_COLOR);
+ inpDXCC_log->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ inpDXCC_log->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* inpDXCC_log
+ { inpQth_log = new Fl_Input2(9, 94, 150, 22, _("Qth"));
+ inpQth_log->tooltip(_("City of station worked"));
+ inpQth_log->box(FL_DOWN_BOX);
+ inpQth_log->color(FL_BACKGROUND2_COLOR);
+ inpQth_log->selection_color(FL_SELECTION_COLOR);
+ inpQth_log->labeltype(FL_NORMAL_LABEL);
+ inpQth_log->labelfont(0);
+ inpQth_log->labelsize(12);
+ inpQth_log->labelcolor(FL_FOREGROUND_COLOR);
+ inpQth_log->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ inpQth_log->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* inpQth_log
+ { inpState_log = new Fl_Input2(161, 94, 35, 22, _("St"));
+ inpState_log->tooltip(_("US state of station worked"));
+ inpState_log->box(FL_DOWN_BOX);
+ inpState_log->color(FL_BACKGROUND2_COLOR);
+ inpState_log->selection_color(FL_SELECTION_COLOR);
+ inpState_log->labeltype(FL_NORMAL_LABEL);
+ inpState_log->labelfont(0);
+ inpState_log->labelsize(12);
+ inpState_log->labelcolor(FL_FOREGROUND_COLOR);
+ inpState_log->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ inpState_log->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* inpState_log
+ { inpVE_Prov_log = new Fl_Input2(198, 94, 35, 22, _("Pr"));
+ inpVE_Prov_log->tooltip(_("Province of station worked"));
+ inpVE_Prov_log->box(FL_DOWN_BOX);
+ inpVE_Prov_log->color(FL_BACKGROUND2_COLOR);
+ inpVE_Prov_log->selection_color(FL_SELECTION_COLOR);
+ inpVE_Prov_log->labeltype(FL_NORMAL_LABEL);
+ inpVE_Prov_log->labelfont(0);
+ inpVE_Prov_log->labelsize(12);
+ inpVE_Prov_log->labelcolor(FL_FOREGROUND_COLOR);
+ inpVE_Prov_log->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ inpVE_Prov_log->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* inpVE_Prov_log
+ { inpCountry_log = new Fl_Input2(235, 94, 100, 22, _("Country"));
+ inpCountry_log->tooltip(_("Country of station worked"));
+ inpCountry_log->box(FL_DOWN_BOX);
+ inpCountry_log->color(FL_BACKGROUND2_COLOR);
+ inpCountry_log->selection_color(FL_SELECTION_COLOR);
+ inpCountry_log->labeltype(FL_NORMAL_LABEL);
+ inpCountry_log->labelfont(0);
+ inpCountry_log->labelsize(12);
+ inpCountry_log->labelcolor(FL_FOREGROUND_COLOR);
+ inpCountry_log->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ inpCountry_log->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* inpCountry_log
+ { inpLoc_log = new Fl_Input2(338, 94, 75, 22, _("Loc"));
+ inpLoc_log->tooltip(_("Stations grid square"));
+ inpLoc_log->box(FL_DOWN_BOX);
+ inpLoc_log->color(FL_BACKGROUND2_COLOR);
+ inpLoc_log->selection_color(FL_SELECTION_COLOR);
+ inpLoc_log->labeltype(FL_NORMAL_LABEL);
+ inpLoc_log->labelfont(0);
+ inpLoc_log->labelsize(12);
+ inpLoc_log->labelcolor(FL_FOREGROUND_COLOR);
+ inpLoc_log->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ inpLoc_log->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* inpLoc_log
+ { inpIOTA_log = new Fl_Input2(418, 94, 50, 22, _("IOTA"));
+ inpIOTA_log->tooltip(_("Islands on the air"));
+ inpIOTA_log->box(FL_DOWN_BOX);
+ inpIOTA_log->color(FL_BACKGROUND2_COLOR);
+ inpIOTA_log->selection_color(FL_SELECTION_COLOR);
+ inpIOTA_log->labeltype(FL_NORMAL_LABEL);
+ inpIOTA_log->labelfont(0);
+ inpIOTA_log->labelsize(12);
+ inpIOTA_log->labelcolor(FL_FOREGROUND_COLOR);
+ inpIOTA_log->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ inpIOTA_log->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* inpIOTA_log
+ { inpCQZ_log = new Fl_Input2(472, 94, 50, 22, _("CQZ"));
+ inpCQZ_log->tooltip(_("CQ zone"));
+ inpCQZ_log->box(FL_DOWN_BOX);
+ inpCQZ_log->color(FL_BACKGROUND2_COLOR);
+ inpCQZ_log->selection_color(FL_SELECTION_COLOR);
+ inpCQZ_log->labeltype(FL_NORMAL_LABEL);
+ inpCQZ_log->labelfont(0);
+ inpCQZ_log->labelsize(12);
+ inpCQZ_log->labelcolor(FL_FOREGROUND_COLOR);
+ inpCQZ_log->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ inpCQZ_log->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* inpCQZ_log
+ { inpITUZ_log = new Fl_Input2(527, 94, 50, 22, _("ITUZ"));
+ inpITUZ_log->tooltip(_("ITU zone"));
+ inpITUZ_log->box(FL_DOWN_BOX);
+ inpITUZ_log->color(FL_BACKGROUND2_COLOR);
+ inpITUZ_log->selection_color(FL_SELECTION_COLOR);
+ inpITUZ_log->labeltype(FL_NORMAL_LABEL);
+ inpITUZ_log->labelfont(0);
+ inpITUZ_log->labelsize(12);
+ inpITUZ_log->labelcolor(FL_FOREGROUND_COLOR);
+ inpITUZ_log->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ inpITUZ_log->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* inpITUZ_log
+ { inpNotes_log = new Fl_Input2(10, 130, 570, 35, _("Notes"));
+ inpNotes_log->tooltip(_("Interesting notes (80 chars max)"));
+ inpNotes_log->type(4);
+ inpNotes_log->box(FL_DOWN_BOX);
+ inpNotes_log->color(FL_BACKGROUND2_COLOR);
+ inpNotes_log->selection_color(FL_SELECTION_COLOR);
+ inpNotes_log->labeltype(FL_NORMAL_LABEL);
+ inpNotes_log->labelfont(0);
+ inpNotes_log->labelsize(12);
+ inpNotes_log->labelcolor(FL_FOREGROUND_COLOR);
+ inpNotes_log->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ inpNotes_log->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* inpNotes_log
+ { bNewSave = new Fl_Button(165, 217, 55, 22, _("New"));
+ bNewSave->shortcut(0x8004e);
+ bNewSave->color(FL_LIGHT1);
+ bNewSave->selection_color((Fl_Color)48);
+ bNewSave->callback((Fl_Callback*)cb_btnNewSave);
+ } // Fl_Button* bNewSave
+ { bUpdateCancel = new Fl_Button(237, 217, 55, 22, _("Update"));
+ bUpdateCancel->shortcut(0x80055);
+ bUpdateCancel->color(FL_LIGHT1);
+ bUpdateCancel->selection_color((Fl_Color)48);
+ bUpdateCancel->callback((Fl_Callback*)cb_btnUpdateCancel);
+ } // Fl_Button* bUpdateCancel
+ { bDelete = new Fl_Button(309, 217, 55, 22, _("Delete"));
+ bDelete->shortcut(0x80044);
+ bDelete->color(FL_LIGHT1);
+ bDelete->selection_color((Fl_Color)48);
+ bDelete->callback((Fl_Callback*)cb_btnDelete);
+ } // Fl_Button* bDelete
+ { txtNbrRecs_log = new Fl_Input2(43, 217, 65, 22, _("Recs"));
+ txtNbrRecs_log->tooltip(_("# Records in logbook"));
+ txtNbrRecs_log->box(FL_DOWN_BOX);
+ txtNbrRecs_log->color(FL_BACKGROUND2_COLOR);
+ txtNbrRecs_log->selection_color(FL_SELECTION_COLOR);
+ txtNbrRecs_log->labeltype(FL_NORMAL_LABEL);
+ txtNbrRecs_log->labelfont(0);
+ txtNbrRecs_log->labelsize(12);
+ txtNbrRecs_log->labelcolor(FL_FOREGROUND_COLOR);
+ txtNbrRecs_log->align(Fl_Align(FL_ALIGN_LEFT));
+ txtNbrRecs_log->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* txtNbrRecs_log
+ { Fl_Group* o = new Fl_Group(10, 169, 453, 44);
+ o->box(FL_ENGRAVED_FRAME);
+ { inpSerNoOut_log = new Fl_Input2(13, 186, 55, 22, _("Ser# out"));
+ inpSerNoOut_log->tooltip(_("Contest seral # sent"));
+ inpSerNoOut_log->box(FL_DOWN_BOX);
+ inpSerNoOut_log->color(FL_BACKGROUND2_COLOR);
+ inpSerNoOut_log->selection_color(FL_SELECTION_COLOR);
+ inpSerNoOut_log->labeltype(FL_NORMAL_LABEL);
+ inpSerNoOut_log->labelfont(0);
+ inpSerNoOut_log->labelsize(12);
+ inpSerNoOut_log->labelcolor(FL_FOREGROUND_COLOR);
+ inpSerNoOut_log->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ inpSerNoOut_log->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* inpSerNoOut_log
+ { inpMyXchg_log = new Fl_Input2(70, 186, 164, 22, _("Exchange Out"));
+ inpMyXchg_log->tooltip(_("Contest exchange sent"));
+ inpMyXchg_log->box(FL_DOWN_BOX);
+ inpMyXchg_log->color(FL_BACKGROUND2_COLOR);
+ inpMyXchg_log->selection_color(FL_SELECTION_COLOR);
+ inpMyXchg_log->labeltype(FL_NORMAL_LABEL);
+ inpMyXchg_log->labelfont(0);
+ inpMyXchg_log->labelsize(12);
+ inpMyXchg_log->labelcolor(FL_FOREGROUND_COLOR);
+ inpMyXchg_log->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ inpMyXchg_log->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* inpMyXchg_log
+ { inpSerNoIn_log = new Fl_Input2(237, 186, 55, 22, _("Ser# in"));
+ inpSerNoIn_log->tooltip(_("Contest serial # received"));
+ inpSerNoIn_log->box(FL_DOWN_BOX);
+ inpSerNoIn_log->color(FL_BACKGROUND2_COLOR);
+ inpSerNoIn_log->selection_color(FL_SELECTION_COLOR);
+ inpSerNoIn_log->labeltype(FL_NORMAL_LABEL);
+ inpSerNoIn_log->labelfont(0);
+ inpSerNoIn_log->labelsize(12);
+ inpSerNoIn_log->labelcolor(FL_FOREGROUND_COLOR);
+ inpSerNoIn_log->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ inpSerNoIn_log->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* inpSerNoIn_log
+ { inpXchgIn_log = new Fl_Input2(295, 186, 164, 22, _("Exchange In"));
+ inpXchgIn_log->tooltip(_("Contest exchange received"));
+ inpXchgIn_log->box(FL_DOWN_BOX);
+ inpXchgIn_log->color(FL_BACKGROUND2_COLOR);
+ inpXchgIn_log->selection_color(FL_SELECTION_COLOR);
+ inpXchgIn_log->labeltype(FL_NORMAL_LABEL);
+ inpXchgIn_log->labelfont(0);
+ inpXchgIn_log->labelsize(12);
+ inpXchgIn_log->labelcolor(FL_FOREGROUND_COLOR);
+ inpXchgIn_log->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ inpXchgIn_log->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* inpXchgIn_log
+ o->end();
+ } // Fl_Group* o
+ { Fl_Group* o = new Fl_Group(466, 169, 116, 73);
+ o->box(FL_ENGRAVED_FRAME);
+ { inpSearchString = new Fl_Input2(471, 186, 105, 22, _("Call Search"));
+ inpSearchString->tooltip(_("Search for this callsign"));
+ inpSearchString->box(FL_DOWN_BOX);
+ inpSearchString->color(FL_BACKGROUND2_COLOR);
+ inpSearchString->selection_color(FL_SELECTION_COLOR);
+ inpSearchString->labeltype(FL_NORMAL_LABEL);
+ inpSearchString->labelfont(0);
+ inpSearchString->labelsize(12);
+ inpSearchString->labelcolor(FL_FOREGROUND_COLOR);
+ inpSearchString->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ inpSearchString->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* inpSearchString
+ { bSearchPrev = new Fl_Button(471, 216, 24, 22);
+ bSearchPrev->tooltip(_("Find previous"));
+ bSearchPrev->color(FL_LIGHT1);
+ bSearchPrev->selection_color((Fl_Color)48);
+ bSearchPrev->callback((Fl_Callback*)cb_search);
+ bSearchPrev->align(Fl_Align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE));
+ bSearchPrev->image(new Fl_Pixmap(left_arrow_icon));
+ } // Fl_Button* bSearchPrev
+ { bSearchNext = new Fl_Button(552, 216, 24, 22);
+ bSearchNext->tooltip(_("Find next"));
+ bSearchNext->color(FL_LIGHT1);
+ bSearchNext->selection_color((Fl_Color)48);
+ bSearchNext->callback((Fl_Callback*)cb_search);
+ bSearchNext->align(Fl_Align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE));
+ bSearchNext->image(new Fl_Pixmap(right_arrow_icon));
+ } // Fl_Button* bSearchNext
+ o->end();
+ } // Fl_Group* o
+ editGroup->end();
+ } // Fl_Group* editGroup
+ { wBrowser = new Table(4, 245, 580, 115);
+ wBrowser->box(FL_DOWN_FRAME);
+ wBrowser->color(FL_BACKGROUND2_COLOR);
+ wBrowser->selection_color(FL_SELECTION_COLOR);
+ wBrowser->labeltype(FL_NORMAL_LABEL);
+ wBrowser->labelfont(0);
+ wBrowser->labelsize(14);
+ wBrowser->labelcolor(FL_FOREGROUND_COLOR);
+ wBrowser->align(Fl_Align(FL_ALIGN_TOP));
+ wBrowser->when(FL_WHEN_RELEASE);
+ wBrowser->end();
+ Fl_Group::current()->resizable(wBrowser);
+ } // Table* wBrowser
+ dlgLogbook->end();
+ } // Fl_Double_Window* dlgLogbook
+ wBrowser->align (FL_ALIGN_TOP | FL_ALIGN_LEFT);
+ wBrowser->addColumn (_("Date"),85);
+ wBrowser->colcallback (0,cb_SortByDate);
+ wBrowser->addColumn (_("Time"),50);
+ wBrowser->addColumn (_("Callsign"),100);
+ wBrowser->colcallback (2,cb_SortByCall);
+ wBrowser->addColumn (_("Name"),110);
+ wBrowser->addColumn (_("Frequency"),120);
+ wBrowser->colcallback (4,cb_SortByFreq);
+ wBrowser->addColumn (_("Mode"),90);
+ wBrowser->colcallback (5,cb_SortByMode);
+ wBrowser->addHiddenColumn ("rn");
+ wBrowser->allowSort(true);
+ wBrowser->callback(cb_browser);
+ wBrowser->when(FL_WHEN_CHANGED);
+ wBrowser->rowSize (FL_NORMAL_SIZE);
+ wBrowser->headerSize (FL_NORMAL_SIZE);
+ wBrowser->allowResize (1);
+ wBrowser->gridEnabled (0);
+ dlgLogbook->xclass(PACKAGE_TARNAME);
+ { wExport = new Fl_Double_Window(655, 385, _("Export Setup"));
+ { Fl_Group* o = new Fl_Group(4, 4, 388, 350, _("Select Records to Export"));
+ o->box(FL_ENGRAVED_FRAME);
+ o->align(Fl_Align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE));
+ { chkExportBrowser = new Fl_Check_Browser(13, 25, 370, 295);
+ } // Fl_Check_Browser* chkExportBrowser
+ { btnClearAll = new Fl_Button(69, 325, 109, 20, _("Clear All"));
+ btnClearAll->callback((Fl_Callback*)cb_btnClearAll);
+ } // Fl_Button* btnClearAll
+ { btnCheckAll = new Fl_Button(200, 325, 109, 20, _("Check All"));
+ btnCheckAll->callback((Fl_Callback*)cb_btnCheckAll);
+ } // Fl_Button* btnCheckAll
+ o->end();
+ } // Fl_Group* o
+ { btnOK = new Fl_Return_Button(536, 360, 100, 20, _("OK"));
+ btnOK->callback((Fl_Callback*)cb_btnOK);
+ } // Fl_Return_Button* btnOK
+ { btnCancel = new Fl_Button(405, 360, 100, 20, _("Cancel"));
+ btnCancel->callback((Fl_Callback*)cb_btnCancel);
+ } // Fl_Button* btnCancel
+ { Fl_Group* o = new Fl_Group(392, 4, 258, 350, _("Select Fields to Export"));
+ o->box(FL_ENGRAVED_FRAME);
+ o->align(Fl_Align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE));
+ { btnClearAllFields = new Fl_Button(400, 325, 76, 20, _("Clear All"));
+ btnClearAllFields->callback((Fl_Callback*)cb_btnClearAllFields);
+ } // Fl_Button* btnClearAllFields
+ { btnCheckAllFields = new Fl_Button(480, 325, 76, 20, _("Check All"));
+ btnCheckAllFields->callback((Fl_Callback*)cb_btnCheckAllFields);
+ } // Fl_Button* btnCheckAllFields
+ { btnSelectCall = new Fl_Check_Button(402, 25, 70, 15, _("Call"));
+ btnSelectCall->down_box(FL_DOWN_BOX);
+ btnSelectCall->value(1);
+ } // Fl_Check_Button* btnSelectCall
+ { btnSelectName = new Fl_Check_Button(402, 44, 70, 15, _("Name"));
+ btnSelectName->down_box(FL_DOWN_BOX);
+ btnSelectName->value(1);
+ } // Fl_Check_Button* btnSelectName
+ { btnSelectFreq = new Fl_Check_Button(402, 64, 70, 15, _("Freq"));
+ btnSelectFreq->down_box(FL_DOWN_BOX);
+ btnSelectFreq->value(1);
+ } // Fl_Check_Button* btnSelectFreq
+ { btnSelectBand = new Fl_Check_Button(402, 83, 70, 15, _("Band"));
+ btnSelectBand->down_box(FL_DOWN_BOX);
+ } // Fl_Check_Button* btnSelectBand
+ { btnSelectMode = new Fl_Check_Button(402, 103, 70, 15, _("Mode"));
+ btnSelectMode->down_box(FL_DOWN_BOX);
+ btnSelectMode->value(1);
+ } // Fl_Check_Button* btnSelectMode
+ { btnSelectQSOdateOn = new Fl_Check_Button(402, 122, 70, 15, _("QSO Date On"));
+ btnSelectQSOdateOn->down_box(FL_DOWN_BOX);
+ btnSelectQSOdateOn->value(1);
+ } // Fl_Check_Button* btnSelectQSOdateOn
+ { btnSelectTimeON = new Fl_Check_Button(402, 142, 70, 15, _("Time ON"));
+ btnSelectTimeON->down_box(FL_DOWN_BOX);
+ btnSelectTimeON->value(1);
+ } // Fl_Check_Button* btnSelectTimeON
+ { btnSelectQSOdateOff = new Fl_Check_Button(402, 162, 70, 15, _("QSO Date Off"));
+ btnSelectQSOdateOff->down_box(FL_DOWN_BOX);
+ btnSelectQSOdateOff->value(1);
+ } // Fl_Check_Button* btnSelectQSOdateOff
+ { btnSelectTimeOFF = new Fl_Check_Button(402, 182, 70, 15, _("Time OFF"));
+ btnSelectTimeOFF->down_box(FL_DOWN_BOX);
+ btnSelectTimeOFF->value(1);
+ } // Fl_Check_Button* btnSelectTimeOFF
+ { btnSelectTX_pwr = new Fl_Check_Button(402, 201, 70, 15, _("TX Power"));
+ btnSelectTX_pwr->down_box(FL_DOWN_BOX);
+ } // Fl_Check_Button* btnSelectTX_pwr
+ { btnSelectRSTsent = new Fl_Check_Button(402, 221, 70, 15, _("RST sent"));
+ btnSelectRSTsent->down_box(FL_DOWN_BOX);
+ btnSelectRSTsent->value(1);
+ } // Fl_Check_Button* btnSelectRSTsent
+ { btnSelectRSTrcvd = new Fl_Check_Button(402, 240, 70, 15, _("RST rcvd"));
+ btnSelectRSTrcvd->down_box(FL_DOWN_BOX);
+ btnSelectRSTrcvd->value(1);
+ } // Fl_Check_Button* btnSelectRSTrcvd
+ { btnSelectQth = new Fl_Check_Button(402, 260, 70, 15, _("Qth"));
+ btnSelectQth->down_box(FL_DOWN_BOX);
+ } // Fl_Check_Button* btnSelectQth
+ { btnSelectLOC = new Fl_Check_Button(402, 280, 70, 15, _("LOC"));
+ btnSelectLOC->down_box(FL_DOWN_BOX);
+ btnSelectLOC->value(1);
+ } // Fl_Check_Button* btnSelectLOC
+ { btnSelectState = new Fl_Check_Button(400, 300, 70, 15, _("State"));
+ btnSelectState->down_box(FL_DOWN_BOX);
+ } // Fl_Check_Button* btnSelectState
+ { btnSelectProvince = new Fl_Check_Button(520, 24, 70, 15, _("Province"));
+ btnSelectProvince->down_box(FL_DOWN_BOX);
+ } // Fl_Check_Button* btnSelectProvince
+ { btnSelectCountry = new Fl_Check_Button(520, 44, 70, 15, _("Country"));
+ btnSelectCountry->down_box(FL_DOWN_BOX);
+ } // Fl_Check_Button* btnSelectCountry
+ { btnSelectNotes = new Fl_Check_Button(520, 63, 70, 15, _("Notes"));
+ btnSelectNotes->down_box(FL_DOWN_BOX);
+ } // Fl_Check_Button* btnSelectNotes
+ { btnSelectQSLrcvd = new Fl_Check_Button(520, 83, 70, 15, _("QSL rcvd date"));
+ btnSelectQSLrcvd->down_box(FL_DOWN_BOX);
+ } // Fl_Check_Button* btnSelectQSLrcvd
+ { btnSelectQSLsent = new Fl_Check_Button(520, 103, 70, 15, _("QSL sent date"));
+ btnSelectQSLsent->down_box(FL_DOWN_BOX);
+ } // Fl_Check_Button* btnSelectQSLsent
+ { btnSelectSerialIN = new Fl_Check_Button(520, 122, 70, 15, _("Serial # in"));
+ btnSelectSerialIN->down_box(FL_DOWN_BOX);
+ } // Fl_Check_Button* btnSelectSerialIN
+ { btnSelectSerialOUT = new Fl_Check_Button(520, 142, 70, 15, _("Serial # out"));
+ btnSelectSerialOUT->down_box(FL_DOWN_BOX);
+ } // Fl_Check_Button* btnSelectSerialOUT
+ { btnSelectXchgIn = new Fl_Check_Button(520, 161, 70, 15, _("Exchange In"));
+ btnSelectXchgIn->down_box(FL_DOWN_BOX);
+ } // Fl_Check_Button* btnSelectXchgIn
+ { btnSelectMyXchg = new Fl_Check_Button(520, 181, 70, 15, _("Exchange Out"));
+ btnSelectMyXchg->down_box(FL_DOWN_BOX);
+ } // Fl_Check_Button* btnSelectMyXchg
+ { btnSelectCONT = new Fl_Check_Button(521, 201, 70, 15, _("CONT"));
+ btnSelectCONT->down_box(FL_DOWN_BOX);
+ } // Fl_Check_Button* btnSelectCONT
+ { btnSelectCQZ = new Fl_Check_Button(521, 220, 70, 15, _("CQZ"));
+ btnSelectCQZ->down_box(FL_DOWN_BOX);
+ } // Fl_Check_Button* btnSelectCQZ
+ { btnSelectDXCC = new Fl_Check_Button(521, 240, 70, 15, _("DXCC"));
+ btnSelectDXCC->down_box(FL_DOWN_BOX);
+ } // Fl_Check_Button* btnSelectDXCC
+ { btnSelectIOTA = new Fl_Check_Button(521, 260, 70, 15, _("IOTA"));
+ btnSelectIOTA->down_box(FL_DOWN_BOX);
+ } // Fl_Check_Button* btnSelectIOTA
+ { btnSelectITUZ = new Fl_Check_Button(521, 280, 70, 15, _("ITUZ"));
+ btnSelectITUZ->down_box(FL_DOWN_BOX);
+ } // Fl_Check_Button* btnSelectITUZ
+ { btnSetFieldDefaults = new Fl_Button(560, 325, 76, 20, _("Defaults"));
+ btnSetFieldDefaults->callback((Fl_Callback*)cb_btnSetFieldDefaults);
+ } // Fl_Button* btnSetFieldDefaults
+ o->end();
+ } // Fl_Group* o
+ wExport->set_modal();
+ wExport->end();
+ } // Fl_Double_Window* wExport
+ { wCabrillo = new Fl_Double_Window(655, 340, _("Cabrillo Setup"));
+ { Fl_Group* o = new Fl_Group(4, 4, 388, 305, _("Select Records to Export"));
+ o->box(FL_ENGRAVED_FRAME);
+ o->align(Fl_Align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE));
+ { chkCabBrowser = new Fl_Check_Browser(13, 25, 370, 245);
+ } // Fl_Check_Browser* chkCabBrowser
+ { btnCabClearAll = new Fl_Button(69, 277, 109, 20, _("Clear All"));
+ btnCabClearAll->callback((Fl_Callback*)cb_btnCabClearAll);
+ } // Fl_Button* btnCabClearAll
+ { btnCabCheckAll = new Fl_Button(200, 277, 109, 20, _("Check All"));
+ btnCabCheckAll->callback((Fl_Callback*)cb_btnCabCheckAll);
+ } // Fl_Button* btnCabCheckAll
+ o->end();
+ } // Fl_Group* o
+ { btnCabOK = new Fl_Return_Button(536, 312, 100, 20, _("OK"));
+ btnCabOK->callback((Fl_Callback*)cb_btnCabOK);
+ } // Fl_Return_Button* btnCabOK
+ { btnCabCancel = new Fl_Button(405, 312, 100, 20, _("Cancel"));
+ btnCabCancel->callback((Fl_Callback*)cb_btnCabCancel);
+ } // Fl_Button* btnCabCancel
+ { Fl_Group* o = new Fl_Group(392, 4, 258, 305, _("Select Cabrillo Contest & Fields"));
+ o->box(FL_ENGRAVED_FRAME);
+ o->align(Fl_Align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE));
+ { cboContest = new Fl_ComboBox(462, 35, 180, 20, _("Contest:"));
+ cboContest->box(FL_BORDER_BOX);
+ cboContest->color(FL_BACKGROUND2_COLOR);
+ cboContest->selection_color(FL_BACKGROUND_COLOR);
+ cboContest->labeltype(FL_NORMAL_LABEL);
+ cboContest->labelfont(0);
+ cboContest->labelsize(14);
+ cboContest->labelcolor(FL_FOREGROUND_COLOR);
+ cboContest->callback((Fl_Callback*)cb_cboContest);
+ cboContest->align(Fl_Align(FL_ALIGN_LEFT));
+ cboContest->when(FL_WHEN_RELEASE);
+ cboContest->end();
+ } // Fl_ComboBox* cboContest
+ { btnCabCall = new Fl_Check_Button(407, 75, 70, 15, _("Call"));
+ btnCabCall->down_box(FL_DOWN_BOX);
+ btnCabCall->value(1);
+ } // Fl_Check_Button* btnCabCall
+ { btnCabFreq = new Fl_Check_Button(407, 100, 70, 15, _("Freq"));
+ btnCabFreq->down_box(FL_DOWN_BOX);
+ btnCabFreq->value(1);
+ } // Fl_Check_Button* btnCabFreq
+ { btnCabMode = new Fl_Check_Button(407, 125, 70, 15, _("Mode"));
+ btnCabMode->down_box(FL_DOWN_BOX);
+ btnCabMode->value(1);
+ } // Fl_Check_Button* btnCabMode
+ { btnCabQSOdateOn = new Fl_Check_Button(407, 210, 70, 15, _("QSO Date On"));
+ btnCabQSOdateOn->down_box(FL_DOWN_BOX);
+ } // Fl_Check_Button* btnCabQSOdateOn
+ { btnCabTimeOn = new Fl_Check_Button(407, 235, 70, 15, _("Time ON"));
+ btnCabTimeOn->down_box(FL_DOWN_BOX);
+ } // Fl_Check_Button* btnCabTimeOn
+ { btnCabQSOdateOff = new Fl_Check_Button(526, 210, 70, 15, _("QSO Date Off"));
+ btnCabQSOdateOff->down_box(FL_DOWN_BOX);
+ btnCabQSOdateOff->value(1);
+ } // Fl_Check_Button* btnCabQSOdateOff
+ { btnCabTimeOff = new Fl_Check_Button(526, 235, 70, 15, _("Time OFF"));
+ btnCabTimeOff->down_box(FL_DOWN_BOX);
+ btnCabTimeOff->value(1);
+ } // Fl_Check_Button* btnCabTimeOff
+ { btnCabRSTsent = new Fl_Check_Button(407, 150, 70, 15, _("RST sent"));
+ btnCabRSTsent->down_box(FL_DOWN_BOX);
+ btnCabRSTsent->value(1);
+ } // Fl_Check_Button* btnCabRSTsent
+ { btnCabRSTrcvd = new Fl_Check_Button(407, 176, 70, 15, _("RST rcvd"));
+ btnCabRSTrcvd->down_box(FL_DOWN_BOX);
+ btnCabRSTrcvd->value(1);
+ } // Fl_Check_Button* btnCabRSTrcvd
+ { btnCabSerialIN = new Fl_Check_Button(526, 75, 70, 15, _("Serial # in"));
+ btnCabSerialIN->down_box(FL_DOWN_BOX);
+ btnCabSerialIN->value(1);
+ } // Fl_Check_Button* btnCabSerialIN
+ { btnCabSerialOUT = new Fl_Check_Button(526, 100, 70, 15, _("Serial # out"));
+ btnCabSerialOUT->down_box(FL_DOWN_BOX);
+ btnCabSerialOUT->value(1);
+ } // Fl_Check_Button* btnCabSerialOUT
+ { btnCabXchgIn = new Fl_Check_Button(526, 125, 70, 15, _("Exchange In"));
+ btnCabXchgIn->down_box(FL_DOWN_BOX);
+ btnCabXchgIn->value(1);
+ } // Fl_Check_Button* btnCabXchgIn
+ { btnCabMyXchg = new Fl_Check_Button(526, 150, 70, 15, _("Exchange Out"));
+ btnCabMyXchg->down_box(FL_DOWN_BOX);
+ btnCabMyXchg->value(1);
+ } // Fl_Check_Button* btnCabMyXchg
+ { btnCabClearAllFields = new Fl_Button(437, 275, 76, 20, _("Clear All"));
+ btnCabClearAllFields->callback((Fl_Callback*)cb_btnCabClearAllFields);
+ } // Fl_Button* btnCabClearAllFields
+ { btnCabCheckAllFields = new Fl_Button(533, 275, 76, 20, _("Check All"));
+ btnCabCheckAllFields->callback((Fl_Callback*)cb_btnCabCheckAllFields);
+ } // Fl_Button* btnCabCheckAllFields
+ o->end();
+ } // Fl_Group* o
+ wCabrillo->set_modal();
+ wCabrillo->end();
+ } // Fl_Double_Window* wCabrillo
+}
diff --git a/src/logbook/lgbook.fl b/src/logbook/lgbook.fl
new file mode 100644
index 0000000..c64701d
--- /dev/null
+++ b/src/logbook/lgbook.fl
@@ -0,0 +1,627 @@
+# data file for the Fltk User Interface Designer (fluid)
+version 1.0110
+i18n_type 1
+i18n_include "gettext.h"
+i18n_function _
+header_name {.h}
+code_name {.cxx}
+decl {\#include <config.h>} {}
+
+decl {\#include <FL/Fl_Pixmap.H>} {}
+
+decl {\#include "logsupport.h"} {}
+
+decl {\#include "pixmaps.h"} {}
+
+decl {\#include "flinput2.h"} {public
+}
+
+Function {create_logbook_dialogs()} {open return_type void
+} {
+ Fl_Window dlgLogbook {
+ label Logbook open
+ xywh {585 110 589 366} type Double color 47 resizable visible
+ } {
+ Fl_Group editGroup {
+ xywh {4 3 580 242} box ENGRAVED_FRAME color 52
+ } {
+ Fl_Input inpDate_log {
+ label {On Date}
+ tooltip {Date QSO started} xywh {9 21 100 22} labelsize 12 align 5
+ code0 {\#include "calendar.h"}
+ code1 {inpDate_log->format(2);}
+ class Fl_DateInput
+ }
+ Fl_Input inpTimeOn_log {
+ label Time
+ tooltip {Time QSO started} xywh {110 21 40 22} labelsize 12 align 5
+ class Fl_Input2
+ }
+ Fl_Input inpDateOff_log {
+ label {Off Date}
+ tooltip {Date QSO Ended} xywh {152 21 100 22} labelsize 12 align 5
+ code0 {\#include "calendar.h"}
+ code1 {inpDateOff_log->format(2);}
+ class Fl_DateInput
+ }
+ Fl_Input inpTimeOff_log {
+ label Time
+ tooltip {Time QSO ended} xywh {253 21 40 22} labelsize 12 align 5
+ class Fl_Input2
+ }
+ Fl_Input inpCall_log {
+ label Call
+ tooltip {Call sign worked} xywh {296 21 100 22} labelsize 12 align 5
+ class Fl_Input2
+ }
+ Fl_Input inpName_log {
+ label Name
+ tooltip {Operator worked} xywh {398 21 96 22} labelsize 12 align 5
+ class Fl_Input2
+ }
+ Fl_Input inpFreq_log {
+ label {Freq.}
+ tooltip {Frequency in MHz} xywh {497 21 80 22} labelsize 12 align 5
+ class Fl_Input2
+ }
+ Fl_Input inpMode_log {
+ label Mode
+ tooltip {Mode in use} xywh {9 57 115 22} labelsize 12 align 5
+ class Fl_Input2
+ }
+ Fl_Input inpRstR_log {
+ label In
+ tooltip {Rst received} xywh {127 57 35 22} labelsize 12 align 5
+ class Fl_Input2
+ }
+ Fl_Input inpRstS_log {
+ label Out
+ tooltip {Rst sent} xywh {164 57 35 22} labelsize 12 align 5
+ class Fl_Input2
+ }
+ Fl_Input inpTX_pwr_log {
+ label {Tx Power}
+ tooltip {Transmit power used} xywh {201 57 60 22} labelsize 12 align 5
+ class Fl_Input2
+ }
+ Fl_Input inpQSLrcvddate_log {
+ label {QSL-rcvd}
+ tooltip {QSL received on this date} xywh {264 57 100 22} labelsize 12 align 5
+ code1 {o->format(2);}
+ class Fl_DateInput
+ }
+ Fl_Input inpQSLsentdate_log {
+ label {QSL-sent}
+ tooltip {QSL sent on this date} xywh {368 57 100 22} labelsize 12 align 5
+ code1 {o->format(2);}
+ class Fl_DateInput
+ }
+ Fl_Input inpCONT_log {
+ label CONT
+ tooltip Continent xywh {472 57 50 22} labelsize 12 align 5
+ class Fl_Input2
+ }
+ Fl_Input inpDXCC_log {
+ label DXCC
+ tooltip {DXCC designator} xywh {527 57 50 22} labelsize 12 align 5
+ class Fl_Input2
+ }
+ Fl_Input inpQth_log {
+ label Qth
+ tooltip {City of station worked} xywh {9 94 150 22} labelsize 12 align 5
+ class Fl_Input2
+ }
+ Fl_Input inpState_log {
+ label St
+ tooltip {US state of station worked} xywh {161 94 35 22} labelsize 12 align 5
+ class Fl_Input2
+ }
+ Fl_Input inpVE_Prov_log {
+ label Pr
+ tooltip {Province of station worked} xywh {198 94 35 22} labelsize 12 align 5
+ class Fl_Input2
+ }
+ Fl_Input inpCountry_log {
+ label Country
+ tooltip {Country of station worked} xywh {235 94 100 22} labelsize 12 align 5
+ class Fl_Input2
+ }
+ Fl_Input inpLoc_log {
+ label Loc
+ tooltip {Stations grid square} xywh {338 94 75 22} labelsize 12 align 5
+ class Fl_Input2
+ }
+ Fl_Input inpIOTA_log {
+ label IOTA
+ tooltip {Islands on the air} xywh {418 94 50 22} labelsize 12 align 5
+ class Fl_Input2
+ }
+ Fl_Input inpCQZ_log {
+ label CQZ
+ tooltip {CQ zone} xywh {472 94 50 22} labelsize 12 align 5
+ class Fl_Input2
+ }
+ Fl_Input inpITUZ_log {
+ label ITUZ
+ tooltip {ITU zone} xywh {527 94 50 22} labelsize 12 align 5
+ class Fl_Input2
+ }
+ Fl_Input inpNotes_log {
+ label Notes
+ tooltip {Interesting notes (80 chars max)} xywh {10 130 570 35} type Multiline labelsize 12 align 5
+ class Fl_Input2
+ }
+ Fl_Button bNewSave {
+ label New
+ callback cb_btnNewSave
+ xywh {165 217 55 22} shortcut 0x8004e color 50 selection_color 48
+ }
+ Fl_Button bUpdateCancel {
+ label Update
+ callback cb_btnUpdateCancel
+ xywh {237 217 55 22} shortcut 0x80055 color 50 selection_color 48
+ }
+ Fl_Button bDelete {
+ label Delete
+ callback cb_btnDelete
+ xywh {309 217 55 22} shortcut 0x80044 color 50 selection_color 48
+ }
+ Fl_Input txtNbrRecs_log {
+ label Recs
+ tooltip {\# Records in logbook} xywh {43 217 65 22} labelsize 12
+ class Fl_Input2
+ }
+ Fl_Group {} {open
+ xywh {10 169 453 44} box ENGRAVED_FRAME
+ } {
+ Fl_Input inpSerNoOut_log {
+ label {Ser\# out}
+ tooltip {Contest seral \# sent} xywh {13 186 55 22} labelsize 12 align 5
+ class Fl_Input2
+ }
+ Fl_Input inpMyXchg_log {
+ label {Exchange Out}
+ tooltip {Contest exchange sent} xywh {70 186 164 22} labelsize 12 align 5
+ class Fl_Input2
+ }
+ Fl_Input inpSerNoIn_log {
+ label {Ser\# in}
+ tooltip {Contest serial \# received} xywh {237 186 55 22} labelsize 12 align 5
+ class Fl_Input2
+ }
+ Fl_Input inpXchgIn_log {
+ label {Exchange In}
+ tooltip {Contest exchange received} xywh {295 186 164 22} labelsize 12 align 5
+ class Fl_Input2
+ }
+ }
+ Fl_Group {} {open
+ xywh {466 169 116 73} box ENGRAVED_FRAME
+ } {
+ Fl_Input inpSearchString {
+ label {Call Search}
+ tooltip {Search for this callsign} xywh {471 186 105 22} labelsize 12 align 5
+ class Fl_Input2
+ }
+ Fl_Button bSearchPrev {
+ callback cb_search
+ tooltip {Find previous} xywh {471 216 24 22} color 50 selection_color 48 align 16
+ code0 {bSearchPrev->image(new Fl_Pixmap(left_arrow_icon));}
+ }
+ Fl_Button bSearchNext {
+ callback cb_search
+ tooltip {Find next} xywh {552 216 24 22} color 50 selection_color 48 align 16
+ code0 {bSearchNext->image(new Fl_Pixmap(right_arrow_icon));}
+ }
+ }
+ }
+ Fl_Group wBrowser {
+ xywh {4 245 580 115} box DOWN_FRAME color 7 selection_color 15 resizable
+ code0 {\#include "table.h"}
+ class Table
+ } {}
+ }
+ code {wBrowser->align (FL_ALIGN_TOP | FL_ALIGN_LEFT);
+wBrowser->addColumn (_("Date"),85);
+wBrowser->colcallback (0,cb_SortByDate);
+wBrowser->addColumn (_("Time"),50);
+wBrowser->addColumn (_("Callsign"),100);
+wBrowser->colcallback (2,cb_SortByCall);
+wBrowser->addColumn (_("Name"),110);
+wBrowser->addColumn (_("Frequency"),120);
+wBrowser->colcallback (4,cb_SortByFreq);
+wBrowser->addColumn (_("Mode"),90);
+wBrowser->colcallback (5,cb_SortByMode);
+wBrowser->addHiddenColumn ("rn");
+wBrowser->allowSort(true);
+wBrowser->callback(cb_browser);
+wBrowser->when(FL_WHEN_CHANGED);
+wBrowser->rowSize (FL_NORMAL_SIZE);
+wBrowser->headerSize (FL_NORMAL_SIZE);
+wBrowser->allowResize (1);
+wBrowser->gridEnabled (0);
+dlgLogbook->xclass(PACKAGE_TARNAME);} {}
+ Fl_Window wExport {
+ label {Export Setup}
+ xywh {585 562 655 385} type Double hide modal
+ } {
+ Fl_Group {} {
+ label {Select Records to Export} open
+ xywh {4 4 388 350} box ENGRAVED_FRAME align 21
+ } {
+ Fl_Check_Browser chkExportBrowser {
+ xywh {13 25 370 295}
+ }
+ Fl_Button btnClearAll {
+ label {Clear All}
+ callback {chkExportBrowser->check_none();}
+ xywh {69 325 109 20}
+ }
+ Fl_Button btnCheckAll {
+ label {Check All}
+ callback {chkExportBrowser->check_all();}
+ xywh {200 325 109 20}
+ }
+ }
+ Fl_Return_Button btnOK {
+ label OK
+ callback {wExport->hide();
+Export_log();}
+ xywh {536 360 100 20}
+ }
+ Fl_Button btnCancel {
+ label Cancel
+ callback {wExport->hide();}
+ xywh {405 360 100 20}
+ }
+ Fl_Group {} {
+ label {Select Fields to Export} open
+ xywh {392 4 258 350} box ENGRAVED_FRAME align 21
+ } {
+ Fl_Button btnClearAllFields {
+ label {Clear All}
+ callback {btnSelectCall->value(0);
+btnSelectName->value(0);
+btnSelectFreq->value(0);
+btnSelectBand->value(0);
+btnSelectMode->value(0);
+btnSelectQSOdateOn->value(0);
+btnSelectQSOdateOff->value(0);
+btnSelectTimeON->value(0);
+btnSelectTimeOFF->value(0);
+btnSelectQth->value(0);
+btnSelectLOC->value(0);
+btnSelectState->value(0);
+btnSelectProvince->value(0);
+btnSelectCountry->value(0);
+btnSelectQSLrcvd->value(0);
+btnSelectQSLsent->value(0);
+btnSelectSerialIN->value(0);
+btnSelectSerialOUT->value(0);
+btnSelectXchgIn->value(0);
+btnSelectMyXchg->value(0);
+btnSelectRSTsent->value(0);
+btnSelectRSTrcvd->value(0);
+btnSelectIOTA->value(0);
+btnSelectCONT->value(0);
+btnSelectCQZ->value(0);
+btnSelectITUZ->value(0);
+btnSelectTX_pwr->value(0);
+btnSelectNotes->value(0);}
+ xywh {400 325 76 20}
+ }
+ Fl_Button btnCheckAllFields {
+ label {Check All}
+ callback {btnSelectCall->value(1);
+btnSelectName->value(1);
+btnSelectFreq->value(1);
+btnSelectBand->value(1);
+btnSelectMode->value(1);
+btnSelectQSOdateOn->value(1);
+btnSelectQSOdateOff->value(1);
+btnSelectTimeON->value(1);
+btnSelectTimeOFF->value(1);
+btnSelectQth->value(1);
+btnSelectLOC->value(1);
+btnSelectState->value(1);
+btnSelectProvince->value(1);
+btnSelectCountry->value(1);
+btnSelectQSLrcvd->value(1);
+btnSelectQSLsent->value(1);
+btnSelectSerialIN->value(1);
+btnSelectSerialOUT->value(1);
+btnSelectXchgIn->value(1);
+btnSelectMyXchg->value(1);
+btnSelectRSTsent->value(1);
+btnSelectRSTrcvd->value(1);
+btnSelectIOTA->value(1);
+btnSelectDXCC->value(1);
+btnSelectCONT->value(1);
+btnSelectCQZ->value(1);
+btnSelectITUZ->value(1);
+btnSelectTX_pwr->value(1);
+btnSelectNotes->value(1);}
+ xywh {480 325 76 20}
+ }
+ Fl_Check_Button btnSelectCall {
+ label Call
+ xywh {402 25 70 15} down_box DOWN_BOX value 1
+ }
+ Fl_Check_Button btnSelectName {
+ label Name
+ xywh {402 44 70 15} down_box DOWN_BOX value 1
+ }
+ Fl_Check_Button btnSelectFreq {
+ label Freq
+ xywh {402 64 70 15} down_box DOWN_BOX value 1
+ }
+ Fl_Check_Button btnSelectBand {
+ label Band
+ xywh {402 83 70 15} down_box DOWN_BOX
+ }
+ Fl_Check_Button btnSelectMode {
+ label Mode
+ xywh {402 103 70 15} down_box DOWN_BOX value 1
+ }
+ Fl_Check_Button btnSelectQSOdateOn {
+ label {QSO Date On}
+ xywh {402 122 70 15} down_box DOWN_BOX value 1
+ }
+ Fl_Check_Button btnSelectTimeON {
+ label {Time ON}
+ xywh {402 142 70 15} down_box DOWN_BOX value 1
+ }
+ Fl_Check_Button btnSelectQSOdateOff {
+ label {QSO Date Off}
+ xywh {402 162 70 15} down_box DOWN_BOX value 1
+ }
+ Fl_Check_Button btnSelectTimeOFF {
+ label {Time OFF}
+ xywh {402 182 70 15} down_box DOWN_BOX value 1
+ }
+ Fl_Check_Button btnSelectTX_pwr {
+ label {TX Power}
+ xywh {402 201 70 15} down_box DOWN_BOX
+ }
+ Fl_Check_Button btnSelectRSTsent {
+ label {RST sent}
+ xywh {402 221 70 15} down_box DOWN_BOX value 1
+ }
+ Fl_Check_Button btnSelectRSTrcvd {
+ label {RST rcvd}
+ xywh {402 240 70 15} down_box DOWN_BOX value 1
+ }
+ Fl_Check_Button btnSelectQth {
+ label Qth
+ xywh {402 260 70 15} down_box DOWN_BOX
+ }
+ Fl_Check_Button btnSelectLOC {
+ label LOC
+ xywh {402 280 70 15} down_box DOWN_BOX value 1
+ }
+ Fl_Check_Button btnSelectState {
+ label State
+ xywh {400 300 70 15} down_box DOWN_BOX
+ }
+ Fl_Check_Button btnSelectProvince {
+ label Province
+ xywh {520 24 70 15} down_box DOWN_BOX
+ }
+ Fl_Check_Button btnSelectCountry {
+ label Country
+ xywh {520 44 70 15} down_box DOWN_BOX
+ }
+ Fl_Check_Button btnSelectNotes {
+ label Notes
+ xywh {520 63 70 15} down_box DOWN_BOX
+ }
+ Fl_Check_Button btnSelectQSLrcvd {
+ label {QSL rcvd date}
+ xywh {520 83 70 15} down_box DOWN_BOX
+ }
+ Fl_Check_Button btnSelectQSLsent {
+ label {QSL sent date}
+ xywh {520 103 70 15} down_box DOWN_BOX
+ }
+ Fl_Check_Button btnSelectSerialIN {
+ label {Serial \# in}
+ xywh {520 122 70 15} down_box DOWN_BOX
+ }
+ Fl_Check_Button btnSelectSerialOUT {
+ label {Serial \# out}
+ xywh {520 142 70 15} down_box DOWN_BOX
+ }
+ Fl_Check_Button btnSelectXchgIn {
+ label {Exchange In}
+ xywh {520 161 70 15} down_box DOWN_BOX
+ }
+ Fl_Check_Button btnSelectMyXchg {
+ label {Exchange Out}
+ xywh {520 181 70 15} down_box DOWN_BOX
+ }
+ Fl_Check_Button btnSelectCONT {
+ label CONT
+ xywh {521 201 70 15} down_box DOWN_BOX
+ }
+ Fl_Check_Button btnSelectCQZ {
+ label CQZ
+ xywh {521 220 70 15} down_box DOWN_BOX
+ }
+ Fl_Check_Button btnSelectDXCC {
+ label DXCC
+ xywh {521 240 70 15} down_box DOWN_BOX
+ }
+ Fl_Check_Button btnSelectIOTA {
+ label IOTA
+ xywh {521 260 70 15} down_box DOWN_BOX
+ }
+ Fl_Check_Button btnSelectITUZ {
+ label ITUZ
+ xywh {521 280 70 15} down_box DOWN_BOX
+ }
+ Fl_Button btnSetFieldDefaults {
+ label Defaults
+ callback {btnSelectCall->value(1);
+btnSelectName->value(1);
+btnSelectFreq->value(1);
+btnSelectBand->value(1);
+btnSelectMode->value(1);
+btnSelectQSOdateOn->value(1);
+btnSelectQSOdateOff->value(1);
+btnSelectTimeON->value(1);
+btnSelectTimeOFF->value(1);
+btnSelectQth->value(0);
+btnSelectLOC->value(1);
+btnSelectState->value(0);
+btnSelectProvince->value(0);
+btnSelectCountry->value(0);
+btnSelectQSLrcvd->value(0);
+btnSelectQSLsent->value(0);
+btnSelectSerialIN->value(0);
+btnSelectSerialOUT->value(0);
+btnSelectXchgIn->value(0);
+btnSelectMyXchg->value(0);
+btnSelectRSTsent->value(0);
+btnSelectRSTrcvd->value(1);
+btnSelectNotes->value(0);
+btnSelectIOTA->value(0);
+btnSelectDXCC->value(0);
+btnSelectTX_pwr->value(0);}
+ xywh {560 325 76 20}
+ }
+ }
+ }
+ Fl_Window wCabrillo {
+ label {Cabrillo Setup} selected
+ xywh {582 159 655 340} type Double hide modal
+ } {
+ Fl_Group {} {
+ label {Select Records to Export} open
+ xywh {4 4 388 305} box ENGRAVED_FRAME align 21
+ } {
+ Fl_Check_Browser chkCabBrowser {
+ xywh {13 25 370 245}
+ }
+ Fl_Button btnCabClearAll {
+ label {Clear All}
+ callback {chkCabBrowser->check_none();}
+ xywh {69 277 109 20}
+ }
+ Fl_Button btnCabCheckAll {
+ label {Check All}
+ callback {chkCabBrowser->check_all();}
+ xywh {200 277 109 20}
+ }
+ }
+ Fl_Return_Button btnCabOK {
+ label OK
+ callback {wCabrillo->hide();
+WriteCabrillo();}
+ xywh {536 312 100 20}
+ }
+ Fl_Button btnCabCancel {
+ label Cancel
+ callback {wCabrillo->hide();}
+ xywh {405 312 100 20}
+ }
+ Fl_Group {} {
+ label {Select Cabrillo Contest & Fields} open
+ xywh {392 4 258 305} box ENGRAVED_FRAME align 21
+ } {
+ Fl_Group cboContest {
+ label {Contest:}
+ callback {setContestType();} open
+ xywh {462 35 180 20} box BORDER_BOX color 7 align 4
+ code0 {\#include "combo.h"}
+ code1 {extern void setContestType();}
+ class Fl_ComboBox
+ } {}
+ Fl_Check_Button btnCabCall {
+ label Call
+ xywh {407 75 70 15} down_box DOWN_BOX value 1
+ }
+ Fl_Check_Button btnCabFreq {
+ label Freq
+ xywh {407 100 70 15} down_box DOWN_BOX value 1
+ }
+ Fl_Check_Button btnCabMode {
+ label Mode
+ xywh {407 125 70 15} down_box DOWN_BOX value 1
+ }
+ Fl_Check_Button btnCabQSOdateOn {
+ label {QSO Date On}
+ xywh {407 210 70 15} down_box DOWN_BOX
+ }
+ Fl_Check_Button btnCabTimeOn {
+ label {Time ON}
+ xywh {407 235 70 15} down_box DOWN_BOX
+ }
+ Fl_Check_Button btnCabQSOdateOff {
+ label {QSO Date Off}
+ xywh {526 210 70 15} down_box DOWN_BOX value 1
+ }
+ Fl_Check_Button btnCabTimeOff {
+ label {Time OFF}
+ xywh {526 235 70 15} down_box DOWN_BOX value 1
+ }
+ Fl_Check_Button btnCabRSTsent {
+ label {RST sent}
+ xywh {407 150 70 15} down_box DOWN_BOX value 1
+ }
+ Fl_Check_Button btnCabRSTrcvd {
+ label {RST rcvd}
+ xywh {407 176 70 15} down_box DOWN_BOX value 1
+ }
+ Fl_Check_Button btnCabSerialIN {
+ label {Serial \# in}
+ xywh {526 75 70 15} down_box DOWN_BOX value 1
+ }
+ Fl_Check_Button btnCabSerialOUT {
+ label {Serial \# out}
+ xywh {526 100 70 15} down_box DOWN_BOX value 1
+ }
+ Fl_Check_Button btnCabXchgIn {
+ label {Exchange In}
+ xywh {526 125 70 15} down_box DOWN_BOX value 1
+ }
+ Fl_Check_Button btnCabMyXchg {
+ label {Exchange Out}
+ xywh {526 150 70 15} down_box DOWN_BOX value 1
+ }
+ Fl_Button btnCabClearAllFields {
+ label {Clear All}
+ callback {btnCabCall->value(0);
+btnCabFreq->value(0);
+btnCabMode->value(0);
+btnCabQSOdateOn->value(0);
+btnCabTimeOn->value(0);
+btnCabQSOdateOff->value(0);
+btnCabTimeOff->value(0);
+btnCabSerialIN->value(0);
+btnCabSerialOUT->value(0);
+btnCabXchgIn->value(0);
+btnCabMyXchg->value(0);
+btnCabRSTsent->value(0);
+btnCabRSTrcvd->value(0);}
+ xywh {437 275 76 20}
+ }
+ Fl_Button btnCabCheckAllFields {
+ label {Check All}
+ callback {btnCabCall->value(1);
+btnCabFreq->value(1);
+btnCabMode->value(1);
+btnCabQSOdateOn->value(1);
+btnCabTimeOn->value(1);
+btnCabQSOdateOff->value(1);
+btnCabTimeOff->value(1);
+btnCabSerialIN->value(1);
+btnCabSerialOUT->value(1);
+btnCabXchgIn->value(1);
+btnCabMyXchg->value(1);
+btnCabRSTsent->value(1);
+btnCabRSTrcvd->value(1);}
+ xywh {533 275 76 20}
+ }
+ }
+ }
+}
diff --git a/src/logbook/logbook.cxx b/src/logbook/logbook.cxx
new file mode 100644
index 0000000..a5ea8bf
--- /dev/null
+++ b/src/logbook/logbook.cxx
@@ -0,0 +1,55 @@
+#include <config.h>
+
+#include <cstring>
+
+#include <FL/Fl.H>
+#include <FL/filename.H>
+
+#include "flwkey.h"
+#include "logbook.h"
+#include "debug.h"
+#include "status.h"
+
+using namespace std;
+
+std::string log_checksum;
+
+pthread_t logbook_thread;
+pthread_mutex_t logbook_mutex = PTHREAD_MUTEX_INITIALIZER;
+bool logbook_exit = false;
+
+void do_load_browser(void *)
+{
+ loadBrowser();
+}
+
+void start_logbook ()
+{
+ create_logbook_dialogs();
+ dlgLogbook->size(580,384);
+
+ if (progStatus.logbookfilename.empty()) {
+ logbook_filename = WKeyHomeDir;
+ logbook_filename.append("logbook." ADIF_SUFFIX);
+ progStatus.logbookfilename = logbook_filename;
+ } else
+ logbook_filename = progStatus.logbookfilename;
+
+ adifFile.readFile (logbook_filename.c_str(), &qsodb);
+ if (qsodb.nbrRecs() == 0)
+ adifFile.writeFile(logbook_filename.c_str(), &qsodb);
+
+ string label = "Logbook - ";
+ label.append(fl_filename_name(logbook_filename.c_str()));
+ dlgLogbook->copy_label(label.c_str());
+
+ loadBrowser();
+ qsodb.isdirty(0);
+ activateButtons();
+
+}
+
+void close_logbook()
+{
+ saveLogbook();
+}
diff --git a/src/logbook/logsupport.cxx b/src/logbook/logsupport.cxx
new file mode 100644
index 0000000..d7958f2
--- /dev/null
+++ b/src/logbook/logsupport.cxx
@@ -0,0 +1,1303 @@
+// ----------------------------------------------------------------------------
+// logsupport.cxx
+//
+// Copyright (C) 2006-2010
+// Dave Freese, W1HKJ
+// Copyright (C) 2008-2009
+// Stelios Bounanos, M0GLD
+//
+// This file is part of fldigi.
+//
+// Fldigi is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Fldigi 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 fldigi. If not, see <http://www.gnu.org/licenses/>.
+// ----------------------------------------------------------------------------
+
+#include <config.h>
+
+#include <string>
+#include <cstring>
+#include <cstdlib>
+#include <ctime>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+
+#include "debug.h"
+#include "status.h"
+#include "date.h"
+
+#include "adif_io.h"
+#include "logbook.h"
+#include "textio.h"
+
+#include "logger.h"
+#include "fileselect.h"
+#include "icons.h"
+#include "gettext.h"
+
+#include "timeops.h"
+
+#include "wkey_dialogs.h"
+
+
+#include <FL/filename.H>
+#include <FL/fl_ask.H>
+
+using namespace std;
+
+char *szTime(int typ)
+{
+ static char szDt[80];
+ time_t tmptr;
+ tm sTime;
+ time (&tmptr);
+ switch (typ) {
+ case 0:
+ localtime_r(&tmptr, &sTime);
+ strftime(szDt, 79, "%H%M", &sTime);
+ break;
+ case 1:
+ localtime_r(&tmptr, &sTime);
+ strftime(szDt, 79, "%H:%M", &sTime);
+ break;
+ case 2:
+ gmtime_r (&tmptr, &sTime);
+ strftime(szDt, 79, "%H%MZ", &sTime);
+ break;
+ case 3:
+ gmtime_r (&tmptr, &sTime);
+ strftime(szDt, 79, "%H:%MZ", &sTime);
+ break;
+ case 4:
+ gmtime_r (&tmptr, &sTime);
+ strftime(szDt, 79, "%H%M UTC", &sTime);
+ break;
+ case 5:
+ gmtime_r (&tmptr, &sTime);
+ strftime(szDt, 79, "%H:%M UTC", &sTime);
+ break;
+ default:
+ localtime_r(&tmptr, &sTime);
+ strftime(szDt, 79, "%H%ML", &sTime);
+ }
+ return szDt;
+}
+
+static const char *month_name[] =
+{
+ "January",
+ "Febuary",
+ "March",
+ "April",
+ "May",
+ "June",
+ "July",
+ "August",
+ "September",
+ "October",
+ "November",
+ "December"
+};
+
+char *szDate(int fmt)
+{
+ static char szDt[20];
+ static char szMonth[10];
+
+ time_t tmptr;
+ tm sTime;
+ time (&tmptr);
+ if ((fmt & 0x80) == 0x80) {
+ gmtime_r (&tmptr, &sTime);
+ } else {
+ localtime_r(&tmptr, &sTime);
+ }
+ switch (fmt & 0x7F) {
+ case 1 :
+ snprintf (szDt, sizeof(szDt), "%02d/%02d/%02d",
+ sTime.tm_mon + 1,
+ sTime.tm_mday,
+ sTime.tm_year > 100 ? sTime.tm_year - 100 : sTime.tm_year);
+ break;
+ case 2 :
+ snprintf (szDt, sizeof(szDt), "%4d-%02d-%02d",
+ sTime.tm_year + 1900,
+ sTime.tm_mon + 1,
+ sTime.tm_mday);
+ break;
+ case 3 :
+ snprintf (szDt, sizeof(szDt), "%s %2d, %4d",
+ month_name[sTime.tm_mon],
+ sTime.tm_mday,
+ sTime.tm_year + 1900);
+ break;
+ case 4 :
+ strcpy (szMonth, month_name [sTime.tm_mon]);
+ szMonth[3] = 0;
+ snprintf (szDt, sizeof(szDt), "%s %2d, %4d",
+ szMonth,
+ sTime.tm_mday,
+ sTime.tm_year + 1900);
+ break;
+ case 5 :
+ strcpy (szMonth, month_name [sTime.tm_mon]);
+ szMonth[3] = 0;
+ for (int i = 0; i < 3; i++) szMonth[i] = toupper(szMonth[i]);
+ snprintf (szDt, sizeof(szDt), "%s %d",
+ szMonth,
+ sTime.tm_mday);
+ break;
+ case 6 :
+ snprintf (szDt, sizeof(szDt), "%4d%02d%02d",
+ sTime.tm_year + 1900,
+ sTime.tm_mon + 1,
+ sTime.tm_mday);
+ break;
+ case 0 :
+ default :
+ snprintf (szDt, sizeof(szDt), "%02d/%02d/%04d",
+ sTime.tm_mon + 1,
+ sTime.tm_mday,
+ sTime.tm_year + 1900);
+ break;
+ }
+ return szDt;
+}
+
+cQsoDb qsodb;
+cAdifIO adifFile;
+cTextFile txtFile;
+
+string logbook_filename;
+
+void Export_CSV()
+{
+ if (chkExportBrowser->nchecked() == 0) return;
+
+ cQsoRec *rec;
+
+ string filters = "CSV\t*." "csv";
+ const char* p = FSEL::saveas(_("Export to CSV file"), filters.c_str(),
+ "export." "csv");
+ if (!p)
+ return;
+
+ for (int i = 0; i < chkExportBrowser->nitems(); i++) {
+ if (chkExportBrowser->checked(i + 1)) {
+ rec = qsodb.getRec(i);
+ rec->putField(EXPORT, "E");
+ qsodb.qsoUpdRec (i, rec);
+ }
+ }
+ txtFile.writeCSVFile(p, &qsodb);
+}
+
+void Export_TXT()
+{
+ if (chkExportBrowser->nchecked() == 0) return;
+
+ cQsoRec *rec;
+
+ string filters = "TEXT\t*." "txt";
+ const char* p = FSEL::saveas(_("Export to fixed field text file"), filters.c_str(),
+ "export." "txt");
+ if (!p)
+ return;
+
+ for (int i = 0; i < chkExportBrowser->nitems(); i++) {
+ if (chkExportBrowser->checked(i + 1)) {
+ rec = qsodb.getRec(i);
+ rec->putField(EXPORT, "E");
+ qsodb.qsoUpdRec (i, rec);
+ }
+ }
+ txtFile.writeTXTFile(p, &qsodb);
+}
+
+void Export_ADIF()
+{
+ if (chkExportBrowser->nchecked() == 0) return;
+
+ cQsoRec *rec;
+
+ string filters = "ADIF\t*." ADIF_SUFFIX;
+ const char* p = FSEL::saveas(_("Export to ADIF file"), filters.c_str(),
+ "export." ADIF_SUFFIX);
+ if (!p)
+ return;
+
+ for (int i = 0; i < chkExportBrowser->nitems(); i++) {
+ if (chkExportBrowser->checked(i + 1)) {
+ rec = qsodb.getRec(i);
+ rec->putField(EXPORT, "E");
+ qsodb.qsoUpdRec (i, rec);
+ }
+ }
+
+ adifFile.writeFile (p, &qsodb);
+}
+
+static savetype export_to = ADIF;
+
+void Export_log()
+{
+ if (export_to == ADIF) Export_ADIF();
+ else if (export_to == CSV) Export_CSV();
+ else Export_TXT();
+}
+
+void saveLogbook()
+{
+ if (!qsodb.isdirty()) return;
+ if (!fl_choice2(_("Save changed Logbook?"), _("No"), _("Yes"), NULL))
+ return;
+
+ cQsoDb::reverse = false;
+ qsodb.SortByDate();
+
+ adifFile.writeLog (logbook_filename.c_str(), &qsodb);
+
+ qsodb.isdirty(0);
+ restore_sort();
+}
+
+void cb_mnuNewLogbook(){
+ saveLogbook();
+
+ logbook_filename = WKeyHomeDir;
+ logbook_filename.append("newlog." ADIF_SUFFIX);
+ progStatus.logbookfilename = logbook_filename;
+ dlgLogbook->label(fl_filename_name(logbook_filename.c_str()));
+ qsodb.deleteRecs();
+ wBrowser->clear();
+ clearRecord();
+ activateButtons();
+}
+
+void OpenLogbook()
+{
+ adifFile.readFile (progStatus.logbookfilename.c_str(), &qsodb);
+ qsodb.isdirty(0);
+ loadBrowser();
+ dlgLogbook->label(fl_filename_name(progStatus.logbookfilename.c_str()));
+ activateButtons();
+}
+
+void cb_mnuOpenLogbook()
+{
+ const char* p = FSEL::select(_("Open logbook file"), "ADIF\t*." ADIF_SUFFIX,
+ logbook_filename.c_str());
+ if (p) {
+ saveLogbook();
+ qsodb.deleteRecs();
+ logbook_filename = p;
+ progStatus.logbookfilename = logbook_filename;
+ OpenLogbook();
+ }
+}
+
+void cb_mnuSaveLogbook() {
+ const char* p = FSEL::saveas(_("Save logbook file"), "ADIF\t*." ADIF_SUFFIX,
+ logbook_filename.c_str());
+ if (p) {
+ logbook_filename = p;
+ dlgLogbook->label(fl_filename_name(logbook_filename.c_str()));
+
+ cQsoDb::reverse = false;
+ qsodb.SortByDate();
+
+ adifFile.writeLog (logbook_filename.c_str(), &qsodb);
+
+ qsodb.isdirty(0);
+ restore_sort();
+ }
+}
+
+void cb_mnuMergeADIF_log() {
+ const char* p = FSEL::select(_("Merge ADIF file"), "ADIF\t*." ADIF_SUFFIX);
+ if (p) {
+ adifFile.readFile (p, &qsodb);
+ loadBrowser();
+ qsodb.isdirty(1);
+ }
+}
+
+void cb_Export_log() {
+ if (qsodb.nbrRecs() == 0) return;
+ cQsoRec *rec;
+ char line[80];
+ chkExportBrowser->clear();
+ chkExportBrowser->textfont(FL_COURIER);
+ chkExportBrowser->textsize(12);
+ for( int i = 0; i < qsodb.nbrRecs(); i++ ) {
+ rec = qsodb.getRec (i);
+ memset(line, 0, sizeof(line));
+ snprintf(line,sizeof(line),"%8s %4s %-32s %10s %-s",
+ rec->getField(QSO_DATE),
+ rec->getField(TIME_OFF),
+ rec->getField(CALL),
+ rec->getField(FREQ),
+ rec->getField(MODE) );
+ chkExportBrowser->add(line);
+ }
+ wExport->show();
+}
+
+void cb_mnuExportADIF_log() {
+ export_to = ADIF;
+ cb_Export_log();
+}
+
+void cb_mnuExportCSV_log() {
+ export_to = CSV;
+ cb_Export_log();
+}
+
+void cb_mnuExportTEXT_log() {
+ export_to = TEXT;
+ cb_Export_log();
+}
+
+
+void cb_mnuShowLogbook()
+{
+ dlgLogbook->show();
+}
+
+enum State {VIEWREC, NEWREC};
+static State logState = VIEWREC;
+
+void activateButtons()
+{
+ if (logState == NEWREC) {
+ bNewSave->label(_("Save"));
+ bUpdateCancel->label(_("Cancel"));
+ bUpdateCancel->activate();
+ bDelete->deactivate ();
+ bSearchNext->deactivate ();
+ bSearchPrev->deactivate ();
+ inpDate_log->take_focus();
+ return;
+ }
+ bNewSave->label(_("New"));
+ bUpdateCancel->label(_("Update"));
+ if (qsodb.nbrRecs() > 0) {
+ bDelete->activate();
+ bUpdateCancel->activate();
+ bSearchNext->activate ();
+ bSearchPrev->activate ();
+ wBrowser->take_focus();
+ } else {
+ bDelete->deactivate();
+ bUpdateCancel->deactivate();
+ bSearchNext->deactivate();
+ bSearchPrev->deactivate();
+ }
+}
+
+void cb_btnNewSave(Fl_Button* b, void* d) {
+ if (logState == VIEWREC) {
+ logState = NEWREC;
+ clearRecord();
+ activateButtons();
+ } else {
+ saveRecord();
+ qsodb.SortByDate();
+ loadBrowser();
+ logState = VIEWREC;
+ activateButtons();
+ }
+}
+
+void cb_btnUpdateCancel(Fl_Button* b, void* d) {
+ if (logState == NEWREC) {
+ logState = VIEWREC;
+ activateButtons ();
+ } else {
+ updateRecord();
+ wBrowser->take_focus();
+ }
+}
+
+void cb_btnDelete(Fl_Button* b, void* d) {
+ deleteRecord();
+ wBrowser->take_focus();
+}
+
+enum sorttype {NONE, SORTCALL, SORTDATE, SORTFREQ, SORTMODE};
+sorttype lastsort = SORTDATE;
+bool callfwd = true;
+bool datefwd = true;
+bool modefwd = true;
+bool freqfwd = true;
+
+void restore_sort()
+{
+ switch (lastsort) {
+ case SORTCALL :
+ cQsoDb::reverse = callfwd;
+ qsodb.SortByCall();
+ break;
+ case SORTDATE :
+ cQsoDb::reverse = datefwd;
+ qsodb.SortByDate();
+ break;
+ case SORTFREQ :
+ cQsoDb::reverse = freqfwd;
+ qsodb.SortByFreq();
+ break;
+ case SORTMODE :
+ cQsoDb::reverse = modefwd;
+ qsodb.SortByMode();
+ break;
+ default: break;
+ }
+}
+
+void cb_SortByCall (void) {
+ if (lastsort == SORTCALL)
+ callfwd = !callfwd;
+ else {
+ callfwd = false;
+ lastsort = SORTCALL;
+ }
+ cQsoDb::reverse = callfwd;
+ qsodb.SortByCall();
+ loadBrowser();
+}
+
+void cb_SortByDate (void) {
+ if (lastsort == SORTDATE)
+ datefwd = !datefwd;
+ else {
+ datefwd = false;
+ lastsort = SORTDATE;
+ }
+ cQsoDb::reverse = datefwd;
+ qsodb.SortByDate();
+ loadBrowser();
+}
+
+void cb_SortByMode (void) {
+ if (lastsort == SORTMODE)
+ modefwd = !modefwd;
+ else {
+ modefwd = false;
+ lastsort = SORTMODE;
+ }
+ cQsoDb::reverse = modefwd;
+ qsodb.SortByMode();
+ loadBrowser();
+}
+
+void cb_SortByFreq (void) {
+ if (lastsort == SORTFREQ)
+ freqfwd = !freqfwd;
+ else {
+ freqfwd = false;
+ lastsort = SORTFREQ;
+ }
+ cQsoDb::reverse = freqfwd;
+ qsodb.SortByFreq();
+ loadBrowser();
+}
+
+void DupCheck()
+{
+ Fl_Color call_clr = FL_BACKGROUND2_COLOR;
+ int ispn = atoi(txt_time_span->value());
+
+ if (qsodb.nbrRecs() > 0)
+ if (qsodb.duplicate(
+ txt_sta->value(),
+ szDate(6), szTime(0), ispn, progStatus.time_span,
+ txt_freq->value(), progStatus.band,
+ "", false,
+ "CW", true,
+ "", false ) ) {
+ call_clr = fl_rgb_color( 255, 110, 180);
+ }
+ txt_sta->color(call_clr);
+ txt_sta->redraw();
+}
+
+cQsoRec* SearchLog(const char *callsign)
+{
+ size_t len = strlen(callsign);
+ char* re = new char[len + 3];
+ snprintf(re, len + 3, "^%s$", callsign);
+
+ int row = 0, col = 2;
+ return wBrowser->search(row, col, !cQsoDb::reverse, re) ? qsodb.getRec(row) : 0;
+}
+
+void SearchLastQSO(const char *callsign)
+{
+ if (qsodb.nbrRecs() == 0) return;
+ size_t len = strlen(callsign);
+ if (!len)
+ return;
+ char* re = new char[len + 3];
+ snprintf(re, len + 3, "^%s$", callsign);
+ int row = 0, col = 2;
+ if (wBrowser->search(row, col, !cQsoDb::reverse, re)) {
+ wBrowser->GotoRow(row);
+ txt_name->value(inpName_log->value());
+ inpSearchString->value(callsign);
+ } else {
+ txt_name->value("");
+ inpSearchString->value("");
+ }
+ delete [] re;
+}
+
+void cb_search(Fl_Widget* w, void*)
+{
+ const char* str = inpSearchString->value();
+ if (!*str)
+ return;
+
+ bool rev = w == bSearchPrev;
+ int col = 2, row = wBrowser->value() + (rev ? -1 : 1);
+ row = WCLAMP(row, 0, wBrowser->rows() - 1);
+
+ if (wBrowser->search(row, col, rev, str))
+ wBrowser->GotoRow(row);
+ wBrowser->take_focus();
+}
+
+int log_search_handler(int)
+{
+ if (!(Fl::event_state() & FL_CTRL))
+ return 0;
+
+ switch (Fl::event_key()) {
+ case 's':
+ bSearchNext->do_callback();
+ break;
+ case 'r':
+ bSearchPrev->do_callback();
+ break;
+ default:
+ return 0;
+ }
+ return 1;
+}
+
+int editNbr = 0;
+
+void clearRecord() {
+ Date tdy;
+ inpCall_log->value ("");
+ inpName_log->value ("");
+ inpDate_log->value (tdy.szDate(2));
+ inpTimeOn_log->value ("");
+ inpTimeOff_log->value ("");
+ inpRstR_log->value ("");
+ inpRstS_log->value ("");
+ inpFreq_log->value ("");
+ inpMode_log->value ("");
+ inpQth_log->value ("");
+ inpState_log->value ("");
+ inpVE_Prov_log->value ("");
+ inpCountry_log->value ("");
+ inpLoc_log->value ("");
+ inpQSLrcvddate_log->value ("");
+ inpQSLsentdate_log->value ("");
+ inpSerNoOut_log->value ("");
+ inpSerNoIn_log->value ("");
+ inpXchgIn_log->value("");
+ inpMyXchg_log->value("");
+ inpNotes_log->value ("");
+ inpIOTA_log->value("");
+ inpDXCC_log->value("");
+ inpCONT_log->value("");
+ inpCQZ_log->value("");
+ inpITUZ_log->value("");
+ inpTX_pwr_log->value("");
+ inpSearchString->value ("");
+ editGroup->show();
+}
+
+void saveRecord() {
+
+ cQsoRec rec;
+
+ rec.putField(CALL, inpCall_log->value());
+ rec.putField(NAME, inpName_log->value());
+ rec.putField(QSO_DATE, inpDate_log->value());
+ rec.putField(QSO_DATE_OFF, inpDateOff_log->value());
+ rec.putField(TIME_ON, inpTimeOn_log->value());
+ rec.putField(TIME_OFF, inpTimeOff_log->value());
+ rec.putField(TIME_OFF, inpTimeOff_log->value());
+ rec.putField(FREQ, inpFreq_log->value());
+ rec.putField(MODE, inpMode_log->value());
+ rec.putField(QTH, inpQth_log->value());
+ rec.putField(STATE, inpState_log->value());
+ rec.putField(VE_PROV, inpVE_Prov_log->value());
+ rec.putField(COUNTRY, inpCountry_log->value());
+ rec.putField(GRIDSQUARE, inpLoc_log->value());
+ rec.putField(NOTES, inpNotes_log->value());
+ rec.putField(QSLRDATE, inpQSLrcvddate_log->value());
+ rec.putField(QSLSDATE, inpQSLsentdate_log->value());
+ rec.putField(RST_RCVD, inpRstR_log->value ());
+ rec.putField(RST_SENT, inpRstS_log->value ());
+ rec.putField(SRX, inpSerNoIn_log->value());
+ rec.putField(STX, inpSerNoOut_log->value());
+ rec.putField(XCHG1, inpXchgIn_log->value());
+ rec.putField(MYXCHG, inpMyXchg_log->value());
+ rec.putField(IOTA, inpIOTA_log->value());
+ rec.putField(DXCC, inpDXCC_log->value());
+ rec.putField(CONT, inpCONT_log->value());
+ rec.putField(CQZ, inpCQZ_log->value());
+ rec.putField(ITUZ, inpITUZ_log->value());
+ rec.putField(TX_PWR, inpTX_pwr_log->value());
+
+ qsodb.qsoNewRec (&rec);
+
+ cQsoDb::reverse = false;
+ qsodb.SortByDate();
+
+ adifFile.writeLog (logbook_filename.c_str(), &qsodb);
+
+ qsodb.isdirty(0);
+ restore_sort();
+
+ loadBrowser();
+ logState = VIEWREC;
+ activateButtons();
+}
+
+void updateRecord() {
+cQsoRec rec;
+
+ if (qsodb.nbrRecs() == 0) return;
+ rec.putField(CALL, inpCall_log->value());
+ rec.putField(NAME, inpName_log->value());
+ rec.putField(QSO_DATE, inpDate_log->value());
+ rec.putField(QSO_DATE_OFF, inpDateOff_log->value());
+ rec.putField(TIME_ON, inpTimeOn_log->value());
+ rec.putField(TIME_OFF, inpTimeOff_log->value());
+ rec.putField(FREQ, inpFreq_log->value());
+ rec.putField(MODE, inpMode_log->value());
+ rec.putField(QTH, inpQth_log->value());
+ rec.putField(STATE, inpState_log->value());
+ rec.putField(VE_PROV, inpVE_Prov_log->value());
+ rec.putField(COUNTRY, inpCountry_log->value());
+ rec.putField(GRIDSQUARE, inpLoc_log->value());
+ rec.putField(NOTES, inpNotes_log->value());
+ rec.putField(QSLRDATE, inpQSLrcvddate_log->value());
+ rec.putField(QSLSDATE, inpQSLsentdate_log->value());
+ rec.putField(RST_RCVD, inpRstR_log->value ());
+ rec.putField(RST_SENT, inpRstS_log->value ());
+ rec.putField(SRX, inpSerNoIn_log->value());
+ rec.putField(STX, inpSerNoOut_log->value());
+ rec.putField(XCHG1, inpXchgIn_log->value());
+ rec.putField(MYXCHG, inpMyXchg_log->value());
+ rec.putField(IOTA, inpIOTA_log->value());
+ rec.putField(DXCC, inpDXCC_log->value());
+ rec.putField(CONT, inpCONT_log->value());
+ rec.putField(CQZ, inpCQZ_log->value());
+ rec.putField(ITUZ, inpITUZ_log->value());
+ rec.putField(TX_PWR, inpTX_pwr_log->value());
+ qsodb.qsoUpdRec (editNbr, &rec);
+
+ cQsoDb::reverse = false;
+ qsodb.SortByDate();
+
+ adifFile.writeLog (logbook_filename.c_str(), &qsodb);
+
+ qsodb.isdirty(0);
+ restore_sort();
+
+ loadBrowser(true);
+}
+
+void deleteRecord () {
+ if (qsodb.nbrRecs() == 0 || fl_choice2(_("Really delete record for \"%s\"?"),
+ _("Yes"), _("No"), NULL, wBrowser->valueAt(-1, 2)))
+ return;
+
+ qsodb.qsoDelRec(editNbr);
+
+ cQsoDb::reverse = false;
+ qsodb.SortByDate();
+
+ adifFile.writeLog (logbook_filename.c_str(), &qsodb);
+
+ qsodb.isdirty(0);
+ restore_sort();
+
+ loadBrowser(true);
+}
+
+void EditRecord( int i )
+{
+ cQsoRec *editQSO = qsodb.getRec (i);
+ if( !editQSO )
+ return;
+
+ inpCall_log->value (editQSO->getField(CALL));
+ inpName_log->value (editQSO->getField(NAME));
+ inpDate_log->value (editQSO->getField(QSO_DATE));
+ inpDateOff_log->value (editQSO->getField(QSO_DATE_OFF));
+ inpTimeOn_log->value (editQSO->getField(TIME_ON));
+ inpTimeOff_log->value (editQSO->getField(TIME_OFF));
+ inpRstR_log->value (editQSO->getField(RST_RCVD));
+ inpRstS_log->value (editQSO->getField(RST_SENT));
+ inpFreq_log->value (editQSO->getField(FREQ));
+ inpMode_log->value (editQSO->getField(MODE));
+ inpState_log->value (editQSO->getField(STATE));
+ inpVE_Prov_log->value (editQSO->getField(VE_PROV));
+ inpCountry_log->value (editQSO->getField(COUNTRY));
+ inpQth_log->value (editQSO->getField(QTH));
+ inpLoc_log->value (editQSO->getField(GRIDSQUARE));
+ inpQSLrcvddate_log->value (editQSO->getField(QSLRDATE));
+ inpQSLsentdate_log->value (editQSO->getField(QSLSDATE));
+ inpNotes_log->value (editQSO->getField(NOTES));
+ inpSerNoIn_log->value(editQSO->getField(SRX));
+ inpSerNoOut_log->value(editQSO->getField(STX));
+ inpXchgIn_log->value(editQSO->getField(XCHG1));
+ inpMyXchg_log->value(editQSO->getField(MYXCHG));
+ inpIOTA_log->value(editQSO->getField(IOTA));
+ inpDXCC_log->value(editQSO->getField(DXCC));
+ inpCONT_log->value(editQSO->getField(CONT));
+ inpCQZ_log->value(editQSO->getField(CQZ));
+ inpITUZ_log->value(editQSO->getField(ITUZ));
+ inpTX_pwr_log->value(editQSO->getField(TX_PWR));
+ editGroup->show();
+}
+
+std::string sDate_on = "";
+
+void AddRecord ()
+{
+ if (txt_sta->value()[0] == 0) return;
+ char *szt = szTime(2);
+ char *szdt = szDate(0x86);
+ char sznbr[6];
+ snprintf(sznbr, sizeof(sznbr), "%d", progStatus.serial_nbr);
+
+ string xin = txt_xchg->value();
+ for (size_t n = 0; n < xin.length(); n++) xin[n] = toupper(xin[n]);
+
+ inpCall_log->value(txt_sta->value());
+ inpName_log->value (txt_name->value());
+ inpTimeOn_log->value (szt);
+ inpTimeOff_log->value (szt);
+ inpDate_log->value(szdt);
+ inpRstR_log->value ("599");
+ inpRstS_log->value ("599");
+ inpFreq_log->value(txt_freq->value());
+ inpMode_log->value ("CW");
+ inpState_log->value ("");
+ inpVE_Prov_log->value ("");
+ inpCountry_log->value ("");
+
+ inpSerNoIn_log->value("");
+ inpSerNoOut_log->value(sznbr);
+ inpXchgIn_log->value(xin.c_str());
+ inpMyXchg_log->value(progStatus.xout.c_str());
+
+ inpQth_log->value ("");
+ inpLoc_log->value ("");
+ inpQSLrcvddate_log->value ("");
+ inpQSLsentdate_log->value ("");
+ inpNotes_log->value ("");
+
+ inpTX_pwr_log->value ("");
+ inpIOTA_log->value("");
+ inpDXCC_log->value("");
+ inpCONT_log->value("");
+ inpCQZ_log->value("");
+ inpITUZ_log->value("");
+
+ saveRecord();
+
+ txt_sta->value("");
+ txt_name->value("");
+ txt_xchg->value("");
+}
+
+void cb_browser (Fl_Widget *w, void *data )
+{
+ Table *table = (Table *)w;
+ editNbr = atoi(table->valueAt(-1,6));
+ EditRecord (editNbr);
+}
+
+void loadBrowser(bool keep_pos)
+{
+ cQsoRec *rec;
+ char sNbr[6];
+ int row = wBrowser->value(), pos = wBrowser->scrollPos();
+ if (row >= qsodb.nbrRecs()) row = qsodb.nbrRecs() - 1;
+ wBrowser->clear();
+ if (qsodb.nbrRecs() == 0)
+ return;
+ for( int i = 0; i < qsodb.nbrRecs(); i++ ) {
+ rec = qsodb.getRec (i);
+ snprintf(sNbr,sizeof(sNbr),"%d",i);
+ wBrowser->addRow (7,
+ rec->getField(QSO_DATE),
+ rec->getField(TIME_ON),
+ rec->getField(CALL),
+ rec->getField(NAME),
+ rec->getField(FREQ),
+ rec->getField(MODE),
+ sNbr);
+ }
+ if (keep_pos && row >= 0) {
+ wBrowser->value(row);
+ wBrowser->scrollTo(pos);
+ }
+ else {
+ if (cQsoDb::reverse == true)
+ wBrowser->FirstRow ();
+ else
+ wBrowser->LastRow ();
+ }
+ char szRecs[6];
+ snprintf(szRecs, sizeof(szRecs), "%5d", qsodb.nbrRecs());
+ txtNbrRecs_log->value(szRecs);
+}
+
+//=============================================================================
+// Cabrillo reporter
+//=============================================================================
+
+const char *contests[] =
+{ "AP-SPRINT",
+ "ARRL-10", "ARRL-160", "ARRL-DX-CW", "ARRL-DX-SSB", "ARRL-SS-CW",
+ "ARRL-SS-SSB", "ARRL-UHF-AUG", "ARRL-VHF-JAN", "ARRL-VHF-JUN", "ARRL-VHF-SEP",
+ "ARRL-RTTY",
+ "BARTG-RTTY", "BARTG-SPRINT",
+ "CQ-160-CW", "CQ-160-SSB", "CQ-WPX-CW", "CQ-WPX-RTTY", "CQ-WPX-SSB", "CQ-VHF",
+ "CQ-WW-CW", "CQ-WW-RTTY", "CQ-WW-SSB",
+ "DARC-WAEDC-CW", "DARC-WAEDC-RTTY", "DARC-WAEDC-SSB",
+ "FCG-FQP", "IARU-HF", "JIDX-CW", "JIDX-SSB",
+ "NAQP-CW", "NAQP-RTTY", "NAQP-SSB", "NA-SPRINT-CW", "NA-SPRINT-SSB", "NCCC-CQP",
+ "NEQP", "OCEANIA-DX-CW", "OCEANIA-DX-SSB", "RDXC", "RSGB-IOTA",
+ "SAC-CW", "SAC-SSB", "STEW-PERRY", "TARA-RTTY", 0 };
+
+enum icontest {
+ AP_SPRINT,
+ ARRL_10, ARRL_160, ARRL_DX_CW, ARRL_DX_SSB, ARRL_SS_CW,
+ ARRL_SS_SSB, ARRL_UHF_AUG, ARRL_VHF_JAN, ARRL_VHF_JUN, ARRL_VHF_SEP,
+ ARRL_RTTY,
+ BARTG_RTTY, BARTG_SPRINT,
+ CQ_160_CW, CQ_160_SSB, CQ_WPX_CW, CQ_WPX_RTTY, CQ_WPX_SSB, CQ_VHF,
+ CQ_WW_CW, CQ_WW_RTTY, CQ_WW_SSB,
+ DARC_WAEDC_CW, DARC_WAEDC_RTTY, DARC_WAEDC_SSB,
+ FCG_FQP, IARU_HF, JIDX_CW, JIDX_SSB,
+ NAQP_CW, NAQP_RTTY, NAQP_SSB, NA_SPRINT_CW, NA_SPRINT_SSB, NCCC_CQP,
+ NEQP, OCEANIA_DX_CW, OCEANIA_DX_SSB, RDXC, RSGB_IOTA,
+ SAC_CW, SAC_SSB, STEW_PERRY, TARA_RTTY
+};
+
+bool bInitCombo = true;
+icontest contestnbr;
+
+void setContestType()
+{
+ contestnbr = (icontest)cboContest->index();
+
+ btnCabCall->value(true);
+ btnCabFreq->value(true);
+ btnCabMode->value(true);
+ btnCabQSOdateOn->value(false);
+ btnCabTimeOn->value(false);
+ btnCabQSOdateOff->value(true);
+ btnCabTimeOff->value(true);
+ btnCabRSTsent->value(true);
+ btnCabRSTrcvd->value(true);
+ btnCabSerialIN->value(true);
+ btnCabSerialOUT->value(true);
+ btnCabXchgIn->value(true);
+ btnCabMyXchg->value(true);
+
+ switch (contestnbr) {
+ case ARRL_SS_CW :
+ case ARRL_SS_SSB :
+ btnCabRSTrcvd->value(false);
+ break;
+ case BARTG_RTTY :
+ case BARTG_SPRINT :
+ break;
+ case ARRL_UHF_AUG :
+ case ARRL_VHF_JAN :
+ case ARRL_VHF_JUN :
+ case ARRL_VHF_SEP :
+ case CQ_VHF :
+ btnCabRSTrcvd->value(false);
+ btnCabSerialIN->value(false);
+ btnCabSerialOUT->value(false);
+ break;
+ case AP_SPRINT :
+ case ARRL_10 :
+ case ARRL_160 :
+ case ARRL_DX_CW :
+ case ARRL_DX_SSB :
+ case CQ_160_CW :
+ case CQ_160_SSB :
+ case CQ_WPX_CW :
+ case CQ_WPX_RTTY :
+ case CQ_WPX_SSB :
+ case RDXC :
+ case OCEANIA_DX_CW :
+ case OCEANIA_DX_SSB :
+ break;
+ case DARC_WAEDC_CW :
+ case DARC_WAEDC_RTTY :
+ case DARC_WAEDC_SSB :
+ break;
+ case NAQP_CW :
+ case NAQP_RTTY :
+ case NAQP_SSB :
+ case NA_SPRINT_CW :
+ case NA_SPRINT_SSB :
+ break;
+ case RSGB_IOTA :
+ break;
+ default :
+ break;
+ }
+}
+
+void cb_Export_Cabrillo() {
+ if (qsodb.nbrRecs() == 0) return;
+ cQsoRec *rec;
+ char line[80];
+ int indx = 0;
+
+ if (bInitCombo) {
+ bInitCombo = false;
+ while (contests[indx]) {
+ cboContest->add(contests[indx]);
+ indx++;
+ }
+ }
+ cboContest->index(0);
+ chkCabBrowser->clear();
+ chkCabBrowser->textfont(FL_COURIER);
+ chkCabBrowser->textsize(12);
+ for( int i = 0; i < qsodb.nbrRecs(); i++ ) {
+ rec = qsodb.getRec (i);
+ memset(line, 0, sizeof(line));
+ snprintf(line,sizeof(line),"%8s %4s %-32s %10s %-s",
+ rec->getField(QSO_DATE),
+ rec->getField(TIME_OFF),
+ rec->getField(CALL),
+ rec->getField(FREQ),
+ rec->getField(MODE) );
+ chkCabBrowser->add(line);
+ }
+ wCabrillo->show();
+}
+
+void cabrillo_append_qso (FILE *fp, cQsoRec *rec)
+{
+ char freq[16] = "";
+ string rst_in, rst_out, exch_in, exch_out, date, time, mode, mycall, call;
+ string qsoline = "QSO: ";
+ int rst_len = 3;
+ int ifreq = 0;
+ size_t len = 0;
+
+ exch_out.clear();
+
+ if (btnCabFreq->value()) {
+ ifreq = (int)(1000.0 * atof(rec->getField(FREQ)));
+ snprintf(freq, sizeof(freq), "%d", ifreq);
+ qsoline.append(freq); qsoline.append(" ");
+ }
+
+ if (btnCabMode->value()) {
+ mode = rec->getField(MODE);
+ if (mode.compare("USB") == 0 || mode.compare("LSB") == 0 ||
+ mode.compare("PH") == 0 ) mode = "PH";
+ else if (mode.compare("FM") == 0 || mode.compare("CW") == 0 ) ;
+ else mode = "RY";
+ if (mode.compare("PH") == 0 || mode.compare("FM") == 0 ) rst_len = 2;
+ qsoline.append(mode); qsoline.append(" ");
+ }
+
+ if (btnCabQSOdateOn->value()) {
+ date = rec->getField(QSO_DATE);
+ date.insert(4,"-");
+ date.insert(7,"-");
+ qsoline.append(date); qsoline.append(" ");
+ }
+ if (btnCabTimeOn->value()) {
+ time = rec->getField(TIME_ON);
+ qsoline.append(time); qsoline.append(" ");
+ }
+
+ if (btnCabQSOdateOff->value()) {
+ date = rec->getField(QSO_DATE_OFF);
+ date.insert(4,"-");
+ date.insert(7,"-");
+ qsoline.append(date); qsoline.append(" ");
+ }
+ if (btnCabTimeOff->value()) {
+ time = rec->getField(TIME_OFF);
+ qsoline.append(time); qsoline.append(" ");
+ }
+
+// mycall = progStatus.tag_cll;
+// mycall = progdefaults.myCall;
+ if (mycall.length() > 13) mycall = mycall.substr(0,13);
+ if ((len = mycall.length()) < 13) mycall.append(13 - len, ' ');
+ qsoline.append(mycall); qsoline.append(" ");
+
+ if (btnCabRSTsent->value()) {
+ rst_out = rec->getField(RST_SENT);
+ rst_out = rst_out.substr(0,rst_len);
+ exch_out.append(rst_out).append(" ");
+ }
+
+ if (btnCabSerialOUT->value()) {
+ exch_out.append(rec->getField(STX)).append(" ");
+ }
+
+ if (btnCabMyXchg->value()) {
+ exch_out.append(rec->getField(MYXCHG)).append(" ");
+ }
+
+ if (contestnbr == BARTG_RTTY && exch_out.length() < 11) {
+ exch_out.append(rec->getField(TIME_OFF)).append(" ");
+ }
+
+ if (exch_out.length() > 14) exch_out = exch_out.substr(0,14);
+ if ((len = exch_out.length()) < 14) exch_out.append(14 - len, ' ');
+
+ qsoline.append(exch_out).append(" ");
+
+ if (btnCabCall->value()) {
+ call = rec->getField(CALL);
+ if (call.length() > 13) call = call.substr(0,13);
+ if ((len = call.length()) < 13) call.append(13 - len, ' ');
+ qsoline.append(call); qsoline.append(" ");
+ }
+
+ if (btnCabRSTrcvd->value()) {
+ rst_in = rec->getField(RST_RCVD);
+ rst_in = rst_in.substr(0,rst_len);
+ qsoline.append(rst_in); qsoline.append(" ");
+ }
+
+ if (btnCabSerialIN->value()) {
+ exch_in = rec->getField(SRX);
+ if (exch_in.length())
+ exch_in += ' ';
+ }
+ if (btnCabXchgIn->value())
+ exch_in.append(rec->getField(XCHG1));
+ if (exch_in.length() > 14) exch_in = exch_in.substr(0,14);
+ if ((len = exch_in.length()) < 14) exch_in.append(14 - len, ' ');
+ qsoline.append(exch_in);
+
+ fprintf (fp, "%s\n", qsoline.c_str());
+ return;
+}
+
+void WriteCabrillo()
+{
+ if (chkCabBrowser->nchecked() == 0) return;
+
+ cQsoRec *rec;
+
+ string filters = "TEXT\t*.txt";
+ string strContest = "";
+
+ const char* p = FSEL::saveas(_("Create cabrillo report"), filters.c_str(),
+ "contest.txt");
+ if (!p)
+ return;
+
+ for (int i = 0; i < chkCabBrowser->nitems(); i++) {
+ if (chkCabBrowser->checked(i + 1)) {
+ rec = qsodb.getRec(i);
+ rec->putField(EXPORT, "E");
+ qsodb.qsoUpdRec (i, rec);
+ }
+ }
+
+ FILE *cabFile = fopen (p, "w");
+ if (!cabFile)
+ return;
+
+ strContest = cboContest->value();
+ contestnbr = (icontest)cboContest->index();
+
+ fprintf (cabFile,
+"START-OF-LOG: 3.0\n\
+CREATED-BY: %s %s\n\
+\n\
+# The callsign used during the contest.\n\
+CALLSIGN: %s\n\
+\n\
+# ASSISTED or NON-ASSISTED\n\
+CATEGORY-ASSISTED: \n\
+\n\
+# Band: ALL, 160M, 80M, 40M, 20M, 15M, 10M, 6M, 2M, 222, 432, 902, 1.2G\n\
+CATEGORY-BAND: \n\
+\n\
+# Mode: SSB, CW, RTTY, MIXED \n\
+CATEGORY-MODE: \n\
+\n\
+# Operator: SINGLE-OP, MULTI-OP, CHECKLOG \n\
+CATEGORY-OPERATOR: \n\
+\n\
+# Power: HIGH, LOW, QRP \n\
+CATEGORY-POWER: \n\
+\n\
+# Station: FIXED, MOBILE, PORTABLE, ROVER, EXPEDITION, HQ, SCHOOL \n\
+CATEGORY-STATION: \n\
+\n\
+# Time: 6-HOURS, 12-HOURS, 24-HOURS \n\
+CATEGORY-TIME: \n\
+\n\
+# Transmitter: ONE, TWO, LIMITED, UNLIMITED, SWL \n\
+CATEGORY-TRANSMITTER: \n\
+\n\
+# Overlay: ROOKIE, TB-WIRES, NOVICE-TECH, OVER-50 \n\
+CATEGORY-OVERLAY: \n\
+\n\
+# Integer number\n\
+CLAIMED-SCORE: \n\
+\n\
+# Name of the radio club with which the score should be aggregated.\n\
+CLUB: \n\
+\n\
+# Contest: AP-SPRINT, ARRL-10, ARRL-160, ARRL-DX-CW, ARRL-DX-SSB, ARRL-SS-CW,\n\
+# ARRL-SS-SSB, ARRL-UHF-AUG, ARRL-VHF-JAN, ARRL-VHF-JUN, ARRL-VHF-SEP,\n\
+# ARRL-RTTY, BARTG-RTTY, CQ-160-CW, CQ-160-SSB, CQ-WPX-CW, CQ-WPX-RTTY,\n\
+# CQ-WPX-SSB, CQ-VHF, CQ-WW-CW, CQ-WW-RTTY, CQ-WW-SSB, DARC-WAEDC-CW,\n\
+# DARC-WAEDC-RTTY, DARC-WAEDC-SSB, FCG-FQP, IARU-HF, JIDX-CW, JIDX-SSB,\n\
+# NAQP-CW, NAQP-RTTY, NAQP-SSB, NA-SPRINT-CW, NA-SPRINT-SSB, NCCC-CQP,\n\
+# NEQP, OCEANIA-DX-CW, OCEANIA-DX-SSB, RDXC, RSGB-IOTA, SAC-CW, SAC-SSB,\n\
+# STEW-PERRY, TARA-RTTY \n\
+CONTEST: %s\n\
+\n\
+# Optional email address\n\
+EMAIL: \n\
+\n\
+LOCATION: \n\
+\n\
+# Operator name\n\
+NAME: \n\
+\n\
+# Maximum 4 address lines.\n\
+ADDRESS: \n\
+ADDRESS: \n\
+ADDRESS: \n\
+ADDRESS: \n\
+\n\
+# A space-delimited list of operator callsign(s). \n\
+OPERATORS: \n\
+\n\
+# Offtime yyyy-mm-dd nnnn yyyy-mm-dd nnnn \n\
+# OFFTIME: \n\
+\n\
+# Soapbox comments.\n\
+SOAPBOX: \n\
+SOAPBOX: \n\
+SOAPBOX: \n\n",
+ PACKAGE_NAME, PACKAGE_VERSION,
+ "",//progStatus.tag_cll.c_str(),
+// progdefaults.myCall.c_str(),
+ strContest.c_str() );
+
+ qsodb.SortByDate();
+ for (int i = 0; i < qsodb.nbrRecs(); i++) {
+ rec = qsodb.getRec(i);
+ if (rec->getField(EXPORT)[0] == 'E') {
+ cabrillo_append_qso(cabFile, rec);
+ rec->putField(EXPORT,"");
+ qsodb.qsoUpdRec(i, rec);
+ }
+ }
+ fprintf(cabFile, "END-OF-LOG:\n");
+ fclose (cabFile);
+ return;
+}
+
+/*
+#include <tr1/unordered_map>
+typedef tr1::unordered_map<string, unsigned> dxcc_entity_cache_t;
+static dxcc_entity_cache_t dxcc_entity_cache;
+static bool dxcc_entity_cache_enabled = false;
+
+#include "dxcc.h"
+
+static void dxcc_entity_cache_clear(void)
+{
+ if (dxcc_entity_cache_enabled)
+ dxcc_entity_cache.clear();
+}
+
+static void dxcc_entity_cache_add(cQsoRec* r)
+{
+ if (!dxcc_entity_cache_enabled | !r)
+ return;
+
+ const dxcc* e = dxcc_lookup(r->getField(CALL));
+ if (e)
+ dxcc_entity_cache[e->country]++;
+}
+static void dxcc_entity_cache_add(cQsoDb& db)
+{
+ if (!dxcc_entity_cache_enabled)
+ return;
+
+ int n = db.nbrRecs();
+ for (int i = 0; i < n; i++)
+ dxcc_entity_cache_add(db.getRec(i));
+ if (!dxcc_entity_cache.empty())
+ LOG_INFO("Found %" PRIuSZ " countries in %d QSO records",
+ dxcc_entity_cache.size(), n);
+}
+
+static void dxcc_entity_cache_rm(cQsoRec* r)
+{
+ if (!dxcc_entity_cache_enabled || !r)
+ return;
+
+ const dxcc* e = dxcc_lookup(r->getField(CALL));
+ if (!e)
+ return;
+ dxcc_entity_cache_t::iterator i = dxcc_entity_cache.find(e->country);
+ if (i != dxcc_entity_cache.end()) {
+ if (i->second)
+ i->second--;
+ else
+ dxcc_entity_cache.erase(i);
+ }
+}
+
+void dxcc_entity_cache_enable(bool v)
+{
+ if (dxcc_entity_cache_enabled == v)
+ return;
+
+ dxcc_entity_cache_clear();
+ if ((dxcc_entity_cache_enabled = v))
+ dxcc_entity_cache_add(qsodb);
+}
+
+bool qsodb_dxcc_entity_find(const char* country)
+{
+ return dxcc_entity_cache.find(country) != dxcc_entity_cache.end();
+}
+*/
diff --git a/src/logbook/qso_db.cxx b/src/logbook/qso_db.cxx
new file mode 100644
index 0000000..40c615d
--- /dev/null
+++ b/src/logbook/qso_db.cxx
@@ -0,0 +1,616 @@
+// ----------------------------------------------------------------------------
+// qso_db.cxx
+//
+// Copyright (C) 2006-2009
+// Dave Freese, W1HKJ
+//
+// This file is part of fldigi.
+//
+// Fldigi is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Fldigi 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 fldigi. If not, see <http://www.gnu.org/licenses/>.
+// ----------------------------------------------------------------------------
+
+#include <config.h>
+#include <fstream>
+#include <stdlib.h>
+#include <ctype.h>
+#include <string.h>
+#include <iostream>
+#include "qso_db.h"
+#include "field_def.h"
+#include "util.h"
+
+using namespace std;
+
+// =====================================================================
+// support for band / frequency translations
+// =====================================================================
+
+enum band_t {
+ BAND_160M, BAND_80M, BAND_75M, BAND_60M, BAND_40M, BAND_30M, BAND_20M,
+ BAND_17M, BAND_15M, BAND_12M, BAND_10M, BAND_6M, BAND_4M, BAND_2M, BAND_125CM,
+ BAND_70CM, BAND_33CM, BAND_23CM, BAND_13CM, BAND_9CM, BAND_6CM, BAND_3CM, BAND_125MM,
+ BAND_6MM, BAND_4MM, BAND_2P5MM, BAND_2MM, BAND_1MM, BAND_OTHER, NUM_BANDS
+};
+
+band_t band(long long freq_hz);
+band_t band(const char* freq_mhz);
+const char* band_name(band_t b);
+const char* band_name(const char* freq_mhz);
+const char* band_freq(band_t b);
+const char* band_freq(const char* band_name);
+
+band_t band(long long freq_hz)
+{
+ switch (freq_hz / 1000000LL) {
+ case 0: case 1: return BAND_160M;
+ case 3: return BAND_80M;
+ case 4: return BAND_75M;
+ case 5: return BAND_60M;
+ case 7: return BAND_40M;
+ case 10: return BAND_30M;
+ case 14: return BAND_20M;
+ case 18: return BAND_17M;
+ case 21: return BAND_15M;
+ case 24: return BAND_12M;
+ case 28 ... 29: return BAND_10M;
+ case 50 ... 54: return BAND_6M;
+ case 70 ... 71: return BAND_4M;
+ case 144 ... 148: return BAND_2M;
+ case 222 ... 225: return BAND_125CM;
+ case 420 ... 450: return BAND_70CM;
+ case 902 ... 928: return BAND_33CM;
+ case 1240 ... 1325: return BAND_23CM;
+ case 2300 ... 2450: return BAND_13CM;
+ case 3300 ... 3500: return BAND_9CM;
+ case 5650 ... 5925: return BAND_6CM;
+ case 10000 ... 10500: return BAND_3CM;
+ case 24000 ... 24250: return BAND_125MM;
+ case 47000 ... 47200: return BAND_6MM;
+ case 75500 ... 81000: return BAND_4MM;
+ case 119980 ... 120020: return BAND_2P5MM;
+ case 142000 ... 149000: return BAND_2MM;
+ case 241000 ... 250000: return BAND_1MM;
+ }
+
+ return BAND_OTHER;
+}
+
+band_t band(const char* freq_mhz)
+{
+ double d = strtod(freq_mhz, NULL);
+ if (d != 0.0)
+ return band((long long)(d * 1e6));
+ else
+ return BAND_OTHER;
+}
+
+struct band_freq_t {
+ const char* band;
+ const char* freq;
+};
+
+static struct band_freq_t band_names[NUM_BANDS] = {
+ { "160m", "1.8" },
+ { "80m", "3.4" },
+ { "75m", "4.0" },
+ { "60m", "5.3" },
+ { "40m", "7.0" },
+ { "30m", "10.0" },
+ { "20m", "14.0" },
+ { "17m", "18.0" },
+ { "15m", "21.0" },
+ { "12m", "24.0" },
+ { "10m", "28.0" },
+ { "6m", "50.0" },
+ { "4m", "70.0" },
+ { "2m", "144.0" },
+ { "1.25m", "222.0" },
+ { "70cm", "420.0" },
+ { "33cm", "902.0" },
+ { "23cm", "1240.0" },
+ { "13cm", "2300.0" },
+ { "9cm", "3300.0" },
+ { "6cm", "5650.0" },
+ { "3cm", "10000.0" },
+ { "1.25cm", "24000.0" },
+ { "6mm", "47000.0" },
+ { "4mm", "75500.0" },
+ { "2.5mm", "119980.0" },
+ { "2mm", "142000.0" },
+ { "1mm", "241000.0" },
+ { "other", "" }
+};
+
+const char* band_name(band_t b)
+{
+ return band_names[CLAMP(b, 0, NUM_BANDS-1)].band;
+}
+
+const char* band_name(const char* freq_mhz)
+{
+ return band_name(band(freq_mhz));
+}
+
+const char* band_freq(band_t b)
+{
+ return band_names[CLAMP(b, 0, NUM_BANDS-1)].freq;
+}
+
+const char* band_freq(const char* band_name)
+{
+ for (size_t i = 0; i < BAND_OTHER; i++)
+ if (!strcmp(band_names[i].band, band_name))
+ return band_names[i].freq;
+
+ return "";
+}
+
+//======================================================================
+
+// class cQsoRec
+
+static int compby = COMPDATE;
+
+bool cQsoDb::reverse = false;
+
+cQsoRec::cQsoRec() {
+ for (int i=0;i < NUMFIELDS; i++)
+ qsofield[i] = "";
+}
+
+cQsoRec::~cQsoRec () {
+// for (int i = 0; i < NUMFIELDS; i++)
+// delete [] qsofield[i];
+}
+
+void cQsoRec::clearRec () {
+ for (int i = 0; i < NUMFIELDS; i++)
+ qsofield[i].clear();
+}
+
+int cQsoRec::validRec() {
+ return 0;
+}
+
+void cQsoRec::checkBand() {
+ size_t flen = qsofield[FREQ].length(),
+ blen = qsofield[BAND].length();
+ if (flen == 0 && blen != 0)
+ qsofield[FREQ] = band_freq(qsofield[BAND].c_str());
+ else if (blen == 0 && flen != 0)
+ qsofield[BAND] = band_name(qsofield[FREQ].c_str());
+}
+
+void cQsoRec::putField (int n, const char *s){
+ if (n < 0 || n >= NUMFIELDS) return;
+ qsofield[n] = s;
+}
+
+void cQsoRec::putField (int n, const char *s, int len) {
+ if (n < 0 || n >= NUMFIELDS) return;
+ qsofield[n].clear();
+ qsofield[n].append(s, len);
+}
+
+void cQsoRec::addtoField (int n, const char *s){
+ if (n < 0 || n >= NUMFIELDS) return;
+ qsofield[n].append(s);
+}
+
+void cQsoRec::trimFields () {
+ size_t p;
+ string s;
+ for (int i = 0; i < NUMFIELDS; i++) {
+ s = qsofield[i];
+//right trim string
+ p = s.length();
+ while (p && s[p-1] == ' ') {
+ s.erase(p - 1);
+ p = s.length();
+ }
+//left trim string
+ p = s.length();
+ while (p && s[0] == ' ') {
+ s.erase(0,1);
+ p = s.length();
+ }
+//make all upper case if Callsign or Mode
+ if (i == CALL || i == MODE) {
+ for (p = 0; p < s.length(); p++)
+ s[p] = toupper(s[p]);
+ }
+ qsofield[i] = s;
+ }
+}
+
+const char * cQsoRec::getField (int n) {
+ if (n < 0 || n >= NUMFIELDS) return 0;
+ return (qsofield[n].c_str());
+}
+
+const cQsoRec &cQsoRec::operator=(const cQsoRec &right) {
+ if (this != &right) {
+ for (int i = 0; i < NUMFIELDS; i++)
+ this->qsofield[i] = right.qsofield[i];
+ }
+ return *this;
+}
+
+int compareTimes (const cQsoRec &r1, const cQsoRec &r2) {
+ if (r1.qsofield[TIME_OFF] < r2.qsofield[TIME_OFF])
+ return -1;
+ if (r1.qsofield[TIME_OFF] > r2.qsofield[TIME_OFF])
+ return 1;
+ return 0;
+}
+
+int compareDates (const cQsoRec &r1, const cQsoRec &r2) {
+ if (r1.qsofield[QSO_DATE] < r2.qsofield[QSO_DATE])
+ return -1;
+ if (r1.qsofield[QSO_DATE] > r2.qsofield[QSO_DATE])
+ return 1;
+ return compareTimes (r1,r2);
+}
+
+int compareCalls (const cQsoRec &r1, const cQsoRec &r2) {
+ int cmp = 0;
+ char *s1 = new char[r1.qsofield[CALL].length() + 1];
+ char *s2 = new char[r2.qsofield[CALL].length() + 1];
+ char *p1, *p2;
+ strcpy(s1, r1.qsofield[CALL].c_str());
+ strcpy(s2, r2.qsofield[CALL].c_str());
+ p1 = strpbrk (&s1[1], "0123456789");
+ p2 = strpbrk (&s2[1], "0123456789");
+ if (p1 && p2) {
+ cmp = (*p1 < *p2) ? -1 :(*p1 > *p2) ? 1 : 0;
+ if (cmp == 0) {
+ *p1 = 0; *p2 = 0;
+ cmp = strcmp (s1, s2);
+ if (cmp == 0)
+ cmp = strcmp(p1+1, p2+1);
+ }
+ } else
+ cmp = (r1.qsofield[CALL] == r2.qsofield[CALL]);
+ delete [] s1;
+ delete [] s2;
+ if (cmp == 0)
+ return compareDates (r1,r2);
+ return cmp;
+}
+
+int compareModes (const cQsoRec &r1, const cQsoRec &r2) {
+ if (r1.qsofield[MODE] < r2.qsofield[MODE])
+ return -1;
+ if (r1.qsofield[MODE] > r2.qsofield[MODE])
+ return 1;
+ return compareDates (r1,r2);
+}
+
+int compareFreqs (const cQsoRec &r1, const cQsoRec &r2) {
+ int cmp = 0;
+ double f1, f2;
+ f1 = atof(r1.qsofield[FREQ].c_str());
+ f2 = atof(r2.qsofield[FREQ].c_str());
+ if (f1 == f2) cmp = 0;
+ else if (f1 < f2) return -1;
+ else if (f1 > f2) return 1;
+ return compareDates (r1,r2);
+}
+
+int compareqsos (const void *p1, const void *p2) {
+ cQsoRec *r1, *r2;
+ if (cQsoDb::reverse) {
+ r2 = (cQsoRec *)p1;
+ r1 = (cQsoRec *)p2;
+ } else {
+ r1 = (cQsoRec *)p1;
+ r2 = (cQsoRec *)p2;
+ }
+
+ switch (compby) {
+ case COMPCALL :
+ return compareCalls (*r1, *r2);
+ case COMPMODE :
+ return compareModes (*r1, *r2);
+ case COMPFREQ :
+ return compareFreqs (*r1, *r2);
+ case COMPDATE :
+ default :
+ return compareDates (*r1, *r2);
+ }
+}
+
+bool cQsoRec::operator==(const cQsoRec &right) const {
+ if (compareDates (*this, right) != 0) return false;
+ if (compareTimes (*this, right) != 0) return false;
+ if (compareCalls (*this, right) != 0) return false;
+ if (compareFreqs (*this, right) != 0) return false;
+ return true;
+}
+
+bool cQsoRec::operator<(const cQsoRec &right) const {
+ if (compareDates (*this, right) > -1) return false;
+ if (compareTimes (*this, right) > -1) return false;
+ if (compareCalls (*this, right) > -1) return false;
+ if (compareFreqs (*this, right) > -1) return false;
+ return true;
+}
+
+static char delim_in = '\t';
+static char delim_out = '\t';
+static bool isVer3 = false;
+
+ostream &operator<< (ostream &output, const cQsoRec &rec) {
+ for (int i = 0; i < EXPORT; i++)
+ output << rec.qsofield[i].c_str() << delim_out;
+ return output;
+}
+
+istream &operator>> (istream &input, cQsoRec &rec ) {
+char c;
+int i;
+ for (i = 0; i < NUMFIELDS; i++) {
+ rec.qsofield[i].clear();
+ c = input.get();
+ while (c != delim_in && c != EOF) {
+ rec.qsofield[i] += c;
+ c = input.get();
+ }
+ }
+ return input;
+}
+
+//======================================================================
+// class cQsoDb
+
+#define MAXRECS 8192
+
+cQsoDb::cQsoDb() {
+ nbrrecs = 0;
+ maxrecs = MAXRECS;
+ qsorec = new cQsoRec[maxrecs];
+ compby = COMPDATE;
+ dirty = 0;
+}
+
+cQsoDb::~cQsoDb() {
+ delete [] qsorec;
+}
+
+void cQsoDb::deleteRecs() {
+ delete [] qsorec;
+ nbrrecs = 0;
+ maxrecs = MAXRECS;
+ qsorec = new cQsoRec[maxrecs];
+ dirty = 0;
+}
+
+void cQsoDb::clearDatabase() {
+ deleteRecs();
+}
+
+int cQsoDb::qsoFindRec(cQsoRec *rec) {
+ for (int i = 0; i < nbrrecs; i++)
+ if (qsorec[i] == *rec)
+ return i;
+ return -1;
+}
+
+void cQsoDb::qsoNewRec (cQsoRec *nurec) {
+ if (nbrrecs == maxrecs) {
+ maxrecs *= 2;
+ cQsoRec *atemp = new cQsoRec[maxrecs];
+ for (int i = 0; i < nbrrecs; i++)
+ atemp[i] = qsorec[i];
+ delete [] qsorec;
+ qsorec = atemp;
+ }
+ qsorec[nbrrecs] = *nurec;
+ qsorec[nbrrecs].checkBand();
+ nbrrecs++;
+ dirty = 1;
+}
+
+void cQsoDb::qsoDelRec (int rnbr) {
+ if (rnbr < 0 || rnbr > (nbrrecs - 1))
+ return;
+ for (int i = rnbr; i < nbrrecs - 1; i++)
+ qsorec[i] = qsorec[i+1];
+ nbrrecs--;
+ qsorec[nbrrecs].clearRec();
+}
+
+void cQsoDb::qsoUpdRec (int rnbr, cQsoRec *updrec) {
+ if (rnbr < 0 || rnbr > (nbrrecs - 1))
+ return;
+ qsorec[rnbr] = *updrec;
+ qsorec[rnbr].checkBand();
+ return;
+}
+
+void cQsoDb::SortByDate () {
+ compby = COMPDATE;
+ qsort (qsorec, nbrrecs, sizeof (cQsoRec), compareqsos);
+}
+
+void cQsoDb::SortByCall () {
+ compby = COMPCALL;
+ qsort (qsorec, nbrrecs, sizeof (cQsoRec), compareqsos);
+}
+
+void cQsoDb::SortByMode () {
+ compby = COMPMODE;
+ qsort (qsorec, nbrrecs, sizeof (cQsoRec), compareqsos);
+}
+
+void cQsoDb::SortByFreq () {
+ compby = COMPFREQ;
+ qsort (qsorec, nbrrecs, sizeof (cQsoRec), compareqsos);
+}
+
+bool cQsoDb::qsoIsValidFile(const char *fname) {
+ char buff[256];
+ ifstream inQsoFile (fname, ios::in);
+ if (!inQsoFile)
+ return false;
+ inQsoFile.getline (buff, 256);
+ if (strstr (buff, "_LOGBODUP DB") == 0) {
+ inQsoFile.close();
+ return false;
+ }
+ inQsoFile.close();
+ return true;
+}
+
+int cQsoDb::qsoReadFile (const char *fname) {
+char buff[256];
+ ifstream inQsoFile (fname, ios::in);
+ if (!inQsoFile)
+ return 1;
+ inQsoFile.getline (buff, 256);
+ if (strstr (buff, "_LOGBODUP DB") == 0) {
+ inQsoFile.close();
+ return 2;
+ }
+ if (strstr (buff, "_LOGBODUP DBX") == 0) // new file format
+ delim_in = '\n';
+ if (strstr (buff, "3.0") != 0)
+ isVer3 = true;
+
+ cQsoRec inprec;
+ while (inQsoFile >> inprec) {
+ qsoNewRec (&inprec);
+ inprec.clearRec();
+ }
+ inQsoFile.close();
+ SortByDate();
+ return 0;
+}
+
+int cQsoDb::qsoWriteFile (const char *fname) {
+ ofstream outQsoFile (fname, ios::out);
+ if (!outQsoFile) {
+ printf("write failure: %s\n", fname);
+ return 1;
+ }
+ outQsoFile << "_LOGBODUP DBX 3.0" << '\n';
+ for (int i = 0; i < nbrrecs; i++)
+ outQsoFile << qsorec[i];
+ outQsoFile.close();
+ return 0;
+}
+
+const int cQsoDb::jdays[2][13] = {
+ { 0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 },
+ { 0, 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335 }
+};
+
+bool cQsoDb::isleapyear( int y )
+{
+ if( y % 400 == 0 || ( y % 100 != 0 && y % 4 == 0 ) )
+ return true;
+ return false;
+}
+
+int cQsoDb::dayofyear (int year, int mon, int mday)
+{
+ return mday + jdays[isleapyear (year) ? 1 : 0][mon];
+}
+
+unsigned int cQsoDb::epoch_minutes (const char *szdate, const char *sztime)
+{
+ unsigned int doe;
+ int era, cent, quad, rest;
+ int year, mon, mday;
+ int mins;
+
+ year = ((szdate[0]*10 + szdate[1])*10 + szdate[2])*10 + szdate[3];
+ mon = szdate[4]*10 + szdate[5];
+ mday = szdate[6]*10 + szdate[7];
+
+ mins = (sztime[0]*10 + sztime[1])*60 + sztime[2]*10 + sztime[3];
+
+ /* break down the year into 400, 100, 4, and 1 year multiples */
+ rest = year - 1;
+ quad = rest / 4; rest %= 4;
+ cent = quad / 25; quad %= 25;
+ era = cent / 4; cent %= 4;
+
+ /* set up doe */
+ doe = dayofyear (year, mon, mday);
+ doe += era * (400 * 365 + 97);
+ doe += cent * (100 * 365 + 24);
+ doe += quad * (4 * 365 + 1);
+ doe += rest * 365;
+
+ return doe*60*24 + mins;
+}
+
+bool cQsoDb::duplicate(
+ const char *callsign,
+ const char *szdate, const char *sztime, unsigned int interval, bool chkdatetime,
+ const char *freq, bool chkfreq,
+ const char *state, bool chkstate,
+ const char *mode, bool chkmode,
+ const char *xchg1, bool chkxchg1 )
+{
+ int f1, f2 = 0;
+ f1 = (int)atof(freq);
+ bool b_freqDUP = true, b_stateDUP = true, b_modeDUP = true,
+ b_xchg1DUP = true,
+ b_dtimeDUP = true;
+ unsigned int datetime = epoch_minutes(szdate, sztime);
+ unsigned int qsodatetime;
+
+ for (int i = 0; i < nbrrecs; i++) {
+ if (strcasecmp(qsorec[i].getField(CALL), callsign) == 0) {
+// found callsign duplicate
+ b_freqDUP = b_stateDUP = b_modeDUP =
+ b_xchg1DUP = b_dtimeDUP = false;
+ if (chkfreq) {
+ f2 = (int)atof(qsorec[i].getField(FREQ));
+ while (f1 > 1000) f1 /= 1000;
+ while (f2 > 1000) f2 /= 1000;
+ if (f1 > 100) { f1 /= 10; f2 /= 10; }
+ f1 = (int)(f1); f2 = (int)(f2);
+ b_freqDUP = (f1 == f2);
+ }
+ if (chkstate)
+ b_stateDUP = (qsorec[i].getField(STATE)[0] == 0 && state[0] == 0) ||
+ (strcasestr(qsorec[i].getField(STATE), state) != 0);
+ if (chkmode)
+ b_modeDUP = (qsorec[i].getField(MODE)[0] == 0 && mode[0] == 0) ||
+ (strcasestr(qsorec[i].getField(MODE), mode) != 0);
+ if (chkxchg1)
+ b_xchg1DUP = (qsorec[i].getField(XCHG1)[0] == 0 && xchg1[0] == 0) ||
+ (strcasestr(qsorec[i].getField(XCHG1), xchg1) != 0);
+
+ if (chkdatetime) {
+ qsodatetime = epoch_minutes (
+ qsorec[i].getField(QSO_DATE),
+ qsorec[i].getField(TIME_OFF));
+ if ((datetime - qsodatetime) < interval) b_dtimeDUP = true;
+ }
+ if ( (!chkfreq || (chkfreq && b_freqDUP)) &&
+ (!chkstate || (chkstate && b_stateDUP)) &&
+ (!chkmode || (chkmode && b_modeDUP)) &&
+ (!chkxchg1 || (chkxchg1 && b_xchg1DUP)) &&
+ (!chkdatetime || (chkdatetime && b_dtimeDUP))) {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
diff --git a/src/logbook/table.cxx b/src/logbook/table.cxx
new file mode 100644
index 0000000..a9b1688
--- /dev/null
+++ b/src/logbook/table.cxx
@@ -0,0 +1,1840 @@
+/*
+ Copyright (c) 2004 Markus Niemistö
+
+ 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 AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+*/
+
+#include <config.h>
+
+#include <FL/Fl.H>
+#include <FL/fl_draw.H>
+
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
+#include <string>
+#include "table.h"
+
+#include "util.h"
+
+//#define DAMAGE_HEADER FL_DAMAGE_USER1
+//#define DAMAGE_ROWS FL_DAMAGE_USER2
+
+#define DAMAGE_HEADER FL_DAMAGE_ALL
+#define DAMAGE_ROWS FL_DAMAGE_ALL
+
+using namespace std;
+
+
+/*
+ * ======================================
+ * void Table.drawHeader(int x, int y);
+ * ======================================
+ *
+ * Draws header buttons starting at (x, y).
+ */
+void Table::drawHeader(int x, int y) {
+ int w;
+ struct ColumnInfo col;
+
+ fl_font(FL_HELVETICA, headerHeight - 4);
+
+ /*
+ * Draw all header cells that aren't clipped.
+ */
+ for (int i = leftCol; i <= rightCol; i++) {
+ col = header[i];
+
+ if (col.hidden)
+ continue;
+
+ // Draw box
+ if (pushed != i)
+ fl_draw_box(FL_THIN_UP_BOX, x, y, w = col.width, headerHeight, FL_GRAY);
+ else
+ fl_draw_box(FL_THIN_DOWN_BOX, x, y, w = col.width, headerHeight, FL_GRAY);
+
+ fl_color(FL_FOREGROUND_COLOR);
+
+ // Draw labels
+ if (col.title != NULL)
+ fl_draw(col.title, x + 2, y - 1, w - 2, headerHeight, col.hdr_align);
+
+ x += w;
+
+ // Draw "the sort arrow", if any.
+ if (sortColumn == i) {
+ int mod = headerHeight - 10;
+
+ if (ascent)
+ fl_polygon(x - mod - 6, y + 5, x - mod / 2 - 6,
+ y + mod + 5, x - 6, y + 5);
+ else
+ fl_polygon(x - mod - 6, y + mod + 5,
+ x - mod / 2 - 6, y + 5, x - 6, y + mod + 5);
+ }
+ }
+}
+
+
+/*
+ * =============================================================
+ * void Table.drawRow(int row, char *rowData[], int x, int y);
+ * =============================================================
+ *
+ * Draws all items in the row. Starts drawing from (x, y).
+ */
+void Table::drawRow(int row, char *rowData[], int x, int y) {
+ int w;
+ ColumnInfo col;
+
+ fl_font(FL_HELVETICA, rowHeight - 4);
+
+ // Draw background box.
+ if (row != selected) {
+ Fl_Color bg;
+ if (!withGrid && row % 2 == 0) // different bg for consecutive rows
+ bg = color();
+ else {
+ bg = fl_color_average(color(), FL_BLACK, .9);
+ if (fl_contrast(bg, FL_BLACK) == FL_WHITE) // widget has very dark text bg
+ bg = fl_color_average(color(), FL_WHITE, .9);
+ }
+
+ fl_rectf(iX, y, tableWidth - hScroll->value(), rowHeight, bg);
+
+ fl_color(FL_FOREGROUND_COLOR);
+ }
+ else {
+ if (Fl::focus() == this) {
+ fl_rectf(iX, y, tableWidth - hScroll->value(), rowHeight, selection_color());
+ fl_color(FL_FOREGROUND_COLOR);
+
+ // Draw focus
+ fl_line_style(FL_DOT);
+ fl_rect(iX, y, tableWidth - hScroll->value(), rowHeight);
+ fl_line_style(FL_SOLID);
+ }
+ else
+ fl_rectf(iX, y, tableWidth - hScroll->value(), rowHeight, selection_color());
+
+ fl_color(fl_contrast(FL_FOREGROUND_COLOR, selection_color()));
+ }
+
+
+ // Get color from highlighter.
+ Fl_Color color;
+ if ((highlighter != NULL) && (highlighter(row, rowData, &color)))
+ fl_color(color);
+
+ const char *str;
+
+ // Draw the data.
+ for (int i = leftCol; i <= rightCol; i++) {
+ w = (col = header[i]).width;
+ if (col.hidden)
+ continue;
+
+ if (withGrid == true) {
+ fl_color(FL_FOREGROUND_COLOR);
+ fl_line_style(FL_SOLID);
+ fl_rect(x,y,w,rowHeight);
+
+ fl_color(FL_FOREGROUND_COLOR);
+ }
+
+ if ((str = rowData[i]) != NULL)
+ fl_draw(str, x + 1, y - 1, w - 2, rowHeight + 1, col.align);
+
+ x += w;
+ }
+}
+
+
+/*
+ * =======================================================
+ * Table.Table(int x, int y, int w, int h, char *label);
+ * =======================================================
+ *
+ * This is standard FLTK constructor. See FLTK documentation for
+ * more information.
+ */
+Table::Table(int x, int y, int w, int h, char *label) :
+ Fl_Group(x, y, w, h, label) {
+
+ // Setup variables.
+ align((Fl_Align)(FL_ALIGN_LEFT | FL_ALIGN_CLIP));
+
+ box(FL_THIN_DOWN_FRAME);
+ color(FL_BACKGROUND2_COLOR, FL_SELECTION_COLOR);
+
+ headerHeight = 18;
+ rowHeight = 17;
+ scrollbarSize = 16;
+
+ // Create scrollbars.
+ vScroll = new Fl_Scrollbar(x + w - scrollbarSize, y, scrollbarSize, h + scrollbarSize);
+ vScroll->type(FL_VERTICAL);
+ vScroll->linesize(3 * rowHeight);
+ vScroll->callback(scrollCallback, (void*)this);
+ vScroll->hide();
+
+ hScroll = new Fl_Scrollbar(x, y + h - scrollbarSize, w, scrollbarSize);
+ hScroll->type(FL_HORIZONTAL);
+ hScroll->callback(scrollCallback, (void*)this);
+ hScroll->hide();
+
+ Fl_Group::end();
+
+ // Setup the rest of the variables to reasonable defaults.
+ nCols = nRows = 0;
+ cPos = 0;
+
+ dragX = 0;
+ resizing = -1;
+ pushed = -1;
+
+ curRow = NULL;
+ highlighter = NULL;
+
+ sortColumn = -1;
+ selected = -1;
+ canSort = true;
+ canResize = true;
+ ascent = false;
+ noMoreColumns = false;
+ dimensionsChanged = false;
+ toBeSorted = false;
+ headerEnabled = true;
+ withGrid = false;
+
+ popupMenu = NULL;
+ menuAlloc = false;
+
+ Vscroll = var;
+ Hscroll = var;
+}
+
+
+/*
+ * =================
+ * Table.~Table();
+ * =================
+ *
+ * Destructor.
+ */
+Table::~Table() {
+ delete vScroll;
+ delete hScroll;
+
+ menuClear();
+ clear();
+}
+
+
+/*
+ * ====================================
+ * bool Table.headerOn();
+ * void Table.headerOn(bool enabled);
+ * ====================================
+ *
+ * These methods get or set the value of variable controlling
+ * whether header buttons are displayed.
+ */
+bool Table::headerOn() const {
+ return headerEnabled;
+}
+
+void Table::headerOn(bool enabled) {
+ headerEnabled = enabled;
+ dimensionsChanged = true;
+ redraw();
+}
+
+
+/*
+ * ====================================
+ * bool Table.gridEnabled();
+ * void Table.gridEnabled(bool enabled);
+ * ====================================
+ *
+ * These methods get or set the value of variable controlling
+ * whether the table grid is displayed.
+ */
+bool Table::gridEnabled() const {
+ return withGrid;
+}
+
+void Table::gridEnabled(bool enabled) {
+ withGrid = enabled;
+ dimensionsChanged = true;
+ redraw();
+}
+
+
+/*
+ * =====================================
+ * bool Table.allowResize();
+ * void Table.allowResize(bool allow);
+ * =====================================
+ *
+ * These methods get or set the value of variable controlling
+ * whether user may resize columns by dragging the column border.
+ */
+bool Table::allowResize() const {
+ return canResize;
+}
+
+void Table::allowResize(bool allow) {
+ canResize = allow;
+}
+
+
+/*
+ * ===================================
+ * bool Table.allowSort();
+ * void Table.allowSort(bool allow);
+ * ===================================
+ *
+ * These methods get or set the value of variable controlling
+ * whether user can determine how data on table is sorted by
+ * clicking on the header buttons.
+ */
+bool Table::allowSort() const {
+ return canSort;
+}
+
+void Table::allowSort(bool allow) {
+ canSort = allow;
+}
+
+
+/*
+ * ==================================
+ * int Table.headerSize();
+ * void Table.headerSize(int size);
+ * ==================================
+ *
+ * These methods get or set the value of variable controlling
+ * the height of header buttons.
+ */
+int Table::headerSize() const {
+ return headerHeight;
+}
+
+void Table::headerSize(int height) {
+ headerHeight = height + 4;
+ dimensionsChanged = true;
+ redraw();
+}
+
+
+/*
+ * ===============================
+ * int Table.rowSize();
+ * void Table.rowSize(int size);
+ * ===============================
+ *
+ * These methods get or set the value of variable controlling
+ * the height of rows.
+ */
+int Table::rowSize() const {
+ return rowHeight;
+}
+
+void Table::rowSize(int height) {
+ height += 4;
+ rowHeight = height;
+ vScroll->linesize(3 * height);
+ dimensionsChanged = true;
+ redraw();
+}
+
+
+/*
+ * ===================================
+ * int Table.scrollbSize();
+ * void Table.scrollbSize(int size);
+ * ===================================
+ *
+ * These methods get or set the value of variable controlling
+ * the size (width) of the scrollbars.
+ */
+int Table::scrollbSize() const {
+ return scrollbarSize;
+}
+
+void Table::scrollbSize(int size) {
+ scrollbarSize = size;
+ dimensionsChanged = true;
+ redraw();
+}
+
+
+/*
+ * =====================================================
+ * Fl_Align Table.columnAlign(int column);
+ * void Table.columnAlign(int column, Fl_Align align);
+ * =====================================================
+ *
+ * These methods get or set the value of variable controlling
+ * the alignment of the specified column.
+ */
+Fl_Align Table::columnAlign(int column) const {
+ if ((column < 0) && (column >= nCols))
+ return (Fl_Align)(FL_ALIGN_LEFT | FL_ALIGN_CLIP);
+ /* NOT REACHED */
+
+ return header[column].align;
+}
+
+void Table::columnAlign(int column, Fl_Align align) {
+ if ((column < 0) || (column >= nCols))
+ return;
+ /* NOT REACHED */
+
+ header[column].align = (Fl_Align)(align | FL_ALIGN_CLIP);
+ redraw();
+}
+
+Fl_Align Table::headerAlign(int column) const {
+ if ((column < 0) && (column >= nCols))
+ return (Fl_Align)(FL_ALIGN_LEFT | FL_ALIGN_CLIP);
+ /* NOT REACHED */
+
+ return header[column].hdr_align;
+}
+
+void Table::headerAlign(int column, Fl_Align align) {
+ if ((column < 0) && (column >= nCols))
+ return;
+ /* NOT REACHED */
+
+ header[column].hdr_align = (Fl_Align)(align | FL_ALIGN_CLIP);
+ redraw();
+}
+
+
+/*
+ * =====================================================
+ * int Table.columnWidth(int column);
+ * void Table.columnWidth(int column, int width);
+ * =====================================================
+ *
+ * These methods get or set the value of variable controlling
+ * the width of the specified column.
+ */
+int Table::columnWidth(int column) const {
+ if ((column < 0) && (column >= nCols))
+ return 0;
+ /* NOT REACHED */
+
+ return header[column].width;
+}
+
+void Table::columnWidth(int column, int width) {
+ if ((column < 0) && (column >= nCols))
+ return;
+ /* NOT REACHED */
+
+ header[column].width = width;
+ dimensionsChanged = true;
+ redraw();
+}
+
+
+/*
+ * ========================================================
+ * const char *Table.columnTitle(int column);
+ * void Table.columnTitle(int column, const char *title);
+ * ========================================================
+ *
+ * These methods get or set the value of variable controlling
+ * the width of the specified column.
+ */
+const char *Table::columnTitle(int column) {
+ if ((column < 0) && (column >= nCols))
+ return NULL;
+ /* NOT REACHED */
+
+ return header[column].title;
+}
+
+void Table::columnTitle(int column, const char *title) {
+ if ((column < 0) && (column >= nCols))
+ return;
+ /* NOT REACHED */
+
+ free((void*)header[column].title);
+ header[column].title = strdup(title);
+
+ damage(DAMAGE_HEADER);
+}
+
+
+/*
+ * ===================================================
+ * bool Table.columnHidden(int column);
+ * void Table.columnHidden(int column, bool hidden);
+ * ===================================================
+ *
+ * These methods get or set the value of variable controlling
+ * whether column is visible or not.
+ */
+bool Table::columnHidden(int column) {
+ if ((column < 0) && (column >= nCols))
+ return false;
+ /* NOT REACHED */
+
+ return header[column].hidden;
+}
+
+void Table::columnHidden(int column, bool hidden) {
+ if ((column < 0) && (column >= nCols))
+ return;
+ /* NOT REACHED */
+
+ header[column].hidden = hidden;
+ dimensionsChanged = true;
+ damage(DAMAGE_HEADER | DAMAGE_ROWS);
+}
+
+
+/*
+ * ===================
+ * int Table.rows();
+ * ===================
+ *
+ * Returns the number of rows in table.
+ */
+int Table::rows() {
+ return nRows;
+}
+
+
+/*
+ * ======================
+ * int Table.columns();
+ * ======================
+ *
+ * Returns the number of columns in table.
+ */
+int Table::columns() {
+ return nCols;
+}
+
+
+/*
+ * ==================================
+ * void Table.value(int selection);
+ * ==================================
+ *
+ * Sets the currently selected row.
+ */
+void Table::value(int selection) {
+ if ((selection >= 0) && (selection < nRows))
+ selected = selection;
+ damage(DAMAGE_ROWS);
+}
+
+
+/*
+ * ====================
+ * int Table.value();
+ * ====================
+ *
+ * Returns the number of the currently selected row.
+ */
+int Table::value() {
+ return selected;
+}
+
+
+/*
+ * ====================================================================
+ * void Table.addColumn(const char *label, int width, Fl_Align align,
+ * int (*comparator)(const char*, const char*));
+ * ====================================================================
+ *
+ * Adds column with label as title, width, align and comparator as
+ * sort function.
+ */
+void Table::addColumn(const char *label, int width, Fl_Align align,
+ int (*comparator)(const char*, const char*)) {
+ if (!noMoreColumns) {
+ struct ColumnInfo col;
+
+ dimensionsChanged = true;
+
+ col.title = strdup(label);
+ col.width = width;
+ col.hidden = false;
+ col.align = (Fl_Align)(align | FL_ALIGN_CLIP);
+ col.hdr_align = (Fl_Align)(FL_ALIGN_CENTER | FL_ALIGN_CLIP);
+ col.comparator = comparator;
+ col.callback = NULL;
+ header.push_back(col);
+ nCols++;
+ }
+}
+
+
+void Table::colcomparator(int col,
+ int (*comparator)(const char*, const char*))
+{
+ header[col].comparator = comparator;
+}
+
+void Table::colcallback (int col, void (*callback)())
+{
+ header[col].callback = callback;
+}
+
+/*
+ * ================================================
+ * void Table.addHiddenColumn(const char *label);
+ * ================================================
+ *
+ * Adds a nonvisible column with label as title.
+ */
+void Table::addHiddenColumn(const char *label) {
+ if (!noMoreColumns) {
+ struct ColumnInfo col;
+
+ col.title = strdup(label);
+ col.width = 0;
+ col.hidden = true;
+ col.align = FL_ALIGN_LEFT;
+ col.comparator = NULL;
+ header.push_back(col);
+ nCols++;
+ }
+}
+
+
+/*
+ * =================================
+ * void Table.addCell(char *data);
+ * =================================
+ *
+ * Adds a cell with data to the table.
+ */
+void Table::addCell(char *data) {
+ if (!noMoreColumns)
+ noMoreColumns = true;
+
+ if ((cPos >= nCols) || (curRow == NULL)) {
+ this->data.push_back(curRow = new char*[nCols]);
+ dimensionsChanged = true;
+ nRows++;
+ cPos = 0;
+ }
+
+ if (data != NULL)
+ curRow[cPos] = strdup(data);
+ else
+ curRow[cPos] = strdup("");
+
+ if (cPos == sortColumn)
+ toBeSorted = true;
+ cPos++;
+}
+
+
+/*
+ * ===================================
+ * void Table.addRow(int cols, ...);
+ * ===================================
+ *
+ * Adds cols number of cells to table.
+ */
+void Table::addRow(int cols, ...) {
+ char *temp;
+
+ if (!noMoreColumns)
+ noMoreColumns = true;
+
+ if ((cPos != 0) || (curRow == NULL)) {
+ this->data.push_back(curRow = new char*[nCols]);
+ dimensionsChanged = true;
+ nRows++;
+ cPos = 0;
+ }
+
+ if (cols > nCols)
+ cols = nCols;
+
+ va_list ap;
+ va_start(ap, cols);
+ for (int c = 0; c < cols; c++, cPos++) {
+ if (cPos >= nCols) {
+ this->data.push_back(curRow = new char*[nCols]);
+ dimensionsChanged = true;
+ nRows++;
+ cPos = 0;
+ }
+
+ if ((temp = va_arg(ap, char *)) != NULL)
+ curRow[cPos] = strdup(temp);
+ else
+ curRow[cPos] = strdup("");
+ }
+ va_end(ap);
+
+ toBeSorted = true;
+ dimensionsChanged = true;
+}
+
+
+/*
+ * ================================
+ * void Table.removeRow(int row);
+ * ================================
+ *
+ * Removes row referenced by row.
+ */
+void Table::removeRow(int row) {
+ if ((row == -1) && (selected >= 0))
+ row = selected;
+ if ((row >= 0) && (row < nRows)) {
+ char **rowData = data[row];
+ if (rowData == curRow)
+ curRow = NULL;
+ for (int i = 0; i < nCols; i++)
+ free(rowData[i]);
+ data.erase(row + data.begin());
+ nRows--;
+ dimensionsChanged = true;
+ toBeSorted = true;
+ selected = -1;
+ }
+ redraw ();
+}
+
+
+/*
+ * =======================================
+ * void Table.clear(bool removeColumns);
+ * =======================================
+ *
+ * Frees all data in table. If removeColumns is true, frees also header
+ * structures.
+ */
+void Table::clear(bool removeColumns) {
+ nRows = 0;
+ curRow = NULL;
+ cPos = 0;
+
+ // Delete row data.
+ vector<char**>::iterator end = data.end();
+ char **row;
+ for (vector<char**>::iterator i = data.begin(); i < end; ++i) {
+ row = *i;
+ for (int i = 0; i < nCols; i++)
+ free(row[i]);
+ delete [] row;
+ }
+ data.clear();
+
+ if (removeColumns) {
+ // Delete header data.
+ vector<struct ColumnInfo>::iterator end = header.end();
+ for (vector<struct ColumnInfo>::iterator i = header.begin();
+ i < end; ++i)
+ free((void*)(*i).title);
+
+ header.clear();
+ nCols = 0;
+ }
+
+ selected = -1;
+ dimensionsChanged = true;
+ redraw ();
+}
+
+
+/*
+ * ============================================
+ * char *Table.valueAt(int row, int column);
+ * int Table.intValueAt(int row, int column);
+ * ============================================
+ *
+ * Returns value in cell referenced by row and column.
+ */
+char *Table::valueAt(int row, int column) {
+ if ((row >= 0) && (row < nRows) && (column >= 0) && (column < nCols))
+ return data[row][column];
+ else if ((row == -1) && (selected >= 0) && (column >= 0) && (column < nCols))
+ return data[selected][column];
+ else
+ return NULL;
+}
+
+
+int Table::intValueAt(int row, int column) {
+ if ((row == -1) && (selected >= 0))
+ row = selected;
+
+ if ((row >= 0) && (row < nRows) && (column >= 0) && (column < nCols))
+ return strtol(data[row][column], NULL, 10);
+ else
+ return 0;
+}
+
+
+/*
+ * ======================================================
+ * void Table.valueAt(int row, int column, char *data);
+ * void Table.valueAt(int row, int column, int data);
+ * ======================================================
+ *
+ * Sets alue in cell referenced by row and column.
+ */
+void Table::valueAt(int row, int column, char *data) {
+ if ((row == -1) && (selected >= 0))
+ row = selected;
+
+ if ((row >= 0) && (row < nRows) && (column >= 0) && (column < nCols)) {
+ if (column == sortColumn)
+ toBeSorted = true;
+ if (this->data[row][column] != NULL)
+ free(this->data[row][column]);
+ this->data[row][column] = strdup(data);
+ }
+}
+
+
+void Table::valueAt(int row, int column, int data) {
+ if ((row == -1) && (selected >= 0))
+ row = selected;
+
+ if ((row >= 0) && (row < nRows) && (column >= 0) && (column < nCols)) {
+ if (column == sortColumn)
+ toBeSorted = true;
+ if (this->data[row][column] != NULL)
+ free(this->data[row][column]);
+ string temp = "";
+ temp += data;
+ strcpy(this->data[row][column] = (char*)malloc(temp.length()),
+ temp.c_str());
+ }
+}
+
+
+/*
+ * =====================================
+ * const char **Table.getRow(int row);
+ * =====================================
+ *
+ * Returns pointer to the data of the row number row.
+ */
+const char **Table::getRow(int row) {
+ if ((row == -1) && (selected >= 0))
+ row = selected;
+
+ if ((row >= 0) && (row < nRows))
+ return (const char**)data[row];
+ else
+ return NULL;
+}
+
+
+/*
+ * ==============
+ * Menu methods
+ * ==============
+ *
+ * These work in the same way as in class Fl_Menu_ (methods menu,
+ * copy and clear). These are used for handling the popup menu.
+ */
+const Fl_Menu_Item *Table::menu() {
+ return popupMenu;
+}
+
+void Table::menu(const Fl_Menu_Item *m) {
+ menuClear();
+ popupMenu = m;
+}
+
+void Table::menuCopy(const Fl_Menu_Item *m) {
+ int n = m->size();
+
+ Fl_Menu_Item* newMenu = new Fl_Menu_Item[n];
+ memcpy(newMenu, m, n * sizeof(Fl_Menu_Item));
+ menu(newMenu);
+ menuAlloc = true;
+}
+
+void Table::menuClear() {
+ if (menuAlloc)
+ delete[] popupMenu;
+ popupMenu = NULL;
+}
+
+
+/*
+ * ================================================================
+ * Table.where(int x, int y, int &row, int &column, int &resize);
+ * ================================================================
+ *
+ * Finds corresponding row and column for x and y coordinates. This function
+ * uses Fl::event_inside() method.
+ *
+ * row = -1 means header and row = -2 means that coordinates don't
+ * correspond any cell.
+ */
+void Table::where(int x, int y, int &row, int &column, int &resize) {
+ int temp, temp2;
+
+ // Inside the header
+ if ((nCols > 0) && headerEnabled &&
+ Fl::event_inside(oX, oY, iW, headerHeight)) {
+ row = -1;
+ temp = leftColX + iX - hScroll->value();
+
+ // Scan visible columns until found one that matches.
+ for (column = leftCol; column <= rightCol; column++ ) {
+ if (header[column].hidden)
+ continue;
+
+ temp2 = temp;
+
+ // Near the left border of the column header
+ if ((x >= temp) && (x <= temp + 3)) {
+ resize = 1;
+ return;
+ /* NOT REACHED */
+ }
+
+ // Near the right border of the column header
+ else if ((x >= (temp += header[column].width) - 3) &&
+ (x < temp)) {
+ resize = 2;
+ return;
+ /* NOT REACHED */
+ }
+
+ // Somewhere else
+ else if ((x >= temp2) && (x < temp)) {
+ resize = 0;
+ return;
+ /* NOT REACHED */
+ }
+ }
+ } // Header
+
+
+ /*
+ * Now the harder one. X and Y lie somewhere in the table.
+ * Find correct row and column.
+ */
+ else if ((nRows > 0) && Fl::event_inside(iX, iY, iW, iH)) {
+ temp = topRowY;
+ int yMod = iY - vScroll->value();
+ int leftX = leftColX + iX - hScroll->value();
+
+ // Scan rows
+ for (row = topRow; row <= bottomRow; row++) {
+ int temp2 = leftX;
+ for (column = leftCol; column <= rightCol; column++) {
+ if (header[column].hidden)
+ continue;
+
+ if (Fl::event_inside(temp2, temp + yMod,
+ header[column].width, rowHeight))
+ return;
+ /* NOT REACHED */
+ temp2 += header[column].width;
+ }
+ temp += rowHeight;
+ }
+ }
+ row = column = -2;
+}
+
+
+void Table::FirstRow()
+{
+ if (nRows == 0 || selected == 0) return;
+ scrollTo (selected = 0);
+}
+
+void Table::PrevPage ()
+{
+// Does it make sense to move up?
+ if (selected > 0) {
+// Number of rows on the 'page'
+ int step = iH / rowHeight;
+// Change selection
+ if (selected >= step)
+ selected -= step;
+ else
+ selected = 0;
+ scrollTo(selected * rowHeight);
+ }
+}
+
+void Table::PrevRow()
+{
+ int newpos, oldpos;
+ if (nRows == 0) return;
+ selected = (selected > 0) ? selected - 1 : 0;
+ oldpos = vScroll->value();
+ newpos = rowHeight * selected;
+ if (newpos - oldpos > 0)
+ scrollTo (oldpos);
+ else
+ scrollTo (newpos);
+}
+
+void Table::NextRow()
+{
+ int newpos, oldpos, lastrow;
+ if (nRows == 0 || selected == (nRows - 1)) return;
+ lastrow = nRows -1;
+ selected = (selected < lastrow) ? selected + 1 : lastrow;
+ oldpos = vScroll->value();
+ newpos = rowHeight *(selected + 1) - iH;
+ if (newpos - oldpos < 0)
+ scrollTo (oldpos);
+ else
+ scrollTo (newpos);
+}
+
+void Table::NextPage ()
+{
+ if ((selected >= 0) && (selected < (nRows - 1))) {
+ int step = iH / rowHeight;
+ if ((selected += step) >= nRows)
+ selected = nRows - 1;
+ scrollTo(rowHeight * (selected + 1) - iH);
+ }
+}
+
+void Table::LastRow()
+{
+ if (nRows == 0) return;
+ selected = nRows - 1;
+ scrollTo (rowHeight * (selected + 1) - iH);
+}
+
+void Table::GotoRow(int n)
+{
+ if (n >= 0 && (n < nRows)) {
+ selected = n;
+ scrollTo(rowHeight * (selected + 1) - iH);
+ }
+}
+
+/*
+ * ==============================
+ * int Table.handle(int event);
+ * ==============================
+ *
+ * FLTK internal. Handles incoming events.
+ */
+int Table::handle(int event) {
+ int ret = 0;
+ static int row, prev_row;
+ int column, resize;
+
+ if (event != FL_KEYDOWN)
+ ret = Fl_Group::handle(event);
+
+ /*
+ * MAIN SWITCH
+ */
+ switch (event) {
+
+ /*
+ * PUSH event
+ */
+ case FL_PUSH:
+ // Which row/column are we over?
+ where(Fl::event_x(), Fl::event_y(), row, column, resize);
+
+ switch (row) {
+ // Push on nothing... Not interested
+ case -2:
+ if (selected != -1) {
+// selected = -1;
+ damage(DAMAGE_ROWS);
+ }
+ break;
+
+ // Push on header.
+ case -1:
+ if ((canResize) && (Fl::event_button() == 1) &&
+ (resize != 0)) {
+ resizing = (resize == 1) ? column - 1 : column;
+ dragX = Fl::event_x();
+ ret = 1;
+ }
+ else if ((canSort) && (Fl::event_button() == 1)) {
+ pushed = column;
+ damage(DAMAGE_HEADER);
+ ret = 1;
+ }
+ break;
+
+ // Push on cell.
+ default:
+ bool changed = selected != row;
+ selected = row;
+
+ // Create new selection
+ int len = 0;
+ char **tableRow = data[selected];
+ char *buffer;
+
+ for (int col = 0; col < nCols; col++)
+ len += strlen(tableRow[col]) + 1;
+
+ // Create a tab separated list from data.
+ buffer = (char*)malloc(len);
+ strcpy(buffer, tableRow[0]);
+ for (int col = 1; col < nCols; col++) {
+ strcat(buffer, "\t");
+ strcat(buffer, tableRow[col]);
+ }
+ Fl::selection(*this, buffer, len);
+ free(buffer);
+
+ // Update view.
+ damage(DAMAGE_ROWS);
+ take_focus();
+
+ // Show popup menu
+ if ((Fl::event_button() == 3) && (popupMenu != NULL)) {
+ const Fl_Menu_Item *m;
+ m = popupMenu->popup(Fl::event_x(),
+ Fl::event_y());
+ if (m != NULL)
+ m->do_callback(this, m->user_data());
+ ret = 1;
+ break;
+ }
+
+
+ // Callback
+ if ((Fl::event_clicks() != 0) && !changed &&
+ (when() & TABLE_WHEN_DCLICK)) {
+ Fl::event_is_click(0);
+ do_callback();
+ }
+ else if (changed && (when() & FL_WHEN_CHANGED))
+ do_callback();
+ else if (!changed && (when() & FL_WHEN_NOT_CHANGED))
+ do_callback();
+ ret = 1;
+ break;
+ } // switch(row)
+ break;
+
+
+ /*
+ * DRAG event
+ */
+ case FL_DRAG:
+ // Resizing...
+ if (resizing > -1 ) {
+ int offset = dragX - Fl::event_x();
+ int newWidth = header[resizing].width - offset;
+
+ // Width must be at least 1.
+ if (newWidth < 1)
+ newWidth = 1;
+
+ // Test if column really is resized.
+ if (header[resizing].width != newWidth) {
+ header[resizing].width = newWidth;
+ dragX = Fl::event_x();
+ resized();
+ redraw();
+ }
+ ret = 1;
+ }
+ else {
+ prev_row = row;
+ where(Fl::event_x(), Fl::event_y(), row, column, resize);
+ if (row < 0 || pushed != -1) {
+ ret = 1;
+ break;
+ }
+ if (prev_row != row) {
+ selected = row;
+ damage(DAMAGE_ROWS);
+ take_focus();
+ if (when() & FL_WHEN_CHANGED)
+ do_callback();
+ }
+ }
+ break;
+
+
+ /*
+ * RELEASE event
+ */
+ case FL_RELEASE:
+ // Which row/column are we over?
+ where(Fl::event_x(), Fl::event_y(), row, column, resize);
+
+ // Restore cursor and end resizing.
+ if (Fl::event_button() == 1) {
+ fl_cursor(FL_CURSOR_DEFAULT, FL_BLACK, FL_WHITE);
+ if ((pushed == column) && canSort) {
+
+if (this->header[pushed].callback != NULL)
+ (this->header[pushed].callback)();
+
+if (this->header[pushed].comparator != NULL) {
+ if (sortColumn == pushed) {
+ if (ascent)
+ ascent = false;
+ else
+ sortColumn = -1;
+ }
+ else {
+ ascent = true;
+ sortColumn = pushed;
+ }
+ sort();
+}
+ redraw();
+ }
+ pushed = -1;
+ resizing = -1;
+ ret = 1;
+ }
+
+ // Callback.
+ if ((row >= 0) && (when() & FL_WHEN_RELEASE))
+ do_callback();
+ break;
+
+
+ /*
+ * MOVE event
+ */
+ case FL_MOVE:
+ // Which row/column are we over?
+ where(Fl::event_x(), Fl::event_y(), row, column, resize);
+
+ // If near header boundary.
+ if ((row == -1) && canResize && resize)
+ fl_cursor(FL_CURSOR_WE, FL_BLACK, FL_WHITE);
+ else
+ fl_cursor(FL_CURSOR_DEFAULT, FL_BLACK, FL_WHITE);
+ ret = 1;
+ break;
+
+ case FL_ENTER:
+ case FL_LEAVE:
+ if (event == FL_LEAVE)
+ fl_cursor(FL_CURSOR_DEFAULT, FL_BLACK, FL_WHITE);
+ ret = 1;
+ break;
+
+ case FL_FOCUS:
+ case FL_UNFOCUS:
+ if (Fl::visible_focus()) {
+ damage(DAMAGE_ROWS);
+ ret = 1;
+ }
+ break;
+
+ /*
+ * KEYDOWN event
+ */
+ case FL_KEYDOWN:
+ switch(Fl::event_key()) {
+ case FL_Enter:
+ if ((selected > -1) && ((when() & TABLE_WHEN_DCLICK) ||
+ (when() & FL_WHEN_ENTER_KEY)))
+ do_callback();
+ ret = 1;
+ break;
+
+ case FL_Home:
+ FirstRow();
+ ret = 1;
+ break;
+
+ case FL_Up:
+ PrevRow();
+ ret = 1;
+ break;
+
+ case FL_Down:
+ NextRow();
+ ret = 1;
+ break;
+
+ case FL_End:
+ LastRow();
+ ret = 1;
+ break;
+
+ case FL_Page_Up:
+ PrevPage ();
+ ret = 1;
+ break;
+
+ case FL_Page_Down:
+ NextPage ();
+ ret = 1;
+ break;
+
+ }
+ break;
+
+ }
+ return ret;
+}
+
+
+/*
+ * ===============================
+ * void Table.scrollTo(int pos);
+ * ===============================
+ *
+ * Scrolls table to given position.
+ */
+void Table::scrollTo(int pos) {
+
+ if (vScroll->visible() || nRows > (iH / rowHeight)) {
+ int max = rowHeight * nRows - iH;
+//printf ("pos %d, max %d\n", pos, max); fflush (stdout);
+ if (pos < 0 || max < 0) pos = 0;
+ if (pos > max) pos = max;
+
+ vScroll->Fl_Valuator::value(1.0*pos);
+ vScroll->damage (FL_DAMAGE_ALL);
+ vScroll->redraw ();
+ scrolled();
+ }
+ damage(DAMAGE_ROWS);
+ if (when() & FL_WHEN_CHANGED)
+ do_callback();
+
+}
+
+int Table::scrollPos() const
+{
+ return (int)vScroll->value();
+}
+
+/*
+ * ===========================================
+ * void Table.sort(int column, bool ascent);
+ * ===========================================
+ *
+ * Sets sortColumn and ascent and sorts table. Does not redraw.
+ */
+void Table::sort(int column, bool ascent) {
+ if ((column < -1) || (column >= nCols))
+ return;
+
+ sortColumn = column;
+ this->ascent = ascent;
+ sort();
+}
+
+
+void Table::aSort(int start, int end,
+ int (*compare)(const char *, const char*)) {
+ int i, j;
+ const char *x;
+ char **temp;
+
+ x = data[(start + end) / 2][sortColumn];
+ i = start;
+ j = end;
+
+ for (;;) {
+ while ((i < end) && (compare(data[i][sortColumn], x) < 0))
+ i++;
+ while ((j > 0) && (compare(data[j][sortColumn], x) > 0))
+ j--;
+
+ while ((i < end) && (i != j) &&
+ (compare(data[i][sortColumn], data[j][sortColumn]) == 0))
+ i++;
+
+ if (i == j)
+ break;
+
+ temp = data[i];
+ data[i] = data[j];
+ data[j] = temp;
+ }
+
+ if (start < --i)
+ aSort(start, i, compare);
+
+ if (end > ++j)
+ aSort(j, end, compare);
+}
+
+
+void Table::dSort(int start, int end,
+ int (*compare)(const char *, const char*)) {
+ int i, j;
+ const char *x;
+ char **temp;
+
+ x = data[(start + end) / 2][sortColumn];
+ i = start;
+ j = end;
+
+ for (;;) {
+ while ((i < end) && (compare(data[i][sortColumn], x) > 0))
+ i++;
+ while ((j > 0) && (compare(data[j][sortColumn], x) < 0))
+ j--;
+
+ while ((i < end) && (i != j) &&
+ (compare(data[i][sortColumn], data[j][sortColumn]) == 0))
+ i++;
+
+ if (i == j)
+ break;
+
+ temp = data[i];
+ data[i] = data[j];
+ data[j] = temp;
+ }
+
+ if (start < --i)
+ dSort(start, i, compare);
+
+ if (end > ++j)
+ dSort(j, end, compare);
+}
+
+
+/*
+ * ====================
+ * void Table.sort();
+ * ====================
+ *
+ * Sorts table according sortColumn and ascent. Does not redraw.
+ */
+void Table::sort() {
+ if ((sortColumn == -1) || !canSort)
+ return;
+ /* NOT REACHED */
+
+ toBeSorted = false;
+
+ int (*compare)(const char *, const char*);
+
+ // Get comparator function or set it to the default.
+ if (this->header[sortColumn].comparator == NULL)
+// compare = strcasecmp;
+ return;
+ else
+ compare = header[sortColumn].comparator;
+
+ // Sort in descending order.
+ if ((nRows > 1) && ascent)
+ aSort(0, nRows - 1, compare);
+
+ // Sort in ascending order.
+ else if (nRows > 1)
+ dSort(0, nRows - 1, compare);
+}
+
+
+/*
+ * ====================================================
+ * void Table.getSort(int &sortColumn, bool &ascent);
+ * ====================================================
+ *
+ * Set sortColumn and ascent according to current sort policy.
+ */
+void Table::getSort(int &sortColumn, bool &ascent) {
+ sortColumn = this->sortColumn;
+ ascent = this->ascent;
+}
+
+
+/*
+ * =====================================================
+ * int compareInt(const char *val1, const char *val2);
+ * =====================================================
+ *
+ * This function compares values as numbers instead of strings. Solves
+ * problem with string sorting (eg. 1 - 10 - 11 - 12 - 2 - 3 ...).
+ */
+int compareInt(const char *val1, const char *val2) {
+ return strtol(val1, NULL, 0) - strtol(val2, NULL, 0);
+}
+
+
+/*
+ * ==============================================================================
+ * void Table.setHighlighter(bool (*highliter)(int, char **, Fl_Color &color));
+ * ==============================================================================
+ *
+ * Sets highlighter function to highlighter. Highlighter is used to determine
+ * text color in Table.drawRow().
+ */
+void Table::setHighlighter(bool (*highlighter)(int, char **, Fl_Color *)) {
+ this->highlighter = highlighter;
+}
+
+
+/*
+ * ====================
+ * void Table.draw();
+ * ====================
+ *
+ * FLTK internal. Called when Table widget needs to be drawn.
+ */
+void Table::draw() {
+ int damage;
+
+ if (dimensionsChanged) {
+ dimensionsChanged = false;
+ resized();
+ }
+
+ if (toBeSorted)
+ sort();
+
+ damage = Fl_Widget::damage();
+
+ // Draw children.
+ if (damage & (FL_DAMAGE_ALL | FL_DAMAGE_CHILD)) {
+ fl_push_clip(oX, oY, oW, oH);
+ Fl_Group::draw();
+ fl_pop_clip();
+ }
+
+ // Draw box.
+ if (damage & FL_DAMAGE_ALL) {
+ // Draw box.
+ draw_box(box(), x(), y(), w(), h(), FL_GRAY);
+
+ // Draw label.
+ draw_label();
+ }
+
+ // Draw header.
+ int xPos = leftColX + iX - hScroll->value();
+ if (headerEnabled && (damage & (FL_DAMAGE_ALL | DAMAGE_HEADER)) &&
+ (nCols > 0)) {
+ fl_push_clip(iX, oY, iW, headerHeight);
+ drawHeader(xPos, oY);
+ fl_pop_clip();
+ }
+
+ // Draw all the cells.
+ if ((damage & (FL_DAMAGE_ALL | DAMAGE_ROWS)) && (nRows > 0) &&
+ (nCols > 0)) {
+ fl_push_clip(iX, iY, iW, iH);
+
+ int yMod = iY - vScroll->value();
+ for (int row = topRow, rowY = topRowY; row <= bottomRow;
+ row++, rowY += rowHeight)
+ drawRow(row, data[row], xPos, rowY + yMod);
+ fl_pop_clip();
+ }
+
+ fl_push_clip(oX, oY, oW, oH);
+
+ if (tableWidth < iW)
+ fl_rectf(iX + tableWidth, oY, iW - tableWidth, oH, FL_GRAY);
+
+ // Table height smaller than window? Fill remainder with rectangle
+ if (tableHeight < iH)
+ fl_rectf(iX, iY + tableHeight, iW, iH - tableHeight, FL_GRAY);
+
+ if (vScroll->visible()) {
+ vScroll->damage (FL_DAMAGE_ALL);
+ vScroll->redraw();
+ }
+ if (hScroll->visible()) {
+ hScroll->damage (FL_DAMAGE_ALL);
+ hScroll->redraw();
+ }
+
+ // Both scrollbars? Draw little box in lower right
+ if (vScroll->visible() && hScroll->visible())
+ fl_rectf(vScroll->x(), hScroll->y(), vScroll->w(), hScroll->h(), FL_GRAY);
+ fl_pop_clip();
+}
+
+
+/*
+ * ================================================
+ * void Table.resize(int x, int y, int w, int h);
+ * ================================================
+ *
+ * FLTK internal. Called when Table widget is resized.
+ */
+void Table::resize(int x, int y, int w, int h) {
+ Fl_Widget::resize(x, y, w, h);
+ resized();
+ damage(FL_DAMAGE_ALL);
+}
+
+
+/*
+ * ==============================
+ * void Table.calcDimensions();
+ * ==============================
+ *
+ * Calculates table dimensions.
+ */
+void Table::calcDimensions() {
+ // Calculate width and height of the table (in pixels).
+ tableWidth = 0;
+ for (int i = 0; i < nCols; i++)
+ if (!header[i].hidden)
+ tableWidth +=header[i].width;
+
+ tableHeight = nRows * rowHeight;
+ Fl_Boxtype b;
+
+ iX = oX = x() + Fl::box_dx(b = box());
+ iY = oY = y() + Fl::box_dy(b);
+ iW = oW = w() - Fl::box_dw(b);
+ iH = oH = h() - Fl::box_dh(b);
+
+ // Trim inner size if header enabled.
+ if (headerEnabled) {
+ iY += headerHeight;
+ iH -= headerHeight;
+ }
+
+ // Hide scrollbars if window is large enough
+ int hideV, hideH;
+
+ hideV = (tableHeight <= iH),
+ hideH = (tableWidth <= iW);
+
+ if (!hideH & hideV)
+ hideV = (tableHeight - iH - scrollbarSize) <= 0;
+ if (!hideV & hideH)
+ hideH = (tableWidth - iW + scrollbarSize) <= 0;
+
+ if (Vscroll == always) {
+ vScroll->show();
+ iW -= scrollbarSize;
+ } else if (Vscroll == never) {
+ vScroll->hide();
+ vScroll->Fl_Valuator::value(0);
+ } else if (hideV) {
+ vScroll->hide();
+ vScroll->Fl_Valuator::value(0);
+ }
+ else {
+ vScroll->show();
+ iW -= scrollbarSize;
+ }
+
+ if (Hscroll == always) {
+ hScroll->show();
+ iH -= scrollbarSize;
+ } else if (Hscroll == never) {
+ hScroll->hide();
+ hScroll->Fl_Valuator::value(0);
+ } else if (hideH) {
+ hScroll->hide();
+ hScroll->Fl_Valuator::value(0);
+ }
+ else {
+ hScroll->show();
+ iH -= scrollbarSize;
+ }
+}
+
+
+/*
+ * ========================
+ * void Table.scrolled();
+ * ========================
+ *
+ * Calculates visible are after scroll or adding data.
+ */
+void Table::scrolled()
+{
+ int y, row, voff = vScroll->value();
+
+ // First visible row
+ row = voff / rowHeight;
+ topRow = (row >= nRows) ? (nRows - 1) : row;
+ topRow = (topRow < 0) ? 0 : topRow;
+
+ y = topRow * rowHeight;
+ if ((topRow > 0) && (y > voff)) {
+ topRow--;
+ y -= rowHeight;
+ }
+ topRowY = y;
+
+ // Last visible row
+ row = (voff + iH) / rowHeight;
+ bottomRow = (row >= nRows) ? (nRows - 1) : row;
+
+ // First visible column
+ int x, col, h = hScroll->value();
+ for (col = x = 0; col < nCols; col++) {
+ if (header[col].hidden)
+ continue;
+
+ x += header[col].width;
+ if (x >= h) {
+ x -= header[col].width;
+ break;
+ }
+ }
+ leftCol = (col >= nCols) ? (nCols - 1) : col;
+ leftColX = x;
+
+ // Last visible column
+ h += iW;
+ for (; col < nCols; col++) {
+ if (header[col].hidden)
+ continue;
+
+ x += header[col].width;
+ if (x >= h)
+ break;
+ }
+ rightCol = (col >= nCols) ? (nCols - 1) : col;
+}
+
+
+/*
+ * =======================
+ * void Table.resized();
+ * =======================
+ *
+ * Calculates scrollbar properties after resizing or adding data.
+ */
+void Table::resized() {
+ calcDimensions();
+
+ // Calculate properties for vertical scrollbar.
+ if (vScroll->visible()) {
+ vScroll->bounds(0, tableHeight - iH);
+ vScroll->resize(oX + oW - scrollbarSize, oY, scrollbarSize,
+ oH - (hScroll->visible() ? scrollbarSize : 0));
+ vScroll->Fl_Valuator::value(vScroll->clamp(vScroll->value()));
+ vScroll->slider_size(iH > tableHeight ? 1 : (float)iH / tableHeight);
+ }
+
+ // Calculate properties for horizontal scrollbar.
+ if (hScroll->visible()) {
+ hScroll->bounds(0, tableWidth - iW);
+ hScroll->resize(oX, oY + oH - scrollbarSize,
+ oW - (vScroll->visible() ? scrollbarSize : 0), scrollbarSize);
+ hScroll->Fl_Valuator::value(hScroll->clamp(hScroll->value()));
+ hScroll->slider_size(iW > tableWidth ? 1 : (float)iW / tableWidth);
+ }
+ scrolled();
+ dimensionsChanged = false;
+}
+
+
+/*
+ * ===========================================================
+ * void Table.scrollCallback(Fl_Widget *widget, void *data);
+ * ===========================================================
+ *
+ * Internal callback for scrollbars. Scrolls view.
+ */
+void Table::scrollCallback(Fl_Widget *widget, void *data) {
+ Table *me = (Table*)data;
+
+ me->scrolled();
+
+ if (widget == me->vScroll)
+ me->damage(DAMAGE_ROWS);
+ else
+ me->damage(DAMAGE_ROWS | DAMAGE_HEADER);
+}
+
+
+#include "re.h"
+
+inline static
+bool search_row(const std::vector<char**>& data, int row, int col, int ncols, fre_t& re, bool allcols)
+{
+ if (unlikely(allcols)) {
+ for (col = 0; col < ncols; col++)
+ if (re.match(data[row][col]))
+ return true;
+ }
+ else if (re.match(data[row][col]))
+ return true;
+ return false;
+}
+
+//
+// ==================================================================
+// void Table.search(int& row, int& col, bool rev, const char* re);
+// ==================================================================
+//
+// Searches Table data starting at `row', in direction indicated by `rev',
+// for column data matching regexp `re'. Looks in all row columns if `col'
+// is equal to nCols, or just the specified column if 0 <= col < nCols.
+// Returns true if found, in which case the `row' and `col' arguments will
+// point to the matching data. If false is returned, the contents of
+// `row' and `col' are undefined.
+//
+
+bool Table::search(int& row, int& col, bool rev, const char* re)
+{
+ if (unlikely(col < 0 || col > nCols || row < 0 || row >= nRows))
+ return false;
+
+ bool allcols = col == nCols;
+ fre_t sre(re, REG_EXTENDED | REG_ICASE | REG_NOSUB);
+ if (!sre)
+ return false;
+
+
+ int r = row;
+ if (rev) {
+ for (; row >= 0; row--)
+ if (search_row(data, row, col, nCols, sre, allcols))
+ return true;
+ for (row = nRows - 1; row > r; row--)
+ if (search_row(data, row, col, nCols, sre, allcols))
+ return true;
+ }
+ else {
+ for (; row < nRows; row++)
+ if (search_row(data, row, col, nCols, sre, allcols))
+ return true;
+ for (row = 0; row < r; row++)
+ if (search_row(data, row, col, nCols, sre, allcols))
+ return true;
+ }
+
+ return false;
+}
+
diff --git a/src/logbook/textio.cxx b/src/logbook/textio.cxx
new file mode 100644
index 0000000..cb794c4
--- /dev/null
+++ b/src/logbook/textio.cxx
@@ -0,0 +1,283 @@
+// ----------------------------------------------------------------------------
+// textio.cxx
+//
+// Copyright (C) 2006-2010
+// Dave Freese, W1HKJ
+//
+// This file is part of fldigi.
+//
+// Fldigi is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Fldigi 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 fldigi. If not, see <http://www.gnu.org/licenses/>.
+// ----------------------------------------------------------------------------
+
+#include <config.h>
+
+#include <string>
+#include <cstdio>
+#include <cstring>
+
+#include "textio.h"
+#include "lgbook.h"
+
+using namespace std;
+
+#ifdef __WOE32__
+static const char *szEOL = "\r\n";
+#else
+static const char *szEOL = "\n";
+#endif
+
+char * cTextFile::adif_to_date( char *s) {
+static char date[9];
+ strcpy(date, " / / ");
+ for (int i = 0; i < 2; i++) {
+ date[i+6] = s[i+2];
+ date[i] = s[i+4];
+ date[i+3] = s[i+6];
+ }
+ return date;
+}
+
+char * cTextFile::adif_to_time( char *s) {
+static char time[6];
+ strcpy(time, " : ");
+ for (int i = 0; i < 2; i++) {
+ time[i] = s[i];
+ time[i+3] = s[i+2];
+ }
+ return time;
+}
+
+void cTextFile::writeCSVHeader(FILE *txtFile)
+{
+ if (btnSelectQSOdateOn->value()) fprintf (txtFile, "%s", "\"DATE_ON\"");
+ if (btnSelectQSOdateOff->value())fprintf (txtFile, "%s", "\"DATE_OFF\"");
+ if (btnSelectTimeON->value()) fprintf (txtFile, "%s", ",\"ON\"");
+ if (btnSelectTimeOFF->value()) fprintf (txtFile, "%s", ",\"OFF\"");
+ if (btnSelectCall->value()) fprintf (txtFile, "%s", ",\"CALL\"");
+ if (btnSelectName->value()) fprintf (txtFile, "%s", ",\"NAME\"");
+ if (btnSelectBand->value()) fprintf (txtFile, "%s", ",\"BAND\"");
+ if (btnSelectFreq->value()) fprintf (txtFile, "%s", ",\"FREQ\"");
+ if (btnSelectMode->value()) fprintf (txtFile, "%s", ",\"MODE\"");
+ if (btnSelectTX_pwr->value()) fprintf (txtFile, "%s", ",\"TX_PWR\"");
+ if (btnSelectRSTsent->value()) fprintf (txtFile, "%s", ",\"RSTSENT\"");
+ if (btnSelectRSTrcvd->value()) fprintf (txtFile, "%s", ",\"RSTRCVD\"");
+ if (btnSelectQth->value()) fprintf (txtFile, "%s", ",\"QTH\"");
+ if (btnSelectState->value()) fprintf (txtFile, "%s", ",\"ST\"");
+ if (btnSelectProvince->value()) fprintf (txtFile, "%s", ",\"PR\"");
+ if (btnSelectCountry->value()) fprintf (txtFile, "%s", ",\"CNTRY\"");
+ if (btnSelectDXCC->value()) fprintf (txtFile, "%s", ",\"DXCC\"");
+ if (btnSelectIOTA->value()) fprintf (txtFile, "%s", ",\"IOTA\"");
+ if (btnSelectCONT->value()) fprintf (txtFile, "%s", ",\"CONT\"");
+ if (btnSelectITUZ->value()) fprintf (txtFile, "%s", ",\"ITUZ\"");
+ if (btnSelectQSLrcvd->value()) fprintf (txtFile, "%s", ",\"QSL_RCVD\"");
+ if (btnSelectQSLsent->value()) fprintf (txtFile, "%s", ",\"QSL_SENT\"");
+ if (btnSelectNotes->value()) fprintf (txtFile, "%s", ",\"NOTES\"");
+ if (btnSelectSerialIN->value()) fprintf (txtFile, "%s", ",\"SERIAL RCVD\"");
+ if (btnSelectSerialOUT->value()) fprintf (txtFile, "%s", ",\"SERIAL_SENT\"");
+ if (btnSelectXchgIn->value()) fprintf (txtFile, "%s", ",\"XCHG1\"");
+ if (btnSelectMyXchg->value()) fprintf (txtFile, "%s", ",\"MYXCHG\"");
+ fprintf (txtFile, "%s", szEOL);
+}
+
+int cTextFile::writeCSVFile (const char *fname, cQsoDb *db) {
+ cQsoRec *pRec = (cQsoRec *)0;
+ FILE *txtFile = fopen (fname, "w");
+ if (!txtFile) return 1;
+
+ if (txtFile) {
+ writeCSVHeader(txtFile);
+ for (int i = 0; i < db->nbrRecs(); i++) {
+ pRec = db->getRec(i);
+ if (pRec->getField(EXPORT)[0] == 'E') {
+ if (btnSelectQSOdateOn->value())
+ fprintf (txtFile, "\"%s\"", pRec->getField(QSO_DATE));
+ if (btnSelectQSOdateOff->value())
+ fprintf (txtFile, "\"%s\"", pRec->getField(QSO_DATE_OFF));
+ if (btnSelectTimeON->value())
+ fprintf (txtFile, ",\"%s\"", pRec->getField(TIME_ON));
+ if (btnSelectTimeOFF->value())
+ fprintf (txtFile, ",\"%s\"", pRec->getField(TIME_OFF));
+ if (btnSelectCall->value())
+ fprintf (txtFile, ",\"%s\"", pRec->getField(CALL));
+ if (btnSelectName->value())
+ fprintf (txtFile, ",\"%s\"", pRec->getField(NAME));
+ if (btnSelectBand->value())
+ fprintf (txtFile, ",\"%s\"", pRec->getField(BAND));
+ if (btnSelectFreq->value())
+ fprintf (txtFile, ",\"%s\"", pRec->getField(FREQ));
+ if (btnSelectMode->value())
+ fprintf (txtFile, ",\"%s\"", pRec->getField(MODE));
+ if (btnSelectTX_pwr->value())
+ fprintf (txtFile, ",\"%s\"", pRec->getField(TX_PWR));
+ if (btnSelectRSTsent->value())
+ fprintf (txtFile, ",\"%s\"", pRec->getField(RST_SENT));
+ if (btnSelectRSTrcvd->value())
+ fprintf (txtFile, ",\"%s\"", pRec->getField(RST_RCVD));
+ if (btnSelectQth->value())
+ fprintf (txtFile, ",\"%s\"", pRec->getField(QTH));
+ if (btnSelectState->value())
+ fprintf (txtFile, ",\"%s\"", pRec->getField(STATE));
+ if (btnSelectProvince->value())
+ fprintf (txtFile, ",\"%s\"", pRec->getField(VE_PROV));
+ if (btnSelectCountry->value())
+ fprintf (txtFile, ",\"%s\"", pRec->getField(COUNTRY));
+ if (btnSelectDXCC->value())
+ fprintf (txtFile, ",\"%s\"", pRec->getField(DXCC));
+ if (btnSelectIOTA->value())
+ fprintf (txtFile, ",\"%s\"", pRec->getField(IOTA));
+ if (btnSelectCONT->value())
+ fprintf (txtFile, ",\"%s\"", pRec->getField(CONT));
+ if (btnSelectITUZ->value())
+ fprintf (txtFile, ",\"%s\"", pRec->getField(ITUZ));
+ if (btnSelectQSLrcvd->value())
+ fprintf (txtFile, ",\"%s\"", pRec->getField(QSL_RCVD));
+ if (btnSelectQSLsent->value())
+ fprintf (txtFile, ",\"%s\"", pRec->getField(QSL_SENT));
+ if (btnSelectNotes->value()) {
+ string temp = pRec->getField(NOTES);
+ for (size_t n = 0; n < temp.length(); n++)
+ if (temp[n] == '\r' || temp[n] == '\n') temp[n] = '-';
+ fprintf (txtFile, ",\"%s\"", temp.c_str());
+ }
+ if (btnSelectSerialIN->value())
+ fprintf (txtFile, ",\"%s\"", pRec->getField(SRX));
+ if (btnSelectSerialOUT->value())
+ fprintf (txtFile, ",\"%s\"", pRec->getField(STX));
+ if (btnSelectXchgIn->value())
+ fprintf (txtFile, ",\"%s\"", pRec->getField(XCHG1));
+ if (btnSelectMyXchg->value())
+ fprintf (txtFile, ",\"%s\"", pRec->getField(MYXCHG));
+ fprintf (txtFile, "%s", szEOL);
+ pRec->putField(EXPORT,"");
+ db->qsoUpdRec(i, pRec);
+ }
+ }
+ fclose (txtFile);
+ }
+ return 0;
+}
+
+// text file in fixed fields
+void cTextFile::writeTXTHeader(FILE *txtFile)
+{
+ if (btnSelectQSOdateOn->value()) fprintf (txtFile, "%-10s", "DATE_ON");
+ if (btnSelectQSOdateOff->value())fprintf (txtFile, "%-10s", "DATE_OFF");
+ if (btnSelectTimeON->value()) fprintf (txtFile, "%-6s", "ON");
+ if (btnSelectTimeOFF->value()) fprintf (txtFile, "%-6s", "OFF");
+ if (btnSelectCall->value()) fprintf (txtFile, "%-10s", "CALL");
+ if (btnSelectName->value()) fprintf (txtFile, "%-15s", "NAME");
+ if (btnSelectBand->value()) fprintf (txtFile, "%-7s", "BAND");
+ if (btnSelectFreq->value()) fprintf (txtFile, "%-12s", "FREQ");
+ if (btnSelectMode->value()) fprintf (txtFile, "%-8s", "MODE");
+ if (btnSelectTX_pwr->value()) fprintf (txtFile, "%-8s", "TX_PWR");
+
+ if (btnSelectRSTsent->value()) fprintf (txtFile, "%-6s", "RSTX");
+ if (btnSelectRSTrcvd->value()) fprintf (txtFile, "%-6s", "RSTR");
+ if (btnSelectQth->value()) fprintf (txtFile, "%-20s", "QTH");
+ if (btnSelectState->value()) fprintf (txtFile, "%-5s", "ST");
+ if (btnSelectProvince->value()) fprintf (txtFile, "%-5s", "PR");
+ if (btnSelectCountry->value()) fprintf (txtFile, "%-15s", "CNTRY");
+ if (btnSelectDXCC->value()) fprintf (txtFile, "%-8s", "DXCC");
+ if (btnSelectIOTA->value()) fprintf (txtFile, "%-8s", "IOTA");
+ if (btnSelectCONT->value()) fprintf (txtFile, "%-8s", "CONT");
+ if (btnSelectITUZ->value()) fprintf (txtFile, "%-8s", "ITUZ");
+
+ if (btnSelectQSLrcvd->value()) fprintf (txtFile, "%-10s", "QSLR");
+ if (btnSelectQSLsent->value()) fprintf (txtFile, "%-10s", "QSLS");
+ if (btnSelectNotes->value()) fprintf (txtFile, "%-80s", "NOTES");
+ if (btnSelectSerialIN->value()) fprintf (txtFile, "%-7s", "SRX");
+ if (btnSelectSerialOUT->value()) fprintf (txtFile, "%-7s", "STX");
+ if (btnSelectXchgIn->value()) fprintf (txtFile, "%-15s", "XCHG1");
+ if (btnSelectMyXchg->value()) fprintf (txtFile, "%-15s", "MYXCHG");
+ fprintf (txtFile, "%s", szEOL);
+}
+
+int cTextFile::writeTXTFile (const char *fname, cQsoDb *db) {
+ cQsoRec *pRec = (cQsoRec *)0;
+ FILE *txtFile = fopen (fname, "w");
+ if (!txtFile) return 1;
+
+ if (txtFile) {
+ writeTXTHeader(txtFile);
+ for (int i = 0; i < db->nbrRecs(); i++) {
+ pRec = db->getRec(i);
+ if (pRec->getField(EXPORT)[0] == 'E') {
+ if (btnSelectQSOdateOn->value())
+ fprintf (txtFile, "%-10s", pRec->getField(QSO_DATE));
+ if (btnSelectQSOdateOff->value())
+ fprintf (txtFile, "%-10s", pRec->getField(QSO_DATE_OFF));
+ if (btnSelectTimeON->value())
+ fprintf (txtFile, "%-6s", pRec->getField(TIME_ON));
+ if (btnSelectTimeOFF->value())
+ fprintf (txtFile, "%-6s", pRec->getField(TIME_OFF));
+ if (btnSelectCall->value())
+ fprintf (txtFile, "%-10s", pRec->getField(CALL));
+ if (btnSelectName->value())
+ fprintf (txtFile, "%-15s", pRec->getField(NAME));
+ if (btnSelectBand->value())
+ fprintf (txtFile, "%-7s", pRec->getField(BAND));
+ if (btnSelectFreq->value())
+ fprintf (txtFile, "%-12s", pRec->getField(FREQ));
+ if (btnSelectMode->value())
+ fprintf (txtFile, "%-8s", pRec->getField(MODE));
+ if (btnSelectTX_pwr->value())
+ fprintf (txtFile, "%-8s", pRec->getField(TX_PWR));
+ if (btnSelectRSTsent->value())
+ fprintf (txtFile, "%-6s", pRec->getField(RST_SENT));
+ if (btnSelectRSTrcvd->value())
+ fprintf (txtFile, "%-6s", pRec->getField(RST_RCVD));
+ if (btnSelectQth->value())
+ fprintf (txtFile, "%-20s", pRec->getField(QTH));
+ if (btnSelectState->value())
+ fprintf (txtFile, "%-5s", pRec->getField(STATE));
+ if (btnSelectProvince->value())
+ fprintf (txtFile, "%-5s", pRec->getField(VE_PROV));
+ if (btnSelectCountry->value())
+ fprintf (txtFile, "%-15s", pRec->getField(COUNTRY));
+ if (btnSelectDXCC->value())
+ fprintf (txtFile, "%-8s", pRec->getField(DXCC));
+ if (btnSelectIOTA->value())
+ fprintf (txtFile, "%-8s", pRec->getField(IOTA));
+ if (btnSelectCONT->value())
+ fprintf (txtFile, "%-8s", pRec->getField(CONT));
+ if (btnSelectITUZ->value())
+ fprintf (txtFile, "%-8s", pRec->getField(ITUZ));
+ if (btnSelectQSLrcvd->value())
+ fprintf (txtFile, "%-10s", pRec->getField(QSL_RCVD));
+ if (btnSelectQSLsent->value())
+ fprintf (txtFile, "%-10s", pRec->getField(QSL_SENT));
+ if (btnSelectNotes->value()) {
+ string temp = pRec->getField(NOTES);
+ for (size_t n = 0; n < temp.length(); n++)
+ if (temp[n] == '\n') temp[n] = ';';
+ fprintf (txtFile, "%-80s", temp.c_str());
+ }
+ if (btnSelectSerialIN->value())
+ fprintf (txtFile, "%-7s", pRec->getField(SRX));
+ if (btnSelectSerialOUT->value())
+ fprintf (txtFile, "%-7s", pRec->getField(STX));
+ if (btnSelectXchgIn->value())
+ fprintf (txtFile, "%-15s", pRec->getField(XCHG1));
+ if (btnSelectMyXchg->value())
+ fprintf (txtFile, "%-15s", pRec->getField(MYXCHG));
+ fprintf (txtFile, "%s", szEOL);
+ pRec->putField(EXPORT,"");
+ db->qsoUpdRec(i, pRec);
+ }
+ }
+ fclose (txtFile);
+ }
+ return 0;
+}
+
diff --git a/src/misc/debug.cxx b/src/misc/debug.cxx
new file mode 100644
index 0000000..b3a15d2
--- /dev/null
+++ b/src/misc/debug.cxx
@@ -0,0 +1,280 @@
+// ----------------------------------------------------------------------------
+// debug.cxx
+//
+// Copyright (C) 2008, 2012
+// Stelios Bounanos, M0GLD, Dave Freese, W1HKJ
+//
+// This file is part of flmsg.
+//
+// fldigi is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// fldigi is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+// ----------------------------------------------------------------------------
+
+#include <cstdio>
+#include <cstring>
+#include <cstdarg>
+#include <string>
+#include <iostream>
+#include <fstream>
+
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <time.h>
+
+#include <FL/Fl.H>
+#include <FL/Fl_Double_Window.H>
+#include <FL/Fl_Slider.H>
+#include <FL/Fl_Button.H>
+#include <FL/Fl_Menu_Item.H>
+#include <FL/Fl_Menu_Button.H>
+
+#include <FL/Fl_Browser.H>
+
+#include "debug.h"
+//#include "icons.h"
+#include "gettext.h"
+#include "flwkey.h"
+
+using namespace std;
+
+#define MAX_LINES 65536
+
+static FILE* wfile;
+static FILE* rfile;
+static int rfd;
+static bool tty;
+
+static Fl_Double_Window* window;
+static Fl_Browser* btext;
+static string dbg_buffer;
+
+debug* debug::inst = 0;
+debug::level_e debug::level = debug::WARN_LEVEL;
+uint32_t debug::mask = ~0u;
+
+const char* prefix[] = { _("Quiet"), _("Error"), _("Warning"), _("Info"), _("Debug") };
+
+static void slider_cb(Fl_Widget* w, void*);
+static void src_menu_cb(Fl_Widget* w, void*);
+static void clear_cb(Fl_Widget *w, void*);
+static void save_cb(Fl_Widget *w, void*);
+
+//static void popup_message(void*);
+
+Fl_Menu_Item src_menu[] = {
+ { _("Serial I/O"), 0, 0, 0, FL_MENU_TOGGLE | FL_MENU_VALUE },
+ { _("Other"), 0, 0, 0, FL_MENU_TOGGLE | FL_MENU_VALUE },
+ { 0 }
+};
+
+void debug::start(const char* filename)
+{
+ if (debug::inst)
+ return;
+ inst = new debug(filename);
+
+ window = new Fl_Double_Window(500, 256, _("Event log"));
+
+ int pad = 2;
+ Fl_Menu_Button* button = new Fl_Menu_Button(pad, pad, 128, 20, _("Log sources"));
+ button->menu(src_menu);
+ button->callback(src_menu_cb);
+
+ Fl_Slider* slider = new Fl_Slider(button->x() + button->w() + pad, pad, 128, 20, prefix[level]);
+ slider->tooltip(_("Change log level"));
+ slider->align(FL_ALIGN_RIGHT);
+ slider->type(FL_HOR_NICE_SLIDER);
+ slider->range(0.0, LOG_NLEVELS - 1);
+ slider->step(1.0);
+ slider->value(level);
+ slider->callback(slider_cb);
+
+ Fl_Button* savebtn = new Fl_Button(window->w() - 124, pad, 60, 20, "save");
+ savebtn->callback(save_cb);
+
+ Fl_Button* clearbtn = new Fl_Button(window->w() - 60, pad, 60, 20, "clear");
+ clearbtn->callback(clear_cb);
+
+ btext = new Fl_Browser(pad, slider->h()+pad, window->w()-2*pad, window->h()-slider->h()-2*pad, 0);
+ window->resizable(btext);
+
+ dbg_buffer.clear();
+
+ window->end();
+}
+
+void debug::stop(void)
+{
+ delete inst;
+ inst = 0;
+ delete window;
+}
+
+static char fmt[1024];
+static char sztemp[1024];
+static string estr = "";
+bool debug_in_use = false;
+
+void debug::log(level_e level, const char* func, const char* srcf, int line, const char* format, ...)
+{
+ if (!inst)
+ return;
+
+ snprintf(fmt, sizeof(fmt), "%c: %s: %s\n", *prefix[level], func, format);
+
+ while(debug_in_use) MilliSleep(1);
+
+ va_list args;
+ va_start(args, format);
+
+// intptr_t nw = vfprintf(wfile, fmt, args);
+
+ vsnprintf(sztemp, sizeof(sztemp), fmt, args);
+ estr.append(sztemp);
+
+ va_end(args);
+
+#ifndef __WIN32__
+ if (tty) {
+ if (level <= DEBUG_LEVEL && level > QUIET_LEVEL) {
+ va_start(args, format);
+ vfprintf(stderr, fmt, args);
+ va_end(args);
+ }
+ }
+#else
+ fflush(wfile);
+#endif
+
+ Fl::awake(sync_text, 0);
+
+// Fl::add_timeout(0.0, sync_text, (void*)nw);
+}
+
+void debug::slog(level_e level, const char* func, const char* srcf, int line, const char* format, ...)
+{
+ if (!inst)
+ return;
+
+ snprintf(fmt, sizeof(fmt), "%c:%s\n", *prefix[level], format);
+
+ while(debug_in_use) MilliSleep(1);
+
+ va_list args;
+ va_start(args, format);
+
+ vsnprintf(sztemp, sizeof(sztemp), fmt, args);
+ estr.append(sztemp);
+
+ va_end(args);
+ fflush(wfile);
+
+ Fl::awake(sync_text, 0);
+}
+
+void debug::elog(const char* func, const char* srcf, int line, const char* text)
+{
+ log(ERROR_LEVEL, func, srcf, line, "%s: %s", text, strerror(errno));
+}
+
+void debug::show(void)
+{
+ window->show();
+}
+
+//static char buf[BUFSIZ+1];
+
+void debug::sync_text(void* arg)
+{
+/*
+ intptr_t toread = (intptr_t)arg;
+ size_t block = MIN((size_t)toread, sizeof(buf) - 1);
+ ssize_t n;
+ string tempbuf;
+
+ while (toread > 0) {
+ if ((n = read(rfd, buf, block)) <= 0)
+ break;
+ buf[n] = '\0';
+ tempbuf.append(buf);
+ toread -= n;
+ }
+ text->insert(tempbuf.c_str());
+*/
+ debug_in_use = true;
+ size_t p0 = 0, p1 = estr.find('\n');
+ while (p1 != string::npos) {
+ btext->insert(1, estr.substr(p0,p1-p0).c_str());
+ dbg_buffer.append(estr.substr(p0, p1 - p0)).append("\n");
+ p0 = p1 + 1;
+ p1 = estr.find('\n', p0);
+ }
+ estr = "";
+ debug_in_use = false;
+}
+
+debug::debug(const char* filename)
+{
+ if ((wfile = fopen(filename, "w")) == NULL)
+ throw strerror(errno);
+ setvbuf(wfile, (char*)NULL, _IOLBF, 0);
+
+ if ((rfile = fopen(filename, "r")) == NULL)
+ throw strerror(errno);
+ rfd = fileno(rfile);
+#ifndef __WIN32__
+ int f;
+ if ((f = fcntl(rfd, F_GETFL)) == -1)
+ throw strerror(errno);
+ if (fcntl(rfd, F_SETFL, f | O_NONBLOCK) == -1)
+ throw strerror(errno);
+#endif
+ tty = isatty(fileno(stderr));
+}
+
+debug::~debug()
+{
+ fclose(wfile);
+ fclose(rfile);
+}
+
+static void slider_cb(Fl_Widget* w, void*)
+{
+ debug::level = (debug::level_e)((Fl_Slider*)w)->value();
+ w->label(prefix[debug::level]);
+ w->parent()->redraw();
+}
+
+static void src_menu_cb(Fl_Widget* w, void*)
+{
+ debug::mask ^= 1 << ((Fl_Menu_*)w)->value();
+}
+
+static void clear_cb(Fl_Widget* w, void*)
+{
+ btext->clear();
+ dbg_buffer.clear();
+}
+
+static void save_cb(Fl_Widget* w, void*)
+{
+ if (!btext->size()) return;
+ string filename = WKeyHomeDir;
+ filename.append("debug_log.txt");
+ ofstream fout;
+ fout.open(filename.c_str(), ios::app);
+ fout << dbg_buffer;
+ fout.close();
+// fl_alert2("Saved in %s", filename.c_str());
+}
diff --git a/src/misc/icons.cxx b/src/misc/icons.cxx
new file mode 100644
index 0000000..76d8acc
--- /dev/null
+++ b/src/misc/icons.cxx
@@ -0,0 +1,264 @@
+// ----------------------------------------------------------------------------
+// icons.cxx
+//
+// Copyright (C) 2008
+// Stelios Bounanos, M0GLD
+//
+// This file is part of fldigi.
+//
+// fldigi is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// fldigi 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 the program; if not, write to the Free Software
+// Foundation, Inc.
+// 59 Temple Place, Suite 330
+// Boston, MA 02111-1307 USA
+//
+// =====================================================================
+// ----------------------------------------------------------------------------
+
+//#include <config.h>
+#include "config.h"
+#include "icons.h"
+#include "util.h"
+
+#include <FL/Fl.H>
+#include <FL/Fl_Menu_Item.H>
+#include <FL/Fl_Widget.H>
+#include <FL/Fl_Group.H>
+
+#if USE_IMAGE_LABELS
+# include <map>
+# include <cassert>
+# include <cstring>
+
+# include <FL/Fl_Multi_Label.H>
+# include <FL/Fl_Image.H>
+# include <FL/Fl_Pixmap.H>
+
+#endif
+
+
+using namespace std;
+
+#if USE_IMAGE_LABELS
+typedef map<Fl_Multi_Label*, Fl_Image**> imap_t;
+static imap_t* imap = 0;
+#endif
+
+#define FL_EMPTY_LABEL FL_FREE_LABELTYPE
+static void draw_empty(const Fl_Label*, int, int, int, int, Fl_Align) { }
+static void measure_empty(const Fl_Label*, int& w, int& h) { w = h = 0; }
+
+// The following functions create image+text menu item labels.
+// You've had too much FLTK if you already know how to do that.
+
+
+// Return a multi_label pointer, cast to a string, for `text' and
+// `pixmap'. This goes into the label pointer of a widget or menu
+// item. The text label is copied if we are using multi labels. You must
+// call set_icon_label on the widget or menu item before its draw()
+// function is called for the first time.
+//
+// A NULL pixmap means that the caller wants an empty, transparent, icon.
+const char* make_icon_label(const char* text, const char** pixmap)
+{
+#if USE_IMAGE_LABELS
+ static imap_t* imap_ = 0;
+ if (unlikely(!imap_)) {
+ imap = imap_ = new imap_t;
+ Fl::set_labeltype(FL_EMPTY_LABEL, draw_empty, measure_empty);
+ }
+
+ // Create a multi label and associate it with an Fl_Image* array
+ Fl_Multi_Label* mlabel = new Fl_Multi_Label;
+ Fl_Image** images = new Fl_Image*[2];
+ images[0] = new Fl_Pixmap(pixmap ? pixmap : clear_row_icon);
+ images[1] = 0; // we create this on demand
+ // set_icon_label_ will set mlabel->labela later
+ mlabel->typea = _FL_IMAGE_LABEL;
+
+ if (!text)
+ text = "";
+ size_t len = strlen(text);
+ char* s = new char[len + 2];
+ s[0] = ' ';
+ memcpy(s + 1, text, len + 1);
+ mlabel->labelb = s;
+ mlabel->typeb = FL_NORMAL_LABEL;
+
+ (*imap)[mlabel] = images;
+
+ return (const char*)mlabel;
+#else
+ return text;
+#endif
+}
+
+#if USE_IMAGE_LABELS
+// Find the item's label, which should be something that was returned by
+// make_icon_label, and set the active or inactive image.
+template <typename T>
+void set_icon_label_(T* item)
+{
+ imap_t::iterator j = imap->find((Fl_Multi_Label*)(item->label()));
+ if (j == imap->end())
+ return;
+
+ Fl_Multi_Label* mlabel = j->first;
+ Fl_Image** images = j->second;
+ unsigned char i = !item->active();
+
+ if (!images[i]) { // create inactive version of other image
+ images[i] = images[!i]->copy();
+ images[i]->inactive();
+ }
+ if (mlabel->typea == _FL_IMAGE_LABEL)
+ mlabel->labela = (const char*)images[i];
+ else
+ mlabel->labelb = (const char*)images[i];
+ item->image(images[i]);
+ mlabel->label(item);
+ item->labeltype(_FL_MULTI_LABEL);
+}
+#endif
+
+void set_icon_label(Fl_Menu_Item* item)
+{
+#if USE_IMAGE_LABELS
+ set_icon_label_(item);
+#else
+ // this isn't needed but it simplifies fldigi's UI setup code
+ if (item->labeltype() == _FL_MULTI_LABEL)
+ item->labeltype(FL_NORMAL_LABEL);
+#endif
+}
+
+void set_icon_label(Fl_Widget* w)
+{
+#if USE_IMAGE_LABELS
+ set_icon_label_(w);
+ w->image(0);
+#else
+ if (w->labeltype() == _FL_MULTI_LABEL)
+ w->labeltype(FL_NORMAL_LABEL);
+#endif
+}
+
+void toggle_icon_labels(void)
+{
+#if USE_IMAGE_LABELS
+ for (imap_t::iterator i = imap->begin(); i != imap->end(); ++i) {
+ // swap sublabels
+ const char* l = i->first->labela;
+ i->first->labela = i->first->labelb;
+ i->first->labelb = l;
+ if (i->first->typea == _FL_IMAGE_LABEL) {
+ i->first->typea = FL_NORMAL_LABEL;
+ i->first->typeb = FL_EMPTY_LABEL;
+ i->first->labela++;
+ }
+ else {
+ i->first->typea = _FL_IMAGE_LABEL;
+ i->first->typeb = FL_NORMAL_LABEL;
+ i->first->labelb--;
+ }
+ }
+
+#endif
+}
+
+template <typename T>
+const char* get_icon_label_text_(T* item)
+{
+#if USE_IMAGE_LABELS
+ if (item->labeltype() == _FL_MULTI_LABEL) {
+ imap_t::iterator i = imap->find((Fl_Multi_Label*)(item->label()));
+ if (i == imap->end())
+ return 0;
+ if (i->first->typeb == FL_NORMAL_LABEL)
+ return i->first->labelb + 1;
+ else // disabled icons
+ return i->first->labela;
+ }
+ else
+#endif
+ return item->label();
+}
+
+const char* get_icon_label_text(Fl_Menu_Item* item)
+{
+ return get_icon_label_text_(item);
+}
+const char* get_icon_label_text(Fl_Widget* w)
+{
+ return get_icon_label_text_(w);
+}
+
+template <typename T>
+void free_icon_label_(T* item)
+{
+#if USE_IMAGE_LABELS
+ if (item->labeltype() == FL_NORMAL_LABEL) {
+ delete [] item->label();
+ item->label(0);
+ return;
+ }
+
+ imap_t::iterator i = imap->find((Fl_Multi_Label*)item->label());
+ if (i == imap->end())
+ return;
+
+ item->label(0);
+
+ // delete the images
+ delete i->second[0];
+ delete i->second[1];
+ delete [] i->second;
+
+ // delete the multi label
+ delete [] ((i->first->typeb == FL_NORMAL_LABEL) ? i->first->labelb : i->first->labela-1);
+ delete i->first;
+
+ imap->erase(i);
+#endif
+}
+
+void free_icon_label(Fl_Menu_Item* item) { free_icon_label_(item); }
+void free_icon_label(Fl_Widget* w) { free_icon_label_(w); }
+
+template <typename T>
+void set_active_(T* t, bool v) {
+ if (v)
+ t->activate();
+ else
+ t->deactivate();
+ if (t->labeltype() == _FL_MULTI_LABEL)
+ set_icon_label(t);
+}
+
+void set_active(Fl_Menu_Item* item, bool v) { set_active_(item, v); }
+void set_active(Fl_Widget* w, bool v) { set_active_(w, v); }
+
+static Fl_Image* msg_icon;
+void set_message_icon(const char** pixmap)
+{
+ if (msg_icon && msg_icon->data() == pixmap)
+ return;
+ delete msg_icon;
+
+ Fl_Widget* msg = fl_message_icon();
+ msg->label("");
+ msg->align(FL_ALIGN_TOP_LEFT | FL_ALIGN_INSIDE);
+ msg->color(msg->parent()->color());
+ msg->box(FL_NO_BOX);
+ msg->image(msg_icon = new Fl_Pixmap(pixmap));
+}
diff --git a/src/misc/mingw.c b/src/misc/mingw.c
new file mode 100644
index 0000000..bfa8119
--- /dev/null
+++ b/src/misc/mingw.c
@@ -0,0 +1,313 @@
+// ----------------------------------------------------------------------------
+// mingw.c
+//
+// The following routines were copied from git-1.6.1.2/compat/mingw.c:
+// git_vsnprintf git_snprintf sleep mingw_getcwd mingw_getenv mingw_rename
+//
+// The uname routine was adapted from libgw32c 0.4.
+//
+// The rest:
+// Copyright (C) 2009
+// Stelios Bounanos, M0GLD
+//
+// This file is part of fldigi.
+//
+// fldigi is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// fldigi is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+// ----------------------------------------------------------------------------
+
+#include <config.h>
+
+#include <ctype.h>
+#include "compat.h"
+#include "util.h"
+
+/* default mode for stdin, stdout and stderr */
+unsigned int _CRT_fmode = _O_BINARY;
+
+/******************************************************************************/
+
+#if SNPRINTF_RETURNS_BOGUS
+/*
+ * The size parameter specifies the available space, i.e. includes
+ * the trailing NUL byte; but Windows's vsnprintf expects the
+ * number of characters to write without the trailing NUL.
+ */
+#define SNPRINTF_SIZE_CORR 1
+
+#undef vsnprintf
+int git_vsnprintf(char *str, size_t maxsize, const char *format, va_list ap)
+{
+ char *s;
+ int ret = -1;
+
+ if (maxsize > 0) {
+ ret = vsnprintf(str, maxsize-SNPRINTF_SIZE_CORR, format, ap);
+ if (ret == maxsize-1)
+ ret = -1;
+ /* Windows does not NUL-terminate if result fills buffer */
+ str[maxsize-1] = 0;
+ }
+ if (ret != -1)
+ return ret;
+
+ s = NULL;
+ if (maxsize < 128)
+ maxsize = 128;
+
+ while (ret == -1) {
+ maxsize *= 4;
+ str = (char *)realloc(s, maxsize);
+ if (! str)
+ break;
+ s = str;
+ ret = vsnprintf(str, maxsize-SNPRINTF_SIZE_CORR, format, ap);
+ if (ret == maxsize-1)
+ ret = -1;
+ }
+ free(s);
+ return ret;
+}
+
+int git_snprintf(char *str, size_t maxsize, const char *format, ...)
+{
+ va_list ap;
+ int ret;
+
+ va_start(ap, format);
+ ret = git_vsnprintf(str, maxsize, format, ap);
+ va_end(ap);
+
+ return ret;
+}
+#endif /* SNPRINTF_RETURNS_BOGUS */
+
+unsigned sleep(unsigned seconds)
+{
+ Sleep(seconds*1000);
+ return 0;
+}
+
+#undef getcwd
+char *mingw_getcwd(char *pointer, int len)
+{
+ int i;
+ char *ret = getcwd(pointer, len);
+ if (!ret)
+ return ret;
+ for (i = 0; pointer[i]; i++)
+ if (pointer[i] == '\\')
+ pointer[i] = '/';
+ return ret;
+}
+
+#undef getenv
+char *mingw_getenv(const char *name)
+{
+ char *result = getenv(name);
+ if (!result && !strcmp(name, "TMPDIR")) {
+ /* on Windows it is TMP and TEMP */
+ result = getenv("TMP");
+ if (!result)
+ result = getenv("TEMP");
+ }
+ return result;
+}
+
+#undef rename
+int mingw_rename(const char *pold, const char *pnew)
+{
+ DWORD attrs;
+
+ /*
+ * Try native rename() first to get errno right.
+ * It is based on MoveFile(), which cannot overwrite existing files.
+ */
+ if (!rename(pold, pnew))
+ return 0;
+ if (errno != EEXIST)
+ return -1;
+ if (MoveFileEx(pold, pnew, MOVEFILE_REPLACE_EXISTING))
+ return 0;
+ /* TODO: translate more errors */
+ if (GetLastError() == ERROR_ACCESS_DENIED &&
+ (attrs = GetFileAttributes(pnew)) != INVALID_FILE_ATTRIBUTES) {
+ if (attrs & FILE_ATTRIBUTE_DIRECTORY) {
+ errno = EISDIR;
+ return -1;
+ }
+ if ((attrs & FILE_ATTRIBUTE_READONLY) &&
+ SetFileAttributes(pnew, attrs & ~FILE_ATTRIBUTE_READONLY)) {
+ if (MoveFileEx(pold, pnew, MOVEFILE_REPLACE_EXISTING))
+ return 0;
+ /* revert file attributes on failure */
+ SetFileAttributes(pnew, attrs);
+ }
+ }
+ errno = EACCES;
+ return -1;
+}
+
+/******************************************************************************/
+
+__attribute__((constructor))
+static void wsa_init(void)
+{
+ WSADATA wsa;
+
+ static int wsa_init_ = 0;
+ if (wsa_init_)
+ return;
+
+ if (WSAStartup(MAKEWORD(2, 2), &wsa)) {
+ fprintf(stderr, "unable to initialize winsock: error %d", WSAGetLastError());
+ exit(EXIT_FAILURE);
+ }
+ atexit((void(*)(void)) WSACleanup);
+ wsa_init_ = 1;
+}
+
+int socketpair(int family, int type, int protocol, int *sv)
+{
+ struct sockaddr_in addr;
+ SOCKET sfd;
+ int err, len = sizeof(addr);
+
+ if (sv == NULL || family != AF_INET || type != SOCK_STREAM || protocol) {
+ WSASetLastError(WSAEINVAL);
+ return SOCKET_ERROR;
+ }
+
+ sv[0] = sv[1] = INVALID_SOCKET;
+ if ((sfd = socket(family, type, 0)) == INVALID_SOCKET)
+ return SOCKET_ERROR;
+
+ memset(&addr, 0, sizeof(addr));
+ addr.sin_family = family;
+ addr.sin_addr.s_addr = inet_addr("127.0.0.1");
+ addr.sin_port = 0; /* any port */
+
+ if ((err = bind(sfd, (const struct sockaddr*)&addr, sizeof(addr))) == SOCKET_ERROR) {
+ err = WSAGetLastError();
+ closesocket(sfd);
+ WSASetLastError(err);
+ return SOCKET_ERROR;
+ }
+
+ if ((err = getsockname(sfd, (struct sockaddr*)&addr, &len)) == SOCKET_ERROR) {
+ err = WSAGetLastError();
+ closesocket(sfd);
+ WSASetLastError(err);
+ return SOCKET_ERROR;
+ }
+
+ do {
+ if (listen(sfd, 1) == SOCKET_ERROR)
+ break;
+ if ((sv[0] = WSASocket(family, type, 0, NULL, 0, 0)) == INVALID_SOCKET)
+ break;
+ if (connect(sv[0], (const struct sockaddr*)&addr, sizeof(addr)) == SOCKET_ERROR)
+ break;
+ if ((sv[1] = accept(sfd, NULL, NULL)) == INVALID_SOCKET)
+ break;
+ closesocket(sfd);
+ return 0;
+ } while (0);
+
+ /* error */
+ err = WSAGetLastError();
+ closesocket(sfd);
+ closesocket(sv[0]);
+ closesocket(sv[1]);
+ WSASetLastError(err);
+ return SOCKET_ERROR;
+}
+
+/******************************************************************************/
+
+int nanosleep(const struct timespec *req, struct timespec *rem)
+{
+ if (unlikely(req->tv_nsec < 0 || req->tv_nsec < 0L || req->tv_nsec > 999999999L)) {
+ errno = EINVAL;
+ return -1;
+ }
+ Sleep(req->tv_sec * 1000 + req->tv_nsec / 1000000L);
+ if (unlikely(rem)) {
+ rem->tv_sec = 0;
+ rem->tv_nsec = 0L;
+ }
+ return 0;
+}
+
+/*
+BOOL GetOsInfo(LPSTR OsName, LPSTR Release, LPSTR Version);
+BOOL GetMachInfo(LPSTR MachineName, LPSTR ProcessorName);
+int uname(struct utsname *name)
+{
+ char processor[1024];
+
+ if (name == NULL) {
+ errno = EINVAL;
+ return -1;
+ }
+
+ if (gethostname(name->nodename, sizeof(name->nodename)) < 0) {
+ name->nodename[0] = '\0';
+ errno = ENOSYS;
+ return -1;
+ }
+
+ if (!GetOsInfo(name->sysname, name->release, name->version)) {
+ strncpy (name->sysname, "win32", sizeof (name->sysname));
+ strncpy (name->release, "unknown", sizeof (name->release));
+ strncpy (name->version, "unknown", sizeof (name->version));
+ }
+ // "windows32" is as yet the only universal windows description allowed
+ // by config.guess and config.sub
+ strncpy(name->sysname, "windows32", sizeof (name->sysname));
+ if (!GetMachInfo(name->machine, processor))
+ strncpy(name->machine, "i386", sizeof (name->machine));
+
+ return 0;
+}
+
+int getrusage(int who, struct rusage *usage)
+{
+ FILETIME ct, et, kt, ut;
+ ULARGE_INTEGER uli;
+
+ if (who != RUSAGE_SELF) {
+ errno = EINVAL;
+ return -1;
+ }
+ if (!usage) {
+ errno = EFAULT;
+ return -1;
+ }
+
+ if (!GetProcessTimes(GetCurrentProcess(), &ct, &et, &kt, &ut)) {
+ errno = ENOENT;
+ return -1;
+ }
+
+ // FILETIMEs use 100-ns units
+ memcpy(&uli, &kt, sizeof(FILETIME));
+ usage->ru_stime.tv_sec = uli.QuadPart / 10000000L;
+ usage->ru_stime.tv_usec = uli.QuadPart % 10000000L;
+ memcpy(&uli, &ut, sizeof(FILETIME));
+ usage->ru_utime.tv_sec = uli.QuadPart / 10000000L;
+ usage->ru_utime.tv_usec = uli.QuadPart % 10000000L;
+
+ return 0;
+}
+*/
diff --git a/src/misc/pixmaps.cxx b/src/misc/pixmaps.cxx
new file mode 100644
index 0000000..f778775
--- /dev/null
+++ b/src/misc/pixmaps.cxx
@@ -0,0 +1,8175 @@
+#include <config.h>
+
+// This file contains pixmap versions of icons from the Tango base icon
+// theme: http://tango.freedesktop.org/Tango_Desktop_Project
+//
+// Licensed under the Creative Commons Attribution Share-Alike license:
+// http://creativecommons.org/licenses/by-sa/2.5/
+
+// ---------------------------------------------------------------------
+// Tango icons
+// ---------------------------------------------------------------------
+
+/* XPM */
+const char *address_book_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 124 2",
+" c #727E0A",
+". c #785977",
+"X c #CC0000",
+"o c #EF2929",
+"O c #698373",
+"+ c #67837F",
+"@ c #9DB029",
+"# c #EDD400",
+"$ c #A2AB7B",
+"% c #FCE94F",
+"& c #6F6384",
+"* c #617296",
+"= c #5A7AA4",
+"- c #6C7CA0",
+"; c #7A88A7",
+": c #7B8AA8",
+"> c #7E8CA8",
+", c #7E8CAB",
+"< c #8F9E86",
+"1 c #99A580",
+"2 c #808DA9",
+"3 c #808DAA",
+"4 c #818FAB",
+"5 c #828EAA",
+"6 c #8290AC",
+"7 c #8390AC",
+"8 c #8B96AE",
+"9 c #8F9FB8",
+"0 c #9E9DBF",
+"q c #AB82AA",
+"w c #AA83AB",
+"e c #AC80A8",
+"r c #AC80A9",
+"t c #AC82AA",
+"y c #AA84AC",
+"u c #AA85AC",
+"i c #A986AD",
+"p c #A887AE",
+"a c #A987AE",
+"s c #A889AF",
+"d c #A789B0",
+"f c #A78AB1",
+"g c #A78BB1",
+"h c #A58DB3",
+"j c #A889B0",
+"k c #AC8BB1",
+"l c #A491B6",
+"z c #AB92B6",
+"x c #A7ADBD",
+"c c #A9ACB8",
+"v c #A8AEBC",
+"b c #ABB0BE",
+"n c #ABB1BE",
+"m c #ACB1BE",
+"M c #B5B5B6",
+"N c #B7B7B7",
+"B c #B9B9B9",
+"V c #9E9DC0",
+"C c #9D9EC0",
+"Z c #9D9FC1",
+"A c #9BA2C3",
+"S c #9CA1C3",
+"D c #9CA2C3",
+"F c #9BA3C4",
+"G c #9AA4C5",
+"H c #9AA5C5",
+"J c #99A7C7",
+"K c #9AA6C6",
+"L c #9FABC3",
+"P c #95AFCD",
+"I c #96AECC",
+"U c #95AFCE",
+"Y c #95B0CE",
+"T c #95B1CF",
+"R c #9DB7D2",
+"E c #AAACC9",
+"W c #AFB5C2",
+"Q c #A9B3CF",
+"! c #AFBAC9",
+"~ c #B4B9C4",
+"^ c #A5BDD7",
+"/ c #A8B8D0",
+"( c #A9B8D0",
+") c #A9B9D0",
+"_ c #A9B9D1",
+"` c #A7BFD8",
+"' c #A8BFD8",
+"] c #A9C1D9",
+"[ c #ACC3DA",
+"{ c #B1C0D6",
+"} c #B4C9DE",
+"| c #BCC8D9",
+" . c #B7CAE0",
+".. c #B7CBE0",
+"X. c #B8CBE0",
+"o. c #B9CBE0",
+"O. c #BACDE2",
+"+. c #BFCCE0",
+"@. c #C1C1C3",
+"#. c #DDDDDD",
+"$. c #DEDEDE",
+"%. c #C3CFE0",
+"&. c #C3D0E2",
+"*. c #C0D2E4",
+"=. c #C6D6E7",
+"-. c #CBD7E5",
+";. c #CBD8E7",
+":. c #C7D7E8",
+">. c #CEDAE8",
+",. c #CEDBE8",
+"<. c #CEDBE9",
+"1. c #CFDBE9",
+"2. c #CCDAEA",
+"3. c #CFDCE9",
+"4. c #CFDCEA",
+"5. c #CFDCEC",
+"6. c #D0DCEA",
+"7. c #D1DEEB",
+"8. c #D2DEEB",
+"9. c #D3DFEC",
+"0. c #D7E3F0",
+"q. c #D7E4F0",
+"w. c #D8E4F1",
+"e. c None",
+/* pixels */
+"e.= = = = = = = = = = = = = e.e.",
+"= - 8.=.O.} ^ ^ ` ` ' ' R < # e.",
+"= | 6.&.5.] G d r u V T [ < % # ",
+"= %.4.{ 2.Q y F U J p A [ 1 % # ",
+"= -.3./ 2.z Z 0 q w J f [ $ % # ",
+"= 7.1./ 2.t I y C i P r [ O @ ",
+"= 0.<.( 2.r P r S a D s [ O @ ",
+"= w.,.) 2.k G l j h y K [ + @ ",
+"= w.,._ 2.E p J Y T T T [ & o X ",
+"= q.>.+.2.] H g e i T T [ & o X ",
+"= 0.9.5.:.*. .....X.X.X.o.& o X ",
+"= ;., 5 2 > ; : 4 6 7 3 * . X e.",
+"= L M N N N N N N N B ! = = e.e.",
+"= 9 @.#.#.#.#.#.$.$.$.~ = = e.e.",
+"= = 8 x W b b n n m m v c = e.e.",
+"e.= = = = = = = = = = = = = e.e."
+};
+
+/* XPM */
+const char *edit_undo_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 61 1",
+" c #BB9F15",
+". c #BEA113",
+"X c #BCA114",
+"o c #BCA015",
+"O c #BDA116",
+"+ c #BBA11B",
+"@ c #BFA31B",
+"# c #C4A000",
+"$ c #C4A901",
+"% c #C8AC02",
+"& c #CBAA0E",
+"* c #C2A211",
+"= c #C1A313",
+"- c #C2A611",
+"; c #C1A314",
+": c #C1A319",
+"> c #C0A41A",
+", c #C5AB1B",
+"< c #C0A623",
+"1 c #D6C004",
+"2 c #DAC304",
+"3 c #D8C207",
+"4 c #DFC80A",
+"5 c #DFC80B",
+"6 c #DFC90F",
+"7 c #F7DD05",
+"8 c #E3CD16",
+"9 c #E8D21D",
+"0 c #F1DB29",
+"q c #F4DF2C",
+"w c #ECD936",
+"e c #FAE320",
+"r c #FBE425",
+"t c #F5E02F",
+"y c #F6E02F",
+"u c #F6E131",
+"i c #F7E232",
+"p c #F8E232",
+"a c #D8C543",
+"s c #DBC443",
+"d c #E1CD40",
+"f c #E3CE41",
+"g c #E9DA5D",
+"h c #EADB66",
+"j c #EBDC6F",
+"k c #EEE16E",
+"l c #F2E469",
+"z c #F3E56A",
+"x c #F6E769",
+"c c #F5E66D",
+"v c #F7E86C",
+"b c #F7E86E",
+"n c #F9EA69",
+"m c #FAEB6F",
+"M c #EFE276",
+"N c #FAEC73",
+"B c #FBED76",
+"V c #FBED79",
+"C c #F2E788",
+"Z c #FBF3AD",
+"A c None",
+/* pixels */
+"AAAAAA#AAAAAAAAA",
+"AAAAA##AAAAAAAAA",
+"AAAA#Z#AAAAAAAAA",
+"AAA#Zr##. +AAAAA",
+"AA#ZueNmbvX;AAAA",
+"A#Zyi0t08wxf=AAA",
+"#Zypiit0999wdOAA",
+"A#Vpq1119995z,oA",
+"AA#B2Bnnnn743j at A",
+"AAA#BB####$k6l>A",
+"AAAA#B#AAAA#cM:A",
+"AAAAA##AAAAA%C*A",
+"AAAAAA#AAAAA&g<A",
+"AAAAAAAAAAAAsaAA",
+"AAAAAAAAAAAAh-AA",
+"AAAAAAAAAAAAAAAA"
+};
+
+/* XPM */
+const char *edit_select_all_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 37 1",
+" c #000000",
+". c #888A85",
+"X c #8B8D88",
+"o c #8B8D89",
+"O c #8C8E89",
+"+ c #8D8F8A",
+"@ c #8197AF",
+"# c #8298B0",
+"$ c #A8BED6",
+"% c #A9BFD7",
+"& c #AAC0D8",
+"* c #ABC1D9",
+"= c #ACC2DA",
+"- c #ADC3DB",
+"; c #AEC4DC",
+": c #AFC5DD",
+"> c #B0C6DE",
+", c #B1C7DF",
+"< c #B2C8E0",
+"1 c #B3C9E1",
+"2 c #EBEBEB",
+"3 c #ECECEC",
+"4 c #EEEEEE",
+"5 c #F0F0F0",
+"6 c #F2F2F2",
+"7 c #F4F4F4",
+"8 c #F5F5F5",
+"9 c #F6F6F6",
+"0 c #F7F7F7",
+"q c #F8F8F8",
+"w c #F9F9F9",
+"e c #FAFAFA",
+"r c #FBFBFB",
+"t c #FCFCFC",
+"y c #FDFDFD",
+"u c #FEFEFE",
+"i c None",
+/* pixels */
+"io............Oi",
+"i.yuuyyttrreewXi",
+"i.y$%%&&*****qXi",
+"i.u%@@@@=@@@=qXi",
+"i.y&@@@@-----qXi",
+"i.y&@@@@-;;;2qXi",
+"i.t*@@@@;@@:3qXi",
+"i.t==-;::>>>4qXi",
+"i.t=-;::>>,,5qXi",
+"i.r=@@@@@@@<60Xi",
+"i.r-;:>> < 170Xi",
+"i.e-;:>,< 8990Xi",
+"i.w-####< 0q00Xi",
+"i.w-;:>,< 0wq0Xi",
+"i.qqqqqq q qqqXi",
+"iO............+i"
+};
+
+/* XPM */
+const char *edit_clear_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 108 2",
+" c #7B4A00",
+". c #7C4B00",
+"X c #AB1B0D",
+"o c #A12400",
+"O c #A03600",
+"+ c #B8381D",
+"@ c #804E01",
+"# c #845201",
+"$ c #865203",
+"% c #AD4213",
+"& c #876400",
+"* c #A6690A",
+"= c #A96B0A",
+"- c #AB6D0B",
+"; c #B2760B",
+": c #B2720C",
+"> c #BC7A0F",
+", c #B06917",
+"< c #BB4A28",
+"1 c #C17D10",
+"2 c #C86D33",
+"3 c #9A8500",
+"4 c #9C8800",
+"5 c #9C8B00",
+"6 c #9D8C00",
+"7 c #9E8D00",
+"8 c #9F8D00",
+"9 c #9E8D01",
+"0 c #9F8D01",
+"q c #9F8E00",
+"w c #9F8E01",
+"e c #9F8E04",
+"r c #9F8F05",
+"t c #A18801",
+"y c #A08E01",
+"u c #A08F01",
+"i c #A08F05",
+"p c #A19008",
+"a c #A29009",
+"s c #A59411",
+"d c #AB9B1A",
+"f c #AE9E1B",
+"g c #B1A01D",
+"h c #BBA529",
+"j c #BEAE32",
+"k c #C0B02F",
+"l c #C6B530",
+"z c #C5B432",
+"x c #C6B633",
+"c c #C5B536",
+"v c #DAC203",
+"b c #DBC304",
+"n c #DCC407",
+"m c #DCC510",
+"M c #DCC610",
+"N c #DCC615",
+"B c #E3CB11",
+"V c #E5CD14",
+"C c #E7D018",
+"Z c #DFCA26",
+"A c #EED723",
+"S c #F3DB2A",
+"D c #F6DE2F",
+"F c #FBE437",
+"G c #FCE53C",
+"H c #FDE63C",
+"J c #CDBD41",
+"K c #CCBD43",
+"L c #CDBE45",
+"P c #D7B162",
+"I c #CFC149",
+"U c #D2C34F",
+"Y c #D8C84F",
+"T c #D6C856",
+"R c #DCCD58",
+"E c #DDCF5E",
+"W c #EDDA46",
+"Q c #E4D249",
+"! c #E4D34C",
+"~ c #E5D44E",
+"^ c #E6D656",
+"/ c #E1D35B",
+"( c #E7D75B",
+") c #E7D85F",
+"_ c #FBE544",
+"` c #FDE952",
+"' c #FDEA5F",
+"] c #E2D467",
+"[ c #E7D96D",
+"{ c #ECDC68",
+"} c #E8DA6C",
+"| c #F6D861",
+" . c #EADC72",
+".. c #EBDD77",
+"X. c #EBDE77",
+"o. c #F3E365",
+"O. c #FDEB61",
+"+. c #FDEA63",
+"@. c #FDEC6B",
+"#. c #FDEB6C",
+"$. c #FDEC6D",
+"%. c #FDEE7D",
+"&. c #FBEA84",
+"*. c #FDEF84",
+"=. c #F8EA88",
+"-. c #FBED8B",
+";. c #FDEF8A",
+":. c None",
+/* pixels */
+":.. :.:.:.:.:.:.:.:.:.:.:.:.:.",
+" * - :.:.:.:.:.:.:.:.:.:.:.:.",
+" : 1 = :.5 :.:.:.:.:.:.:.:.:.",
+":.$ > 1 # 3 5 :.:.:.:.:.:.:.:.:.",
+":. @ ; t j g :.:.:.:.:.:.:.:.:.",
+":.:.& 4 J X., O u :.:.:.:.:.:.:.",
+":.:.9 Y { 2 X P .K a w :.:.:.:.",
+":.:.7 h < + | +.#.%.=.L r q :.:.",
+":.:.:.o % &. at .*.$.` _ o...I f 6 ",
+":.:.:.:.k ;.' O.` H S C M Q ] 0 ",
+":.:.:.:.s -.G F D A V b v ^ x q ",
+":.:.:.:.y E W C B n v v ! R e :.",
+":.:.:.:.:.d } m v v N ( T i :.:.",
+":.:.:.:.:.q c ) Z ~ [ z 7 :.:.:.",
+":.:.:.:.:.:.7 U / l p 8 :.:.:.:.",
+":.:.:.:.:.:.:.6 7 7 :.:.:.:.:.:."
+};
+
+/* XPM */
+const char *edit_copy_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 27 1",
+" c #888A85",
+". c #898B86",
+"X c #8A8C87",
+"o c #8C8E89",
+"O c #8D8F8A",
+"+ c #989A95",
+"@ c #989A96",
+"# c #9A9B97",
+"$ c #C3C4C3",
+"% c #C7C7C6",
+"& c #D4D4D4",
+"* c #E3E3E2",
+"= c #E3E4E2",
+"- c #EEEEEE",
+"; c #F0F0EF",
+": c #F3F3F3",
+"> c #F4F4F4",
+", c #F6F6F5",
+"< c #F7F7F6",
+"1 c #F8F8F7",
+"2 c #FAFAF9",
+"3 c #FAFAFA",
+"4 c #FBFBFB",
+"5 c #FCFCFB",
+"6 c #FEFEFD",
+"7 c #FFFFFF",
+"8 c None",
+/* pixels */
+"8888888888888888",
+"8888888888888888",
+"8888888888888888",
+"8888# O",
+"8888X7777777777 ",
+"8888.7;;;;;;;;7 ",
+"8888X7;%%%%%%;7 ",
+"8888.7;;;;;;;;7 ",
+"8888X7;%%%%%;;7 ",
+"8888.7;;;;;;;3: ",
+"8888X7;%%%%%-<$ ",
+"8888X7;;;;;oooo ",
+"8888.6;;;;3+31= ",
+"8888.2;;;33+3* ",
+"8888.><,54&@= 88",
+"8888o. 888"
+};
+
+/* XPM */
+const char *edit_cut_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 88 1",
+" c #A60101",
+". c #A60202",
+"X c #A40502",
+"o c #A60606",
+"O c #A70606",
+"+ c #A80303",
+"@ c #A80403",
+"# c #A80606",
+"$ c #A80707",
+"% c #A90707",
+"& c #AA0808",
+"* c #AA0909",
+"= c #A90A0A",
+"- c #A90B0B",
+"; c #AA0B0B",
+": c #AA0C0C",
+"> c #AA0D0D",
+", c #AB0D0D",
+"< c #AA0E0E",
+"1 c #B50B0B",
+"2 c #B70F0E",
+"3 c #B80D0D",
+"4 c #AB1010",
+"5 c #AB1111",
+"6 c #AB1313",
+"7 c #AB1414",
+"8 c #AB1616",
+"9 c #AD1717",
+"0 c #AE1818",
+"q c #9C2F2C",
+"w c #C01513",
+"e c #C01514",
+"r c #C71A19",
+"t c #C91A1A",
+"y c #CA1B1A",
+"u c #CB1F1F",
+"i c #CD1D1C",
+"p c #CD1D1D",
+"a c #CE1D1D",
+"s c #CF1D1D",
+"d c #CE1E1E",
+"f c #D01F1F",
+"g c #D11F1F",
+"h c #D12020",
+"j c #D22020",
+"k c #D32121",
+"l c #D42222",
+"z c #D52323",
+"x c #D62323",
+"c c #DB2727",
+"v c #A34A45",
+"b c #898984",
+"n c #8A8C87",
+"m c #8B8D88",
+"M c #8C8E89",
+"N c #8D8F8A",
+"B c #8E908B",
+"V c #8F918C",
+"C c #90918D",
+"Z c #91938E",
+"A c #92948F",
+"S c #939590",
+"D c #9A9C97",
+"F c #9FA09C",
+"G c #A8A9A5",
+"H c #AAACA7",
+"J c #AEAFAB",
+"K c #B3B2AF",
+"L c #B3B5B0",
+"P c #B5B6B2",
+"I c #B5B6B3",
+"U c #B6B8B3",
+"Y c #B8BAB5",
+"T c #BABBB7",
+"R c #C5C6C3",
+"E c #C6C8C3",
+"W c #CCCEC9",
+"Q c #CDCECB",
+"! c #D2D3D0",
+"~ c #D2D4D0",
+"^ c #DBDCD9",
+"/ c #E1E1DF",
+"( c #E7E8E6",
+") c #EFF0EF",
+"_ c #F5F6F5",
+"` c #F7F7F6",
+"' c #F7F7F7",
+"] c None",
+/* pixels */
+"]]]]mS]]]]mV]]]]",
+"]]]B'm]]]]C!V]]]",
+"]]]m~)A]]]HEN]]]",
+"]]]NL`m]]BWJm]]]",
+"]]]]m^)ZMUQm]]]]",
+"]]]]NP'mFIYm]]]]",
+"]]]]]m/_DGm]]]]]",
+"]]]]]NT(HBn]]]]]",
+"]]]]]]bRKq]]]]]]",
+"]]]]08ov.r90]]]]",
+"]]]%jd2X at thu=]]]",
+"]]#f+e ]]iw+pO]]",
+"]7z]]a=]]+y]]h7]",
+"],s]1k:]]*x3]g5]",
+"]6cfa$]]]]&lsa6]",
+"]]<48]]]]]]>;-]]"
+};
+
+/* XPM */
+const char *edit_paste_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 77 1",
+" c #6A4200",
+". c #6B4301",
+"X c #6C4301",
+"o c #6B4403",
+"O c #6C4401",
+"+ c #6D4401",
+"@ c #6E4502",
+"# c #6E4602",
+"$ c #6F4602",
+"% c #5C5C5B",
+"& c #5C5C5C",
+"* c #5E5E5E",
+"= c #5F5F5E",
+"- c #666864",
+"; c #676964",
+": c #6E6C64",
+"> c #6E6D64",
+", c #6A6C68",
+"< c #706D63",
+"1 c #706D64",
+"2 c #716F64",
+"3 c #736F64",
+"4 c #7E7E7B",
+"5 c #7F7F7C",
+"6 c #B37B22",
+"7 c #B97F23",
+"8 c #BA7F23",
+"9 c #A77D3B",
+"0 c #A37C3D",
+"q c #A47E3E",
+"w c #A17C40",
+"e c #C08424",
+"r c #C58726",
+"t c #C58727",
+"y c #C68827",
+"u c #C28628",
+"i c #80807D",
+"p c #959589",
+"a c #97978A",
+"s c #B1B2B2",
+"d c #B2B4B4",
+"f c #B3B5B5",
+"g c #B7B7B4",
+"h c #B8B9B5",
+"j c #B9B9B6",
+"k c #B9BAB6",
+"l c #BBBBBB",
+"z c #C1C2BE",
+"x c #CCCDCA",
+"c c #CDCECB",
+"v c #D8D8D5",
+"b c #D9D9D6",
+"n c #DADAD8",
+"m c #DBDBD9",
+"M c #E0E0E0",
+"N c #E7E7E4",
+"B c #E7E7E5",
+"V c #E8E8E6",
+"C c #E9E9E7",
+"Z c #EAEAE8",
+"A c #EBEBE9",
+"S c #EBEBEA",
+"D c #ECECEA",
+"F c #ECECEB",
+"G c #EDEDEB",
+"H c #EDEDEC",
+"J c #EDEEED",
+"K c #EEEEED",
+"L c #EFEFED",
+"P c #EFEFEE",
+"I c #F0F0EF",
+"U c #F1F1F1",
+"Y c #F2F2F2",
+"T c #FEFEFD",
+"R c #FEFEFE",
+"E c #FFFFFF",
+"W c None",
+/* pixels */
+"WWWWW=&&&&=WWWWW",
+"WW+Oo%paap%oOOWW",
+"W+eq1*5ii4*:w7XW",
+"W$y2UMllllMY>t W",
+"W$y-EIIIIIIE;u W",
+"W$r-EIffffPE;u W",
+"W$r-EIIIILGE;u W",
+"W#r-EIffdsZE;u W",
+"W#r-EIPHSZmE;u W",
+"W#r-EKFACnxE;u W",
+"W#r-EDZVckhE;u W",
+"W at r-ECBbjEEE;u W",
+"W at r-ENvzgEE;tu W",
+"W at r<JRRRPT;ttt W",
+"WX893,,,,,0006.W",
+"WWXOOOOOOOOOO.WW"
+};
+
+/* XPM */
+const char *file_open_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 69 1",
+" c #555753",
+". c #595B57",
+"X c #5D5F5B",
+"o c #61635F",
+"O c #455D79",
+"+ c #636561",
+"@ c #676965",
+"# c #6A6C68",
+"$ c #6D6F6B",
+"% c #3F6086",
+"& c #3E6089",
+"* c #3465A4",
+"= c #436B9D",
+"- c #537196",
+"; c #58769B",
+": c #617A9A",
+"> c #6395CC",
+", c #6496CC",
+"< c #6597CC",
+"1 c #6598CD",
+"2 c #6698CC",
+"3 c #6898CD",
+"4 c #6899CD",
+"5 c #6999CD",
+"6 c #6A9ACD",
+"7 c #6B9ACD",
+"8 c #6B9BCD",
+"9 c #6A9ACE",
+"0 c #6C9BCE",
+"q c #6D9CCE",
+"w c #6E9CCE",
+"e c #6E9DCE",
+"r c #709DCF",
+"t c #709ECE",
+"y c #729FCF",
+"u c #76A2D0",
+"i c #7CA6D2",
+"p c #969795",
+"a c #969992",
+"s c #9A9C98",
+"d c #A6A6A6",
+"f c #A7A9A4",
+"g c #A9ABA9",
+"h c #C0C0BF",
+"j c #81A9D4",
+"k c #85ACD5",
+"l c #88AED6",
+"z c #89AED6",
+"x c #89AFD7",
+"c c #8AAFD7",
+"v c #8BB0D7",
+"b c #8CB1D8",
+"n c #94B6DB",
+"m c #9BBBDD",
+"M c #9ABADE",
+"N c #9CBBDD",
+"B c #A6C2E0",
+"V c #ADC7E3",
+"C c #AEC7E3",
+"Z c #BED2E8",
+"A c #C6C6C5",
+"S c #C9C9C9",
+"D c #CCCCCA",
+"F c #CECECE",
+"G c #D8D8D7",
+"H c #C6D8EB",
+"J c #F5F5F4",
+"K c #FFFFFF",
+"L c None",
+/* pixels */
+"L$$$$$@@LLLLLLLL",
+"$FFFFFFA+LLLLLLL",
+"#hppsfffffffffaL",
+"@SddfKKKKKKKKKfL",
+"ohppfKJJJJJJJKfL",
+"XSddfKJDDDDDJKfL",
+"XhppfKJJJJJJJKfL",
+".SddfKJDDDGJJKfL",
+" h:************=",
+" S*HZZZZZZZZZZH*",
+" h*CbbbbbbbbbzB*",
+" S*VvbvclkjiuyN*",
+" h;mtrewq08954n*",
+" gx8765321<,>M-O",
+"&*************%L",
+"LLLLLLLLLLLLLLLL"
+};
+
+/* XPM */
+const char *format_indent_more_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 68 1",
+" c #555753",
+". c #61635F",
+"X c #797B78",
+"o c #7A7B78",
+"O c #7A7C78",
+"+ c #888A85",
+"@ c #8B8D88",
+"# c #8C8E8A",
+"$ c #8D8F8A",
+"% c #929391",
+"& c #929491",
+"* c #939491",
+"= c #939492",
+"- c #939592",
+"; c #ABACAA",
+": c #ACADAA",
+"> c #ACADAB",
+", c #ADAEAB",
+"< c #C5C5C3",
+"1 c #C5C6C4",
+"2 c #C5C7C4",
+"3 c #C7C7C5",
+"4 c #C7C7C6",
+"5 c #D2D2D0",
+"6 c #D2D3D0",
+"7 c #D2D2D1",
+"8 c #D2D3D1",
+"9 c #D3D4D2",
+"0 c #D4D5D3",
+"q c #D6D6D4",
+"w c #D6D7D5",
+"e c #DBDBD9",
+"r c #E0E1E0",
+"t c #E7E7E7",
+"y c #EDEDEC",
+"u c #EEEDEC",
+"i c #EEEEED",
+"p c #EFEEED",
+"a c #EEEEEE",
+"s c #EFEEEE",
+"d c #EFEFEE",
+"f c #F0F0EF",
+"g c #F1F1F1",
+"h c #F2F1F0",
+"j c #F2F1F1",
+"k c #F2F2F0",
+"l c #F2F2F1",
+"z c #F3F2F1",
+"x c #F3F2F2",
+"c c #F3F3F2",
+"v c #F4F3F2",
+"b c #F4F3F3",
+"n c #F4F4F3",
+"m c #F4F4F4",
+"M c #F5F4F4",
+"N c #F4F5F4",
+"B c #F5F5F4",
+"V c #F5F6F4",
+"C c #F5F6F5",
+"Z c #F6F6F5",
+"A c #F7F6F5",
+"S c #F7F6F6",
+"D c #F7F7F6",
+"F c #F7F8F6",
+"G c #F8F8F7",
+"H c #FEFEFE",
+"J c #FFFFFF",
+"K c None",
+/* pixels */
+"K$++++++++++++$K",
+"K+JJJJJJJJJJJJ at K",
+"K+JGGGGGFAZCBH at K",
+"K+JGGGG@@@@@MH at K",
+"K+JGGGDeZVmnnH at K",
+"K+JGGDZ.wNnbxH at K",
+"K+JGDSC. qvzjH at K",
+"K+t4,-O. 0ghH at K",
+"K+t3,=o. 9fH at K",
+"K+t2>*o. 8H at K",
+"K+t1:&o. 5dH at K",
+"K+t<;%X. 7sdH at K",
+"K+Jcchl. 6piuH at K",
+"K+Jckgf.6aiuyH at K",
+"K+JHHHHrHHHHHJ at K",
+"K$@@@@@@@@@@@@#K"
+};
+
+/* XPM */
+const char *left_arrow_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 98 2",
+" c #3A7304",
+". c #3A7404",
+"X c #3B7404",
+"o c #3B7504",
+"O c #3A7405",
+"+ c #3B7604",
+"@ c #3C7604",
+"# c #3D7904",
+"$ c #3F790A",
+"% c #41790E",
+"& c #437A10",
+"* c #457C13",
+"= c #4E9A06",
+"- c #519E07",
+"; c #4D8419",
+": c #52891E",
+"> c #55A409",
+", c #56A609",
+"< c #58A90A",
+"1 c #59AC0B",
+"2 c #5AAD0B",
+"3 c #5CAD0E",
+"4 c #5EB30D",
+"5 c #5EA31D",
+"6 c #60B50D",
+"7 c #61B60E",
+"8 c #61B70E",
+"9 c #62AF17",
+"0 c #65B519",
+"q c #578927",
+"w c #598B29",
+"e c #5A8C2C",
+"r c #5D8D2E",
+"t c #60A420",
+"y c #66AF20",
+"u c #66AC22",
+"i c #65A827",
+"p c #68A92B",
+"a c #6BA236",
+"s c #6EA23D",
+"d c #70AD35",
+"f c #71B035",
+"g c #75B23C",
+"h c #67C111",
+"j c #69C211",
+"k c #6EC915",
+"l c #7CC833",
+"z c #7BB642",
+"x c #7AB742",
+"c c #7FB947",
+"v c #7DB549",
+"b c #7DA855",
+"n c #7FA956",
+"m c #80B64D",
+"M c #82B74F",
+"N c #85B954",
+"B c #87BB54",
+"V c #87BA57",
+"C c #87B65B",
+"Z c #88BB58",
+"A c #89BC59",
+"S c #8ABC5A",
+"D c #8BBD5C",
+"F c #90BF63",
+"G c #97BD72",
+"H c #8DC459",
+"J c #97DA54",
+"K c #91C064",
+"L c #96CA65",
+"P c #94C26A",
+"I c #9DC477",
+"U c #A5DC6E",
+"Y c #A0C37E",
+"T c #A3CA7E",
+"R c #A6CF7F",
+"E c #A3D572",
+"W c #A5D576",
+"Q c #A9D77D",
+"! c #A5C982",
+"~ c #A7CD84",
+"^ c #AACF88",
+"/ c #A9D480",
+"( c #ACD881",
+") c #AEDB82",
+"_ c #B0DE83",
+"` c #B3D296",
+"' c #B5D497",
+"] c #B8D69B",
+"[ c #BDD9A3",
+"{ c #BFDAA6",
+"} c #C2DCAA",
+"| c #C4DDAC",
+" . c #C5DEAE",
+".. c #C6DEAE",
+"X. c #C7DFB1",
+"o. c #C8DFB1",
+"O. c #CAE0B5",
+"+. c None",
+/* pixels */
+"+.+.+.+.+.+.+.+.+.+.o +.+.+.+.+.",
+"+.+.+.+.+.+.+.+.X w +.+.+.+.+.",
+"+.+.+.+.+.+.+.. n o. +.+.+.+.+.",
+"+.+.+.+.+.+.& Y [ O. +.+.+.+.+.",
+"+.+.+.+.X r ` ^ K X.+ . ",
+"+.+.+.O b ' P V D | ... .| } ",
+"+.+.* G ~ m v M N Z A S A Z { ",
+"o e ! F d g z c x f i 5 t p ] ",
+"o q I B u y 9 3 1 < > - = = T ",
+"+.+.% C L 0 6 8 7 4 2 , - = T ",
+"+.+.+.o s W l j h ) ( / R T T ",
+"+.+.+.+.+ : E J k _ # . ",
+"+.+.+.+.+.+.$ H U _ +.+.+.+.+.",
+"+.+.+.+.+.+.+.@ a Q +.+.+.+.+.",
+"+.+.+.+.+.+.+.+.+ ; +.+.+.+.+.",
+"+.+.+.+.+.+.+.+.+.+.o +.+.+.+.+."
+};
+
+/* XPM */
+const char *log_out_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 184 2",
+" c #555753",
+". c #565854",
+"X c #575955",
+"o c #585A56",
+"O c #595B57",
+"+ c #595959",
+"@ c #5B5D59",
+"# c #5C5E5A",
+"$ c #5D5D5D",
+"% c #645F5E",
+"& c #5F615D",
+"* c #61635F",
+"= c #606060",
+"- c #646562",
+"; c #656763",
+": c #646464",
+"> c #656565",
+", c #686966",
+"< c #686A67",
+"1 c #686868",
+"2 c #696B68",
+"3 c #6D6E6B",
+"4 c #6C6C6C",
+"5 c #6E6E6E",
+"6 c #6F6F6F",
+"7 c #7E6A6A",
+"8 c #707070",
+"9 c #737571",
+"0 c #757575",
+"q c #767676",
+"w c #797979",
+"e c #7E7E7E",
+"r c #7F7F7F",
+"t c #A50000",
+"y c #A50101",
+"u c #A60303",
+"i c #A60404",
+"p c #A20E0E",
+"a c #AA0B0B",
+"s c #A90C0C",
+"d c #A61111",
+"f c #A51413",
+"g c #A11616",
+"h c #AC1111",
+"j c #AC1515",
+"k c #B51B1B",
+"l c #B01E1E",
+"z c #AC2524",
+"x c #B02121",
+"c c #B12221",
+"v c #BC2424",
+"b c #B72828",
+"n c #BC3030",
+"m c #B93C3C",
+"M c #BC3E3E",
+"N c #CE0808",
+"B c #CE0C0C",
+"V c #CF0E0E",
+"C c #CF1010",
+"Z c #D11A1A",
+"A c #D21B1B",
+"S c #C42D2D",
+"D c #D32525",
+"F c #D52D2D",
+"G c #C53636",
+"H c #D33535",
+"J c #D73636",
+"K c #D63838",
+"L c #D43A3A",
+"P c #D23C3C",
+"I c #D23D3D",
+"U c #B64543",
+"Y c #BB4948",
+"T c #8A6464",
+"R c #8B7373",
+"E c #867979",
+"W c #D94141",
+"Q c #DB4848",
+"! c #DB4A4A",
+"~ c #DB4C4C",
+"^ c #DB4D4D",
+"/ c #C45151",
+"( c #DC5151",
+") c #DD5656",
+"_ c #D55E5E",
+"` c #C76565",
+"' c #CD6161",
+"] c #C46C6B",
+"[ c #D26565",
+"{ c #E16969",
+"} c #E26E6E",
+"| c #7F817D",
+" . c #808080",
+".. c #828282",
+"X. c #858585",
+"o. c #858685",
+"O. c #868686",
+"+. c #878886",
+"@. c #888888",
+"#. c #898989",
+"$. c #898A88",
+"%. c #8B8B8B",
+"&. c #8D8F8B",
+"*. c #8C8C8C",
+"=. c #8D8D8D",
+"-. c #8F8F8F",
+";. c #919191",
+":. c #929390",
+">. c #929292",
+",. c #939393",
+"<. c #949494",
+"1. c #959595",
+"2. c #969696",
+"3. c #979797",
+"4. c #989897",
+"5. c #989898",
+"6. c #999999",
+"7. c #9A9B98",
+"8. c #9A9A9A",
+"9. c #9C9C9C",
+"0. c #9D9D9D",
+"q. c #9E9E9E",
+"w. c #A28988",
+"e. c #A0A0A0",
+"r. c #A1A1A1",
+"t. c #A2A3A1",
+"y. c #A2A2A2",
+"u. c #A3A3A3",
+"i. c #A4A4A4",
+"p. c #A5A5A5",
+"a. c #A6A6A6",
+"s. c #A7A7A7",
+"d. c #A9A9A9",
+"f. c #AAAAAA",
+"g. c #ABABAB",
+"h. c #ADADAD",
+"j. c #AFAFAF",
+"k. c #BABABA",
+"l. c #BBBBBB",
+"z. c #BDBDBD",
+"x. c #A9A9A9",
+"c. c #C58886",
+"v. c #D79292",
+"b. c #E78888",
+"n. c #E88D8D",
+"m. c #E88E8E",
+"M. c #EA9595",
+"N. c #EA9696",
+"B. c #EB9A9A",
+"V. c #ECA7A7",
+"C. c #BEC1BB",
+"Z. c #C3C3C3",
+"A. c #C3C6C1",
+"S. c #C5C7C1",
+"D. c #C6C8C3",
+"F. c #C6C9C3",
+"G. c #C6C9C4",
+"H. c #C7C9C5",
+"J. c #D0D2D0",
+"K. c #D4D6D2",
+"L. c #D6D8D4",
+"P. c #D7D9D5",
+"I. c #D8DAD6",
+"U. c #D9DBD7",
+"Y. c #EDD4D3",
+"T. c #E4E5E3",
+"R. c #E5E6E4",
+"E. c #ECE3E1",
+"W. c #EDEEEC",
+"Q. c #EFEFED",
+"!. c #EFEFEE",
+"~. c #F0F0EE",
+"^. c #F1F1EF",
+"/. c #F3F1EF",
+"(. c #F3F3F2",
+"). c #F4F4F2",
+"_. c #F4F4F3",
+"`. c #F6F6F5",
+"'. c #F8F8F7",
+"]. c #F9F9F9",
+"[. c #FAFAFA",
+"{. c #FBFBFA",
+"}. c #FBFBFB",
+"|. c None",
+/* pixels */
+"@ . # - , < ; 3 |.",
+" a.X.w 5 > $ + Q.^._.`.`.W.| |.",
+" h.*.r 0 4 : = Q.(.'.{.}.].7.|.",
+" k.1.#.e 0 5 1 !.).].v.M [.t.|.",
+" l.0.<.#.r q 8 ~./.` / j Y.w.|.",
+" z.e.3.-.O.e q E.m ' V.n b c y ",
+" x.y.8.;. at . .7 x [ b.m.M.N.B.y ",
+" x.i.9.,.%.T d _ { Q ! ~ ^ n.u ",
+" x.s.q.2.=.g G ) F D Z C A } i ",
+" x.d.r.5.-.R p S J N B B V ( y ",
+" x.f.u.8.>.#.E z v K W L P I t ",
+" x.f.p.0.1.-...% Y k H i l f a ",
+" x.f.d.r.6.6 $.J.T.] h s R.+.|.",
+" x.g.j.o.&.H.K.P.I.U.c.U L.9 |.",
+" Z.4.:.C.A.D.F.G.G.G.G.G.S.* |.",
+"@ 2 . X o o o o O O O O O o & |."
+};
+
+/* XPM */
+const char *minus_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 19 1",
+" c #3465A4",
+". c #7DA6D7",
+"X c #7FA8D7",
+"o c #83AAD8",
+"O c #86ADD9",
+"+ c #90B3DA",
+"@ c #92B4DA",
+"# c #94B6DB",
+"$ c #95B7DB",
+"% c #9FBEE0",
+"& c #B4CCE5",
+"* c #B5CCE6",
+"= c #B6CCE6",
+"- c #B6CDE6",
+"; c #B7CEE6",
+": c #BBD1E7",
+"> c #BCD1E7",
+", c #C0D3E8",
+"< c None",
+/* pixels */
+"<<<<<<<<<<<<<<<<",
+"<<<<<<<<<<<<<<<<",
+"<<<<<<<<<<<<<<<<",
+"<<<<<<<<<<<<<<<<",
+"<<<<<<<<<<<<<<<<",
+"<<<<<<<<<<<<<<<<",
+"<< <<",
+"<< ,:>;;;;-*= <<",
+"<< &$#@+OoX.% <<",
+"<< <<",
+"<<<<<<<<<<<<<<<<",
+"<<<<<<<<<<<<<<<<",
+"<<<<<<<<<<<<<<<<",
+"<<<<<<<<<<<<<<<<",
+"<<<<<<<<<<<<<<<<",
+"<<<<<<<<<<<<<<<<"
+};
+
+/* XPM */
+const char *net_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 160 2",
+" c #576F95",
+". c #58749D",
+"X c #5A769F",
+"o c #5876A0",
+"O c #5977A0",
+"+ c #5877A2",
+"@ c #5978A2",
+"# c #5979A3",
+"$ c #5A79A3",
+"% c #5E7AA3",
+"& c #5A79A4",
+"* c #5A7AA4",
+"= c #5B7AA4",
+"- c #5D7DA6",
+"; c #5E7DA6",
+": c #627BA3",
+"> c #627CA5",
+", c #617FA6",
+"< c #617FA8",
+"1 c #637FA8",
+"2 c #4F80B6",
+"3 c #5685B7",
+"4 c #5686BA",
+"5 c #5988BC",
+"6 c #5C8ABD",
+"7 c #6983A6",
+"8 c #6380A8",
+"9 c #6984A9",
+"0 c #708AAD",
+"q c #6D90B7",
+"w c #7591B4",
+"e c #7591B5",
+"r c #7792B6",
+"t c #7994B6",
+"y c #7A95B7",
+"u c #7E97B9",
+"i c #628FC1",
+"p c #6B96C6",
+"a c #6C96C5",
+"s c #719BC9",
+"d c #759FCB",
+"f c #819ABA",
+"g c #839BBB",
+"h c #9DA6AE",
+"j c #AEB5BC",
+"k c #8BA7C7",
+"l c #84A6CA",
+"z c #83A7CE",
+"x c #93ABC7",
+"c c #94ACC8",
+"v c #9AB0CB",
+"b c #9CB2CB",
+"n c #9BB2CC",
+"m c #9DB3CD",
+"M c #9FB4CE",
+"N c #80A7D1",
+"B c #93B6DC",
+"V c #A4B5C9",
+"C c #A5B7C9",
+"Z c #A0B4CD",
+"A c #A3B6CE",
+"S c #BABFC4",
+"D c #B8BFC6",
+"F c #B5BEC8",
+"G c #A3B8D0",
+"H c #A9BCD1",
+"J c #ABBDD3",
+"K c #AABED3",
+"L c #AFBFD4",
+"P c #A2BDDA",
+"I c #9CBDE0",
+"U c #B7C2CD",
+"Y c #BCC4CC",
+"T c #B3C1D0",
+"R c #B1C0D5",
+"E c #B1C2D6",
+"W c #BEC7D0",
+"Q c #BCC8D4",
+"! c #BECAD6",
+"~ c #B5C5D8",
+"^ c #B4C7DC",
+"/ c #B7C8DC",
+"( c #BBC9DA",
+") c #BECBDA",
+"_ c #B8C9DD",
+"` c #BCCDDF",
+"' c #ACCAE9",
+"] c #BECFE1",
+"[ c #B3CCE8",
+"{ c #B1CEEC",
+"} c #B5D1EE",
+"| c #BED4EB",
+" . c #BCD7F2",
+".. c #C0C6CE",
+"X. c #C7CDD2",
+"o. c #C8CED4",
+"O. c #C8CFD5",
+"+. c #C6CFD8",
+"@. c #CED0D1",
+"#. c #CED1D3",
+"$. c #CAD5DF",
+"%. c #D1D1D1",
+"&. c #D3D3D3",
+"*. c #D7D9DB",
+"=. c #DCDDDF",
+"-. c #C3D2E3",
+";. c #CCD7E2",
+":. c #CFD9E2",
+">. c #CCD9E7",
+",. c #CEDBEA",
+"<. c #CCDDEF",
+"1. c #DBDEE0",
+"2. c #D4DDE9",
+"3. c #D5DFE9",
+"4. c #D6DFE9",
+"5. c #D5DFEB",
+"6. c #DFE1E3",
+"7. c #DCE1E5",
+"8. c #DEE2E7",
+"9. c #D9E1E9",
+"0. c #DCE3E9",
+"q. c #DBE4EF",
+"w. c #DCE4ED",
+"e. c #C9E1F9",
+"r. c #CCE3FA",
+"t. c #D4E5F6",
+"y. c #D2E5F9",
+"u. c #D5E8FC",
+"i. c #DAEAFA",
+"p. c #DEEDFB",
+"a. c #DAEBFC",
+"s. c #DEEEFF",
+"d. c #DFEFFF",
+"f. c #E0E0E0",
+"g. c #E2E2E2",
+"h. c #E0E3E4",
+"j. c #E3E4E5",
+"k. c #E2E4E6",
+"l. c #E0E5EB",
+"z. c #E4E6E8",
+"x. c #EDEEEF",
+"c. c #EFEFEF",
+"v. c #E6EBF0",
+"b. c #E6EBF4",
+"n. c #E0EFFF",
+"m. c #E2EFFE",
+"M. c #E1F0FF",
+"N. c #E2F1FF",
+"B. c #E3F1FF",
+"V. c #F1F2F3",
+"C. c #F4F4F5",
+"Z. c #F5F5F5",
+"A. c #F6F6F6",
+"S. c #F0F4F8",
+"D. c #F8F9F9",
+"F. c #F9F9F9",
+"G. c #FBFBFB",
+"H. c #FDFDFD",
+"J. c #FEFEFE",
+"K. c None",
+/* pixels */
+"K.K.K.K.K.o = * @ + K.K.K.K.K.K.",
+"K.K.K.% g ( w.b.5.E u # K.K.K.K.",
+"K.K., R l.:.S ) | ! 9.A $ K.K.K.",
+"K.9 L 8.#.m.p.t.Q ..1.v.Z * K.K.",
+": f S.j.$.N.B.i.+.*.C.G.3.t K.K.",
+"0 ~ h.<.n.M.M.a.X.W V F z.G * K.",
+"8 2.K r.s.d.d.,.H.J.H.k.=.` * K.",
+"= q.' .e.u.y.O.J.J.J.F.j -.* K.",
+"; >.U o.[ } { H D.V.J.c. at ._ * K.",
+"1 J 7.J.6.P I B l k Z.g.h m * K.",
+"> y 4.J.J.x.z N d a f.&.C e K.K.",
+"K.< b 0.A.D s p i 5 %.Y c * K.K.",
+"K.K.- v ;.q 6 4 2 3 T x # K.K.K.",
+"K.K.K.7 r M / ] ^ n w O K.K.K.K.",
+"K.K.K.K. X $ & @ . K.K.K.K.K.K.",
+"K.K.K.K.K.K.K.K.K.K.K.K.K.K.K.K."
+};
+
+/* XPM */
+const char *plus_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 19 1",
+" c #3465A4",
+". c #7DA6D7",
+"X c #7FA8D7",
+"o c #83AAD8",
+"O c #86ADD9",
+"+ c #90B3DA",
+"@ c #92B4DA",
+"# c #94B6DB",
+"$ c #95B7DB",
+"% c #9FBEE0",
+"& c #B4CCE5",
+"* c #B5CCE6",
+"= c #B6CCE6",
+"- c #B6CDE6",
+"; c #B7CEE6",
+": c #BBD1E7",
+"> c #BCD1E7",
+", c #C0D3E8",
+"< c None",
+/* pixels */
+"<<<<<<<<<<<<<<<<",
+"<<<<<<<<<<<<<<<<",
+"<<<<<< <<<<<<",
+"<<<<<< ;; <<<<<<",
+"<<<<<< ;; <<<<<<",
+"<<<<<< ;; <<<<<<",
+"<< ;; <<",
+"<< ,:>;;;;-*= <<",
+"<< &$#@+OoX.% <<",
+"<< OO <<",
+"<<<<<< ;O <<<<<<",
+"<<<<<< ;O <<<<<<",
+"<<<<<< ;; <<<<<<",
+"<<<<<< <<<<<<",
+"<<<<<<<<<<<<<<<<",
+"<<<<<<<<<<<<<<<<"
+};
+
+/* XPM */
+const char *process_stop_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 133 2",
+" c #860000",
+". c #870000",
+"X c #880000",
+"o c #890000",
+"O c #880202",
+"+ c #890202",
+"@ c #890303",
+"# c #BD0000",
+"$ c #BF0000",
+"% c #BD0202",
+"& c #BD0303",
+"* c #BE0404",
+"= c #BE0505",
+"- c #BF0505",
+"; c #B01818",
+": c #B11A1A",
+"> c #B11B1B",
+", c #B41D1D",
+"< c #B41F1F",
+"1 c #BC1818",
+"2 c #BF1919",
+"3 c #AF2222",
+"4 c #B12222",
+"5 c #B72121",
+"6 c #B22424",
+"7 c #B32626",
+"8 c #B82323",
+"9 c #B82424",
+"0 c #C10000",
+"q c #C10101",
+"w c #C30000",
+"e c #C50000",
+"r c #C70000",
+"t c #C70303",
+"y c #CB0101",
+"u c #CC0F0F",
+"i c #C51A1A",
+"p c #C41B1B",
+"a c #C71D1D",
+"s c #D01010",
+"d c #D31111",
+"f c #D21F1F",
+"g c #C92929",
+"h c #CE2828",
+"j c #CC2F2F",
+"k c #CE2F2F",
+"l c #CF2F2F",
+"z c #D52323",
+"x c #D02F2F",
+"c c #D22F2F",
+"v c #D52F2F",
+"b c #DF2B2B",
+"n c #DF2C2C",
+"m c #DF2D2D",
+"M c #D13131",
+"N c #D23131",
+"B c #D53030",
+"V c #D53737",
+"C c #D63B3B",
+"Z c #D93B3B",
+"A c #DA3B3B",
+"S c #DB3C3C",
+"D c #E63434",
+"F c #E73737",
+"G c #E83737",
+"H c #E83B3B",
+"J c #EA3F3F",
+"K c #DB4040",
+"L c #DB4141",
+"P c #DC4242",
+"I c #D75757",
+"U c #D65858",
+"Y c #D75B5B",
+"T c #D65F5F",
+"R c #D75F5F",
+"E c #D85A5A",
+"W c #D85B5B",
+"Q c #D85C5C",
+"! c #DB5F5F",
+"~ c #EB4343",
+"^ c #E94545",
+"/ c #ED4747",
+"( c #EC4A4A",
+") c #EB4C4C",
+"_ c #ED5252",
+"` c #EF5A5A",
+"' c #D76060",
+"] c #DA6464",
+"[ c #DA6767",
+"{ c #EC6161",
+"} c #ED6565",
+"| c #EE6868",
+" . c #EF6A6A",
+".. c #F26969",
+"X. c #F06F6F",
+"o. c #F17575",
+"O. c #D89292",
+"+. c #DE9292",
+"@. c #D89999",
+"#. c #F38383",
+"$. c #F58383",
+"%. c #F58585",
+"&. c #F68787",
+"*. c #F68888",
+"=. c #F68989",
+"-. c #F68A8A",
+";. c #F78B8B",
+":. c #E39696",
+">. c #DEACAC",
+",. c #E5A5A5",
+"<. c #E6A5A5",
+"1. c #E9A5A5",
+"2. c #E4AAAA",
+"3. c #E6ABAB",
+"4. c #E8BCBC",
+"5. c #DACDCD",
+"6. c #DAD6D6",
+"7. c #DBDBDB",
+"8. c #DFDFDF",
+"9. c #E6D9D9",
+"0. c #E2DEDE",
+"q. c #E5DFDF",
+"w. c #E6DFDF",
+"e. c #E6E0E0",
+"r. c #E8E8E8",
+"t. c #ECECEC",
+"y. c #EDEDED",
+"u. c #F3EDED",
+"i. c #F1F1F1",
+"p. c #FCF7F7",
+"a. c #F9F9F9",
+"s. c #FEFEFE",
+"d. c None",
+/* pixels */
+"d.d.d.d.o o d.d.d.d.",
+"d.d.d.o 3 *.;.;.-.&.$.8 o d.d.d.",
+"d.d.o 4 #.P v v v v S o.< o d.d.",
+"d.o 6 #.P V v v v v V A X.> o d.",
+"o 7 #.L I 5.R v v Q 9.! Z .; o ",
+"O =.K v O.7.6.' E e.y.,.c C | O ",
+"@ *.v v B @.8.0.w.t.3.N x k } + ",
+"@ *.v v v B >.r.t.4.M l k j { + ",
+"@ *.v v v W w.t.i.u.] k j g ^ + ",
+"@ %.v v Y q.t.2.<.a.p.[ i % G + ",
+"O ..z f +.t.2.x h 1.s.:.# & D + ",
+"o 9 ` d y U t e w q T % * b a . ",
+"d.o 5 _ s r e w 0 $ # = n p X d.",
+"d.d.o , ) u w 0 $ # - m 2 X d.d.",
+"d.d.d.o : ( / ~ J H F 1 X d.d.d.",
+"d.d.d.d.o X d.d.d.d."
+};
+
+/* XPM */
+const char *right_arrow_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 100 2",
+" c #3A7304",
+". c #3A7404",
+"X c #3B7404",
+"o c #3B7504",
+"O c #3A7405",
+"+ c #3B7604",
+"@ c #3C7604",
+"# c #3C7804",
+"$ c #40790A",
+"% c #427A0E",
+"& c #437A10",
+"* c #467C14",
+"= c #4E9A06",
+"- c #4F9C06",
+"; c #4D8418",
+": c #538B1E",
+"> c #52A007",
+", c #54A408",
+"< c #57A709",
+"1 c #5AAC0B",
+"2 c #5BAE0B",
+"3 c #5EB30D",
+"4 c #5FB20E",
+"5 c #61B70E",
+"6 c #62B90E",
+"7 c #64BC0F",
+"8 c #64BA11",
+"9 c #66BF10",
+"0 c #66B817",
+"q c #6CBA1F",
+"w c #6CBF1C",
+"e c #568926",
+"r c #598C2A",
+"t c #5E8F30",
+"y c #5F8F31",
+"u c #68A92B",
+"i c #6BAC2F",
+"p c #6FBA26",
+"a c #6AA136",
+"s c #6EAC33",
+"d c #71A63E",
+"f c #74AF3B",
+"g c #78B63D",
+"h c #7FCB34",
+"j c #80BE44",
+"k c #82BE49",
+"l c #81AB5A",
+"z c #82AB5A",
+"x c #85B954",
+"c c #88BB58",
+"v c #8BBC5B",
+"b c #8BBB5D",
+"n c #8BBD5C",
+"m c #8CBE5C",
+"M c #84C249",
+"N c #88C44D",
+"B c #89C350",
+"V c #8AC255",
+"C c #8DC655",
+"Z c #8BC158",
+"A c #8CC358",
+"S c #8DC25A",
+"D c #8DC15C",
+"F c #92D352",
+"G c #8FC161",
+"H c #91C164",
+"J c #99C46F",
+"K c #9BCA6D",
+"L c #9CD267",
+"P c #9DC873",
+"I c #9EC976",
+"U c #9CC37A",
+"Y c #A0D56C",
+"T c #A3CA7E",
+"R c #A4CC7E",
+"E c #A5D773",
+"W c #A6D37B",
+"Q c #A7D17F",
+"! c #A8DA78",
+"~ c #A4C684",
+"^ c #AACE89",
+"/ c #AAD581",
+"( c #ABD681",
+") c #ABD781",
+"_ c #AFD48C",
+"` c #B1D291",
+"' c #B7D49C",
+"] c #B9D79C",
+"[ c #BBD99F",
+"{ c #BDD9A3",
+"} c #C0DBA7",
+"| c #C2DCAA",
+" . c #C3DCAB",
+".. c #C5DDAD",
+"X. c #C6DEAF",
+"o. c #C7DEB0",
+"O. c #CBE0B6",
+"+. c #CBE1B7",
+"@. c #CEE3BB",
+"#. c None",
+/* pixels */
+"#.#.#.#.#.o #.#.#.#.#.#.#.#.#.#.",
+"#.#.#.#.#. r . #.#.#.#.#.#.#.#.",
+"#.#.#.#.#. +.z . #.#.#.#.#.#.#.",
+"#.#.#.#.#. @. .~ & #.#.#.#.#.#.",
+". + O.J ` ' y X #.#.#.#.",
+" } | ..X.o.o.H G P [ l O #.#.#.",
+" { x c v n m D S V A _ U * #.#.",
+" ] f s u i g k B N M j K ^ t o ",
+" T = = = > < 2 4 0 q p C I e o ",
+" T = = - , 1 3 6 7 w L b % #.#.",
+" T T T R Q / 5 9 h ! d + #.#.#.",
+". # ( 8 F E : @ #.#.#.#.",
+"#.#.#.#.#. ) Y Z $ #.#.#.#.#.#.",
+"#.#.#.#.#. W a @ #.#.#.#.#.#.#.",
+"#.#.#.#.#. ; + #.#.#.#.#.#.#.#.",
+"#.#.#.#.#.o #.#.#.#.#.#.#.#.#.#."
+};
+
+/* XPM */
+const char *save_as_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 95 2",
+" c #000000",
+". c #4E6A7D",
+"X c #58787A",
+"o c #6E706B",
+"O c #6B716E",
+"+ c #72756B",
+"@ c #667173",
+"# c #627075",
+"$ c #38678B",
+"% c #3D698A",
+"& c #3B6B8F",
+"* c #3D6B8E",
+"= c #3F6C8E",
+"- c #4A6D85",
+"; c #436E88",
+": c #4A7180",
+"> c #41749A",
+", c #44789F",
+"< c #547D9B",
+"1 c #6B7F88",
+"2 c #5186AF",
+"3 c #5892BD",
+"4 c #688BA0",
+"5 c #6E99B6",
+"6 c #7798B0",
+"7 c #719FBF",
+"8 c #739FC0",
+"9 c #79A7CA",
+"0 c #92A6AC",
+"q c #95A9AF",
+"w c #9AAEB4",
+"e c #A2A4A1",
+"r c #A3A4A1",
+"t c #AEB0AD",
+"y c #AFB0AD",
+"u c #AEB0AE",
+"i c #AFB0AE",
+"p c #B7B8B6",
+"a c #C5CBBF",
+"s c #8FB3CE",
+"d c #92B7D3",
+"f c #96BBD8",
+"g c #9EBFD9",
+"h c #98BFDC",
+"j c #ACBCC3",
+"k c #9BC2DF",
+"l c #ABC8DF",
+"z c #ABCBE2",
+"x c #ACCBE3",
+"c c #B1CEE6",
+"v c #CACFC4",
+"b c #CED4C8",
+"n c #C9D6DD",
+"m c #DCDBDB",
+"M c #DBDCDB",
+"N c #DCDCDB",
+"B c #DCDBDC",
+"V c #DBDCDC",
+"C c #DCDCDC",
+"Z c #DDE1D6",
+"A c #DFE2DE",
+"S c #E2E6DD",
+"D c #C1D9EB",
+"F c #C5DBEC",
+"G c #D5DFE5",
+"H c #D0DFEF",
+"J c #E3E3E3",
+"K c #E4E4E4",
+"L c #E9E9EA",
+"P c #EAE9EA",
+"I c #EBECEC",
+"U c #ECECEC",
+"Y c #EDEDED",
+"T c #EDEEED",
+"R c #EDEDEE",
+"E c #EDEEEE",
+"W c #EEEEEE",
+"Q c #EEEFEE",
+"! c #EEEEEF",
+"~ c #EFEEEF",
+"^ c #EFEFEF",
+"/ c #F0F0F0",
+"( c #F1F1F1",
+") c #F2F2F2",
+"_ c #F3F3F3",
+"` c #F3F4F3",
+"' c #F4F4F4",
+"] c #F7F7F7",
+"[ c #F9F9F9",
+"{ c #FAFAFA",
+"} c #FCFBFC",
+"| c #FCFCFC",
+" . c #FDFDFD",
+".. c #FFFFFF",
+"X. c None",
+/* pixels */
+"X.X.X.$ $ $ % : X X.X.X.X.X.X.X.",
+"X.X.X.c H F k 4 ; X.X.X.X.X.X.X.",
+"1 @ # - > , g D 2 . o o o o o o ",
+"O S ..Z n 5 $ z d < G ......' o ",
+"+ .W Y A 6 $ 9 s * j R E T ` o ",
+"o } I $ $ $ $ 9 3 $ $ $ $ U _ o ",
+"o { L v $ h 7 7 7 8 f $ q P ) o ",
+"o [ { K a $ h 8 8 l $ 0 K ' ( o ",
+"o [ W { K a $ x h & 0 K { W ( o ",
+"o ] J W { { b = $ w { | W J / o ",
+"o r e r r r r r r r r r r r r o ",
+"o C m N C B N B C M V N V C o ",
+"o ^ y u i t y y y y ~ Q ! ~ o ",
+"o ..p p p p p p p p .. ......o ",
+"o .................... ......o ",
+"o o o o o o o o o o o o o o o o "
+};
+
+/* XPM */
+const char *save_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 107 2",
+" c #4E6A7D",
+". c #58787A",
+"X c #6E706B",
+"o c #6B716E",
+"O c #72756B",
+"+ c #667173",
+"@ c #627075",
+"# c #38678B",
+"$ c #3D698A",
+"% c #3B6B8F",
+"& c #3D6B8E",
+"* c #3F6C8E",
+"= c #4A6D85",
+"- c #436E88",
+"; c #4A7180",
+": c #41749A",
+"> c #44789F",
+", c #547D9B",
+"< c #6B7F88",
+"1 c #5186AF",
+"2 c #5892BD",
+"3 c #688BA0",
+"4 c #6E99B6",
+"5 c #7798B0",
+"6 c #719FBF",
+"7 c #739FC0",
+"8 c #79A7CA",
+"9 c #9F9F9F",
+"0 c #92A6AC",
+"q c #95A9AF",
+"w c #9AAEB4",
+"e c #A8A7A7",
+"r c #A8A7A8",
+"t c #A9A9A9",
+"y c #AAAAA9",
+"u c #AFAFAF",
+"i c #B4B4B4",
+"p c #B7B6B6",
+"a c #B9B9B9",
+"s c #BCBCBC",
+"d c #C5CBBF",
+"f c #8FB3CE",
+"g c #92B7D3",
+"h c #96BBD8",
+"j c #9EBFD9",
+"k c #98BFDC",
+"l c #ACBCC3",
+"z c #9BC2DF",
+"x c #ABC8DF",
+"c c #ABCBE2",
+"v c #ACCBE3",
+"b c #B1CEE6",
+"n c #C2C2C2",
+"m c #C3C3C3",
+"M c #C4C4C4",
+"N c #C5C5C5",
+"B c #CACFC4",
+"V c #C8C8C8",
+"C c #C9C9C9",
+"Z c #CACACA",
+"A c #CBCBCB",
+"S c #CDCDCD",
+"D c #CECECE",
+"F c #CFCFCF",
+"G c #CED4C8",
+"H c #C9D6DD",
+"J c #D0D0D0",
+"K c #D1D1D1",
+"L c #D2D2D2",
+"P c #D5D5D5",
+"I c #D6D6D6",
+"U c #DCDCDC",
+"Y c #DDDDDD",
+"T c #DDE1D6",
+"R c #DFE2DE",
+"E c #E2E6DD",
+"W c #C1D9EB",
+"Q c #C5DBEC",
+"! c #D5DFE5",
+"~ c #D0DFEF",
+"^ c #E3E3E3",
+"/ c #E4E4E4",
+"( c #E9E9EA",
+") c #EAE9EA",
+"_ c #EBEBEB",
+"` c #EBECEC",
+"' c #ECECEC",
+"] c #EDEDED",
+"[ c #EDEEED",
+"{ c #EDEDEE",
+"} c #EDEEEE",
+"| c #EEEEEE",
+" . c #F0F0F0",
+".. c #F1F1F1",
+"X. c #F2F2F2",
+"o. c #F3F3F3",
+"O. c #F3F4F3",
+"+. c #F4F4F4",
+"@. c #F7F7F7",
+"#. c #F9F9F9",
+"$. c #FAFAFA",
+"%. c #FCFBFC",
+"&. c #FCFCFC",
+"*. c #FDFDFD",
+"=. c #FEFEFE",
+"-. c #FFFFFF",
+";. c None",
+/* pixels */
+";.;.;.# # # $ ; . ;.;.;.;.;.;.;.",
+";.;.;.b ~ Q z 3 - ;.;.;.;.;.;.;.",
+"< + @ = : > j W 1 X X X X X X ",
+"o E -.T H 4 # c g , ! -.-.-.+.X ",
+"O *.| ] R 5 # 8 f & l { } [ O.X ",
+"X %.` # # # # 8 2 # # # # ' o.X ",
+"X $.( B # k 6 6 6 7 h # q ) X.X ",
+"X #.$./ d # k 7 7 x # 0 / +...X ",
+"X #.| $./ d # v k % 0 / $.| ..X ",
+"X @.^ | $.$.G * # w $.&.| ^ .X ",
+"X =.-.-.-.-.-.-.-.+.+._ _ ^ .X ",
+"X D C C C C N C C N N N N N I X ",
+"X D N 9 u s M V J t L t L a Z X ",
+"X S m y i n M V A r K e K p Z X ",
+"X Y U U U P P F F F F F F F Z X ",
+"X X X X X X X X X X X X X X X X "
+};
+
+/* XPM */
+const char *time_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 59 1",
+" c #2E3436",
+". c #32383A",
+"X c #383E40",
+"o c #393E40",
+"O c #3B4042",
+"+ c #404648",
+"@ c #414748",
+"# c #4A5052",
+"$ c #4C5153",
+"% c #4D5254",
+"& c #555753",
+"* c #61635F",
+"= c #636561",
+"- c #646662",
+"; c #686A66",
+": c #6E706C",
+"> c #7C7E79",
+", c #818485",
+"< c #888A85",
+"1 c #939591",
+"2 c #959798",
+"3 c #9B9C9A",
+"4 c #A0A2A3",
+"5 c #AAABA8",
+"6 c #B0B1AE",
+"7 c #B0B2B3",
+"8 c #B8B9B7",
+"9 c #C2C3C1",
+"0 c #C3C4C2",
+"q c #C2C4C4",
+"w c #C5C6C6",
+"e c #C8C8C8",
+"r c #CACAC9",
+"t c #C8C9CA",
+"y c #C9C9CA",
+"u c #CACBCA",
+"i c #CDCECD",
+"p c #CECFCE",
+"a c #D2D2D2",
+"s c #D6D6D6",
+"d c #D9D9D9",
+"f c #DFDFDF",
+"g c #E0E0E0",
+"h c #E1E1E1",
+"j c #E2E2E2",
+"k c #E3E3E2",
+"l c #E3E3E3",
+"z c #E4E4E4",
+"x c #E6E6E6",
+"c c #E7E7E7",
+"v c #E9E9E9",
+"b c #ECECEC",
+"n c #EEEEEE",
+"m c #F1F1F1",
+"M c #F3F3F3",
+"N c #FBFBFA",
+"B c #FDFDFD",
+"V c #FFFFFF",
+"C c None",
+/* pixels */
+"CC<<CCC<CCC<CCCC",
+"C<<<<<<<<<<<<<CC",
+"<V<0VV<sBB<sBV<C",
+"<V<1xx<<kx<<xV<C",
+"<VsdxxsszxsssV<C",
+">Vxzt,j$+7ccxV>C",
+">Vnx% f2e#xxpV>C",
+">Vnxf fq at 4xxrV>C",
+";Vxxf f.ywxi9V;C",
+";Vxxf fOoXxi9V;C",
+"=VxllglhhhaMBN=C",
+"-Vxvbnmxpu8M63-C",
+"-VVVVVVVVVVV5:-C",
+"=*************-C",
+"C <&&&&&&&&&& CC",
+"C CC"
+};
+
+/* XPM */
+const char *trash_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 130 2",
+" c #535A22",
+". c #545B23",
+"X c #575E26",
+"o c #5B6129",
+"O c #5D6329",
+"+ c #61682A",
+"@ c #666D2D",
+"# c #6C732F",
+"$ c #6F7731",
+"% c #737B32",
+"& c #767F33",
+"* c #494D4C",
+"= c #5C5E59",
+"- c #5E605C",
+"; c #61635E",
+": c #62645F",
+"> c #636561",
+", c #646663",
+"< c #666863",
+"1 c #686A65",
+"2 c #686A66",
+"3 c #6A6C68",
+"4 c #6B6D68",
+"5 c #6D6F6B",
+"6 c #70726D",
+"7 c #70726E",
+"8 c #727470",
+"9 c #737571",
+"0 c #757773",
+"q c #767B77",
+"w c #787A75",
+"e c #797B77",
+"r c #788134",
+"t c #7A8235",
+"y c #798237",
+"u c #7F865E",
+"i c #81893A",
+"p c #8B943E",
+"a c #879042",
+"s c #899245",
+"d c #8B9348",
+"f c #8C9548",
+"g c #909946",
+"h c #929C4A",
+"j c #959E49",
+"k c #969F4A",
+"l c #919A4C",
+"z c #949D4F",
+"x c #8A9259",
+"c c #8A915C",
+"v c #939A59",
+"b c #98A247",
+"n c #96A04F",
+"m c #9CA64D",
+"M c #98A150",
+"N c #9AA252",
+"B c #9FA956",
+"V c #A5AE49",
+"C c #A0A956",
+"Z c #A6AF55",
+"A c #A8B154",
+"S c #ADB757",
+"D c #A9B259",
+"F c #ADB75C",
+"G c #AEB75D",
+"H c #B2BD50",
+"J c #B3BE50",
+"K c #B3BD5A",
+"L c #888E69",
+"P c #8C9162",
+"I c #9FA46B",
+"U c #A7AF67",
+"Y c #A1A76E",
+"T c #A9B260",
+"R c #AAB263",
+"E c #AAB264",
+"W c #B2BB64",
+"Q c #A3AB72",
+"! c #A5AC72",
+"~ c #A8AD75",
+"^ c #ADB17E",
+"/ c #ACB27E",
+"( c #B5C051",
+") c #B8C257",
+"_ c #B9C35D",
+"` c #BBC55F",
+"' c #BBC561",
+"] c #BCC661",
+"[ c #BCC662",
+"{ c #BDC763",
+"} c #B8C065",
+"| c #BDC765",
+" . c #BBC469",
+".. c #BAC36D",
+"X. c #BDC675",
+"o. c #C7D07E",
+"O. c #989A94",
+"+. c #B2B881",
+"@. c #B5BB82",
+"#. c #B7BE81",
+"$. c #B8BE84",
+"%. c #A9AD94",
+"&. c #B6BBA6",
+"*. c #B1B4AD",
+"=. c #BCC286",
+"-. c #BFC687",
+";. c #C3CA89",
+":. c #C7CC8B",
+">. c #C9D181",
+",. c #CAD184",
+"<. c #C9D18D",
+"1. c #CCD28E",
+"2. c #C3CA99",
+"3. c #C4CB9E",
+"4. c #CDD590",
+"5. c #CBD09E",
+"6. c #CCD29D",
+"7. c #CCD19F",
+"8. c #D0D691",
+"9. c #D1D793",
+"0. c #C8CEA5",
+"q. c #CDD2A1",
+"w. c #D2D7B9",
+"e. c #D3D8BB",
+"r. c #D3D9BB",
+"t. c #D4D9BB",
+"y. c #D4D9BC",
+"u. c #D6DBC8",
+"i. c #DBE0D7",
+"p. c None",
+/* pixels */
+"p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.",
+"p.p.. . . . . . . . . . . . p.p.",
+"p.u i.i.i.i.i.i.i.i.i.i.i.i.L p.",
+". i.q = - ; > < 2 4 5 6 8 *.i.. ",
+". i.* : , 1 3 5 7 9 0 w e O.i.. ",
+". &.i.i.i.i.i.i.i.i.i.i.i.i.%.. ",
+". . v t r & % $ # @ + O o X . ",
+"p.. o.( ( J V Z E b p i y x . p.",
+"p.. o.( ( H } u.u.5.C j f c . p.",
+"p.. >.( ( 6...W 7.q.B N z I . p.",
+"p.. ,.) ] t.u.F D T #.M l ! . p.",
+"p.. 8.| { r.X.G 0.R w.n d ~ . p.",
+"p.. 9.[ ' .q.2.y.e.U h s Q . p.",
+"p.. 4.` _ K S A 3.m k g a Y . p.",
+"p.. ^ 1.<.:.;.-.=.$. at .+./ P . p.",
+"p.p.. . . . . . . . . . . . p.p."
+};
+
+/* XPM */
+const char *image_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 86 1",
+" c #233659",
+". c #384151",
+"X c #2F4262",
+"o c #374762",
+"O c #33476A",
+"+ c #34486A",
+"@ c #3B4C6B",
+"# c #384C6E",
+"$ c #3D4E6D",
+"% c #3D4F6D",
+"& c #3F516F",
+"* c #3D5071",
+"= c #515151",
+"- c #45546E",
+"; c #435470",
+": c #455672",
+"> c #475773",
+", c #405374",
+"< c #415474",
+"1 c #485773",
+"2 c #495973",
+"3 c #67758F",
+"4 c #5072A3",
+"5 c #5475A4",
+"6 c #5778A6",
+"7 c #5B7BA8",
+"8 c #5F7EAA",
+"9 c #617FAB",
+"0 c #7A8698",
+"q c #7D899D",
+"w c #6180AD",
+"e c #6381AD",
+"r c #6583AF",
+"t c #6884AA",
+"y c #718DA7",
+"u c #6986B1",
+"i c #6D89B3",
+"p c #728DB6",
+"a c #738EB6",
+"s c #7590B7",
+"d c #7892B9",
+"f c #888A85",
+"g c #818A9A",
+"h c #818DA2",
+"j c #8691A3",
+"k c #819AB8",
+"l c #8099BD",
+"z c #839ABE",
+"x c #869CBF",
+"c c #8FA6AF",
+"v c #9CA7B9",
+"b c #9EA8BA",
+"n c #9EA9BA",
+"m c #9FA9BB",
+"M c #A4B8A9",
+"N c #B6C5B2",
+"B c #B3C2B7",
+"V c #C4D1AF",
+"C c #C5D1B1",
+"Z c #D1DCB1",
+"A c #DCE5B9",
+"S c #E2EBBE",
+"D c #889EC1",
+"F c #8CA1C1",
+"G c #8EA3C4",
+"H c #93A6C6",
+"J c #95A8C7",
+"K c #9DAFC7",
+"L c #96A9C8",
+"P c #98ABC9",
+"I c #9AACCA",
+"U c #A1B3C3",
+"Y c #A2B3CE",
+"T c #A5B5D0",
+"R c #A6B6D1",
+"E c #A7B7D1",
+"W c #A8B7D1",
+"Q c #A8B8D2",
+"! c #EEF3CB",
+"~ c #F7FADF",
+"^ c #FCFDEE",
+"/ c #F6F6F6",
+"( c #FEFEF9",
+") c #FDFDFD",
+"_ c #FEFEFE",
+"` c #FFFFFE",
+/* pixels */
+"ffffffffffffffff",
+"f______________f",
+"f)0oooooooooo0/f",
+"f_&9ety876554o/f",
+"f);acA!Miurrwo/f",
+"f):lV(`Skdsspo/f",
+"f)>GN~^ZFDxxzo/f",
+"f)1IKBCUPLqJHo/f",
+"f)2WQQWERT=jYo/f",
+"f)-mmmmnbv==go/f",
+"f)o$%%$@X ==.o/f",
+"f)o<,*#+O====o/f",
+"f)oh333333333o/f",
+"f)0oooooooooo0/f",
+"f_////////////)f",
+"ffffffffffffffff"
+};
+
+/* XPM */
+const char *weather_clear_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 76 1",
+" c #FCAF3E",
+". c #FBB13E",
+"X c #FBB13F",
+"o c #FCB03E",
+"O c #FCB13E",
+"+ c #FCB23E",
+"@ c #FCB33E",
+"# c #FCB23F",
+"$ c #FCB33F",
+"% c #FAB43F",
+"& c #FBB43F",
+"* c #FCB43F",
+"= c #FAB545",
+"- c #FBB94A",
+"; c #FCB953",
+": c #FBBA57",
+"> c #FCBC57",
+", c #FBBD5B",
+"< c #FBD349",
+"1 c #FCD549",
+"2 c #FCE34E",
+"3 c #FCE956",
+"4 c #FCEA57",
+"5 c #FCE459",
+"6 c #FCE55D",
+"7 c #FCE959",
+"8 c #FCEA5A",
+"9 c #FCC66D",
+"0 c #FCD964",
+"q c #FBDB6C",
+"w c #FCC470",
+"e c #FCC570",
+"r c #FCEB65",
+"t c #FCE768",
+"y c #FCEC68",
+"u c #FCE86E",
+"i c #FCED71",
+"p c #FCCC82",
+"a c #FDCD83",
+"s c #FCCD84",
+"d c #FCEF81",
+"f c #FCEF82",
+"g c #FCEF84",
+"h c #FCEF87",
+"j c #FDF089",
+"k c #FDF08B",
+"l c #FDF08C",
+"z c #FDEAAD",
+"x c #FDF3A1",
+"c c #FDF0A2",
+"v c #FDF3A2",
+"b c #FDF1AA",
+"n c #FCF4AB",
+"m c #FDF4AC",
+"M c #FCF4AD",
+"N c #FDF4AE",
+"B c #FDECB4",
+"V c #FDE6BF",
+"C c #FDF4B0",
+"Z c #FDF5B1",
+"A c #FDF6BE",
+"S c #FDE6C1",
+"D c #FEF8CE",
+"F c #FEF9CF",
+"G c #FEF8D0",
+"H c #FEF9D0",
+"J c #FEF9DF",
+"K c #FEFAE3",
+"L c #FEF8E7",
+"P c #FEF9E7",
+"I c #FEFCEF",
+"U c #FEFCF0",
+"Y c #FEFDF0",
+"T c #FEFCF1",
+"R c #FEFEFB",
+"E c None",
+/* pixels */
+"EEEEEEEEEEEEEEEE",
+"EEEEEEEoOEEEEEEE",
+"EEEEEEEOOEEEEEEE",
+"EEE #Eapw;E+ EEE",
+"EEE+9VPUJz:$#EEE",
+"EEEESRIDCMc=EEEE",
+"EEEaLYYFmjh0 at EEE",
+"EOOsTGHAxdyt.OoE",
+"EoOeKZNvli75XOOE",
+"EEE>Bnkfi84<#EEE",
+"EEEE,bgr342%EEEE",
+"EEE#*-qu61&@+EEE",
+"EEE +E#X. at E# EEE",
+"EEEEEEEOOEEEEEEE",
+"EEEEEEEOoEEEEEEE",
+"EEEEEEEEEEEEEEEE"
+};
+
+/* XPM */
+const char *start_here_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 52 1",
+" c #204A87",
+". c #204A88",
+"X c #204B88",
+"o c #214B88",
+"O c #214B89",
+"+ c #214C89",
+"@ c #234E8B",
+"# c #234F8C",
+"$ c #244F8C",
+"% c #24508D",
+"& c #25508E",
+"* c #25518F",
+"= c #285593",
+"- c #295694",
+"; c #2A5896",
+": c #2C5B99",
+"> c #2D5C9A",
+", c #2F5F9D",
+"< c #2F5F9E",
+"1 c #30609F",
+"2 c #31619F",
+"3 c #3162A0",
+"4 c #3465A4",
+"5 c #3566A4",
+"6 c #3566A5",
+"7 c #3667A5",
+"8 c #3667A6",
+"9 c #3768A6",
+"0 c #3868A6",
+"q c #3869A7",
+"w c #3A6AA8",
+"e c #3D6EAA",
+"r c #4070AC",
+"t c #4272AD",
+"y c #4474AF",
+"u c #4575B0",
+"i c #4E7DB6",
+"p c #507FB7",
+"a c #5080B8",
+"s c #5180B8",
+"d c #5483BA",
+"f c #5B8ABF",
+"g c #5D8BC0",
+"h c #5E8CC1",
+"j c #6492C5",
+"k c #6593C6",
+"l c #6795C7",
+"z c #6895C8",
+"x c #6996C8",
+"c c #6B98CA",
+"v c #729FCF",
+"b c None",
+/* pixels */
+"bbbbbbbbbb. obbb",
+"bb750bbbbb at 2;Xbb",
+"bbexd8bbbX144#bb",
+"b7lvvrbbbX444- b",
+"b7vvva5bb%444>Ob",
+"btvvvhqb -4443 b",
+"4svvvc6bb-4441Xb",
+"bpvvvz7bb&444:Ob",
+"byvvvfqbb+444=bb",
+"bwvvvibbb bb",
+"b44444bbbbbbbbbb",
+"bbbbbbbbb bb",
+"b64444bbbo>4,obb",
+"b0gvj9bbbb$<*Xbb",
+"bbrku7bbbb Xbbb",
+"bb668bbbbbbbbbbb"
+};
+
+/* XPM */
+const char *help_browser_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 153 2",
+" c #204A87",
+". c #214B88",
+"X c #224B88",
+"o c #224C88",
+"O c #234C89",
+"+ c #234D89",
+"@ c #244E8A",
+"# c #254F8A",
+"$ c #254F8B",
+"% c #264F8B",
+"& c #27508B",
+"* c #2A538E",
+"= c #2C548D",
+"- c #2D558D",
+"; c #2D558E",
+": c #2E558F",
+"> c #2F578F",
+", c #2D5690",
+"< c #2F5891",
+"1 c #315891",
+"2 c #365C93",
+"3 c #325B94",
+"4 c #335B94",
+"5 c #335C94",
+"6 c #345C95",
+"7 c #345D95",
+"8 c #385E94",
+"9 c #386097",
+"0 c #3B6096",
+"q c #386098",
+"w c #3A6299",
+"e c #3B639A",
+"r c #3C649A",
+"t c #40679D",
+"y c #42699F",
+"u c #436A9F",
+"i c #47699C",
+"p c #4B6E9F",
+"a c #456CA1",
+"s c #466DA1",
+"d c #496FA3",
+"f c #4D6FA0",
+"g c #4B72A5",
+"h c #4C72A5",
+"j c #4D73A6",
+"k c #5176A7",
+"l c #5878A5",
+"z c #5978A6",
+"x c #5B7AA7",
+"c c #5C7BA7",
+"v c #5278A9",
+"b c #547AAC",
+"n c #567CAD",
+"m c #597AA8",
+"M c #5D7CA8",
+"N c #5A7FB0",
+"B c #617EAA",
+"V c #5E83B2",
+"C c #6381AB",
+"Z c #6482AC",
+"A c #6582AC",
+"S c #6482AD",
+"D c #6A86AF",
+"F c #6284B2",
+"G c #6587B3",
+"H c #6085B4",
+"J c #6286B4",
+"K c #6387B6",
+"L c #6987B1",
+"P c #6589B7",
+"I c #6B88B2",
+"U c #6B89B3",
+"Y c #6C88B0",
+"T c #6D8BB5",
+"R c #6C8DB7",
+"E c #678BB9",
+"W c #6A8EBA",
+"Q c #6B8FBB",
+"! c #718DB5",
+"~ c #728FB7",
+"^ c #6F92BD",
+"/ c #7191BB",
+"( c #7093BF",
+") c #7594BD",
+"_ c #7296C1",
+"` c #7396C1",
+"' c #7497C1",
+"] c #7999C1",
+"[ c #789BC5",
+"{ c #829DC1",
+"} c #86A1C3",
+"| c #89A1C2",
+" . c #8CA1C1",
+".. c #8CA2C1",
+"X. c #8BA5C7",
+"o. c #8FA8C8",
+"O. c #90A5C3",
+"+. c #94A9C6",
+"@. c #94ADCC",
+"#. c #9BAFCB",
+"$. c #9BB2D1",
+"%. c #9FB7D5",
+"&. c #9DB7D6",
+"*. c #A0B4CF",
+"=. c #A0B5D0",
+"-. c #A7B8D0",
+";. c #A6B9D3",
+":. c #A0B9D7",
+">. c #A9B9D0",
+",. c #AABAD1",
+"<. c #ADBCD3",
+"1. c #B7C6DA",
+"2. c #BDC9DB",
+"3. c #BAC9DD",
+"4. c #BDCADC",
+"5. c #C0CCDD",
+"6. c #C2CEDE",
+"7. c #C6D2E1",
+"8. c #C8D4E4",
+"9. c #CAD6E5",
+"0. c #CBD6E5",
+"q. c #C9D7E7",
+"w. c #CCD7E6",
+"e. c #CDDAE9",
+"r. c #D1DBE8",
+"t. c #D6DEE9",
+"y. c #E3E8F0",
+"u. c #E4E9F0",
+"i. c #E5EAF1",
+"p. c #E6EAF1",
+"a. c #E6EBF2",
+"s. c #E7EBF2",
+"d. c #E8ECF3",
+"f. c #E8EDF3",
+"g. c #E9EDF3",
+"h. c #E9EEF3",
+"j. c #EBEFF4",
+"k. c #EDF0F5",
+"l. c #EDF1F7",
+"z. c #EFF2F6",
+"x. c #EFF3F7",
+"c. c #EFF3F8",
+"v. c #F0F3F7",
+"b. c #F0F3F8",
+"n. c #F1F4F8",
+"m. c #F1F5F9",
+"M. c #F2F5F9",
+"N. c #F9FBFC",
+"B. c #FBFCFD",
+"V. c #FDFDFE",
+"C. c #FEFEFE",
+"Z. c #FFFFFF",
+"A. c None",
+/* pixels */
+"A.A.A.A.A. A.A.A.A.A.",
+"A.A.A.A.= .2.j.j.2...= A.A.A.A.",
+"A.A. x y.>.A 0 0 A ,.u.c A.A.",
+"A.A.B s.z i 6.v.p.-.f S f.M A.A.",
+"A.; i.l Y V.t.z.Z.4.q U a.- A.",
+" O.>. p f 3 m Z.B.s u 1.+. ",
+" 5.A & , 6 w | Z.d.g j } 7.O ",
+" k.2 # , 7 e T N.C.{ b n R x.. ",
+" k.8 * 4 w y f.Z.=.N V H ) b.X ",
+" 5.D < 9 t k 8.9.J K E W $.w.@ ",
+" O.<.5 r a v o. at .P Q ( ` q.*.. ",
+"A.; a.L t d F Z.Z.^ _ [ &.l.> A.",
+"A.A.C h.~ h G Z.Z.' [ :.m.I A.A.",
+"A.A. Z g.3.X./ ] %.e.c.! % A.A.",
+"A.A.A.A.: #.0.n.M.r.;.1 A.A.A.A.",
+"A.A.A.A.A. + o o $ . A.A.A.A.A."
+};
+
+/* XPM */
+const char *system_software_update_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 165 2",
+" c #364878",
+". c #774861",
+"X c #6E5471",
+"o c #6F5674",
+"O c #705472",
+"+ c #9E080B",
+"@ c #991116",
+"# c #A40000",
+"$ c #931821",
+"% c #843345",
+"& c #405583",
+"* c #4E648F",
+"= c #516790",
+"- c #506A96",
+"; c #576F95",
+": c #5A6B93",
+"> c #5B6D94",
+", c #546E98",
+"< c #597199",
+"1 c #58749D",
+"2 c #5A769F",
+"3 c #686284",
+"4 c #656588",
+"5 c #6B7B9F",
+"6 c #5877A2",
+"7 c #5C77A1",
+"8 c #5978A2",
+"9 c #5979A3",
+"0 c #5A79A3",
+"q c #5A79A4",
+"w c #5A7AA4",
+"e c #5D7DA6",
+"r c #607AA3",
+"t c #617FA8",
+"y c #4F80B6",
+"u c #5685B7",
+"i c #5686BA",
+"p c #5988BC",
+"a c #5C8ABD",
+"s c #6983A6",
+"d c #768BAD",
+"f c #6D90B7",
+"g c #7591B4",
+"h c #7792B6",
+"j c #7994B6",
+"k c #7A95B7",
+"l c #7E97B9",
+"z c #628FC1",
+"x c #6B96C6",
+"c c #6C96C5",
+"v c #719BC9",
+"b c #759FCB",
+"n c #8593B1",
+"m c #9DA6AE",
+"M c #AEB5BC",
+"N c #8BA7C7",
+"B c #84A6CA",
+"V c #83A7CE",
+"C c #95A7C2",
+"Z c #93ABC7",
+"A c #9EADC5",
+"S c #94ACC8",
+"D c #9AB0CB",
+"F c #9CB2CB",
+"G c #9BB2CC",
+"H c #9DB3CD",
+"J c #9FB4CE",
+"K c #80A7D1",
+"L c #93B6DC",
+"P c #A4B5C9",
+"I c #A5B7C9",
+"U c #A0B4CD",
+"Y c #A3B6CE",
+"T c #AFB8CB",
+"R c #ADB9CE",
+"E c #BABFC4",
+"W c #B8BFC6",
+"Q c #B5BEC8",
+"! c #B4BCCD",
+"~ c #A3B8D0",
+"^ c #A9BCD1",
+"/ c #AABED3",
+"( c #A2BDDA",
+") c #9CBDE0",
+"_ c #B7C2CD",
+"` c #BCC4CC",
+"' c #B3C1D0",
+"] c #B1C2D6",
+"[ c #BEC7D0",
+"{ c #BCC8D4",
+"} c #BECAD6",
+"| c #B4C7DC",
+" . c #B7C8DC",
+".. c #BECBDA",
+"X. c #B8C9DD",
+"o. c #BCCDDF",
+"O. c #ACCAE9",
+"+. c #BECFE1",
+"@. c #B3CCE8",
+"#. c #B1CEEC",
+"$. c #B5D1EE",
+"%. c #BED4EB",
+"&. c #BCD7F2",
+"*. c #C0C6CE",
+"=. c #C7CDD2",
+"-. c #C4CAD6",
+";. c #C8CED4",
+":. c #C8CFD5",
+">. c #C6CFD8",
+",. c #CED0D1",
+"<. c #CED1D3",
+"1. c #CAD5DF",
+"2. c #D1D1D1",
+"3. c #D3D3D3",
+"4. c #D7D9DB",
+"5. c #D9DCDF",
+"6. c #DCDDDF",
+"7. c #C3D2E3",
+"8. c #CCD7E2",
+"9. c #CFD9E2",
+"0. c #CEDBEA",
+"q. c #CCDDEF",
+"w. c #DBDEE0",
+"e. c #D5DFE9",
+"r. c #D6DFE9",
+"t. c #D5DFEB",
+"y. c #DFE1E3",
+"u. c #DCE1E5",
+"i. c #D9E1E9",
+"p. c #DCE3E9",
+"a. c #DCE4ED",
+"s. c #C9E1F9",
+"d. c #CCE3FA",
+"f. c #D4E5F6",
+"g. c #D2E5F9",
+"h. c #D5E8FC",
+"j. c #DAEAFA",
+"k. c #DEEDFB",
+"l. c #DAEBFC",
+"z. c #DEEEFF",
+"x. c #DFEFFF",
+"c. c #E0E0E0",
+"v. c #E2E2E2",
+"b. c #E3E4E5",
+"n. c #E2E4E6",
+"m. c #E4E6E8",
+"M. c #EDEEEF",
+"N. c #EFEFEF",
+"B. c #E6EBF0",
+"V. c #E6EBF4",
+"C. c #E0EFFF",
+"Z. c #E2EFFE",
+"A. c #E1F0FF",
+"S. c #E2F1FF",
+"D. c #E3F1FF",
+"F. c #F1F2F3",
+"G. c #F4F4F5",
+"H. c #F5F5F5",
+"J. c #F6F6F6",
+"K. c #F8F9F9",
+"L. c #F9F9F9",
+"P. c #FBFBFB",
+"I. c #FDFDFD",
+"U. c #FEFEFE",
+"Y. c None",
+/* pixels */
+"Y. 8 6 Y.Y.Y.Y.Y.Y.",
+"Y.Y. 5 a.V.t.] l 9 Y.Y.Y.Y.",
+"Y.Y., : ! 9.E ..%.} i.Y 0 Y.Y.Y.",
+"Y.< : -.<.Z.k.f.{ *.w.B.U w Y.Y.",
+"* T b.1.S.D.j.>.4.G.P.e.j Y.Y.",
+"= > 5.q.C.A.A.l.=.[ P Q m.~ w Y.",
+"& n / d.z.x.x.0.I.U.I.n.6.o.3 Y.",
+" R O.&.s.h.g.:.U.U.U.L.M 7.O Y.",
+"- A _ ;. at .$.#.^ K.F.U.N.,.X.o Y.",
+"7 C u.U.y.( ) L B N H.v.m H % # ",
+"r k r.U.U.M.V K b c c.3.I d @ # ",
+"Y.t F p.J.W v x z p 2.` S . # Y.",
+"Y.Y.e D 8.f a i y u ' Z 4 + Y.Y.",
+"Y.Y.Y.s h J .+.| G g X + Y.Y.Y.",
+"Y.Y.Y.Y.; 2 0 q 8 1 $ # # # Y.Y.",
+"Y.Y.Y.Y.Y.Y.Y.Y.# # # # # # # Y."
+};
+
+/* XPM */
+const char *utilities_terminal_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 163 2",
+" c #000000",
+". c #010201",
+"X c #020302",
+"o c #060606",
+"O c #060706",
+"+ c #070706",
+"@ c #070806",
+"# c #080807",
+"$ c #090908",
+"% c #0A0B09",
+"& c #0B0C0A",
+"* c #0D0E0C",
+"= c #0F100D",
+"- c #131412",
+"; c #181F11",
+": c #182011",
+"> c #192011",
+", c #273019",
+"< c #273119",
+"1 c #26311A",
+"2 c #27311A",
+"3 c #27321A",
+"4 c #27321B",
+"5 c #28321A",
+"6 c #28331B",
+"7 c #28341B",
+"8 c #29331D",
+"9 c #29341C",
+"0 c #29351C",
+"q c #232423",
+"w c #2F312D",
+"e c #343633",
+"r c #364323",
+"t c #364423",
+"y c #364523",
+"u c #374523",
+"i c #374525",
+"p c #3B4A26",
+"a c #3B4A27",
+"s c #3C4B27",
+"d c #3C4C27",
+"f c #46562B",
+"g c #46572C",
+"h c #4E5E36",
+"j c #4C563D",
+"k c #4C5A3A",
+"l c #4E6132",
+"z c #4F6232",
+"x c #4F6332",
+"c c #536537",
+"v c #545851",
+"b c #555952",
+"n c #5A5E57",
+"m c #5F625B",
+"M c #616E4D",
+"N c #657C41",
+"B c #616A55",
+"V c #62655E",
+"C c #647151",
+"Z c #657152",
+"A c #697850",
+"S c #6A7559",
+"D c #636660",
+"F c #646860",
+"G c #656961",
+"H c #6A6E66",
+"J c #6F736B",
+"K c #737D64",
+"L c #747772",
+"P c #747870",
+"I c #767972",
+"U c #777A73",
+"Y c #787C74",
+"T c #797D75",
+"R c #7D7F79",
+"E c #758954",
+"W c #73825F",
+"Q c #768560",
+"! c #798764",
+"~ c #7B8865",
+"^ c #7C8967",
+"/ c #7A846C",
+"( c #7E8B69",
+") c #7F8C6B",
+"_ c #7D8079",
+"` c #7E807A",
+"' c #7E817A",
+"] c #808D6D",
+"[ c #859869",
+"{ c #828E70",
+"} c #81837D",
+"| c #81837E",
+" . c #82857E",
+".. c #83867E",
+"X. c #849071",
+"o. c #849074",
+"O. c #8C9D72",
+"+. c #8E9F74",
+"@. c #90A076",
+"#. c #92A279",
+"$. c #94A27D",
+"%. c #95A47F",
+"&. c #848681",
+"*. c #868782",
+"=. c #878983",
+"-. c #878A82",
+";. c #888B83",
+":. c #8A8C87",
+">. c #8B8C87",
+",. c #8C8F87",
+"<. c #8D8F8A",
+"1. c #8D9088",
+"2. c #8F918C",
+"3. c #91928D",
+"4. c #92958D",
+"5. c #939590",
+"6. c #969893",
+"7. c #979A92",
+"8. c #989995",
+"9. c #989996",
+"0. c #9A9B97",
+"q. c #999C94",
+"w. c #97A681",
+"e. c #99A38A",
+"r. c #9DA098",
+"t. c #A2B387",
+"y. c #A4B58A",
+"u. c #A5B68D",
+"i. c #A8B88E",
+"p. c #A0A19D",
+"a. c #A2A59C",
+"s. c #A3A69D",
+"d. c #A3A69E",
+"f. c #A9B990",
+"g. c #AABA92",
+"h. c #ACBC94",
+"j. c #AEBD97",
+"k. c #AFBE98",
+"l. c #B1BF9B",
+"z. c #B0B1AE",
+"x. c #B2B4B1",
+"c. c #B4B6B1",
+"v. c #B7B9B4",
+"b. c #C0C1BE",
+"n. c #CCCDCB",
+"m. c #CDCECC",
+"M. c #CDD2C6",
+"N. c #CED1C8",
+"B. c #CFD3CB",
+"V. c #D3D6CD",
+"C. c #D6D7D5",
+"Z. c #D7D7D5",
+"A. c #D7D8D6",
+"S. c #D7D8D7",
+"D. c #D9DED4",
+"F. c #DBDBD9",
+"G. c #DDDDDC",
+"H. c #DDDEDC",
+"J. c #DDDEDD",
+"K. c #E0E3DB",
+"L. c #ECEDEA",
+"P. c #F2F3F1",
+"I. c None",
+/* pixels */
+"I.r.q.4.1.;...' T P J H G V n I.",
+"s.c.Z.J.H.G.G.G.G.G.G.F.n.x.L b ",
+"s.C.e # # # # # # # # + + w 9.b ",
+"a.S.= l.k.j.h.g.f.i.u.y.t. 0.v ",
+"a.S.* o.X.{ ] ) ( ^ ~ ! Q 6.v ",
+"a.S.& w.%.$.#. at .+.O.[ E N 5.v ",
+"a.S.% S D./ Z C M h f f g 3.v ",
+"a.S.$ W e.K.M.A c l z z x <.v ",
+"a.S.@ j B B.V.i r t t y u :.v ",
+"a.S.+ k N.K a p p p s s d =.v ",
+"a.S.+ 8 2 , < P.P.P.L.5 5 &.v ",
+"a.S.O 1 3 4 4 6 6 7 9 9 0 } v ",
+"a.S.o ; ; ; ; ; ; ; : > > ` v ",
+"s.A.q X . . . . . . . . . - I b ",
+"d.v.m.b.z.p.8.5.2.>.*.| R U D b ",
+"I.r.7.4.,.-. ._ Y P J H F m n I."
+};
+
+/* XPM */
+const char *emblem_symbolic_link_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 70 1",
+" c #888A85",
+". c #AAABA8",
+"X c #B6B7B4",
+"o c #BFC0BE",
+"O c #C0C1BF",
+"+ c #C1C2C0",
+"@ c #C7C8C6",
+"# c #E3E3E3",
+"$ c #E4E3E4",
+"% c #E4E4E4",
+"& c #E4E5E4",
+"* c #E4E4E5",
+"= c #E5E5E5",
+"- c #E5E6E5",
+"; c #E6E6E6",
+": c #E6E7E6",
+"> c #E7E7E6",
+", c #E8E8E8",
+"< c #E9E8E8",
+"1 c #E8E8E9",
+"2 c #E8E9E9",
+"3 c #E9E9E9",
+"4 c #EAE9E9",
+"5 c #E9E9EA",
+"6 c #EAEAEA",
+"7 c #EBEAEA",
+"8 c #EAEBEA",
+"9 c #EAEBEB",
+"0 c #EBEBEB",
+"q c #ECECEB",
+"w c #ECEBEC",
+"e c #ECECEC",
+"r c #EDEDED",
+"t c #EDEEED",
+"y c #EDEDEE",
+"u c #EEEEEE",
+"i c #EFEFEE",
+"p c #EFEEEF",
+"a c #EFEFEF",
+"s c #EFF0EF",
+"d c #F0F0F0",
+"f c #F1F1F1",
+"g c #F2F1F1",
+"h c #F1F2F1",
+"j c #F2F2F1",
+"k c #F2F1F2",
+"l c #F2F2F2",
+"z c #F3F3F3",
+"x c #F3F3F4",
+"c c #F4F4F4",
+"v c #F5F5F4",
+"b c #F4F5F5",
+"n c #F5F5F5",
+"m c #F6F5F6",
+"M c #F5F6F6",
+"N c #F6F6F6",
+"B c #F7F6F6",
+"V c #F8F8F8",
+"C c #F9F9F9",
+"Z c #F9FAF9",
+"A c #FAFAFA",
+"S c #FBFAFB",
+"D c #FBFBFB",
+"F c #FCFBFB",
+"G c #FCFCFC",
+"H c #FDFDFC",
+"J c #FDFDFD",
+"K c #FEFEFE",
+"L c #FFFFFF",
+"P c None",
+/* pixels */
+"P P",
+" LLLLLLLLLLLLLL ",
+" L############J ",
+" L############J ",
+" L###%=;:;-*$#J ",
+" L#%oX..O42.;&D ",
+" L%@<6...+..3>D ",
+" L;10ri.....q5V ",
+" L,9rahz....uwN ",
+" L4eajc.....dra ",
+" L8yfx......gpa ",
+" L0ukvVDHFCmzsa ",
+" L9uknVDKGCMzaa ",
+" L7tfcBCSZVblaa ",
+" LGGGGGGAAANNNa ",
+"P P"
+};
+
+/* XPM */
+const char *emblems_system_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 17 1",
+" c #676965",
+". c #71736F",
+"X c #777975",
+"o c #888A84",
+"O c #888A85",
+"+ c #898B87",
+"@ c #8D8F8A",
+"# c #8F918C",
+"$ c #979993",
+"% c #A2A3A0",
+"& c #B8BAB4",
+"* c #BDBFB9",
+"= c #C0C0BE",
+"- c #C7CAC3",
+"; c #D3D7CF",
+": c #EEEEEC",
+"> c None",
+/* pixels */
+">>>>>>>>>>>>>>>>",
+">>>>>>OOO>>>>>>>",
+">>>OO>O:O>OO>>>>",
+">>O:=O%;%O=:O>>>",
+">>O=;;;;;;;=O>>>",
+">>>O;&o$o*;O>>>>",
+">OO%;o.> +;%OO>>",
+">O:;;$>>>$;;:O>>",
+">OO%;@#>Xo;%OO>>",
+">>>O:&@$o-;O>>>>",
+">>O=;;;;;;;=O>>>",
+">>O:=O%;%O=:O>>>",
+">>>OO>O:O>OO>>>>",
+">>>>>>OOO>>>>>>>",
+">>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>"
+};
+
+/* XPM */
+const char *dialog_information_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 116 2",
+" c #303030",
+". c #393936",
+"X c #5E5E3E",
+"o c #3A4A77",
+"O c #3A4B77",
+"+ c #3B4B77",
+"@ c #3D4C76",
+"# c #3D4D76",
+"$ c #384978",
+"% c #384A79",
+"& c #394A79",
+"* c #394B7A",
+"= c #3A4B7A",
+"- c #3B4C78",
+"; c #3C4D78",
+": c #3E4E79",
+"> c #464646",
+", c #435177",
+"< c #40507A",
+"1 c #41517B",
+"2 c #45547E",
+"3 c #46557F",
+"4 c #4A577A",
+"5 c #80805C",
+"6 c #8A8B66",
+"7 c #475780",
+"8 c #485883",
+"9 c #4B5B83",
+"0 c #495985",
+"q c #4A5A86",
+"w c #546083",
+"e c #586383",
+"r c #5E6880",
+"t c #4B7EB2",
+"y c #5E8DBA",
+"u c #608EBC",
+"i c #7E91B1",
+"p c #7E90B2",
+"a c #779DC5",
+"s c #789DC4",
+"d c #A8AA84",
+"f c #A6AC98",
+"g c #A7AD98",
+"h c #ABB198",
+"j c #8C9BB8",
+"k c #8D9CB8",
+"l c #98A4BD",
+"z c #9AA5BE",
+"x c #DDDFAB",
+"c c #D3D5B0",
+"v c #E3E6BA",
+"b c #87A8CC",
+"n c #91AECD",
+"m c #9BAEC8",
+"M c #9DB9D6",
+"N c #A4ADC3",
+"B c #A5BED8",
+"V c #A6BED8",
+"C c #A9C0D9",
+"Z c #AAC1D9",
+"A c #B7C2D5",
+"S c #B9C4D6",
+"D c #B5C6DA",
+"F c #B5C7DB",
+"G c #B5CAE0",
+"H c #C1CCD7",
+"J c #EBEDC1",
+"K c #F3F6C9",
+"L c #F5F8CA",
+"P c #C2D0E0",
+"I c #C0D0E3",
+"U c #C5D2E1",
+"Y c #C1D2E4",
+"T c #C2D3E4",
+"R c #C3D3E4",
+"E c #C5D5E5",
+"W c #C7D6E5",
+"Q c #C9D6E7",
+"! c #C8D7E8",
+"~ c #CBD9E8",
+"^ c #CCD9E8",
+"/ c #CEDBE9",
+"( c #D0D5E0",
+") c #D2DAE2",
+"_ c #D0DDEB",
+"` c #D3DFEB",
+"' c #D4E0EC",
+"] c #D4E0ED",
+"[ c #D6E1ED",
+"{ c #D8E2ED",
+"} c #D9E3EE",
+"| c #DEE7F1",
+" . c #DFE7F2",
+".. c #DFE8F2",
+"X. c #E0E5ED",
+"o. c #E0E6EC",
+"O. c #E2E7EF",
+"+. c #E0E9F2",
+"@. c #E2EAF3",
+"#. c #E8EFF4",
+"$. c #E8EFF5",
+"%. c #EDEFF4",
+"&. c #EBF0F5",
+"*. c #EBF0F6",
+"=. c #ECF1F7",
+"-. c #EFF3F7",
+";. c #EEF3F8",
+":. c #F3F7FA",
+">. c #F4F7FA",
+",. c #F5F8FA",
+"<. c #F7F9FB",
+"1. c #FAFBFD",
+"2. c #FAFCFD",
+"3. c #FCFCFD",
+"4. c #FFFFFF",
+"5. c None",
+/* pixels */
+"5.5.5.5.5.+ o $ % O @ 5.5.5.5.5.",
+"5.5.5.5.- N %.3.<.O.z : 5.5.5.5.",
+"5.5.5.; ( ,.#. at .} ` { S 1 5.5.5.",
+"5.5.# N ,.-.>.*...] T E k , 5.5.",
+"5.5.< %.$.:.2.=. ._ Y s U 3 5.5.",
+"5.5.& 1.+.;.4.4.4.4.H 5./ * 5.5.",
+"5.5.= >.[ | 4.&.o.) n 5.Q * 5.5.",
+"5.5.2 X.~ ! 4.I G M 5.u F 8 5.5.",
+"5.5.4 l ' V 4.B b 5.t Z i w 5.5.",
+"5.5.5.7 A R a 4.5.y C m 0 5.5.5.",
+"5.5.5.5.7 j P ^ W D p q 5.5.5.5.",
+"5.5.5.5.5.e 9 f g h r 5.5.5.5.5.",
+"5.5.5.5.5.5.X J L x X 5.5.5.5.5.",
+"5.5.5.5.5.5.X 5 d 6 X 5.5.5.5.5.",
+"5.5.5.5.5.5.X v K c X 5.5.5.5.5.",
+"5.5.5.5.5.5.5.. > 5.5.5.5.5.5."
+};
+
+/* XPM */
+const char *executable_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 67 1",
+" c #364878",
+". c #486490",
+"X c #516A96",
+"o c #566F99",
+"O c #5F7A9F",
+"+ c #7182AA",
+"@ c #7382AB",
+"# c #7483AB",
+"$ c #7584AC",
+"% c #7786AD",
+"& c #7A87AF",
+"* c #7A88AE",
+"= c #7B88AF",
+"- c #7C89B0",
+"; c #7D89B1",
+": c #7C8CB0",
+"> c #7C8EB0",
+", c #7F90B1",
+"< c #858EB5",
+"1 c #858FB5",
+"2 c #8790B6",
+"3 c #8394B4",
+"4 c #8991B7",
+"5 c #8895B7",
+"6 c #8F9BBB",
+"7 c #8E9CBB",
+"8 c #8D9EBA",
+"9 c #8D9FBA",
+"0 c #9197BC",
+"q c #9099BC",
+"w c #949ABE",
+"e c #95A2BF",
+"r c #9D9FC3",
+"t c #98A2C1",
+"y c #99A3C2",
+"u c #9BABC3",
+"i c #9FAEC6",
+"p c #A1AAC6",
+"a c #A0AFC6",
+"s c #A2AEC7",
+"d c #A3B1C8",
+"f c #A5B0C8",
+"g c #A7B1C9",
+"h c #A4B2C8",
+"j c #A5B2C9",
+"k c #A7B2CA",
+"l c #A7B4CA",
+"z c #A9B3CB",
+"x c #A8B4CB",
+"c c #A9B5CB",
+"v c #ACB0CC",
+"b c #ABB5CD",
+"n c #AAB6CC",
+"m c #ABB6CC",
+"M c #ACB7CD",
+"N c #ADB8CE",
+"B c #AEB9CE",
+"V c #AFB9CF",
+"C c #B0BACF",
+"Z c #B1BBD0",
+"A c #B2BBD1",
+"S c #B3BCD1",
+"D c #BFC4D8",
+"F c #C1C5D9",
+"G c #C3C7DA",
+"H c #C8CADD",
+"J c None",
+/* pixels */
+"JJJJJJJ JJJJJJJJ",
+"JJJJJJ G JJJJJJJ",
+"JJJJJ GuO JJJJJJ",
+"JJJJ Gia9. JJJJJ",
+"JJJ Gdhj8Xo JJJJ",
+"JJ Glxcn>3,o JJJ",
+"J GmMNBs:ez+o JJ",
+" GVCZAk7bS%@$o J",
+"J Ggf65#py=;o JJ",
+"JJ G*&-tDq1o JJJ",
+"JJJ G<24Fwo JJJJ",
+"JJJJ G0vHo JJJJJ",
+"JJJJJ Gro JJJJJJ",
+"JJJJJJ o JJJJJJJ",
+"JJJJJJJ JJJJJJJJ",
+"JJJJJJJJJJJJJJJJ"
+};
+
+/* XPM */
+const char *other_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 82 1",
+" c #CE5C00",
+". c #DF8D14",
+"X c #DF8E17",
+"o c #DE901E",
+"O c #E18F16",
+"+ c #E29018",
+"@ c #E29119",
+"# c #E39119",
+"$ c #E4931B",
+"% c #E5941D",
+"& c #E69721",
+"* c #E69825",
+"= c #E59828",
+"- c #EFA231",
+"; c #EAA238",
+": c #EAA33A",
+"> c #F1A332",
+", c #E5A444",
+"< c #EBA847",
+"1 c #EFAA45",
+"2 c #EBAB4C",
+"3 c #E9AA4F",
+"4 c #EFAE4D",
+"5 c #F5AD43",
+"6 c #F2AF4F",
+"7 c #EFB35C",
+"8 c #F1B55C",
+"9 c #E8B365",
+"0 c #EAB566",
+"q c #EDB665",
+"w c #EEBA6D",
+"e c #EEBB6F",
+"r c #F1BA69",
+"t c #EFC17E",
+"y c #F6C47B",
+"u c #FAC579",
+"i c #F3C889",
+"p c #F2CA8E",
+"a c #F4CA8D",
+"s c #F4CB8F",
+"d c #F4CC8F",
+"f c #F8CC8B",
+"g c #FACD8B",
+"h c #EFCB96",
+"j c #F3CB90",
+"k c #F3CC91",
+"l c #F4CC91",
+"z c #F4CD92",
+"x c #F5CE93",
+"c c #F1CC97",
+"v c #F1CD97",
+"b c #F6CE94",
+"n c #F6CE95",
+"m c #F2CE9B",
+"M c #F1CE9C",
+"N c #F1CE9D",
+"B c #F1CF9E",
+"V c #F7D095",
+"C c #F7D096",
+"Z c #F8D197",
+"A c #F8D198",
+"S c #F9D299",
+"D c #F9D399",
+"F c #FBD49C",
+"G c #FBD59C",
+"H c #FDD79F",
+"J c #F8D1A0",
+"K c #F8D1A1",
+"L c #F7D7AF",
+"P c #F4D8AE",
+"I c #F3D9B4",
+"U c #F5DBB8",
+"Y c #F9DCB9",
+"T c #F8DDBD",
+"R c #F8DEBD",
+"E c #FAE0BF",
+"W c #F5DFC2",
+"Q c #F8DFC0",
+"! c #FAE1C1",
+"~ c #FBEAD3",
+"^ c #F9EAD5",
+"/ c None",
+/* pixels */
+"////////////////",
+"/////// ///////",
+"////// WI //////",
+"///// U9oh /////",
+"//// N,0X.c ////",
+"/// MO3t=#+v ///",
+"// m@$e<&2wqP //",
+"/ B#%;i7rsljp^ /",
+"/ R*:a48bbxzkQ /",
+"// Ld16yZCVnQ //",
+"/// Y->fDSA! ///",
+"//// K5gGF! ////",
+"///// JuH~ /////",
+"////// TE //////",
+"/////// ///////",
+"////////////////"
+};
+
+/* XPM */
+const char *folder_open_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 69 1",
+" c #555753",
+". c #595B57",
+"X c #5D5F5B",
+"o c #61635F",
+"O c #455D79",
+"+ c #636561",
+"@ c #676965",
+"# c #6A6C68",
+"$ c #6D6F6B",
+"% c #3F6086",
+"& c #3E6089",
+"* c #3465A4",
+"= c #436B9D",
+"- c #537196",
+"; c #58769B",
+": c #4E7AB1",
+"> c #5C84B7",
+", c #6D85A4",
+"< c #7C8EA4",
+"1 c #6395CC",
+"2 c #6496CC",
+"3 c #6597CC",
+"4 c #6598CD",
+"5 c #6698CC",
+"6 c #6898CD",
+"7 c #6899CD",
+"8 c #6999CD",
+"9 c #6A9ACD",
+"0 c #6B9ACD",
+"q c #6B9BCD",
+"w c #6A9ACE",
+"e c #6C9BCE",
+"r c #6D9CCE",
+"t c #6E9CCE",
+"y c #6E9DCE",
+"u c #7D9DC6",
+"i c #709DCF",
+"p c #709ECE",
+"a c #729FCF",
+"s c #76A2D0",
+"d c #7CA6D2",
+"f c #969795",
+"g c #A6A6A6",
+"h c #A7A7A7",
+"j c #A8A8A8",
+"k c #A9ABA9",
+"l c #C0C0BF",
+"z c #81A9D4",
+"x c #85ACD5",
+"c c #88AED6",
+"v c #89AED6",
+"b c #89AFD7",
+"n c #8AAFD7",
+"m c #8BB0D7",
+"M c #8CB1D8",
+"N c #94B6DB",
+"B c #9ABADE",
+"V c #9CBBDD",
+"C c #9EBDDE",
+"Z c #A6C2E0",
+"A c #A7C3E0",
+"S c #AEC7E3",
+"D c #AFC8E3",
+"F c #B1CAE4",
+"G c #B9CFE7",
+"H c #C6C6C5",
+"J c #C9C9C9",
+"K c #CECECE",
+"L c None",
+/* pixels */
+"L$$$$$@@LLLLLLLL",
+"$KKKKKKH+LLLLLLL",
+"#lfffffff LL",
+"@Jggggggggghj LL",
+"olfffffffffff LL",
+"XJggggggggghj LL",
+"Xlf************=",
+".Jg*SDDDDDDDDDG*",
+" lf:AMMMMMMMMMS*",
+" J<>AMMMMMMMMMS*",
+" l,uAMMMMMMMMvZ*",
+" J*FmMmncxzdsaV*",
+" l;Cpiytreqw87N*",
+" kbq098654321B-O",
+"&*************%L",
+"LLLLLLLLLLLLLLLL"
+};
+
+/* XPM */
+const char *waterfall_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 5 1",
+" c None",
+". c #124188",
+"+ c #788D9B",
+"@ c #ABCBE2",
+"# c #204A87",
+" ",
+" ..+..@@@@..+.. ",
+" ..+..@@@@..+.. ",
+" ..+..@@@@..+.. ",
+" ..+..@##@..+.. ",
+" ..+..@@@@..+.. ",
+" ..+..@@@@..+.. ",
+" ..+..@@@@..+.. ",
+" ..+..@@@@..+.. ",
+" ..+..@##@..+.. ",
+" ..+..@@@@..+.. ",
+" ..+..@@@@..+.. ",
+" ..+..@##@..+.. ",
+" ..+..@@@@..+.. ",
+" ..+..@##@..+.. ",
+" "};
+
+/* XPM */
+const char *dice_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 5 1",
+" c None",
+". c #888A85",
+"+ c #FDF2D2",
+"@ c #740404",
+"# c #A50101",
+"................",
+".++++++++++++++.",
+".++@@#++++@@#++.",
+".++@##++++@##++.",
+".++###++++###++.",
+".++++++++++++++.",
+".++@@#++++@@#++.",
+".++@##++++@##++.",
+".++###++++###++.",
+".++++++++++++++.",
+".++@@#++++@@#++.",
+".++@##++++@##++.",
+".++###++++###++.",
+".++++++++++++++.",
+"................",
+" "}
+;
+
+
+/* XPM */
+const char *preferences_system_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 44 1",
+" c #204A87",
+". c #7D8385",
+"X c #748AA2",
+"o c #788DA4",
+"O c #728BAE",
+"+ c #7D91A7",
+"@ c #7C93B3",
+"# c #7A95B4",
+"$ c #7A95B5",
+"% c #888A85",
+"& c #8A8C87",
+"* c #A0A19E",
+"= c #869CB8",
+"- c #92A5BE",
+"; c #A4A4A3",
+": c #ABACA9",
+"> c #ADADAA",
+", c #B8B7B5",
+"< c #B9B8B7",
+"1 c #BAB9B6",
+"2 c #BFBEBD",
+"3 c #ADBBCC",
+"4 c #BDC8D4",
+"5 c #C4C3C2",
+"6 c #C6C4C2",
+"7 c #CAC9C8",
+"8 c #D2D1D0",
+"9 c #D4D3D2",
+"0 c #D4D3D3",
+"q c #E4E3E2",
+"w c #E5E3E2",
+"e c #ECEBE9",
+"r c #ECECEA",
+"t c #EEEEEC",
+"y c #EEEEED",
+"u c #EFEFEE",
+"i c #F0F0EE",
+"p c #F0F0EF",
+"a c #F0F0F0",
+"s c #F3F3F3",
+"d c #F6F6F5",
+"f c #F7F7F7",
+"g c #FAFAFA",
+"h c None",
+/* pixels */
+"hhhhhhhhhhhhhhhh",
+"hhhh%hhhhhhhh%hh",
+"hhh%e%hhhhhh%u%h",
+"hhhh%i%hhhh%a%hh",
+"h%hh%g%hhhh%&hhh",
+"%d:%fw>thh%hhhhh",
+"h%spyr1%h%hhhhhh",
+"hh%%%%8;%%hhhhhh",
+"hhhhhh,%<%hhhhhh",
+"hhh .>72%hhhhh",
+"hh 33@ %%02%hhhh",
+"h 4oo- hh%q6%%hh",
+" 3oX#@ hhh%95%hh",
+" 3+$O hhhhh%*%hh",
+" -== hhhhhh%%%hh",
+"h hhhhhhhhhhhh"
+};
+
+/* XPM */
+const char *preferences_desktop_font_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 78 1",
+" c #000000",
+". c #010101",
+"X c #040404",
+"o c #050505",
+"O c #060606",
+"+ c #202020",
+"@ c #222222",
+"# c #2C2C2C",
+"$ c #2E2E2E",
+"% c #2F2F2F",
+"& c #343434",
+"* c #474747",
+"= c #484848",
+"- c #494949",
+"; c #4A4A4A",
+": c #4B4B4B",
+"> c #4D4D4D",
+", c #565656",
+"< c #5F5F5F",
+"1 c #626262",
+"2 c #666666",
+"3 c #747474",
+"4 c #767676",
+"5 c #797979",
+"6 c #7C7C7C",
+"7 c #828282",
+"8 c #888A85",
+"9 c #A7A7A7",
+"0 c #ADADAD",
+"q c #B1B1B1",
+"w c #B8B9B8",
+"e c #BFBFBF",
+"r c #CECECE",
+"t c #D3D3D3",
+"y c #DBDBDB",
+"u c #E2E2E2",
+"i c #E3E3E3",
+"p c #E4E3E4",
+"a c #E4E4E4",
+"s c #E4E5E4",
+"d c #E4E4E5",
+"f c #E5E6E5",
+"g c #E6E6E6",
+"h c #E6E7E6",
+"j c #E7E7E6",
+"k c #E8E7E7",
+"l c #E8E8E8",
+"z c #E8E9E9",
+"x c #E9E9E9",
+"c c #EAE9E9",
+"v c #E9E9EA",
+"b c #EBEAEA",
+"n c #EAEBEA",
+"m c #EAEBEB",
+"M c #EBEBEB",
+"N c #ECECEB",
+"B c #ECEBEC",
+"V c #ECECEC",
+"C c #ECEDEC",
+"Z c #EDEDED",
+"A c #EEEEEE",
+"S c #EFEFEF",
+"D c #F0F0F0",
+"F c #F1F1F1",
+"G c #F2F2F2",
+"H c #F3F3F3",
+"J c #F4F4F4",
+"K c #F5F5F5",
+"L c #F6F6F6",
+"P c #F7F7F7",
+"I c #F8F8F8",
+"U c #F9F9F9",
+"Y c #FAFAFA",
+"T c #FBFBFB",
+"R c #FCFCFC",
+"E c #FDFDFD",
+"W c #FFFFFF",
+"Q c None",
+/* pixels */
+"Q88888888888888Q",
+"8WWWWWWWWWWWWWW8",
+"8Wi97%%iggggiiE8",
+"8Wiuyr%ilxlliiE8",
+"8Wiq%3%ghgfdpiE8",
+"8Wi%te%xxczkgsT8",
+"8Wa%%%w:%CBmxjT8",
+"8WgVZAS*#DSANvI8",
+"8WlZSDF=+& .1GL8",
+"8WcSDGH= 4G2 qS8",
+"8WnDGHK-oHUy 6S8",
+"8WMFHJL-OFTt 4S8",
+"8WmGJLP; 5P< 0S8",
+"8WbGJLI,$@X >PS8",
+"8WRRRRRRYYYLLLS8",
+"Q88888888888888Q"
+};
+
+/* XPM */
+const char *system_search_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 127 2",
+" c #646662",
+". c #666864",
+"X c #676965",
+"o c #686966",
+"O c #696B66",
+"+ c #6A6B68",
+"@ c #6B6B6B",
+"# c #6A6C68",
+"$ c #6B6D69",
+"% c #6C6E69",
+"& c #6C6D6A",
+"* c #6C6E6A",
+"= c #6D6F6A",
+"- c #6C6E6B",
+"; c #6D6E6B",
+": c #6D6F6C",
+"> c #6E706B",
+", c #6F706C",
+"< c #6F716C",
+"1 c #70716D",
+"2 c #747672",
+"3 c #767875",
+"4 c #7A7C78",
+"5 c #7F807D",
+"6 c #5980AD",
+"7 c #5C85B3",
+"8 c #618AB9",
+"9 c #6690BF",
+"0 c #6893C2",
+"q c #6994C5",
+"w c #6D97C5",
+"e c #6E9AC9",
+"r c #6F9BCA",
+"t c #6F9CCD",
+"y c #729DCF",
+"u c #719ECE",
+"i c #729ECE",
+"p c #729FCE",
+"a c #739FCE",
+"s c #729ECF",
+"d c #729FCF",
+"f c #739FCF",
+"g c #76A0CD",
+"h c #75A1CF",
+"j c #78A1CD",
+"k c #838580",
+"l c #828481",
+"z c #848682",
+"x c #858784",
+"c c #868785",
+"v c #888A85",
+"b c #898B88",
+"n c #898A89",
+"m c #8F908F",
+"M c #919291",
+"N c #939592",
+"B c #A3A4A1",
+"V c #A7A8A6",
+"C c #A8A9A8",
+"Z c #B7B7B5",
+"A c #B8B8B7",
+"S c #8AA6C5",
+"D c #8EA8C5",
+"F c #81A3CA",
+"G c #85A6CA",
+"H c #89A9CB",
+"J c #96A9C1",
+"K c #9BADC2",
+"L c #9EAFC4",
+"P c #80A7D4",
+"I c #8FB1D9",
+"U c #96B3D2",
+"Y c #97B4D3",
+"T c #97B8DB",
+"R c #ADBACA",
+"E c #A2BEDF",
+"W c #B9CADC",
+"Q c #ACC6E2",
+"! c #AEC8E3",
+"~ c #B4CCE6",
+"^ c #B6CDE6",
+"/ c #C2C2C2",
+"( c #C4C4C4",
+") c #C7C7C7",
+"_ c #C9C9C8",
+"` c #CACAC9",
+"' c #CBCBCA",
+"] c #CBCCCA",
+"[ c #C5CCD2",
+"{ c #D6D6D6",
+"} c #D1D5D9",
+"| c #D4D6D9",
+" . c #D7D8DA",
+".. c #D9D9D8",
+"X. c #DADAD9",
+"o. c #D8DADB",
+"O. c #DADADA",
+"+. c #DADBDB",
+"@. c #DBDBDB",
+"#. c #DADBDC",
+"$. c #DEDEDE",
+"%. c #DFDFDF",
+"&. c #C0D3E9",
+"*. c #C7D8EB",
+"=. c #C7D9EC",
+"-. c #CBDBEC",
+";. c #CEDDED",
+":. c #D1D9E1",
+">. c #D2D9E0",
+",. c #D5DCE4",
+"<. c #DBE2E9",
+"1. c #D1E0F0",
+"2. c #D3E1F0",
+"3. c #D5E2F0",
+"4. c #D6E2F1",
+"5. c #D7E4F1",
+"6. c #D9E4F1",
+"7. c #DFE9F3",
+"8. c #E2E2E2",
+"9. c #E0E9F3",
+"0. c #E0E9F4",
+"q. c #E3EBF4",
+"w. c #E2EBF5",
+"e. c #E3EBF5",
+"r. c #E7EEF7",
+"t. c #ECF2F8",
+"y. c None",
+/* pixels */
+"y.y.y.y.3 , 1 > = 4 y.y.y.y.y.y.",
+"y.y.y.: ] #.| } .` - y.y.y.y.y.",
+"y.y.< +.J w h p 0 K $.> y.y.y.y.",
+"y.* O.S d *.w.7.! p D @.$ y.y.y.",
+"y.V L p 4.r.t.e.1.T u R B y.y.y.",
+"O X.9 Q 6.0.q.9.;.P s F ..O y.y.",
+"> o.u ~ -.2.5.3.y.y.y u 8.> y.y.",
+"% %.g I ^ =.&.E y.y.f e @.% y.y.",
+"k ( G q y y.y.y.y.y.8 H _ z y.y.",
+"y.l :.p t y.y.i y.y.p >.X y.y.y.",
+"y.# C W p 7 y.r 6 a [ N c o y.y.",
+"y.y.% M <.U j p Y ,.+ A x 2 . y.",
+"y.y.y.# 5 m / %.n y.; Z b ) & ",
+"y.y.y.y.y.v % % v y.y.@ & ' { & ",
+"y.y.y.y.y.y.y.y.y.y.y.y.y.& & y.",
+"y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y."
+};
+
+/* XPM */
+const char *utilities_system_monitor_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 115 2",
+" c #7D7D7A",
+". c #7E7E7B",
+"X c #829B7A",
+"o c #829C7C",
+"O c #849E7C",
+"+ c #BBC774",
+"@ c #204A87",
+"# c #265987",
+"$ c #2C5D8E",
+"% c #2C6090",
+"& c #2C6292",
+"* c #2C6294",
+"= c #2F6697",
+"- c #316696",
+"; c #316697",
+": c #316A99",
+"> c #316A9A",
+", c #346A9A",
+"< c #316C9B",
+"1 c #346E9D",
+"2 c #346E9E",
+"3 c #34709E",
+"4 c #3772A1",
+"5 c #3772A2",
+"6 c #3A74A3",
+"7 c #3D77A6",
+"8 c #3D77A7",
+"9 c #3D79A7",
+"0 c #3D7BA8",
+"q c #3D7CAA",
+"w c #407EAB",
+"e c #4280AC",
+"r c #4280AD",
+"t c #4283AE",
+"y c #4284AF",
+"u c #4584B1",
+"i c #4587B1",
+"p c #4887B3",
+"a c #488AB5",
+"s c #4A8DB7",
+"d c #4D8DB7",
+"f c #4D8EB9",
+"g c #4D8FBA",
+"h c #5294BE",
+"j c #5495BF",
+"k c #7792B5",
+"l c #85A180",
+"z c #85A280",
+"x c #87A481",
+"c c #89A483",
+"v c #89A584",
+"b c #8BA785",
+"n c #8BAA86",
+"m c #8CAA86",
+"M c #8EAC89",
+"N c #90AE8B",
+"B c #90AF8B",
+"V c #91B08C",
+"C c #93B28E",
+"Z c #94B48F",
+"A c #96B590",
+"S c #96B691",
+"D c #97B893",
+"F c #8199BA",
+"G c #B4B6B1",
+"H c #B4B7B1",
+"J c #B6C496",
+"K c #B7C699",
+"L c #BACA9C",
+"P c #BECE9F",
+"I c #BFCFA0",
+"U c #EEE788",
+"Y c #D3D9A5",
+"T c #D5DBA7",
+"R c #E7E8B0",
+"E c #EDEAB0",
+"W c #98C0D9",
+"Q c #BAD1E1",
+"! c #C9CCC6",
+"~ c #CBCEC9",
+"^ c #CCCFCA",
+"/ c #D0D2CE",
+"( c #D3D6D1",
+") c #D5D7D3",
+"_ c #D7D9D5",
+"` c #DADCD8",
+"' c #DBDCD9",
+"] c #DCDDDB",
+"[ c #DEE0DD",
+"{ c #DFE1DD",
+"} c #D6E3ED",
+"| c #D6E4ED",
+" . c #D7E5EF",
+".. c #D8E6EF",
+"X. c #E2E3E0",
+"o. c #E4E5E2",
+"O. c #E5E7E4",
+"+. c #E9EAE8",
+"@. c #EEEEED",
+"#. c #E9F1F6",
+"$. c #EFF4F8",
+"%. c #F4F5F3",
+"&. c #F6F7F6",
+"*. c #F0F5F8",
+"=. c #F0F5F9",
+"-. c #F1F6F9",
+";. c #F5F8FA",
+":. c #F6F8FB",
+">. c #F8F9F8",
+",. c #F9F9F8",
+"<. c #F9FAF9",
+"1. c #FAFBFA",
+"2. c #FEFEFE",
+"3. c #FFFFFF",
+"4. c None",
+/* pixels */
+". . . . . . . . . . . . . . . ",
+". ,.>.3.3.3.3.3.3.3.3.2.1.1.1.. ",
+". ,.k @ @ @ @ @ @ @ @ @ @ k ] . ",
+". 2.@ # $ * X o < > : - & @ O.. ",
+". 2.@ % ; O E z 6 6 5 3 , @ X.. ",
+". 2.@ = 2 J $.K b q 0 7 4 @ [ . ",
+". 2.@ 1 x Y Q | M u t w 9 @ ' . ",
+". 2.@ l v } L .V + B M n @ _ . ",
+". 2.@ ;.:.T V ..P U -.=.*.@ ( . ",
+". 2.@ c m N C I #.W Z V M @ / . ",
+". 2.@ 8 r p f S R D A d u @ ^ . ",
+". 2.@ 7 e i s Z j h g a y @ ! . ",
+". ,.F @ @ @ @ @ @ @ @ @ @ k G . ",
+". ,.&.<.%. at .+.o.{ ` ) / ~ H H . ",
+". . . . . . . . . . . . . . . ",
+"4.4.4.4.4.4.4.4.4.4.4.4.4.4.4.4."
+};
+
+
+
+
+
+
+
+
+
+
+
+
+/* XPM */
+const char *system_users_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 146 2",
+" c #6C3F3B",
+". c #624F0D",
+"X c #6D4A0A",
+"o c #685D14",
+"O c #616B09",
+"+ c #616519",
+"@ c #687214",
+"# c #6E771D",
+"$ c #596921",
+"% c #6A692B",
+"& c #6A6A2B",
+"* c #6D712F",
+"= c #6F7131",
+"- c #767B35",
+"; c #797F37",
+": c #55315F",
+"> c #5C3B59",
+", c #723C51",
+"< c #5A3464",
+"1 c #5C3566",
+"2 c #465440",
+"3 c #7E6040",
+"4 c #614D7E",
+"5 c #645370",
+"6 c #864F06",
+"7 c #815107",
+"8 c #885106",
+"9 c #8E5105",
+"0 c #955104",
+"q c #9F5203",
+"w c #9E5807",
+"e c #A35403",
+"r c #B85410",
+"t c #BA5C11",
+"y c #BF6C10",
+"u c #815330",
+"i c #965435",
+"p c #90563F",
+"a c #AA7722",
+"s c #AF7D2E",
+"d c #BC7625",
+"f c #CD5C00",
+"g c #CC5E01",
+"h c #CC5E04",
+"j c #C16404",
+"k c #C4680A",
+"l c #D56402",
+"z c #D16604",
+"x c #C16710",
+"c c #C77D28",
+"v c #844240",
+"b c #895443",
+"n c #905841",
+"m c #8B6B58",
+"M c #AF8033",
+"N c #B68134",
+"B c #B88530",
+"V c #B98633",
+"C c #C2893C",
+"Z c #DF8E3A",
+"A c #E0992A",
+"S c #E09B2D",
+"D c #E3A23C",
+"F c #E1A23E",
+"G c #868F41",
+"H c #B78940",
+"J c #BC8E43",
+"K c #B99355",
+"L c #C38F44",
+"P c #D08F4A",
+"I c #C29142",
+"U c #C0934B",
+"Y c #D8994A",
+"T c #C49A52",
+"R c #CB9A51",
+"E c #CF9D51",
+"W c #DDA053",
+"Q c #DCA552",
+"! c #D1A55F",
+"~ c #DDAB5E",
+"^ c #E3A340",
+"/ c #E5A746",
+"( c #E6AA4D",
+") c #E6A251",
+"_ c #E3A256",
+"` c #E5A255",
+"' c #E6AD54",
+"] c #E5AE5C",
+"[ c #EBAA5B",
+"{ c #E8AA5C",
+"} c #C99C66",
+"| c #D9AC64",
+" . c #DAAE6D",
+".. c #E2B369",
+"X. c #ECB868",
+"o. c #F1BD6F",
+"O. c #EBBC74",
+"+. c #ECBD74",
+"@. c #F3BE71",
+"#. c #EFC075",
+"$. c #3D538B",
+"%. c #3E558E",
+"&. c #30609D",
+"*. c #32629E",
+"=. c #32629F",
+"-. c #3263A1",
+";. c #3264A1",
+":. c #3364A2",
+">. c #3364A3",
+",. c #3466A4",
+"<. c #3466A5",
+"1. c #3467A7",
+"2. c #3568A8",
+"3. c #3568A9",
+"4. c #366AAC",
+"5. c #366BAD",
+"6. c #3B6EAE",
+"7. c #386DB1",
+"8. c #485F99",
+"9. c #4F649A",
+"0. c #4071AF",
+"q. c #4172AF",
+"w. c #4576B2",
+"e. c #4A78B2",
+"r. c #547FB5",
+"t. c #5680B5",
+"y. c #5E83B2",
+"u. c #5981B4",
+"i. c #5F86B7",
+"p. c #5A85B9",
+"a. c #6B8BB4",
+"s. c #6087B9",
+"d. c #A9A3B9",
+"f. c #F3C680",
+"g. c #F9C780",
+"h. c #F6CB8A",
+"j. c #F0CE99",
+"k. c #829FC5",
+"l. c #8BA6C9",
+"z. c #8DA7C8",
+"x. c #A6ACC4",
+"c. c #B0B6CB",
+"v. c #A0B6D1",
+"b. c #B4C1D3",
+"n. c #D6DBE3",
+"m. c None",
+/* pixels */
+"m.m.m.m.6 0 9 e m.m.m.m.m.m.m.m.",
+"m.m.m.z Y ! E L q m.m.m.m.m.m.m.",
+"m.m.w W T U V d x f g f m.m.m.m.",
+"m.m.8 R J K c k ) h. at .{ f m.m.m.",
+"m.m.7 I B H y [ f.O.( #.Z f m.m.",
+"m.m.. C M a l g.+.j.' D ] f m.m.",
+"m.m. u N s j o./ ..S F Q f m.m.",
+"m.2 * + 3 X o ` X.A ^ | P r m.m.",
+"2 - # G G % , n _ ~ .} p v m.m.",
+"2 - @ G & 1 l.5 m h t i b s.1 1 ",
+"2 - @ @ 1 z.4.7.c.4 d.x.2.;.s.1 ",
+"2 - $ O > s.1.5.v.n.p.k.<.&.6.1 ",
+"2 - ; = 1 i.>.1.3.b.u.,.-.-.6.1 ",
+"m.2 2 2 1 y.>.%.:.a.-.*.$.=.6.1 ",
+"m.m.m.m.1 t.r.9.e.0.0.0.8.q.w.1 ",
+"m.m.m.m.: 1 1 1 1 1 1 1 1 1 1 < "
+};
+
+/* XPM */
+const char *multimedia_player_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 78 1",
+" c #535551",
+". c #555753",
+"X c #5B5B58",
+"o c #626460",
+"O c #666864",
+"+ c #676964",
+"@ c #686A65",
+"# c #696B66",
+"$ c #6A6C67",
+"% c #696968",
+"& c #6C6E69",
+"* c #6E6F6C",
+"= c #6E706B",
+"- c #70726D",
+"; c #747671",
+": c #747672",
+"> c #767874",
+", c #787A75",
+"< c #787A76",
+"1 c #7A7B77",
+"2 c #7A7C77",
+"3 c #7B7D78",
+"4 c #7C7D79",
+"5 c #7C7E79",
+"6 c #7C7D7A",
+"7 c #7D7F7A",
+"8 c #7E7F7B",
+"9 c #7E807B",
+"0 c #80817D",
+"q c #80827D",
+"w c #B3BC78",
+"e c #838581",
+"r c #858782",
+"t c #888A85",
+"y c #898A87",
+"u c #8A8C89",
+"i c #91928E",
+"p c #92948F",
+"a c #939592",
+"s c #969893",
+"d c #989996",
+"f c #9B9D9A",
+"g c #9FA09D",
+"h c #A2A49F",
+"j c #B2B796",
+"k c #A4A6A2",
+"l c #A4A6A3",
+"z c #A5A6A3",
+"x c #A5A7A3",
+"c c #A6A7A3",
+"v c #A8AAA5",
+"b c #ADAEAB",
+"n c #AEAEAB",
+"m c #B6BAA6",
+"M c #B4B5A8",
+"N c #B8BCA8",
+"B c #B8BCAA",
+"V c #B6B6B4",
+"C c #B8B9B6",
+"Z c #B9B9B6",
+"A c #BBC286",
+"S c #BDC58D",
+"D c #BBC291",
+"F c #BBC096",
+"G c #BEC496",
+"H c #BFC59B",
+"J c #C3C996",
+"K c #C3CA96",
+"L c #C3C79F",
+"P c #C5CB9A",
+"I c #C4CAA3",
+"U c #C5C9A4",
+"Y c #C9CEAB",
+"T c #CBCFAC",
+"R c #C9D0A3",
+"E c #CBD0A5",
+"W c #D1D6AE",
+"Q c #CFD4B0",
+/* pixels */
+" ...............",
+".>cccxxxxxxzlk>.",
+".di1114444480td.",
+".dajLUYTIHGDQud.",
+".dhFKPREJSAwWsd.",
+".dpMBNNNNNNmmrd.",
+".d=&&$&=&$$&$$d.",
+".d#+ at ++#@++#+ at d.",
+".d,nfvb:;:-XoOd.",
+".dyCkVZ777<%6*d.",
+".d777777777eq9d.",
+".d555555555555d.",
+".d3g3g33333333d.",
+".d222222222222d.",
+".>dddddddddddd>.",
+"................"
+};
+
+/* XPM */
+const char *chat_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 15 1",
+" c #888A85",
+". c #9D9D9D",
+"X c #C6C6C4",
+"o c #E9E9E9",
+"O c #EAEAEA",
+"+ c #EBEBEB",
+"@ c #ECECEC",
+"# c #EDEDED",
+"$ c #EEEEEE",
+"% c #EFEFEF",
+"& c #F0F0F0",
+"* c #F1F1F1",
+"= c #F2F2F2",
+"- c #FFFFFF",
+"; c None",
+/* pixels */
+";;;; ;",
+";;; ----------- ",
+";;; -ooooooooo- ",
+"; Xo- ",
+" ----------- o- ",
+" -ooooooooo- o- ",
+" -ooooooo@@- o- ",
+" -ooooo@@@@- -- ",
+" -ooo@@@&&&- - ;",
+" -o@@@&@@&&- - ;",
+" -o@@&@&&&&- ;",
+" --&@------- ; ;",
+"; - at - .;;;",
+"; -- ;;;;;;;;;;;",
+"; ;;;;;;;;;;;;",
+"; ;;;;;;;;;;;;;;"
+};
+
+/* XPM */
+const char * dialog_information_48_icon[] = {
+"48 48 606 2",
+" c None",
+". c #616673",
+"+ c #626779",
+"@ c #616777",
+"# c #626473",
+"$ c #626472",
+"% c #616776",
+"& c #626778",
+"* c #626574",
+"= c #6B7287",
+"- c #8798B9",
+"; c #9FB3D8",
+"> c #ABC0E2",
+", c #B8C9EB",
+"' c #BBCBEB",
+") c #B3C5E3",
+"! c #AABCDA",
+"~ c #90A0BC",
+"{ c #6D758A",
+"] c #626576",
+"^ c #626675",
+"/ c #727B94",
+"( c #9DB1DB",
+"_ c #ACC1EB",
+": c #98B4E2",
+"< c #85A7DA",
+"[ c #7CA1D5",
+"} c #759CD0",
+"| c #749CCE",
+"1 c #7EA4D2",
+"2 c #89ABD6",
+"3 c #A5BFE1",
+"4 c #C5D5EE",
+"5 c #B6C5E1",
+"6 c #7A8399",
+"7 c #626777",
+"8 c #90A4CD",
+"9 c #A7BEEB",
+"0 c #87A8DE",
+"a c #7197D3",
+"b c #84A7D6",
+"c c #9AB7DB",
+"d c #AAC3DF",
+"e c #B3C9E2",
+"f c #B4CBE2",
+"g c #B1C8E2",
+"h c #A3BEDC",
+"i c #8CAED3",
+"j c #749DC9",
+"k c #94B3D8",
+"l c #CAD8EF",
+"m c #ADBCD6",
+"n c #656978",
+"o c #676D81",
+"p c #9BB0DC",
+"q c #94B0E5",
+"r c #7198D6",
+"s c #93B2DD",
+"t c #BACEE6",
+"u c #C5D6E9",
+"v c #C7D8EA",
+"w c #C7D8E9",
+"x c #C7D7EA",
+"y c #C8D8E9",
+"z c #C6D6E8",
+"A c #C5D6E8",
+"B c #C3D4E7",
+"C c #C0D2E6",
+"D c #91B2D5",
+"E c #769ECA",
+"F c #B3C8E4",
+"G c #C4D2E8",
+"H c #6C7283",
+"I c #63687A",
+"J c #99B0DE",
+"K c #88A8E2",
+"L c #7BA0D9",
+"M c #B3C9E6",
+"N c #C5D6EA",
+"O c #C6D7E9",
+"P c #C8D8EB",
+"Q c #C9D8E9",
+"R c #C9D9EA",
+"S c #C8D8EA",
+"T c #C7D7E9",
+"U c #C6D6E9",
+"V c #C3D4E8",
+"W c #C0D2E7",
+"X c #85A9CF",
+"Y c #779FCA",
+"Z c #A3BDDD",
+"` c #C6D4E9",
+" . c #666B7A",
+".. c #62687A",
+"+. c #8EA4D1",
+"@. c #8DACE4",
+"#. c #7EA2DA",
+"$. c #BDD0EA",
+"%. c #CADAEA",
+"&. c #C8D9EB",
+"*. c #C6D8EA",
+"=. c #C3D5E8",
+"-. c #AEC5E0",
+";. c #7CA3CC",
+">. c #79A0CB",
+",. c #B8C6DD",
+"'. c #7382A2",
+"). c #96B2E7",
+"!. c #749BD8",
+"~. c #BBCFE9",
+"{. c #C3D5E9",
+"]. c #C9D8EA",
+"^. c #CADAEB",
+"/. c #CBDAEB",
+"(. c #CCDAEB",
+"_. c #CCDBEB",
+":. c #CBDBEA",
+"<. c #CBDAEA",
+"[. c #C9D9E9",
+"}. c #C4D6E9",
+"|. c #C2D4E7",
+"1. c #8AACD1",
+"2. c #80A4CE",
+"3. c #7CA1CC",
+"4. c #CADAEE",
+"5. c #8391A7",
+"6. c #626877",
+"7. c #95AFE0",
+"8. c #789CDC",
+"9. c #A1BCE2",
+"0. c #C2D4E9",
+"a. c #CCDBEC",
+"b. c #CDDCEB",
+"c. c #CEDCEB",
+"d. c #CDDBEB",
+"e. c #CDDBEC",
+"f. c #C8D9EA",
+"g. c #C4D5E7",
+"h. c #9AB8D8",
+"i. c #84A8CF",
+"j. c #8EAFD5",
+"k. c #D0DAEE",
+"l. c #626876",
+"m. c #717B94",
+"n. c #94B1E6",
+"o. c #749AD6",
+"p. c #BDD0E8",
+"q. c #C1D3E7",
+"r. c #CCDCEB",
+"s. c #CFDCEC",
+"t. c #D0DDED",
+"u. c #D0DEED",
+"v. c #CFDDEC",
+"w. c #CEDCEC",
+"x. c #CEDBEB",
+"y. c #CCDAEA",
+"z. c #C9D9EB",
+"A. c #A3BDDC",
+"B. c #8AACD2",
+"C. c #85A9D0",
+"D. c #80A5CE",
+"E. c #CFDAF0",
+"F. c #838D9F",
+"G. c #616878",
+"H. c #869AC3",
+"I. c #83A5DE",
+"J. c #8AABD9",
+"K. c #BED1E6",
+"L. c #C1D3E8",
+"M. c #C4D6E8",
+"N. c #CAD9EB",
+"O. c #D1DEEE",
+"P. c #D2E0EE",
+"Q. c #D1DFED",
+"R. c #D0DEEC",
+"S. c #A4BEDB",
+"T. c #8FB1D4",
+"U. c #ACC4E1",
+"V. c #B5C1D5",
+"W. c #626979",
+"X. c #98ADDA",
+"Y. c #92B2D8",
+"Z. c #BDD1E6",
+"`. c #CEDDEC",
+" + c #D4E1EE",
+".+ c #D3E1EE",
+"++ c #D4E0EF",
+"@+ c #D3E0EE",
+"#+ c #9EBBD9",
+"$+ c #95B4D6",
+"%+ c #90B0D4",
+"&+ c #91B3D5",
+"*+ c #DBE2F2",
+"=+ c #626878",
+"-+ c #9EB6E1",
+";+ c #6F98D0",
+">+ c #93B2D6",
+",+ c #BDD2E6",
+"'+ c #C1D4E7",
+")+ c #C4D5E9",
+"!+ c #D0DEEE",
+"~+ c #D5E2EF",
+"{+ c #D7E2F0",
+"]+ c #D6E1EF",
+"^+ c #D6E1ED",
+"/+ c #D5E1EF",
+"(+ c #D3E0EF",
+"_+ c #D0DFEE",
+":+ c #9FBBDA",
+"<+ c #9AB7D8",
+"[+ c #8FB0D4",
+"}+ c #8AABD1",
+"|+ c #E7ECFA",
+"1+ c #626775",
+"2+ c #646775",
+"3+ c #9EB8E4",
+"4+ c #6F99CC",
+"5+ c #8BACD2",
+"6+ c #BFD0E6",
+"7+ c #C5D7E9",
+"8+ c #D2DFED",
+"9+ c #D7E2EF",
+"0+ c #D8E3F0",
+"a+ c #DAE5F1",
+"b+ c #D9E4EF",
+"c+ c #D8E4EF",
+"d+ c #D1E0EE",
+"e+ c #AFC6DF",
+"f+ c #A4C0DC",
+"g+ c #99B8D7",
+"h+ c #92B3D5",
+"i+ c #8DAED3",
+"j+ c #E7EBFA",
+"k+ c #666976",
+"l+ c #A1B9E1",
+"m+ c #6F99C8",
+"n+ c #7AA1CB",
+"o+ c #BDD0E6",
+"p+ c #C7D6E9",
+"q+ c #DBE6F2",
+"r+ c #DCE5F2",
+"s+ c #DCE5F1",
+"t+ c #D8E4F0",
+"u+ c #C3D4E9",
+"v+ c #AEC7E0",
+"w+ c #ABC3DE",
+"x+ c #9EBADA",
+"y+ c #98B6D6",
+"z+ c #92B1D3",
+"A+ c #E8EDFB",
+"B+ c #656876",
+"C+ c #A0B7DA",
+"D+ c #739BC8",
+"E+ c #7AA1CC",
+"F+ c #A2BEDB",
+"G+ c #C4D5E8",
+"H+ c #CFDEED",
+"I+ c #DAE4F0",
+"J+ c #DDE8F3",
+"K+ c #DFE9F2",
+"L+ c #DFEAF4",
+"M+ c #E0E8F2",
+"N+ c #DDE7F2",
+"O+ c #B8CDE3",
+"P+ c #B4CAE1",
+"Q+ c #AFC6E0",
+"R+ c #AAC2DE",
+"S+ c #A2BDDB",
+"T+ c #9DB9D9",
+"U+ c #E8ECFA",
+"V+ c #636777",
+"W+ c #96ACCA",
+"X+ c #7EA3CD",
+"Y+ c #7DA3CD",
+"Z+ c #86AAD0",
+"`+ c #BACDE5",
+" @ c #CCDCEC",
+".@ c #D4E1EF",
+"+@ c #D8E2EF",
+"@@ c #DEE7F3",
+"#@ c #E0EAF4",
+"$@ c #E1E9F2",
+"%@ c #E3EAF3",
+"&@ c #DDE8F2",
+"*@ c #CAD8EB",
+"=@ c #C1D4E6",
+"-@ c #B9CEE5",
+";@ c #A8C1DD",
+">@ c #A0BCD9",
+",@ c #A5C1DE",
+"'@ c #DEE3F3",
+")@ c #636877",
+"!@ c #8291A8",
+"~@ c #92B3D7",
+"{@ c #88ABD1",
+"]@ c #95B3D6",
+"^@ c #B0C7E0",
+"/@ c #FAFCFD",
+"(@ c #EEF3F7",
+"_@ c #DFE7F2",
+":@ c #DCE6F1",
+"<@ c #DEEAF2",
+"[@ c #DFE8F1",
+"}@ c #DCE6F2",
+"|@ c #D5E0EE",
+"1@ c #D4D8DD",
+"2@ c #DFDFDF",
+"3@ c #BFD1E5",
+"4@ c #BACDE3",
+"5@ c #B3C8E2",
+"6@ c #ABC3DD",
+"7@ c #C5D3EB",
+"8@ c #B8C0D1",
+"9@ c #676D7D",
+"0@ c #A8BFDD",
+"a@ c #85AAD0",
+"b@ c #9BB8D8",
+"c@ c #F0F4FA",
+"d@ c #F5F9FC",
+"e@ c #FCFDFD",
+"f@ c #F0F4F7",
+"g@ c #E3E9EF",
+"h@ c #D9E1EA",
+"i@ c #D5DEE5",
+"j@ c #D6DDE3",
+"k@ c #DFE3E7",
+"l@ c #E9ECEC",
+"m@ c #F1F2F2",
+"n@ c #E4E6E9",
+"o@ c #B6CCE4",
+"p@ c #AEC6DF",
+"q@ c #E0E6F6",
+"r@ c #818493",
+"s@ c #8794A9",
+"t@ c #A6C0DE",
+"u@ c #8DAED2",
+"v@ c #9EBAD9",
+"w@ c #A6C0DC",
+"x@ c #D1DFEE",
+"y@ c #EEF2F8",
+"z@ c #C6D6E7",
+"A@ c #E2E9F0",
+"B@ c #EFF2F5",
+"C@ c #F3F4F5",
+"D@ c #F3F4F4",
+"E@ c #F2F2F3",
+"F@ c #EAECEE",
+"G@ c #DFE3E6",
+"H@ c #EFEFF3",
+"I@ c #E5EBF3",
+"J@ c #BACEE5",
+"K@ c #B4C9E2",
+"L@ c #CAD8ED",
+"M@ c #CCD4E3",
+"N@ c #656977",
+"O@ c #646978",
+"P@ c #A6B3C7",
+"Q@ c #A8C2E0",
+"R@ c #A9C2DD",
+"S@ c #B5CBE3",
+"T@ c #F0F3F9",
+"U@ c #C9DBEA",
+"V@ c #F9FAFC",
+"W@ c #C6D5E7",
+"X@ c #C8D9EC",
+"Y@ c #E7EBF8",
+"Z@ c #717481",
+"`@ c #666C7A",
+" # c #B1BBCF",
+".# c #B2C9E3",
+"+# c #A2BDDA",
+"@# c #ACC2DE",
+"## c #B3C9E1",
+"$# c #E0E9F3",
+"%# c #F1F5F9",
+"&# c #F2F5FA",
+"*# c #CFDEEE",
+"=# c #EAEDFA",
+"-# c #7F8490",
+";# c #686C7B",
+"># c #BBC5D7",
+",# c #ACC4DF",
+"'# c #B5CBE2",
+")# c #E0E7F0",
+"!# c #F1F3F4",
+"~# c #D0E0EF",
+"{# c #EAEEFA",
+"]# c #818592",
+"^# c #707683",
+"/# c #CAD7EA",
+"(# c #C1D1E6",
+"_# c #D0D6DD",
+":# c #D8D9DB",
+"<# c #E5EAF8",
+"[# c #ACB0BC",
+"}# c #646976",
+"|# c #C7CFDE",
+"1# c #AFC7E0",
+"2# c #B9CCE4",
+"3# c #BFD4E7",
+"4# c #BDC5CF",
+"5# c #BDC4CD",
+"6# c #E8ECF9",
+"7# c #868895",
+"8# c #B5BCCB",
+"9# c #B9C4CF",
+"0# c #9DA3A9",
+"a# c #939595",
+"b# c #EAEDF8",
+"c# c #767B88",
+"d# c #8A8F9D",
+"e# c #D0DDEF",
+"f# c #B2C5D8",
+"g# c #B0C0CA",
+"h# c #B0BBBB",
+"i# c #80837C",
+"j# c #A5AB94",
+"k# c #B1B494",
+"l# c #ADB08A",
+"m# c #9C9D7A",
+"n# c #757567",
+"o# c #E3E6F3",
+"p# c #666977",
+"q# c #656A78",
+"r# c #C6CEDC",
+"s# c #B4BEC5",
+"t# c #A3AF9F",
+"u# c #A8B19D",
+"v# c #888B7B",
+"w# c #929683",
+"x# c #BBBEA1",
+"y# c #C1C2A0",
+"z# c #999A7D",
+"A# c #949477",
+"B# c #B3B48C",
+"C# c #A3A584",
+"D# c #A1A591",
+"E# c #E2E7EF",
+"F# c #9B9FAC",
+"G# c #6E717D",
+"H# c #CACFD7",
+"I# c #C0C8C8",
+"J# c #AEB7AD",
+"K# c #9CA296",
+"L# c #7E8174",
+"M# c #BFC2AC",
+"N# c #C5C8AC",
+"O# c #92937E",
+"P# c #B9BB9E",
+"Q# c #D5D8B7",
+"R# c #D1D5B9",
+"S# c #DBDEDD",
+"T# c #C3C6CE",
+"U# c #656776",
+"V# c #555744",
+"W# c #6E737A",
+"X# c #BFC4CC",
+"Y# c #D8DDE2",
+"Z# c #C9CFCA",
+"`# c #C2C7B9",
+" $ c #C3C7B4",
+".$ c #C7CBB2",
+"+$ c #CED2BB",
+"@$ c #DADBC8",
+"#$ c #E4E6DE",
+"$$ c #EEF0F5",
+"%$ c #B9BDBF",
+"&$ c #62666E",
+"*$ c #666635",
+"=$ c #A1A262",
+"-$ c #6E7276",
+";$ c #82868E",
+">$ c #B9BDC0",
+",$ c #D5D8DB",
+"'$ c #E1E4E7",
+")$ c #E6E9ED",
+"!$ c #E3E5E8",
+"~$ c #D9DBDC",
+"{$ c #BABCBC",
+"]$ c #757780",
+"^$ c #686A68",
+"/$ c #4E4E2F",
+"($ c #595A30",
+"_$ c #A3A456",
+":$ c #D3D58E",
+"<$ c #BEC19D",
+"[$ c #92968B",
+"}$ c #73767C",
+"|$ c #686B75",
+"1$ c #626571",
+"2$ c #6B6E77",
+"3$ c #76797A",
+"4$ c #8C8D7B",
+"5$ c #999772",
+"6$ c #8E8C5C",
+"7$ c #4D4D28",
+"8$ c #4C4C28",
+"9$ c #83834C",
+"0$ c #D8D9A1",
+"a$ c #F2F4D6",
+"b$ c #ECEEC0",
+"c$ c #EBEFBE",
+"d$ c #E9ECBB",
+"e$ c #E8EAB7",
+"f$ c #DCDEAB",
+"g$ c #CDCE99",
+"h$ c #BCBB87",
+"i$ c #9D9B6C",
+"j$ c #696740",
+"k$ c #4B4B28",
+"l$ c #636334",
+"m$ c #B3B35F",
+"n$ c #EFF0D4",
+"o$ c #FFFFFF",
+"p$ c #F8FADD",
+"q$ c #F4F7C6",
+"r$ c #F1F3C1",
+"s$ c #E9EBB8",
+"t$ c #DDDFAC",
+"u$ c #C8C997",
+"v$ c #A3A376",
+"w$ c #8F8D61",
+"x$ c #67663D",
+"y$ c #4C4C29",
+"z$ c #5B5C32",
+"A$ c #A9A959",
+"B$ c #DBDDA0",
+"C$ c #F4F6DA",
+"D$ c #F3F6C7",
+"E$ c #F4F7C5",
+"F$ c #EDF0BF",
+"G$ c #DADCAD",
+"H$ c #C6C89A",
+"I$ c #B8B989",
+"J$ c #B8B683",
+"K$ c #A6A471",
+"L$ c #8E8B5E",
+"M$ c #7E7E49",
+"N$ c #DADBA2",
+"O$ c #F2F3D7",
+"P$ c #EDEFC2",
+"Q$ c #ECF0BE",
+"R$ c #E9EBBA",
+"S$ c #E6E8B5",
+"T$ c #CDCD99",
+"U$ c #BCBB86",
+"V$ c #A09E6E",
+"W$ c #707048",
+"X$ c #616132",
+"Y$ c #B2B260",
+"Z$ c #CACB97",
+"`$ c #A8A778",
+" % c #9B996C",
+".% c #949161",
+"+% c #54542F",
+"@% c #5D5D31",
+"#% c #ACAC5A",
+"$% c #DBDCA1",
+"%% c #F0F3C1",
+"&% c #DDDFB0",
+"*% c #C8C89C",
+"=% c #B9BA8C",
+"-% c #BDBE8A",
+";% c #ACAA76",
+">% c #898658",
+",% c #52522E",
+"'% c #474726",
+")% c #5C5C32",
+"!% c #969660",
+"~% c #C4C790",
+"{% c #D8D9A5",
+"]% c #D8DBAB",
+"^% c #D2D4A5",
+"/% c #C8C899",
+"(% c #B4B586",
+"_% c #9C9D6F",
+":% c #86865A",
+"<% c #66653F",
+"[% c #4E4E29",
+"}% c #444424",
+"|% c #404022",
+"1% c #4C4C2F",
+"2% c #505031",
+"3% c #535331",
+"4% c #4F4F2C",
+"5% c #525232",
+"6% c #4F4F31",
+"7% c #4B4B31",
+"8% c #3A3A1F",
+"9% c #3D3D3D",
+"0% c #636363",
+"a% c #B9B9B9",
+"b% c #C0C0C0",
+"c% c #AFAFAF",
+"d% c #8D8D8D",
+"e% c #565656",
+"f% c #383838",
+"g% c #555555",
+"h% c #848484",
+"i% c #B8B8B8",
+"j% c #A8A8A8",
+"k% c #707070",
+"l% c #525252",
+"m% c #5A5A5A",
+"n% c #595959",
+"o% c #4F4F4F",
+" ",
+" ",
+" . + @ # $ % & * ",
+" % = - ; > , ' ) ! ~ { ] ",
+" ^ / ( _ : < [ } | 1 2 3 4 5 6 7 ",
+" 7 8 9 0 a b c d e f g h i j k l m n ",
+" o p q r s t u v w x y z A B C D E F G H ",
+" I J K L M N O w P Q R S S T U V W X Y Z ` . ",
+" ..+. at .#.$.N U x Q %.R R R R &.*.u =.-.;.>.F ,.+ ",
+" '.).!.~.{.A T y ].^./.(._.:.<.[.T }.|.1.2.3.4.5. ",
+" 6.7.8.9.0.V U w R /.a.b.c.c.d.e.(.f.O g.h.i.2.j.k.l. ",
+" m.n.o.p.q.=.A S /.:.r.s.t.u.v.w.x.y.z.A A.B.C.D.E.F. ",
+" G.H.I.J.K.L.M.O N.<.b.t.O.P.Q.Q.u.R.s._.w S.T.B.C.U.V.7 ",
+" W.X.o.Y.Z.|.=.x ^.d.`.Q.Q. + +.+++ at +t.r.z.#+$+%+B.&+*+=+ ",
+" 7 -+;+>+,+'+)+R _.`.!+ at +~+~+{+]+^+/+(+_+L.:+<+$+[+}+|+1+ ",
+" 2+3+4+5+6+|.7+N.r.v.8+++9+0+a+b+c+c+ +d+e+f+:+g+h+i+j+k+ ",
+" 1+l+m+n+o+B p+/.w.8+++9+a+a+q+r+s+a+t+u+v+w+f+x+y+z+A+B+ ",
+" & C+D+E+F+G+y %.H+ at +^+c+I+J+K+L+M+N+%.O+P+Q+R+S+T+$+U+V+ ",
+" + W+X+Y+Z+`+v @H+. at +@q+@@#@$@%@&@*@=@Z.- at P+-.;@>@,@'@)@ ",
+" !@~@2.{@]@^@u /@(@_@:@<@[@}@|@ 1 at 2@3 at 4@5 at 6@f+7 at 8@ ",
+" 9 at 0@a at B.>+b at S+c@d at e@f at g@h at i@j at k@l at m@n at V o+o at p@;@q at r@ ",
+" s at t@u@]@v at w@x at y@z at A@B at C@D at E@F at G@H at I@ =@J at K@L at M@N@ ",
+" O at P@Q at y+>@R at S@T at U@ V@ W at o+X@Y at Z@ ",
+" `@ #.#+#@###$#:@ %#&# *#=#-# ",
+" ;#>#S@,#'#v.)# !# ~#{#]# ",
+" ^#/#v+o@(#_# :# <#[# ",
+" }#|#1#2#3#4#5# 6#7# ",
+" 8#t O+=@9#0# a# b#c# ",
+" d#e#f#g#h#i#j#k#l#m#n# o#p# ",
+" q#r#s#t#u#v#w#x#y#z#A#B#C#D#E#F# ",
+" G#H#I#J#K#L#M#N#O#P#Q#R#S#T#U# ",
+" V#W#X#Y#Z#`# $.$+$@$#$$$%$&$ ",
+" *$=$-$;$>$,$'$)$!$~${$]$^$/$ ",
+" ($_$:$<$[$}$|$1$2$3$4$5$6$7$ ",
+" 8$9$0$a$b$c$d$e$f$g$h$i$j$k$ ",
+" l$m$n$o$p$q$r$s$t$u$v$w$x$y$ ",
+" z$A$B$C$D$E$F$G$H$I$J$K$L$7$ ",
+" 8$M$N$O$P$Q$R$S$f$T$U$V$W$8$ ",
+" X$Y$n$o$p$q$r$s$t$Z$`$ %.%+% ",
+" @%#%$%C$D$q$%%&%*%=%-%;%>%,% ",
+" '%)%!%~%{%]%^%/%(%_%:%<%[%}% ",
+" |%1%2%3%4%4%5%6%7%8% ",
+" 9%0%a%b%c%d%e%f% ",
+" g%h%i%j%k%l% ",
+" l%m%n%o% ",
+" ",
+" ",
+" "
+};
+
+/* XPM */
+const char * dialog_warning_48_icon[] = {
+"48 48 305 2",
+" c None",
+". c #A10000",
+"+ c #A00000",
+"@ c #A20000",
+"# c #B72323",
+"$ c #DE6868",
+"% c #DF6969",
+"& c #BC2828",
+"* c #A70B0B",
+"= c #E16F6F",
+"- c #D22020",
+"; c #D11A1A",
+"> c #E16C6C",
+", c #A90E0E",
+"' c #CE4C4C",
+") c #D94040",
+"! c #CC0000",
+"~ c #D73939",
+"{ c #CF4A4A",
+"] c #AA1414",
+"^ c #E26F6F",
+"/ c #CD0707",
+"( c #CD0505",
+"_ c #E06666",
+": c #AF1717",
+"< c #A30000",
+"[ c #D25252",
+"} c #D73636",
+"| c #D52F2F",
+"1 c #D44F4F",
+"2 c #B01A1A",
+"3 c #CD0404",
+"4 c #D03A3A",
+"5 c #D14040",
+"6 c #CC0202",
+"7 c #DF5E5E",
+"8 c #B31C1C",
+"9 c #D55858",
+"0 c #D63030",
+"a c #D8B6B6",
+"b c #DAC1C1",
+"c c #CC0606",
+"d c #D42626",
+"e c #D75353",
+"f c #B32020",
+"g c #E16767",
+"h c #D25050",
+"i c #DCDCDC",
+"j c #D36060",
+"k c #CC0101",
+"l c #DD5555",
+"m c #B92222",
+"n c #D85E5E",
+"o c #D42828",
+"p c #CC0404",
+"q c #DABFBF",
+"r c #DBC9C9",
+"s c #CD0A0A",
+"t c #D21D1D",
+"u c #D85555",
+"v c #A20202",
+"w c #B72828",
+"x c #DF6060",
+"y c #D35B5B",
+"z c #DDDDDD",
+"A c #D56B6B",
+"B c #DB4C4C",
+"C c #BC2727",
+"D c #A10101",
+"E c #DB6363",
+"F c #D32121",
+"G c #CD0808",
+"H c #DBC5C5",
+"I c #DEDEDE",
+"J c #DDD1D1",
+"K c #CE1010",
+"L c #D01616",
+"M c #DA5656",
+"N c #A20303",
+"O c #BC2D2D",
+"P c #DE5959",
+"Q c #D36565",
+"R c #DFDFDF",
+"S c #D67676",
+"T c #D94242",
+"U c #C02C2C",
+"V c #DC6767",
+"W c #CD0C0C",
+"X c #DCCCCC",
+"Y c #DED6D6",
+"Z c #CE1616",
+"` c #CF1010",
+" . c #DB5656",
+".. c #A30505",
+"+. c #BF3333",
+"@. c #DC5252",
+"#. c #D56F6F",
+"$. c #E0E0E0",
+"%. c #D88484",
+"&. c #C43030",
+"*. c #DE6A6A",
+"=. c #D01515",
+"-. c #CD1111",
+";. c #DCD1D1",
+">. c #949494",
+",. c #777777",
+"'. c #959595",
+"). c #E1DCDC",
+"!. c #CF1D1D",
+"~. c #CE0A0A",
+"{. c #DB5252",
+"]. c #A50909",
+"^. c #C53A3A",
+"/. c #DB4B4B",
+"(. c #D57878",
+"_. c #454545",
+":. c #000000",
+"<. c #E1E1E1",
+"[. c #D98F8F",
+"}. c #D63131",
+"|. c #C83333",
+"1. c #A50808",
+"2. c #E06B6B",
+"3. c #CD1717",
+"4. c #DCD5D5",
+"5. c #505050",
+"6. c #515151",
+"7. c #E2E0E0",
+"8. c #D02727",
+"9. c #CD0606",
+"0. c #DB4E4E",
+"a. c #A90C0C",
+"b. c #C84040",
+"c. c #DA4444",
+"d. c #D68383",
+"e. c #5C5C5C",
+"f. c #5D5D5D",
+"g. c #E2E2E2",
+"h. c #DC9C9C",
+"i. c #D42929",
+"j. c #CA3636",
+"k. c #A70C0C",
+"l. c #E06A6A",
+"m. c #CE0B0B",
+"n. c #CE1E1E",
+"o. c #DEDADA",
+"p. c #696969",
+"q. c #6A6A6A",
+"r. c #E3E3E3",
+"s. c #E4E3E3",
+"t. c #D13131",
+"u. c #DB4949",
+"v. c #AB1010",
+"w. c #CC4646",
+"x. c #D83C3C",
+"y. c #D78D8D",
+"z. c #757575",
+"A. c #E4E4E4",
+"B. c #DFAAAA",
+"C. c #CD3838",
+"D. c #A81111",
+"E. c #E06969",
+"F. c #CE0808",
+"G. c #CF2626",
+"H. c #DEDCDC",
+"I. c #818181",
+"J. c #E5E5E5",
+"K. c #D23C3C",
+"L. c #B01414",
+"M. c #D04A4A",
+"N. c #D73535",
+"O. c #D89797",
+"P. c #8C8C8C",
+"Q. c #8E8E8E",
+"R. c #E6E6E6",
+"S. c #E0B4B4",
+"T. c #AC1616",
+"U. c #E06767",
+"V. c #D02F2F",
+"W. c #DFDEDE",
+"X. c #989898",
+"Y. c #999999",
+"Z. c #E7E7E7",
+"`. c #D44949",
+" + c #D83B3B",
+".+ c #B31818",
+"++ c #DAA3A3",
+"@+ c #A4A4A4",
+"#+ c #A5A5A5",
+"$+ c #E3C1C1",
+"%+ c #D01414",
+"&+ c #D23B3B",
+"*+ c #A00101",
+"=+ c #B11C1C",
+"-+ c #E06262",
+";+ c #CD0303",
+">+ c #D13838",
+",+ c #C7C7C7",
+"'+ c #E8E8E8",
+")+ c #E9E9E9",
+"!+ c #D75555",
+"~+ c #D63333",
+"{+ c #B81B1B",
+"]+ c #D55656",
+"^+ c #DBADAD",
+"/+ c #B0B0B0",
+"(+ c #B1B1B1",
+"_+ c #E6CCCC",
+":+ c #CF0E0E",
+"<+ c #D43939",
+"[+ c #B52222",
+"}+ c #DF5D5D",
+"|+ c #D14242",
+"1+ c #595959",
+"2+ c #636363",
+"3+ c #EAEAEA",
+"4+ c #D96262",
+"5+ c #D52C2C",
+"6+ c #BB1D1D",
+"7+ c #D85B5B",
+"8+ c #D32222",
+"9+ c #DDB7B7",
+"0+ c #0B0B0B",
+"a+ c #0D0D0D",
+"b+ c #EBEBEB",
+"c+ c #E8D4D4",
+"d+ c #CD0909",
+"e+ c #D53838",
+"f+ c #A40404",
+"g+ c #BB2828",
+"h+ c #DD5656",
+"i+ c #D24C4C",
+"j+ c #323232",
+"k+ c #313131",
+"l+ c #ECECEC",
+"m+ c #DB6F6F",
+"n+ c #D32525",
+"o+ c #BF1E1E",
+"p+ c #A10202",
+"q+ c #DB5F5F",
+"r+ c #D11B1B",
+"s+ c #DDBFBF",
+"t+ c #CCCCCC",
+"u+ c #626262",
+"v+ c #616161",
+"w+ c #CACACA",
+"x+ c #EBDDDD",
+"y+ c #CE0E0E",
+"z+ c #D53535",
+"A+ c #A40505",
+"B+ c #BD2E2E",
+"C+ c #DC4F4F",
+"D+ c #D45757",
+"E+ c #EDEDED",
+"F+ c #EEEEEE",
+"G+ c #DD7B7B",
+"H+ c #D21F1F",
+"I+ c #C32020",
+"J+ c #A20404",
+"K+ c #DD6262",
+"L+ c #DEC7C7",
+"M+ c #EEE5E5",
+"N+ c #D53131",
+"O+ c #A60707",
+"P+ c #960000",
+"Q+ c #C02D2D",
+"R+ c #D03636",
+"S+ c #E1DFDF",
+"T+ c #EFEFEF",
+"U+ c #D95858",
+"V+ c #C41E1E",
+"W+ c #9E0000",
+"X+ c #9F0000",
+"Y+ c #D21C1C",
+"Z+ c #D42E2E",
+"`+ c #9F0101",
+" @ c #9D0000",
+".@ c #D85757",
+"+@ c #D12C2C",
+"@@ c #830000",
+"#@ c #B01B1B",
+"$@ c #DA5757",
+"%@ c #E06464",
+"&@ c #E06363",
+"*@ c #DF6161",
+"=@ c #DF5F5F",
+"-@ c #DE5C5C",
+";@ c #DE5A5A",
+">@ c #DD5757",
+",@ c #DD5454",
+"'@ c #DC5050",
+")@ c #DB4D4D",
+"!@ c #DB4A4A",
+"~@ c #DA4848",
+"{@ c #DA4747",
+"]@ c #DA4545",
+"^@ c #D94343",
+"/@ c #D83E3E",
+"(@ c #D83D3D",
+"_@ c #D73838",
+":@ c #D02A2A",
+"<@ c #B00F0F",
+"[@ c #920000",
+"}@ c #860000",
+"|@ c #900000",
+" ",
+" ",
+" ",
+" ",
+" ",
+" . + + @ ",
+" @ # $ % & @ ",
+" * = - ; > , ",
+" . ' ) ! ! ~ { @ ",
+" ] ^ / ! ! ( _ : ",
+" < [ } ! ! ! ! | 1 . ",
+" 2 > 3 ! 4 5 ! 6 7 8 ",
+" @ 9 0 ! 6 a b c ! d e . ",
+" f g 6 ! h i i j ! k l m ",
+" . n o ! p q i i r s ! t u v ",
+" w x ! ! y i z z z A ! ! B C . ",
+" D E F ! G H z z z I J K ! L M N ",
+" O P ! ! Q z z z I I R S ! ! T U + ",
+" N V ; ! W X z z I I R R Y Z ! ` ... ",
+" . +. at .! ! #.z z I I R R R $.%.! ! ~ &.@ ",
+" ..*.=.! -.;.z I >.,.,.'.$.$.).!.! ~.{.]. ",
+" < ^./.! ! (.z I I _.:.:._.$.<.<.[.! ! }.|.. ",
+" 1.2.` ! 3.4.I I R 5.:.:.6.<.<.<.7.8.! 9.0.a. ",
+" @ b.c.! ! d.I I R R e.:.:.f.<.<.g.g.h.! ! i.j.@ ",
+" k.l.m.! n.o.I R R R p.:.:.q.<.g.g.r.s.t.! 3 u.v. ",
+" . w.x.! ! y.I R R R $.z.:.:.z.g.g.r.A.A.B.! ! F C.. ",
+" D.E.F.! G.H.R R R $.$.I.:.:.I.r.r.A.A.J.J.K.! 6 T L. ",
+" < M.N.! ! O.R R R $.$.<.P.:.:.Q.r.A.A.J.J.R.S.k ! ; 4 . ",
+" T.U.( ! V.W.R R $.$.<.<.X.:.:.Y.A.A.J.J.R.R.Z.`.! ! +.+ ",
+" . h | ! ! ++R R $.$.<.<.<. at +:.:.#+A.J.J.R.R.Z.Z.$+6 ! %+&+*+ ",
+" =+-+;+! >+R R $.$.<.<.g.g.,+q.q.,+J.J.R.R.Z.'+'+)+!+! ! ~+{+. ",
+" . ]+o ! ! ^+R $.$.<.<.g.g.r.g./+(+A.J.R.R.Z.'+'+)+)+_+9.! :+<+v ",
+" [+}+k ! |+$.$.$.<.<.g.g.r.r.1+:.:.2+R.R.Z.'+'+)+)+3+3+4+! ! 5+6+< ",
+" D 7+8+! 6 9+$.$.<.<.g.g.r.r.A.0+:.:.a+R.Z.'+'+)+)+3+3+b+c+d+! ~.e+f+ ",
+" g+h+! ! i+$.$.<.<.g.g.r.r.A.A.j+:.:.k+Z.'+'+)+)+3+3+b+b+l+m+! ! n+o+@ ",
+" p+q+r+! 3 s+$.<.<.g.g.r.r.A.A.J.t+u+v+w+'+'+)+)+3+3+b+b+l+l+x+y+! / z+A+ ",
+" + B+C+! ! D+$.<.<.g.g.r.r.A.A.J.J.R.R.Z.'+'+)+)+3+3+b+b+l+l+E+F+G+! ! H+I+@ ",
+" J+K+L ! c L+<.<.g.g.r.r.A.A.J.J.R.R.Z.'+'+)+)+3+3+b+b+l+l+E+F+F+M+L ! 3 N+O+ ",
+" P+Q+B ! ! R+S+<.g.g.r.r.A.A.J.J.R.R.Z.'+'+)+)+3+3+b+b+l+l+E+F+F+T+T+U+! ! ; V+W+ ",
+" X+U+Y+! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! 3 Z+`+ ",
+" @. at n+( ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! 6 m.+@*+ ",
+" @@#@$@-+_ %@&@*@=@7 -@;@P >@l ,@@.'@C+)@B !@~@{@]@^@T ) /@(@ +~ _@} N.~+| :@<@[@ ",
+" }@X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+|@ ",
+" ",
+" ",
+" ",
+" ",
+" "
+};
+
+/* XPM */
+const char *refresh_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 94 2",
+" c #3465A4",
+". c #3565A4",
+"X c #3566A4",
+"o c #3566A5",
+"O c #3667A5",
+"+ c #3767A5",
+"@ c #3767A6",
+"# c #3768A5",
+"$ c #3768A6",
+"% c #3868A6",
+"& c #3869A6",
+"* c #3969A6",
+"= c #3969A7",
+"- c #3A69A7",
+"; c #3A6AA6",
+": c #3A6AA7",
+"> c #3B6BA7",
+", c #3C6BA8",
+"< c #3C6BA9",
+"1 c #3C6CA9",
+"2 c #3D6DA9",
+"3 c #4170AB",
+"4 c #4371AB",
+"5 c #4774AD",
+"6 c #4B77AF",
+"7 c #4C77AF",
+"8 c #4C78AF",
+"9 c #4C78B0",
+"0 c #4D79B0",
+"q c #4E7AB1",
+"w c #4F7CB6",
+"e c #537FB7",
+"r c #5580B5",
+"t c #5B84B7",
+"y c #5D85B7",
+"u c #5F87B9",
+"i c #6188B9",
+"p c #6890C0",
+"a c #6990C0",
+"s c #6D94C2",
+"d c #6891C7",
+"f c #6C95C9",
+"g c #7298C5",
+"h c #82A5CE",
+"j c #84A6CE",
+"k c #88A7CE",
+"l c #88ABD2",
+"z c #8AACD3",
+"x c #8FACD0",
+"c c #8CADD3",
+"v c #8FADD2",
+"b c #8EAED3",
+"n c #8FB0D3",
+"m c #93B1D4",
+"M c #95B2D4",
+"N c #9CB7D7",
+"B c #97B6D8",
+"V c #99B9DB",
+"C c #9DBDDC",
+"Z c #A1BBD9",
+"A c #A1BEDD",
+"S c #A0BEDE",
+"D c #A8C1DE",
+"F c #A8C2DF",
+"G c #B0C9E3",
+"H c #B4CAE3",
+"J c #B4CBE5",
+"K c #BCD1E7",
+"L c #BFD2E7",
+"P c #BFD3E9",
+"I c #C1D2E6",
+"U c #C7D7E9",
+"Y c #C4D7EB",
+"T c #C6D8EB",
+"R c #C8D8EA",
+"E c #C9D9EA",
+"W c #CDDBEB",
+"Q c #C9DAEC",
+"! c #CCDCED",
+"~ c #CCDDEE",
+"^ c #D5E2F0",
+"/ c #D8E4F1",
+"( c #DBE6F2",
+") c #DDE8F3",
+"_ c #E0E9F4",
+"` c #E2EBF5",
+"' c #E3ECF5",
+"] c #E4ECF5",
+"[ c #E4EDF5",
+"{ c #E5EDF5",
+"} c #E5EDF6",
+"| c #E6EEF6",
+" . c #E7EEF6",
+".. c None",
+/* pixels */
+"........% % % % , ..............",
+"......% a n F F m u % ......O ..",
+"....% c C A J P ~ ^ L 0 # 4 ..",
+"..% a g 1 # % y Z / / ) k E % ..",
+"..% 4 1 % ......% i W ` | | % ..",
+"..O % d % .......... U T ' % ..",
+"..O ..............% x | / | , ..",
+"................ O 6 8 8 8 O ..",
+".. O O ................",
+".. | ' ` N O ..............O ..",
+"..O | U E ..........O f r ..",
+"..O | ` | I 0 % ......< w % # ..",
+"..% / M ` ) ! c 9 O % % 1 0 : ..",
+"..O y O 0 J Q K G A z h b % ....",
+".. O ....% r h B V z s % ......",
+"..O ..........: # O : : ........"
+};
+
+/* XPM */
+const char *text_editor_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 52 1",
+" c #000000",
+". c #4C4226",
+"X c #6B5736",
+"o c #705B39",
+"O c #636363",
+"+ c #717171",
+"@ c #757575",
+"# c #8F5902",
+"$ c #C4A000",
+"% c #EBB13D",
+"& c #A18355",
+"* c #A08356",
+"= c #A38555",
+"- c #A08457",
+"; c #A48757",
+": c #C89F64",
+"> c #CEA668",
+", c #CFAA69",
+"< c #D2AC6A",
+"1 c #CFAD71",
+"2 c #868686",
+"3 c #888A85",
+"4 c #8C8C8C",
+"5 c #8F8F8F",
+"6 c #9D9D9D",
+"7 c #AEAEAE",
+"8 c #B1B1B1",
+"9 c #B2B2B2",
+"0 c #B7B7B7",
+"q c #B8B8B8",
+"w c #BCBCBC",
+"e c #C2AB8A",
+"r c #C4C4C4",
+"t c #CACACA",
+"y c #CBCBCB",
+"u c #CCCCCC",
+"i c #D3D3D3",
+"p c #D6D6D6",
+"a c #DADADA",
+"s c #DBDBDB",
+"d c #EDE5C4",
+"f c #EDE6C5",
+"g c #EEEAC6",
+"h c #EFEBC7",
+"j c #F9E8C6",
+"k c #E9E9E9",
+"l c #EAEAEA",
+"z c #EBEBEB",
+"x c #ECECEC",
+"c c #EEEEEE",
+"v c #FFFFFF",
+"b c None",
+/* pixels */
+"bbbbbbbbbbbbbbbb",
+"bbb$b$b$b$b$bbbb",
+"bb$j$j$j$j$j$bbb",
+"b3$%$%$%$%$%$##b",
+"b3z$w$q$q$0$#h1#",
+"b3vxxxxxxxi#h<&#",
+"b3vsuuuuu0#h<;#b",
+"b3vxxxxxi#h,&#bb",
+"b3vsuuu0#f>-#3bb",
+"b3vxxxz#f:=#+3bb",
+"b3vsut+oe=#523bb",
+"b3vxzz#.X#6p73bb",
+"b3vstr #O4ts93bb",
+"b3vxzzzzzzzx93bb",
+"b3x99999999993bb",
+"b3333333333333bb"
+};
+
+/* XPM */
+const char *text_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 21 1",
+" c #818181",
+". c #959595",
+"X c #999999",
+"o c #C4C4C4",
+"O c #C5C5C5",
+"+ c #C6C6C6",
+"@ c #C7C7C7",
+"# c #C8C8C8",
+"$ c #EDEDE5",
+"% c #EDEDE6",
+"& c #EAEAEA",
+"* c #EBEBEB",
+"= c #ECECEC",
+"- c #EDEDED",
+"; c #EEEEEE",
+": c #EFEFEF",
+"> c #F0F0F0",
+", c #F1F1F1",
+"< c #F2F2F2",
+"1 c #FFFFFF",
+"2 c None",
+/* pixels */
+"X 222",
+" 111111111111 22",
+" 1=&==&====>1 22",
+" 1&oooo#oo#>1 22",
+" 1&=&=====>>1 22",
+" 1=o#oo##o#>1 22",
+" 1&=====%==>1 22",
+" 1=oo#o>:%=>1 22",
+" 1====>=>:>>1 22",
+" 1=##o#####>1 22",
+" 1===>=>>>><1 22",
+" 1=o#####>><1 22",
+" 1===>>>>>>>1 22",
+" 111111111111 22",
+". .22",
+"2222222222222222"
+};
+
+/* XPM */
+const char *shutdown_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 66 1",
+" c #272727",
+". c #282828",
+"X c #2B2B2B",
+"o c #2D2D2D",
+"O c #515151",
+"+ c #555555",
+"@ c #5F5F5F",
+"# c #606060",
+"$ c #616161",
+"% c #656565",
+"& c #6C6C6C",
+"* c #6D6D6D",
+"= c #6F6F6F",
+"- c #7A7A7A",
+"; c #7D7D7D",
+": c #808080",
+"> c #848484",
+", c #858585",
+"< c #888A85",
+"1 c #8E8E8E",
+"2 c #8F8F8F",
+"3 c #A0A0A0",
+"4 c #A2A2A2",
+"5 c #A6A6A6",
+"6 c #A9A9A9",
+"7 c #ABABAB",
+"8 c #B3B3B3",
+"9 c #B9B9B9",
+"0 c #BBBBBB",
+"q c #BCBCBC",
+"w c #C1C1C1",
+"e c #C2C2C2",
+"r c #C3C3C3",
+"t c #C5C5C5",
+"y c #C7C7C7",
+"u c #C9C9C9",
+"i c #CCCCCC",
+"p c #D2D2D2",
+"a c #D4D4D4",
+"s c #D8D8D8",
+"d c #DEDEDE",
+"f c #DFDFDF",
+"g c #E0E0E0",
+"h c #E1E1E1",
+"j c #E2E2E2",
+"k c #E3E3E3",
+"l c #E4E4E4",
+"z c #E5E5E5",
+"x c #E6E6E6",
+"c c #E7E7E7",
+"v c #E8E8E8",
+"b c #E9E9E9",
+"n c #EAEAEA",
+"m c #EBEBEB",
+"M c #ECECEC",
+"N c #EDEDED",
+"B c #EEEEEE",
+"V c #EFEFEF",
+"C c #F0F0F0",
+"Z c #F1F1F1",
+"A c #F3F3F3",
+"S c #F4F4F4",
+"D c #F5F5F5",
+"F c #F6F6F6",
+"G c #F7F7F7",
+"H c None",
+/* pixels */
+"H<<<<<<<<<<<<<<H",
+"<kkkkkkkkkkkkkk<",
+"<kkVFFGFFFFFFlk<",
+"<kVFFFFFFFFFFAl<",
+"<lAAAi>>>>1AAAl<",
+"<lAAAOOOOO kAAn<",
+"<nAVV+;::1 dVVn<",
+"<nVVn at 538qXdVnn<",
+"<nVnn%59rioknnV<",
+"<Vnkl-yVnk#llkV<",
+"<Vnkk;dFFF=dkkV<",
+"<Vldk>3rr9;addV<",
+"<Vnddi&=#&7pddA<",
+"<VAndkd9rripdAV<",
+"<VVAAVVAAVAVVAA<",
+"H<<<<<<<<<<<<<<H"
+};
+
+/* XPM */
+const char *applications_system_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 17 1",
+" c #3F638F",
+". c #426B9C",
+"X c #436FA5",
+"o c #467ABA",
+"O c #457ABE",
+"+ c #497CBA",
+"@ c #4C7FBD",
+"# c #5682B7",
+"$ c #5686C3",
+"% c #6490C7",
+"& c #7CA1CF",
+"* c #82A5D1",
+"= c #86A7D2",
+"- c #8FAED5",
+"; c #9DB8DA",
+": c #BCCDE3",
+"> c None",
+/* pixels */
+">>>>>>>>>>>>>>>>",
+">>>>>>OOO>>>>>>>",
+">>>OO>O:O>OO>>>>",
+">>O:=O%;%O=:O>>>",
+">>O=;;;;;;;=O>>>",
+">>>O;&o$o*;O>>>>",
+">OO%;o.> +;%OO>>",
+">O:;;$>>>$;;:O>>",
+">OO%;@#>Xo;%OO>>",
+">>>O:&@$o-;O>>>>",
+">>O=;;;;;;;=O>>>",
+">>O:=O%;%O=:O>>>",
+">>>OO>O:O>OO>>>>",
+">>>>>>OOO>>>>>>>",
+">>>>>>>>>>>>>>>>",
+">>>>>>>>>>>>>>>>"
+};
+
+// ---------------------------------------------------------------------
+// End Tango icons
+// ---------------------------------------------------------------------
+
+// audio-card from gnome icon theme
+
+/* XPM */
+const char *audio_card_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 102 2",
+" c #3A3E00",
+". c #3A3F00",
+"X c #3B3F00",
+"o c #2F3536",
+"O c #303634",
+"+ c #303735",
+"@ c #303637",
+"# c #363D32",
+"$ c #323835",
+"% c #313836",
+"& c #333936",
+"* c #323937",
+"= c #343936",
+"- c #383E31",
+"; c #3B4000",
+": c #3D4104",
+"> c #3E4206",
+", c #657000",
+"< c #677300",
+"1 c #687400",
+"2 c #687502",
+"3 c #687505",
+"4 c #6B7704",
+"5 c #6B7901",
+"6 c #6C7900",
+"7 c #6C7801",
+"8 c #6D7A00",
+"9 c #6C7A02",
+"0 c #6F7D01",
+"q c #707E02",
+"w c #707E07",
+"e c #404630",
+"r c #3D5B50",
+"t c #38595E",
+"y c #38595F",
+"u c #395A5F",
+"i c #365761",
+"p c #405C4F",
+"a c #545650",
+"s c #545652",
+"d c #555753",
+"f c #565852",
+"g c #565853",
+"h c #565854",
+"j c #575955",
+"k c #585A56",
+"l c #5A5C58",
+"z c #5D5E5B",
+"x c #5E5F5C",
+"c c #426050",
+"v c #426251",
+"b c #646662",
+"n c #656663",
+"m c #666864",
+"M c #676965",
+"N c #696A67",
+"B c #696B67",
+"V c #6E6F6D",
+"C c #6E706C",
+"Z c #6F716D",
+"A c #758201",
+"S c #748202",
+"D c #798708",
+"F c #7F8839",
+"G c #A3B31A",
+"H c #A4B31A",
+"J c #A4B419",
+"K c #AABA1A",
+"L c #858E39",
+"P c #848D3B",
+"I c #878F3D",
+"U c #87903B",
+"Y c #8A9539",
+"T c #8C9638",
+"R c #919C38",
+"E c #949E39",
+"W c #959F3A",
+"Q c #959F3B",
+"! c #929D3C",
+"~ c #939E3C",
+"^ c #959F3D",
+"/ c #95A03C",
+"( c #96A03C",
+") c #97A03C",
+"_ c #97A13C",
+"` c #97A23D",
+"' c #D8EB31",
+"] c #DBEF33",
+"[ c #DFF234",
+"{ c #E0F338",
+"} c #E4F839",
+"| c #E8FB38",
+" . c #EBFF39",
+".. c #EFFF65",
+"X. c #B7B9B5",
+"o. c #C4C6C2",
+"O. c #C6C8C4",
+"+. c #C7C9C5",
+"@. c #C8CAC6",
+"#. c #D0D2CE",
+"$. c #D4D6D2",
+"%. c None",
+/* pixels */
+"%.%.%.%.%.%.%.%.%.%.%.%.j k j %.",
+"%.%.%.%.%.%.%.%.%.%.%.d O.#.X.d ",
+"X a $.d d %.",
+" E W W W Q Q ( ( ( ^ f $.d %.%.",
+" ` e * * % % + # c v f $.d l x ",
+" ` + V Z Z Z C & y u f $.d o.d ",
+" ` + Z d d d N = 3 8 f $.d h g ",
+" _ + B M m n b $ p t f $.d %.%.",
+" ) - @ o o o o O r i f $.d k z ",
+" / A q 0 9 5 2 1 < , f $.d @.d ",
+" ~ K S J 6 H 7 G U I f $.d d h ",
+" ! { D ' 4 ] w [ P : a $.d %.%.",
+" T ..R } L | Y .F > s $.d %.%.",
+"; X X X X X X . . . . s +.d %.%.",
+"%.%.%.%.%.%.%.%.%.%.%.d d d %.%.",
+"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%."
+};
+
+// help-about from gnome
+
+/* XPM */
+const char *help_about_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 76 1",
+" c #C4A001",
+". c #C5A101",
+"X c #C5A102",
+"o c #C6A202",
+"O c #C6A203",
+"+ c #C7A403",
+"@ c #C7A404",
+"# c #C7A405",
+"$ c #C7A406",
+"% c #C7A407",
+"& c #C7A507",
+"* c #C8A508",
+"= c #C9A70B",
+"- c #C9A80D",
+"; c #CAA80C",
+": c #C9A810",
+"> c #CCAC12",
+", c #CCAC14",
+"< c #CDAE1B",
+"1 c #CFB11C",
+"2 c #D0B11F",
+"3 c #CFB021",
+"4 c #D2B522",
+"5 c #D3B62C",
+"6 c #D2B62F",
+"7 c #F6E132",
+"8 c #F6E235",
+"9 c #F5E038",
+"0 c #F7E23A",
+"q c #F8E33C",
+"w c #F8E43E",
+"e c #D9C04A",
+"r c #E4CE4C",
+"t c #E4CE4F",
+"y c #E7D041",
+"u c #E7D247",
+"i c #EBD755",
+"p c #EBD756",
+"a c #ECD85A",
+"s c #F8E441",
+"d c #F9E644",
+"f c #F6E349",
+"g c #FBE74A",
+"h c #F9E74D",
+"j c #F7E75F",
+"k c #F8E75A",
+"l c #FBE95C",
+"z c #E9D668",
+"x c #EAD86C",
+"c c #F6E664",
+"v c #F6E667",
+"b c #F8E864",
+"n c #F8E865",
+"m c #F9E96B",
+"M c #FAEB71",
+"N c #F9EB73",
+"B c #F8EA7B",
+"V c #FAEC7C",
+"C c #F9EC7F",
+"Z c #EEDF83",
+"A c #EEDF85",
+"S c #F7E981",
+"D c #F8EC88",
+"F c #F9ED89",
+"G c #FAED8B",
+"H c #F8EB8F",
+"J c #F9EE9B",
+"K c #FBF097",
+"L c #FCF2A6",
+"P c #FCF3AA",
+"I c #FDF6BC",
+"U c #FCF7CF",
+"Y c #FDF8D1",
+"T c #FDF9DF",
+"R c #FEFCEE",
+"E c None",
+/* pixels */
+"EEEEEEE.EEEEEEEE",
+"EEEEEE at e@EEEEEEE",
+"EEEEEE3T<EEEEEEE",
+"EEEEE+ARZ+EEEEEE",
+"EEEEE%UVYOEEEEEE",
+"EEE+OxLdIzo+EEEE",
+"E$:rHKhglPJt- at EE",
+"X6DCf8wddwkGS5XE",
+"E&2aBn0qsNFi1#EE",
+"EEE#;pj7mp=+EEEE",
+"EEEEE*c9v at EEEEEE",
+"EEEEE#uby at EEEEEE",
+"EEEEEE,M>EEEEEEE",
+"EEEEEE&4&EEEEEEE",
+"EEEEEEE EEEEEEEE",
+"EEEEEEEEEEEEEEEE"
+};
+
+// insert link icon from gnome
+
+/* XPM */
+const char *insert_link_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 97 2",
+" c #2E3436",
+". c #2F3536",
+"X c #363C3D",
+"o c #373D3E",
+"O c #464A48",
+"+ c #464B4C",
+"@ c #4F524F",
+"# c #545652",
+"$ c #555753",
+"% c #575955",
+"& c #585A56",
+"* c #595B57",
+"= c #5A5B57",
+"- c #5A5C58",
+"; c #5B5D58",
+": c #5C5D59",
+"> c #62645F",
+", c #656763",
+"< c #6B6D69",
+"1 c #6E6F6B",
+"2 c #6F716D",
+"3 c #71726F",
+"4 c #767773",
+"5 c #777875",
+"6 c #7C7E79",
+"7 c #7C7F79",
+"8 c #CF5F04",
+"9 c #D06106",
+"0 c #D86605",
+"q c #D86706",
+"w c #F47A03",
+"e c #F47A04",
+"r c #F47D0B",
+"t c #E97910",
+"y c #E97911",
+"u c #7E807D",
+"i c #EA9D4C",
+"p c #F4B15E",
+"a c #F5B364",
+"s c #FDC97D",
+"d c #838580",
+"f c #8A8C87",
+"g c #979B96",
+"h c #989B95",
+"j c #9FA19D",
+"k c #B3B4B0",
+"l c #B4B7B0",
+"z c #B7B7B1",
+"x c #B5B7B2",
+"c c #B5B8B2",
+"v c #BABDB6",
+"b c #BBBEB7",
+"n c #BBBEB8",
+"m c #BDBEBB",
+"M c #C0C0BC",
+"N c #C2C3BF",
+"B c #FBD7AA",
+"V c #FBD9AE",
+"C c #C4C6C0",
+"Z c #C5C7C1",
+"A c #CBCEC8",
+"S c #CCCEC9",
+"D c #D0D1CE",
+"F c #D1D3CE",
+"G c #D4D4D0",
+"H c #D6D7D6",
+"J c #D9DAD8",
+"K c #DBDCDB",
+"L c #DEDEDA",
+"P c #DFDFDD",
+"I c #FDE6C4",
+"U c #FEE9CA",
+"Y c #FEEACC",
+"T c #E0E0DC",
+"R c #E0E0DD",
+"E c #E2E3E2",
+"W c #E4E4E1",
+"Q c #E6E6E4",
+"! c #E7E8E6",
+"~ c #E9E9E6",
+"^ c #E8E9E8",
+"/ c #EDEDEB",
+"( c #EDEDEC",
+") c #EDEEED",
+"_ c #EEEEEC",
+"` c #EFF0EE",
+"' c #F1F1F0",
+"] c #F3F3F1",
+"[ c #F3F3F2",
+"{ c #F4F5F4",
+"} c #F5F5F4",
+"| c #F6F6F5",
+" . c #F6F6F6",
+".. c #F8F8F7",
+"X. c #F9F9F9",
+"o. c #FDFDFD",
+"O. c None",
+/* pixels */
+"O.# # # # ; O.O.O.O.O.O.O.O.; # ",
+"O. .{ [ ` J u - O.O.O.O.- H ) o.",
+"O.v v v b C F < # $ $ # 5 / A n ",
+"O.# * $ * 7 b h 1 m m 1 x Z 6 % ",
+"O.O.& R Q 2 $ $ $ $ $ $ $ $ 3 K ",
+"O.O.: z L ] } ...X.| ' ( ^ ! E ",
+"O.O @ 4 M G T W ~ _ P D N k j f ",
+"O.S c d , = $ $ $ $ $ $ $ $ & > ",
+"O.v v v l g + X O.O.O.O.X + g l ",
+"O. . o O.O.O.O.O.O.O.O.o . ",
+"O.O.O.O.O.O.O.O.O.O.O.O.O.O.O.O.",
+"O.O.O.O.O.w e r r r r r e w O.O.",
+"O.O.O.O.O.O.y V Y I U B t O.O.O.",
+"O.O.O.O.O.O.O.q a s p 0 O.O.O.O.",
+"O.O.O.O.O.O.O.O.9 i 9 O.O.O.O.O.",
+"O.O.O.O.O.O.O.O.O.8 O.O.O.O.O.O."
+};
+
+ // close icon from default gtk theme
+
+/* XPM */
+const char *close_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 74 1",
+" c #5A5C58",
+". c #5C5E5B",
+"X c #5C5F5B",
+"o c #5D5F5B",
+"O c #5E5F5B",
+"+ c #5E5F5C",
+"@ c #5D605A",
+"# c #5D605B",
+"$ c #5C615B",
+"% c #5F605A",
+"& c #5E615B",
+"* c #5E605C",
+"= c #5F605C",
+"- c #5E615C",
+"; c #5F615C",
+": c #5E605D",
+"> c #5E615D",
+", c #5F625C",
+"< c #5F625D",
+"1 c #5F615E",
+"2 c #5F625E",
+"3 c #60615B",
+"4 c #60625D",
+"5 c #60615E",
+"6 c #60625E",
+"7 c #61625E",
+"8 c #61645F",
+"9 c #7D807A",
+"0 c #7E817B",
+"q c #80827B",
+"w c #80837E",
+"e c #82847D",
+"r c #82857E",
+"t c #838680",
+"y c #848681",
+"u c #848781",
+"i c #868983",
+"p c #878983",
+"a c #868984",
+"s c #888A85",
+"d c #898C86",
+"f c #898D86",
+"g c #8A8C86",
+"h c #8A8D88",
+"j c #8D9089",
+"k c #8E908A",
+"l c #8E918B",
+"z c #8F928C",
+"x c #8F928D",
+"c c #91938E",
+"v c #92948F",
+"b c #949590",
+"n c #949691",
+"m c #959892",
+"M c #959992",
+"N c #969994",
+"B c #979B95",
+"V c #B1B4AC",
+"C c #B4B7AF",
+"Z c #B8BBB3",
+"A c #B9BCB4",
+"S c #BABDB5",
+"D c #BDC0B8",
+"F c #BDC1B9",
+"G c #BFC3BB",
+"H c #C1C4BC",
+"J c #C3C6BE",
+"K c #C3C7BF",
+"L c #C4C8C0",
+"P c #C5C9C1",
+"I c #CACEC6",
+"U c #CBCEC6",
+"Y c #CDD1C9",
+"T c None",
+/* pixels */
+"TTTTTTTTTTTTTTTT",
+"TTTTTTTTTTTTTTTT",
+"TT681TTTTTT ,5TT",
+"TT5Ll2TTTT=wZ:TT",
+"TT4fUx7TT4aDu;TT",
+"TTT3jYz<;dHs+TTT",
+"TTTT>kINmJh=TTTT",
+"TTTTT>BPKM*TTTTT",
+"TTTTT-vHGc+TTTTT",
+"TTTT-uFnbSr.TTTT",
+"TTT=eAg%#iCq$TTT",
+"TT:9Cp at TTXyV0;TT",
+"TT;Vp at TTTTOtVoTT",
+"TT44&TTTTTT&O4TT",
+"TTTTTTTTTTTTTTTT",
+"TTTTTTTTTTTTTTTT"
+};
+
+// enter key icon from KDE's crystal theme
+
+/* XPM */
+const char *enter_key_icon[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 91 1",
+" c #5C5C5C",
+". c #626262",
+"X c #666666",
+"o c #696969",
+"O c #6B6B6B",
+"+ c #6C6C6C",
+"@ c #6E6E6E",
+"# c #6F6F6F",
+"$ c #717171",
+"% c #737373",
+"& c #747474",
+"* c #838383",
+"= c #8D8D8D",
+"- c #92928F",
+"; c #939393",
+": c #A3A3A2",
+"> c #A7A7A5",
+", c #A7A7A6",
+"< c #A7A7A7",
+"1 c #A9A9A8",
+"2 c #A9A9A9",
+"3 c #AEAEAD",
+"4 c #B0B0AE",
+"5 c #B1B1AF",
+"6 c #B2B2B0",
+"7 c #B4B4B2",
+"8 c #B5B5B3",
+"9 c #B7B7B6",
+"0 c #B7B7B7",
+"q c #B9B9B7",
+"w c #BABAB9",
+"e c #BBBBBB",
+"r c #BCBCBB",
+"t c #BEBEBC",
+"y c #C2C2C1",
+"u c #C4C4C0",
+"i c #C4C4C4",
+"p c #C5C5C5",
+"a c #C6C6C4",
+"s c #C7C7C7",
+"d c #C9C9C6",
+"f c #CBCBC8",
+"g c #CACACA",
+"h c #CFCFCD",
+"j c #D0D0CE",
+"k c #D1D1CF",
+"l c #D0D0D0",
+"z c #D1D1D1",
+"x c #D2D2D0",
+"c c #D3D3D1",
+"v c #D2D2D2",
+"b c #D3D3D2",
+"n c #D3D3D3",
+"m c #D4D4D3",
+"M c #D4D4D4",
+"N c #D5D5D5",
+"B c #D7D7D6",
+"V c #D7D7D7",
+"C c #D8D8D8",
+"Z c #D9D9D8",
+"A c #D9D9D9",
+"S c #DADAD9",
+"D c #DADADA",
+"F c #DCDCDC",
+"G c #DDDDDD",
+"H c #DEDEDE",
+"J c #DFDFDF",
+"K c #E0E0E0",
+"L c #E2E2E2",
+"P c #E3E3E3",
+"I c #E4E4E4",
+"U c #E5E5E5",
+"Y c #E7E7E7",
+"T c #E8E8E8",
+"R c #E9E9E9",
+"E c #EBEBEB",
+"W c #ECECEC",
+"Q c #EDEDED",
+"! c #EFEFEF",
+"~ c #F0F0F0",
+"^ c #F3F3F3",
+"/ c #F4F4F4",
+"( c #F5F5F5",
+") c #F6F6F6",
+"_ c #F7F7F7",
+"` c #F8F8F8",
+"' c #F9F9F9",
+"] c #FAFAFA",
+"[ c #FCFCFC",
+"{ c #FDFDFD",
+"} c None",
+/* pixels */
+"}}}}}}}}}}}}}}}}",
+"}}}}}}fSFFFFFSd}",
+"}}}}}}c{[[[[['a}",
+"}}}}}}x]_`'`_`t}",
+"}}}}}}x)^(p`^/r}",
+"}}}}}}k^!!%'!!w}",
+"}}}}}}j~WQ#`EWq}",
+"}}}}}}yWTR@(TR9}",
+"}Z)))_/YIU+~PI8}",
+"}BLHKH<zLPOWJK7}",
+"}mHGD= 2siXTFG6}",
+"}bDApo$&**;HCC4}",
+"}bVMA0.eDDCNMN3}",
+"}hvlzngzllllll1}",
+"}u5>,,,,,,,,,:-}",
+"}}}}}}}}}}}}}}}}"
+};
+
+// question icon from default gtk theme
+
+/* XPM */
+const char *dialog_question_48_icon[] = {
+"48 48 215 2",
+" c None",
+". c #3768A6",
+"+ c #3968A7",
+"@ c #3A6AA7",
+"# c #386BA6",
+"$ c #3968A5",
+"% c #A7BEDA",
+"& c #F4F7FB",
+"* c #F4F8FB",
+"= c #A5BDD9",
+"- c #3769A6",
+"; c #3869A6",
+"> c #BBCEE4",
+", c #FFFFFF",
+"' c #FEFEFF",
+") c #BBCDE3",
+"! c #F9FBFD",
+"~ c #98B9DC",
+"{ c #99B9DC",
+"] c #729FCF",
+"^ c #97B8DB",
+"/ c #BACDE3",
+"( c #719ECE",
+"_ c #709DCD",
+": c #709DCE",
+"< c #6F9CCD",
+"[ c #6F9CCC",
+"} c #95B6DA",
+"| c #B9CDE3",
+"1 c #6E9CCC",
+"2 c #6E9BCC",
+"3 c #6D9BCC",
+"4 c #6D9ACB",
+"5 c #94B5D9",
+"6 c #B9CCE3",
+"7 c #78A2D0",
+"8 c #709CCC",
+"9 c #6C9ACB",
+"0 c #6C99CA",
+"a c #6B99CA",
+"b c #93B4D8",
+"c c #B9CCE2",
+"d c #739FCE",
+"e c #A1BEDE",
+"f c #C9DAEC",
+"g c #EBF1F8",
+"h c #FAFCFD",
+"i c #E7EEF6",
+"j c #B7CDE6",
+"k c #759FCE",
+"l c #6B98CA",
+"m c #6A98C9",
+"n c #6A97C9",
+"o c #92B3D8",
+"p c #B9CBE2",
+"q c #80A8D3",
+"r c #E8EFF7",
+"s c #6997C9",
+"t c #6996C8",
+"u c #6896C8",
+"v c #91B2D7",
+"w c #B8CBE2",
+"x c #7FA7D2",
+"y c #FDFDFE",
+"z c #E9F0F7",
+"A c #EFF4F9",
+"B c #BBD0E7",
+"C c #6895C8",
+"D c #6795C7",
+"E c #6794C7",
+"F c #8FB1D6",
+"G c #B8CBE1",
+"H c #7EA6D1",
+"I c #F2F6FA",
+"J c #ADC6E1",
+"K c #749FCD",
+"L c #6A98CA",
+"M c #AFC7E2",
+"N c #E1EAF4",
+"O c #6694C7",
+"P c #6694C6",
+"Q c #6593C6",
+"R c #8EAFD5",
+"S c #B7CBE1",
+"T c #96B7DA",
+"U c #6C99CB",
+"V c #709CCB",
+"W c #719DCC",
+"X c #7FA5D0",
+"Y c #6693C6",
+"Z c #6592C6",
+"` c #6492C5",
+" . c #6391C5",
+".. c #8DAFD4",
+"+. c #B0C7E2",
+"@. c #CBDBEC",
+"#. c #6391C4",
+"$. c #6290C4",
+"%. c #8CADD3",
+"&. c #B7CAE1",
+"*. c #3768A5",
+"=. c #396AA7",
+"-. c #A4BCD8",
+";. c #96B6D8",
+">. c #FDFEFE",
+",. c #85A9D2",
+"'. c #6290C3",
+"). c #618FC3",
+"!. c #608EC3",
+"~. c #8BADD3",
+"{. c #A0B8D6",
+"]. c #3768A7",
+"^. c #FEFFFF",
+"/. c #99B8DA",
+"(. c #A4BFDD",
+"_. c #608EC2",
+":. c #5F8DC2",
+"<. c #5F8DC1",
+"[. c #8AABD2",
+"}. c #3868A6",
+"|. c #396AA6",
+"1. c #87AAD2",
+"2. c #FBFCFE",
+"3. c #A1BDDC",
+"4. c #5F8EC2",
+"5. c #5E8DC1",
+"6. c #5E8CC1",
+"7. c #89AAD1",
+"8. c #3767A6",
+"9. c #3969A6",
+"0. c #92B4D8",
+"a. c #D0DEEE",
+"b. c #B1C8E2",
+"c. c #5D8CC1",
+"d. c #5D8BC0",
+"e. c #87AAD1",
+"f. c #F9FAFD",
+"g. c #79A0CC",
+"h. c #5C8BC0",
+"i. c #87A9D0",
+"j. c #F9FAFC",
+"k. c #B6C9E0",
+"l. c #3767A5",
+"m. c #90B2D6",
+"n. c #6B97C7",
+"o. c #6C97C8",
+"p. c #6C97C7",
+"q. c #6C96C7",
+"r. c #5C8AC0",
+"s. c #5B8ABF",
+"t. c #87A8D0",
+"u. c #3668A4",
+"v. c #8FB0D6",
+"w. c #5C8ABF",
+"x. c #5B89BF",
+"y. c #86A8D0",
+"z. c #B6CAE1",
+"A. c #8DAFD5",
+"B. c #ECF1F8",
+"C. c #5A89BF",
+"D. c #5A89BE",
+"E. c #85A7CF",
+"F. c #F8FAFC",
+"G. c #B6CAE0",
+"H. c #BACDE2",
+"I. c #8BADD4",
+"J. c #F6F8FB",
+"K. c #5A88BE",
+"L. c #5988BE",
+"M. c #5987BD",
+"N. c #84A7CE",
+"O. c #89ABD3",
+"P. c #EBF1F7",
+"Q. c #5887BD",
+"R. c #84A6CE",
+"S. c #88ABD1",
+"T. c #5886BD",
+"U. c #5786BC",
+"V. c #83A6CE",
+"W. c #82A5CE",
+"X. c #3667A4",
+"Y. c #85A8D0",
+"Z. c #5785BC",
+"`. c #5685BC",
+" + c #82A4CD",
+".+ c #B6C8E0",
+"++ c #3767A3",
+"@+ c #85A8CF",
+"#+ c #5685BB",
+"$+ c #5584BB",
+"%+ c #3667A3",
+"&+ c #B8CAE1",
+"*+ c #5684BB",
+"=+ c #81A4CC",
+"-+ c #B5C8E0",
+";+ c #3566A2",
+">+ c #82A5CD",
+",+ c #5483BA",
+"'+ c #B7C9E0",
+")+ c #81A4CD",
+"!+ c #5382BA",
+"~+ c #80A3CB",
+"{+ c #B5C8DF",
+"]+ c #80A3CC",
+"^+ c #5382B9",
+"/+ c #7FA2CB",
+"(+ c #B4C8DF",
+"_+ c #9DB5D3",
+":+ c #F1F5F9",
+"<+ c #F0F4F9",
+"[+ c #9CB4D3",
+"}+ c #3565A1",
+"|+ c #305D95",
+"1+ c #3666A3",
+"2+ c #305D96",
+" ",
+" ",
+" . + @ # ",
+" $ % & * = - ",
+" ; > , ' ' , ) ; ",
+" ; > , ! ~ { ! , ) ; ",
+" ; > , ! ~ ] ] ~ ! , ) ; ",
+" ; > , ! ~ ] ] ] ] ~ ! , ) ; ",
+" ; > , ! ~ ] ] ] ] ] ] ~ ! , ) ; ",
+" ; > , ! ~ ] ] ] ] ] ] ] ] ~ ! , ) - ",
+" ; > , ! ~ ] ] ] ] ] ] ] ] ] ] ^ ! , / - ",
+" ; > , ! ~ ] ] ] ] ] ] ] ] ] ( ( _ ^ ! , / - ",
+" ; > , ! ~ ] ] ] ] ] ] ] ( ( : _ < < [ } ! , | - ",
+" ; > , ! ~ ] ] ] ] ] ] ( ( _ _ < < 1 2 3 4 5 ! , 6 - ",
+" ; > , ! ~ ] ] ] ] ( ( : _ < 7 8 2 2 4 4 9 0 a b ! , c - ",
+" ; > , ! ~ ] ] ] ( ( d e f g h , ' i j k a a l m n o ! , p - ",
+" ; > , ! ~ ] ( ( : _ < q , , , , , , , , r k n n s t u v ! , w - ",
+" ; > , ! ~ ( ( _ _ < < 1 x , , y z A , , , , B t u u C D E F ! , G - ",
+" ; > , ! ^ : _ < < [ 2 2 4 H I J K l L M , , , N C D D O P Q Q R ! , S - ",
+" ; > , ! T _ < < 1 2 3 4 9 U V W l m n s X , , , i E O Y Q Z ` ` ...! , S - ",
+" $ > , ! } < [ 2 2 4 4 9 0 a l L n n s t u +., , , @.Q Q Z ` ` .#.$.$.%.! , &.*. ",
+" =.-., ! } 1 2 3 4 9 U 0 a l m n s t u u C ;.>., , >.,.` ` .#.$.$.'.).).!.~.! , {.]. ",
+" . & ^.} 2 4 4 9 0 a l L n n s t u C D D /.y , , ^.(.` .#.$.$.).).)._._.:.<.[.' I }. ",
+" |.& ^.5 9 U 0 a l m n s t u u C D E O 1.2., , ^.3.#.$.$.'.).).!._.4.:.5.6.6.7.' I 8. ",
+" 9.-., ! 0.l L n n s t u C D D O P Q Q a., , , b.$.$.).).)._._.:.<.6.6.c.d.e.f., {.8. ",
+" *./ , ! v s t u u C D E O Y Q Q ` ` r , , , g.).).!._.4.:.5.6.6.d.d.h.i.j., k.l. ",
+" - ) , ! m.C D D O P Q Q Z ` ` .#.n.o.p.q.'._._.:.<.6.6.c.d.h.r.s.t.j., k.u. ",
+" - ) , ! v.O Y Q Q ` ` .#.$.$.'.).).!._.4.:.5.6.6.d.d.h.w.s.x.y.j., z.u. ",
+" - / , ! A.Z ` ` .#.$.$.'.).).B.& & & 6.6.c.d.h.r.s.x.C.D.E.F., G.u. ",
+" - H., ! I.#.$.$.'.).).!._.4.J., , , d.d.h.w.s.x.C.D.K.E.F., k.u. ",
+" - c , ! ~.'.).)._._.:.<.6.J., , , r.s.x.x.D.K.L.M.N.F., k.u. ",
+" - c , ! O._.4.:.5.6.6.d.P.& & & x.C.D.K.L.M.Q.R.F., k.u. ",
+" - p , ! S.5.6.c.d.h.r.s.x.x.D.K.L.M.Q.T.U.V.F., k.u. ",
+" l.w , f.i.d.h.w.s.x.C.D.K.L.M.Q.T.U.U.W.F., k.X. ",
+" l.G , f.Y.x.x.D.K.L.M.Q.T.U.U.Z.`. +F., .+X. ",
+" ++G , j. at +K.L.M.Q.T.U.U.`.#+$+ +F., .+%+ ",
+" %+&+, F.V.T.U.U.Z.`.*+$+$+=+F., -+%+ ",
+" ;+&., F.>+`.#+$+$+,+,+=+F., -+;+ ",
+" ;+'+, F.)+$+,+,+!+~+F., {+;+ ",
+" ;+k., F.]+!+^+/+F., {+;+ ",
+" ;+k., F./+~+F., (+;+ ",
+" %+k., ^.^., (+%+ ",
+" ;+_+:+<+[+}+ ",
+" |+}+1+2+ ",
+" ",
+" ",
+" ",
+" "
+};
+
+/* XPM */
+const char *clear_sq_icon[] = {
+"16 16 1 1",
+" c None",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" "
+};
+
+const char *clear_row_icon[] = {
+"16 1 1 1",
+" c None",
+" "
+};
+
+// The lightning bolt icons are based on gmfsk's rx.xpm and tx.xpm
+
+/* XPM */
+const char *rx1_icon[] = {
+"16 16 4 1",
+" c None",
+". c #0F1F01",
+"+ c #4E9A06",
+"@ c #888A85",
+" ",
+" ......... ",
+" .++++++.@ ",
+" .++++++.@ ",
+" .+++++.@ ",
+" .+++++.@ ",
+" .++++..... ",
+" .++++++++.@ ",
+" .....+++.@ ",
+" @@.+++.@ ",
+" .++.@ ",
+" .++.@ ",
+" .+.@ ",
+" .+.@ ",
+" ..@ ",
+" "
+};
+
+/* XPM */
+const char *tx1_icon[] = {
+"16 16 4 1",
+" c None",
+". c #210000",
+"+ c #A40000",
+"@ c #888A85",
+" ",
+" ......... ",
+" .++++++.@ ",
+" .++++++.@ ",
+" .+++++.@ ",
+" .+++++.@ ",
+" .++++..... ",
+" .++++++++.@ ",
+" .....+++.@ ",
+" @@.+++.@ ",
+" .++.@ ",
+" .++.@ ",
+" .+.@ ",
+" .+.@ ",
+" ..@ ",
+" "
+};
+
+/* XPM */
+const char *rx2_icon[] = {
+"16 16 3 1",
+" c None",
+". c #0F1F01",
+"+ c #4E9A06",
+" ",
+" ......... ",
+" .++++++. ",
+" .++++++. ",
+" .+++++. ",
+" .+++++. ",
+" .++++..... ",
+" .++++++++. ",
+" .....+++. ",
+" .+++. ",
+" .++. ",
+" .++. ",
+" .+. ",
+" .+. ",
+" .. ",
+" "
+};
+
+/* XPM */
+const char *tx2_icon[] = {
+"16 16 3 1",
+" c None",
+". c #210000",
+"+ c #A40000",
+" ",
+" ......... ",
+" .++++++. ",
+" .++++++. ",
+" .+++++. ",
+" .+++++. ",
+" .++++..... ",
+" .++++++++. ",
+" .....+++. ",
+" .+++. ",
+" .++. ",
+" .++. ",
+" .+. ",
+" .+. ",
+" .. ",
+" "
+};
+
+/* XPM */
+const char *rx_icon[] = {
+"16 16 38 1",
+" c None",
+". c #0F1F01",
+"+ c #64B517",
+"@ c #62B315",
+"# c #61B014",
+"$ c #5EAE12",
+"% c #5CAC11",
+"& c #5AA90F",
+"* c #68BA1B",
+"= c #66B719",
+"- c #65B517",
+"; c #63B315",
+"> c #60B014",
+", c #5EAD13",
+"' c #6ABD1C",
+") c #69BA1A",
+"! c #66B718",
+"~ c #64B418",
+"{ c #6FC11F",
+"] c #6CBF1E",
+"^ c #6ABC1C",
+"/ c #70C421",
+"( c #6CBE1E",
+"_ c #6BBC1C",
+": c #75C824",
+"< c #72C622",
+"[ c #6EC11F",
+"} c #6CBE1D",
+"| c #67B819",
+"1 c #6DBF1E",
+"2 c #73C622",
+"3 c #70C321",
+"4 c #74C924",
+"5 c #72C522",
+"6 c #79CD27",
+"7 c #76CA26",
+"8 c #7ACF28",
+"9 c #7FD42B",
+" ",
+" ......... ",
+" .+@#$%&. ",
+" .*=-;>,. ",
+" .')!~@. ",
+" .{]^)=. ",
+" ./{(_..... ",
+" .:</[}^*|. ",
+" .....{1_. ",
+" .23[. ",
+" .45. ",
+" .67. ",
+" .8. ",
+" .9. ",
+" .. ",
+" "
+};
+
+/* XPM */
+const char *tx_icon[] = {
+"16 16 34 1",
+" c None",
+". c #210000",
+"+ c #C11010",
+"@ c #BE0E0E",
+"# c #BB0D0C",
+"$ c #B90B0C",
+"% c #B60A0A",
+"& c #B40908",
+"* c #C51212",
+"= c #C31111",
+"- c #C00F0F",
+"; c #BC0C0D",
+"> c #B90C0B",
+", c #C81313",
+"' c #C10F10",
+") c #CC1617",
+"! c #CA1515",
+"~ c #C71313",
+"{ c #CF1818",
+"] c #CC1616",
+"^ c #D41A1A",
+"/ c #D11819",
+"( c #CF1718",
+"_ c #C71414",
+": c #CA1514",
+"< c #C81413",
+"[ c #D21919",
+"} c #CF1817",
+"| c #CD1616",
+"1 c #D11818",
+"2 c #D81D1D",
+"3 c #D61B1B",
+"4 c #DB1E1E",
+"5 c #E02121",
+" ",
+" ......... ",
+" .+@#$%&. ",
+" .*=-@;>. ",
+" .,*='@. ",
+" .)!~*=. ",
+" .{]!,..... ",
+" .^/(]!_*=. ",
+" .....]:<. ",
+" .[}|. ",
+" .^1. ",
+" .23. ",
+" .4. ",
+" .5. ",
+" .. ",
+" "};
+
+// pskreporter.info "favicon"
+
+/* XPM */
+const char *pskr_icon[] = {
+"16 16 3 1",
+" c None",
+". c #FF0000",
+"+ c #FFFF00",
+" .. ",
+" ... ",
+" ..... ",
+" .....+.. ",
+". ...++++... ",
+".. ..+++++. .. ",
+"....++++++..+. ",
+"..+++++++++++.. ",
+"..+++++++.++++. ",
+"....+++++..++.. ",
+".. ..+++++.... ",
+". ..+++++.. ",
+" ...+... ",
+" .... ",
+" .. ",
+" . "};
+
+
+/* XPM */
+const char *fldigi_icon[] = {
+"48 48 215 2",
+" c None",
+". c #000000",
+"+ c #BFBFBF",
+"@ c #050505",
+"# c #1A1A1A",
+"$ c #1F1F1F",
+"% c #C5C5C5",
+"& c #FEC1C1",
+"* c #FDC5C5",
+"= c #FEC2C2",
+"- c #FFBFBF",
+"; c #D5C4C4",
+"> c #0C0C0C",
+", c #FE0303",
+"' c #FB0C0C",
+") c #FD0606",
+"! c #FE0000",
+"~ c #4F0909",
+"{ c #D1BFBF",
+"] c #2F2F2F",
+"^ c #303030",
+"/ c #3C3C3C",
+"( c #838383",
+"_ c #C7C7C7",
+": c #D9D9D9",
+"< c #D7D7D7",
+"[ c #C2C2C2",
+"} c #C4C4C4",
+"| c #C9C9C9",
+"1 c #9F9F9F",
+"2 c #DDDDDD",
+"3 c #DBDBDB",
+"4 c #CDCDCD",
+"5 c #8F8F8F",
+"6 c #414141",
+"7 c #343434",
+"8 c #313131",
+"9 c #010101",
+"0 c #292929",
+"a c #8A8A8A",
+"b c #A8A8A8",
+"c c #B6B6B6",
+"d c #CFCFCF",
+"e c #DEDEDE",
+"f c #DFDFDF",
+"g c #E5E5E5",
+"h c #E2E2E2",
+"i c #A0A0A0",
+"j c #7D7D7D",
+"k c #1D1D1D",
+"l c #767676",
+"m c #888888",
+"n c #9B9B9B",
+"o c #D3D3D3",
+"p c #C6C6C6",
+"q c #EBEBEB",
+"r c #DADADA",
+"s c #AAAAAA",
+"t c #858585",
+"u c #747474",
+"v c #232323",
+"w c #171717",
+"x c #818181",
+"y c #979797",
+"z c #AEAEAE",
+"A c #E4E4E4",
+"B c #D4D4D4",
+"C c #B5B5B5",
+"D c #E1E1E1",
+"E c #BABABA",
+"F c #9A9A9A",
+"G c #989898",
+"H c #030303",
+"I c #070707",
+"J c #242424",
+"K c #C1C1C1",
+"L c #E0E0E0",
+"M c #B2B2B2",
+"N c #363636",
+"O c #060606",
+"P c #020202",
+"Q c #929292",
+"R c #959595",
+"S c #C8C8C8",
+"T c #CECECE",
+"U c #B0B0B0",
+"V c #999999",
+"W c #040404",
+"X c #151515",
+"Y c #606060",
+"Z c #A2A2A2",
+"` c #CBCBCB",
+" . c #919191",
+".. c #A4A4A4",
+"+. c #AFAFAF",
+"@. c #737373",
+"#. c #181818",
+"$. c #131313",
+"%. c #393939",
+"&. c #C3C3C3",
+"*. c #454545",
+"=. c #3A3A3A",
+"-. c #222222",
+";. c #333333",
+">. c #484848",
+",. c #A1A1A1",
+"'. c #616161",
+"). c #0F0F0F",
+"!. c #C0C0C0",
+"~. c #808080",
+"{. c #404040",
+"]. c #121212",
+"^. c #191919",
+"/. c #BDBDBD",
+"(. c #7E7E7E",
+"_. c #3F3F3F",
+":. c #161616",
+"<. c #090909",
+"[. c #212121",
+"}. c #777777",
+"|. c #BBBBBB",
+"1. c #3B3B3B",
+"2. c #5D5D5D",
+"3. c #A5A5A5",
+"4. c #727272",
+"5. c #272727",
+"6. c #101010",
+"7. c #9C9C9C",
+"8. c #B7B7B7",
+"9. c #B3B3B3",
+"0. c #080808",
+"a. c #262626",
+"b. c #ADADAD",
+"c. c #CCCCCC",
+"d. c #E9E9E9",
+"e. c #E8E8E8",
+"f. c #ACACAC",
+"g. c #2A2A2A",
+"h. c #323232",
+"i. c #DCDCDC",
+"j. c #D1D1D1",
+"k. c #E7E7E7",
+"l. c #D2D2D2",
+"m. c #0E0E0E",
+"n. c #0D0D0D",
+"o. c #4A4A4A",
+"p. c #8C8C8C",
+"q. c #B9B9B9",
+"r. c #7A7A7A",
+"s. c #525252",
+"t. c #373737",
+"u. c #7B7B7B",
+"v. c #E6E6E6",
+"w. c #A9A9A9",
+"x. c #6B6B6B",
+"y. c #141414",
+"z. c #757575",
+"A. c #D6D6D6",
+"B. c #E3E3E3",
+"C. c #6E6E6E",
+"D. c #0B0B0B",
+"E. c #1E1E1E",
+"F. c #EAEAEA",
+"G. c #B4B4B4",
+"H. c #D8D8D8",
+"I. c #9E9E9E",
+"J. c #444444",
+"K. c #ABABAB",
+"L. c #A6A6A6",
+"M. c #505050",
+"N. c #B1B1B1",
+"O. c #3E3E3E",
+"P. c #0A0A0A",
+"Q. c #878787",
+"R. c #EFEFEF",
+"S. c #8B8B8B",
+"T. c #4B4B4B",
+"U. c #4F4F4F",
+"V. c #CACACA",
+"W. c #EEEEEE",
+"X. c #434343",
+"Y. c #D5D5D5",
+"Z. c #7F7F7F",
+"`. c #5B5B5B",
+" + c #515151",
+".+ c #868686",
+"++ c #8E8E8E",
+"@+ c #575757",
+"#+ c #707070",
+"$+ c #636363",
+"%+ c #B8B8B8",
+"&+ c #909090",
+"*+ c #252525",
+"=+ c #8D8D8D",
+"-+ c #969696",
+";+ c #282828",
+">+ c #A3A3A3",
+",+ c #BCBCBC",
+"'+ c #A7A7A7",
+")+ c #3D3D3D",
+"!+ c #2E2E2E",
+"~+ c #353535",
+"{+ c #D0D0D0",
+"]+ c #595959",
+"^+ c #BEBEBE",
+"/+ c #111111",
+"(+ c #5E5E5E",
+"_+ c #383838",
+":+ c #939393",
+"<+ c #464646",
+"[+ c #2C2C2C",
+"}+ c #717171",
+"|+ c #898989",
+"1+ c #494949",
+"2+ c #555555",
+". . . . . . . . + @ . . . . . . . . . . . . . . . . . . . . . . . + . . . . . . . . . . . . . . ",
+". . . . . . . . + # . . . . . . . . . . . . . . . . . . . . . . . + . . . . . . . . . . . . . . ",
+". . . . . . . . + $ . . . . . . . . . . . . . . . . . . . . . . . + . . . . . . . . . . . . . . ",
+"% % % % % % % % % % % % % % % % % % % % % & * * * = - - - ; % % % % % % % % % % % % % % % % % % ",
+"> > > > > > > > > > > > > > > > > > > > > , ' ' ' ) ! ! ! ~ > > > > > > > > > > > > > > > > > > ",
+"+ + + + + + + + + + + + + + + + + + + + + - - - - - - - - { + + + + + + + + + + + + + + + + + + ",
+"] ] ] ] ] ] ] ] ] ] ] ] ] ] ^ ] ] ] / ( _ : < [ } | 1 2 3 4 5 6 ^ ] ] ] 7 8 ] ] ] ] ] ] ] ] ] ] ",
+". . . . . . . . . . . . . . 9 . . . 0 a b c d e f g 2 h } i j 0 9 . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . k l m n o p 3 q h r s t u v . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . 9 w x y z : _ A B C D E F G 0 . . H 9 . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . I 9 . J t z % D K L d d r | M ( N 9 . O H . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . P > 9 . ] Q R S f D L T 4 e } U V 7 9 . H 9 . . . . . . . . . . . . ",
+". . . . . P P . . . . . . 9 P W . . X Y Z e ` + .( ..d 3 +. at .#.. . . . O H . . . . . . . . . . ",
+". . . . . @ @ . . . . . . W P . . . P $.%.&.*.=.-.k ;.>.,.'.X @ . . . . ).O . . . . . . . . . . ",
+". . . . . @ @ . . . . . . P 9 . . . . 9 . !.P . . . . . ~.{.. . . . . . ].I . . . . . . . . . . ",
+". . . . . O O . . . . . . . . . . . P O ^./.$.H H H H W (._.P . . . . . :.<.. . . . . . . . . . ",
+". . . . . H H . . . . . . . . . . . O [.}.|.Y 1.6 6 1.2.3.4.5.P . . . . 6.I . . . . . . . . . . ",
+". . . . . . . . . . . . . . 9 9 . . ).u } A 4 7.8.9.7.: D d ~.W . . . 9 H 9 . . . . . . . . . . ",
+". . . . . . . . . . . . . . H 0.. . a.b.&.c.d.o D L L e._ + f.g.9 . 0.@ . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . 9 0.9 . h.F c ` i.j.A e.k.2 l.C Q / 9 9 m.@ . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . n.P . o.p.f.% q.A g e.q e e Z r.s.@ @ m.P . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . 9 . . t.u.+ v.B i.Z w.: L d.|.x.7 O 9 P . I 9 . . . . . . . . . . ",
+". . . . . . . . . . . . . H O @ . . y.z.c.v.A.+ b b ,.B.e.[ C.D.9 . . 9 <.9 . . . . . . . . . . ",
+". . . . . . . . . . . . . H D.n.. . E.,.o B.e.A.!.z ..F.L 3 Z [.9 . W H . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . P n.9 . 1.c G.H.g F.k.g e.A ` 9.I.J.W . O W . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . W m.. W t.K.1 L.i.2 h i.v.D ..1 +.^ O 9 0.D.. . . . . . . . . . . . ",
+". . . . . . . . . . . . . . H O P > M.5 t p.< g g D d.i.1 Q N.O.O @ ).D.. . . . . . . . . . . . ",
+". . . . . . . . . . . . . . 9 P.H W o.Q.C p l.v.q R.i.i.d 1 S.T.I 9 P . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . O H . U.t +.l.V.V.e.W.k.r } S }.X.<.P W . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . 9 . 1.x U g 2 Y.g g g D 3 l.Z.v H . 9 . D.H . . . . . . . . . . ",
+". . . . . 9 9 . . . . . . 9 9 . . . O -.> 4 @.C.`. +C.}.!..+W 0.. . . . w <.. . . . . . . . . . ",
+". . . . . W W . . . . . . P 9 . . . . P 9 % y.<.<.0.I m.++ at +@ . . . . . :.<.. . . . . . . . . . ",
+". . . . . 9 9 . . . . . . H 9 . . . O t.S.f ,.#+j u.$+n c.z +I 9 . . . > @ . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . X ( | H.v.%+D 4 &+v.` d n *+W . 9 9 9 . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . y.=+G.G.h [ F.d.j.A b +.-+;+P . 9 . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . H . . ] >+C U L B.k.e.h k.s b i *.O . 9 W . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . D.P . %.M -+,+o d.i.A q 2 /.3.s +0.W n.0.. . . . . . . . . . . . ",
+". . . . . . . . . . . . . . H @ 9 . ] '+c V.L e.A 2 D B.S C i )+O 9 H 9 . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . O O . . !+f._ l.e.d.g 2 D e.S &.K.s.P.. . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . P . 9 ~+f.E {+h d.e.g g L % !.R ]+D.9 P . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . O 9 O h.7.9.l.v.k.L B T 2 T ^+3.J.0.. 9 9 . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . /+I D.X.Q L.e g q v.B.v.D B &.i (+P.W P.9 . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . D.I O _+b /.A.2 d.v.F.d.A : %+L.T.0.O /+H . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . m.P . ;.Q + 3 f A h F.q d : } :+<+W H m.W . . . . . . . . . . . . ",
+". . . . . . . . . . . . . H 9 I 9 . [+a p v.g k.o % e i.B.j.p.J.O . H 9 W P . . . . . . . . . . ",
+". . . . . . . . . . . . . I H . . . O 5.}+o |+t 1+X.C..+,+p.8 ).9 . . . y.0.. . . . . . . . . . ",
+". . . . . 9 9 . . . . . . P 9 . . . . . . p X D.9 P O <.~.2+. . . . . . :.<.. . . . . . . . . . ",
+". . . . . @ @ . . . . . . . . . . . . . . &.I . . . . . ~.T.. . . . . . #.P.. . . . . . . . . . "};
+
+
+/* XPM */
+const char *flarq_icon[] = {
+/* columns rows colors chars-per-pixel */
+"48 35 924 2",
+" c None",
+". c #5B1E0E",
+"+ c #7F381B",
+"@ c #A7624B",
+"# c #A8624E",
+"$ c #652012",
+"% c #90555F",
+"& c #AA7A86",
+"* c #D4B5BE",
+"= c #5E231C",
+"- c #540900",
+"; c #AC5D55",
+"> c #B4644F",
+", c #CF7F58",
+"' c #FCAD85",
+") c #FBB18F",
+"! c #BA7057",
+"~ c #965140",
+"{ c #4F1509",
+"] c #3B1314",
+"^ c #45151B",
+"/ c #895156",
+"( c #AB8687",
+"_ c #D7C6C1",
+": c #FFFFFD",
+"< c #FFFFFE",
+"[ c #A58088",
+"} c #945D68",
+"| c #642D34",
+"1 c #AC6352",
+"2 c #A45C49",
+"3 c #A35B46",
+"4 c #CC8C74",
+"5 c #F4B8A0",
+"6 c #FAC5A8",
+"7 c #FFD4B3",
+"8 c #FFD8B8",
+"9 c #FFDCBD",
+"0 c #FFCFAC",
+"a c #E7A380",
+"b c #A2563C",
+"c c #984D37",
+"d c #A2787A",
+"e c #997474",
+"f c #AA8B91",
+"g c #D1C0C6",
+"h c #CAB3BD",
+"i c #FBE6F1",
+"j c #F9FFFF",
+"k c #F8FAFA",
+"l c #FEFFFF",
+"m c #F3F2EF",
+"n c #E9D7D9",
+"o c #AC9092",
+"p c #AC8C8D",
+"q c #926A6E",
+"r c #9A737B",
+"s c #9B747C",
+"t c #9E573C",
+"u c #98543D",
+"v c #9A5F47",
+"w c #BF8469",
+"x c #E9AE90",
+"y c #FFCAA8",
+"z c #FFD9B6",
+"A c #FFDFBA",
+"B c #FDE1BA",
+"C c #FDDEB8",
+"D c #FEDBBB",
+"E c #FBDBC3",
+"F c #F8DBC5",
+"G c #FFDCC3",
+"H c #FFD1AF",
+"I c #FBB891",
+"J c #E79B74",
+"K c #9A4E30",
+"L c #9B5644",
+"M c #7D4F54",
+"N c #D0BCBE",
+"O c #F5EDE7",
+"P c #FCF4EE",
+"Q c #FFFAFC",
+"R c #FFFFFF",
+"S c #C7BDC6",
+"T c #C4B0BD",
+"U c #F4F3F8",
+"V c #FDFCFF",
+"W c #FFFDFF",
+"X c #F7FFFF",
+"Y c #DEDCDC",
+"Z c #E6E1E1",
+"` c #FFFAF9",
+" . c #FFF3F5",
+".. c #FFF4F7",
+"+. c #E2D9DA",
+"@. c #C1AEB5",
+"#. c #C5A3AF",
+"$. c #7B5057",
+"%. c #7D2F24",
+"&. c #C87559",
+"*. c #EA9464",
+"=. c #FFA873",
+"-. c #FFB886",
+";. c #FFC193",
+">. c #FBBD92",
+",. c #FBBE92",
+"'. c #F9B98A",
+"). c #FAB784",
+"!. c #F8AE77",
+"~. c #F9AC76",
+"{. c #F3A97B",
+"]. c #F3BB97",
+"^. c #FDD7BD",
+"/. c #FEDCC3",
+"(. c #FFDBB4",
+"_. c #FED2A6",
+":. c #FEBF94",
+"<. c #E89574",
+"[. c #D07355",
+"}. c #C06F4F",
+"|. c #C09581",
+"1. c #F0F1E9",
+"2. c #E8FBF4",
+"3. c #EEF9F3",
+"4. c #FDFDFE",
+"5. c #FDF8FE",
+"6. c #EFE7ED",
+"7. c #A6969F",
+"8. c #F2E9EF",
+"9. c #F7F9F9",
+"0. c #FEFDFF",
+"a. c #B2A3AC",
+"b. c #CBBFC7",
+"c. c #FCFBFE",
+"d. c #F9F6F8",
+"e. c #F5F8F7",
+"f. c #F6FFFF",
+"g. c #69302D",
+"h. c #5D0100",
+"i. c #A0402C",
+"j. c #CC7D59",
+"k. c #BF6F4E",
+"l. c #C16645",
+"m. c #F6996A",
+"n. c #FCA264",
+"o. c #F8995F",
+"p. c #F3925E",
+"q. c #F29968",
+"r. c #F29F71",
+"s. c #E79469",
+"t. c #C26640",
+"u. c #CF6A43",
+"v. c #FD9366",
+"w. c #FF9B68",
+"x. c #F99B63",
+"y. c #F19F6E",
+"z. c #EEAB80",
+"A. c #F8C59B",
+"B. c #FBD3AB",
+"C. c #FCD2AA",
+"D. c #FCD9B1",
+"E. c #F8D1AA",
+"F. c #F9C596",
+"G. c #FFB371",
+"H. c #FEAC6B",
+"I. c #D69B78",
+"J. c #EAD5D1",
+"K. c #ECF6FA",
+"L. c #F1FAFB",
+"M. c #FFFBFF",
+"N. c #FDF4FB",
+"O. c #FDFAFB",
+"P. c #D3CACE",
+"Q. c #D8C7CE",
+"R. c #F6FAF8",
+"S. c #FEFCFF",
+"T. c #C4B4C0",
+"U. c #D3C8D3",
+"V. c #FAFBFF",
+"W. c #FBFBFF",
+"X. c #FBFDFF",
+"Y. c #F7FEFF",
+"Z. c #F8DEDA",
+"`. c #B76C57",
+" + c #D76E4E",
+".+ c #F89463",
+"++ c #F9A36A",
+"@+ c #FFB783",
+"#+ c #F5A27A",
+"$+ c #D0744E",
+"%+ c #EB9060",
+"&+ c #E68655",
+"*+ c #EA8855",
+"=+ c #F1935B",
+"-+ c #F0975D",
+";+ c #D27B43",
+">+ c #E18450",
+",+ c #E98B5A",
+"'+ c #DD7C50",
+")+ c #D07242",
+"!+ c #F9A06A",
+"~+ c #FFA771",
+"{+ c #F6A26B",
+"]+ c #EE9D67",
+"^+ c #EEA26D",
+"/+ c #F2AA77",
+"(+ c #ECA776",
+"_+ c #EDAC7B",
+":+ c #EEB17D",
+"<+ c #F1A55D",
+"[+ c #FFA45C",
+"}+ c #DC855E",
+"|+ c #D9A3A2",
+"1+ c #F5F0FC",
+"2+ c #E9F7FA",
+"3+ c #F6FDFE",
+"4+ c #FDFBFE",
+"5+ c #F8F9F9",
+"6+ c #D1CFD0",
+"7+ c #CCB9C0",
+"8+ c #F9FAF9",
+"9+ c #FBFAFC",
+"0+ c #F7F0F5",
+"a+ c #D7C6D1",
+"b+ c #E7E0EB",
+"c+ c #EAF4FB",
+"d+ c #F1F9FD",
+"e+ c #F9FEFF",
+"f+ c #F2FCFB",
+"g+ c #F6F5F5",
+"h+ c #CA9E8E",
+"i+ c #F4A27A",
+"j+ c #FAA77A",
+"k+ c #F6B280",
+"l+ c #F5C896",
+"m+ c #FED8AD",
+"n+ c #FFCFAB",
+"o+ c #FFCCA8",
+"p+ c #F8C39B",
+"q+ c #F5BC9C",
+"r+ c #F2B48F",
+"s+ c #ECA878",
+"t+ c #F3A86C",
+"u+ c #FCAA68",
+"v+ c #FAA664",
+"w+ c #F9A76A",
+"x+ c #EC9B65",
+"y+ c #D38048",
+"z+ c #E69056",
+"A+ c #E0874E",
+"B+ c #FAA26B",
+"C+ c #FAA470",
+"D+ c #F5A06F",
+"E+ c #F59E6A",
+"F+ c #FA9C62",
+"G+ c #F99A5D",
+"H+ c #F49E6C",
+"I+ c #F89E63",
+"J+ c #FF9D5E",
+"K+ c #ED8F64",
+"L+ c #B67466",
+"M+ c #F5EBF0",
+"N+ c #E4F6F9",
+"O+ c #EAFCFA",
+"P+ c #FDFFFF",
+"Q+ c #F5F8F8",
+"R+ c #E6E6E7",
+"S+ c #BEAAB2",
+"T+ c #E9E2E6",
+"U+ c #FCF9FB",
+"V+ c #DFCFD2",
+"W+ c #C4AEB7",
+"X+ c #FAF0F9",
+"Y+ c #EAF0F6",
+"Z+ c #F3F8FC",
+"`+ c #FBFEFF",
+" @ c #F8F9F8",
+".@ c #EADFDD",
+"+@ c #B47A60",
+"@@ c #E99560",
+"#@ c #F3BB8E",
+"$@ c #FDD8B6",
+"%@ c #FFDDC1",
+"&@ c #FDCFB2",
+"*@ c #FECEAD",
+"=@ c #FBD0A7",
+"-@ c #F7D3A7",
+";@ c #FAD1AA",
+">@ c #F9CAA1",
+",@ c #F8C392",
+"'@ c #FAB179",
+")@ c #F9A468",
+"!@ c #F9A166",
+"~@ c #F69F67",
+"{@ c #F9A470",
+"]@ c #FDA56E",
+"^@ c #F69A5A",
+"/@ c #D37536",
+"(@ c #D1753D",
+"_@ c #EF9868",
+":@ c #F8A67A",
+"<@ c #F39F71",
+"[@ c #FB9E68",
+"}@ c #FF9D60",
+"|@ c #FA9C65",
+"1@ c #FAA06B",
+"2@ c #FA9C63",
+"3@ c #FDA26C",
+"4@ c #D5926E",
+"5@ c #F2DFDA",
+"6@ c #F0F3FD",
+"7@ c #EDF3F8",
+"8@ c #FEFCFC",
+"9@ c #F9FAFA",
+"0@ c #F3F4F6",
+"a@ c #A2929B",
+"b@ c #C0B1BA",
+"c@ c #C4B0B0",
+"d@ c #AC9398",
+"e@ c #FEF1F8",
+"f@ c #EEF2F7",
+"g@ c #F2F3F8",
+"h@ c #FEF9FB",
+"i@ c #FBF2F0",
+"j@ c #EFD9D8",
+"k@ c #E09D81",
+"l@ c #F0A268",
+"m@ c #F9CCA1",
+"n@ c #FDD3B7",
+"o@ c #F2B094",
+"p@ c #F3A377",
+"q@ c #F5A66E",
+"r@ c #F4A873",
+"s@ c #F3A476",
+"t@ c #F4A66D",
+"u@ c #F6A367",
+"v@ c #F9A269",
+"w@ c #FBA169",
+"x@ c #FD9F69",
+"y@ c #FC9F69",
+"z@ c #FC9F68",
+"A@ c #F99F65",
+"B@ c #F4A471",
+"C@ c #F9B385",
+"D@ c #F6A36E",
+"E@ c #F19359",
+"F@ c #D1743D",
+"G@ c #E3905E",
+"H@ c #F5A370",
+"I@ c #F59F69",
+"J@ c #FAA062",
+"K@ c #FBA05E",
+"L@ c #F8A26B",
+"M@ c #F9A46F",
+"N@ c #FAA160",
+"O@ c #EA9C62",
+"P@ c #C3998A",
+"Q@ c #F7EBFA",
+"R@ c #EEEAF8",
+"S@ c #F6F4F6",
+"T@ c #FCFEFF",
+"U@ c #F4F4F7",
+"V@ c #E4DCE3",
+"W@ c #D4C1CD",
+"X@ c #F2F5FA",
+"Y@ c #AEA19F",
+"Z@ c #C2B0B5",
+"`@ c #F9F8FC",
+" # c #E5F2F8",
+".# c #EAF5FB",
+"+# c #F0F5F5",
+"@# c #F9F7F7",
+"## c #D3B3A9",
+"$# c #DF916B",
+"%# c #FAA76E",
+"&# c #F3B787",
+"*# c #F0AE84",
+"=# c #EE9D6B",
+"-# c #F6A15D",
+";# c #F7A559",
+"># c #F9A160",
+",# c #FE9B68",
+"'# c #FD9D67",
+")# c #FC9F67",
+"!# c #FA9F69",
+"~# c #F9A06C",
+"{# c #F69F6A",
+"]# c #F5A067",
+"^# c #F9A464",
+"/# c #F5A35C",
+"(# c #E9A779",
+"_# c #F8D5C1",
+":# c #FFCEAA",
+"<# c #FAB079",
+"[# c #E1884B",
+"}# c #CD713A",
+"|# c #F39961",
+"1# c #FAA56C",
+"2# c #F8A668",
+"3# c #FFA864",
+"4# c #EF9965",
+"5# c #E59462",
+"6# c #FBA360",
+"7# c #F49958",
+"8# c #BE8469",
+"9# c #E7DAE0",
+"0# c #EFF2FB",
+"a# c #EBF0F3",
+"b# c #FBFEFE",
+"c# c #F6F6FA",
+"d# c #FAF3FA",
+"e# c #B7A0AF",
+"f# c #C4C0C8",
+"g# c #D4CECD",
+"h# c #DED5DD",
+"i# c #EEF5FC",
+"j# c #E4F0FD",
+"k# c #E6F2FC",
+"l# c #EBF5FB",
+"m# c #EAE0E9",
+"n# c #B67A69",
+"o# c #ED8F5B",
+"p# c #FCA368",
+"q# c #F59E66",
+"r# c #F9A067",
+"s# c #F9A165",
+"t# c #F99F66",
+"u# c #FAA069",
+"v# c #FAA169",
+"w# c #FAA166",
+"x# c #F8A264",
+"y# c #F7A262",
+"z# c #F9A162",
+"A# c #F59E5E",
+"B# c #FCA464",
+"C# c #F0A172",
+"D# c #F8C7AA",
+"E# c #FFDFBE",
+"F# c #F7D7AF",
+"G# c #F7C497",
+"H# c #F19C6B",
+"I# c #DC7947",
+"J# c #E48552",
+"K# c #DD8553",
+"L# c #BF6033",
+"M# c #E28B60",
+"N# c #E99B6D",
+"O# c #F2A367",
+"P# c #FA9F60",
+"Q# c #E89874",
+"R# c #E2CBBF",
+"S# c #E9F6F7",
+"T# c #EAF1FA",
+"U# c #F6F6FB",
+"V# c #FAF9FC",
+"W# c #F9F1FA",
+"X# c #BBABB5",
+"Y# c #BDAEB7",
+"Z# c #DDCBCC",
+"`# c #FBF1F9",
+" $ c #EFEAF7",
+".$ c #E9EFFC",
+"+$ c #EAF0FC",
+"@$ c #F1F6FE",
+"#$ c #E2CDCB",
+"$$ c #D28869",
+"%$ c #FFA26B",
+"&$ c #F99F64",
+"*$ c #FAA065",
+"=$ c #FAA167",
+"-$ c #FAA168",
+";$ c #F9A066",
+">$ c #F7A168",
+",$ c #F7A167",
+"'$ c #F7A165",
+")$ c #F9A163",
+"!$ c #FB9F63",
+"~$ c #FA9E65",
+"{$ c #F89D64",
+"]$ c #FEA667",
+"^$ c #F4B072",
+"/$ c #FBD2AB",
+"($ c #FBDFCB",
+"_$ c #F9DECA",
+":$ c #FBCBAA",
+"<$ c #EFA579",
+"[$ c #D3764B",
+"}$ c #AE4621",
+"|$ c #EA865A",
+"1$ c #F8A674",
+"2$ c #F8A16F",
+"3$ c #FAA66A",
+"4$ c #E38A65",
+"5$ c #D5AFA0",
+"6$ c #F1FDFF",
+"7$ c #E9EFFF",
+"8$ c #EEEDFC",
+"9$ c #F5F4FD",
+"0$ c #F0EDF6",
+"a$ c #F5E9EF",
+"b$ c #C6AFB4",
+"c$ c #A28385",
+"d$ c #FFF7FE",
+"e$ c #F1E8F9",
+"f$ c #EBEFF9",
+"g$ c #EBEFFA",
+"h$ c #F0EFF8",
+"i$ c #D5B09E",
+"j$ c #ED9B6E",
+"k$ c #FDA168",
+"l$ c #F89F66",
+"m$ c #F89F65",
+"n$ c #F6A066",
+"o$ c #F5A166",
+"p$ c #F6A065",
+"q$ c #F8A065",
+"r$ c #F9A167",
+"s$ c #FCA06A",
+"t$ c #F99B68",
+"u$ c #DA7F51",
+"v$ c #E88B52",
+"w$ c #F9A15D",
+"x$ c #F1AF7D",
+"y$ c #F8D0B1",
+"z$ c #FBDCC7",
+"A$ c #FDDEC9",
+"B$ c #FED4B9",
+"C$ c #FBBC9A",
+"D$ c #E58C65",
+"E$ c #DB794C",
+"F$ c #F69F61",
+"G$ c #FF9F61",
+"H$ c #FD9D60",
+"I$ c #FAA163",
+"J$ c #F79C6E",
+"K$ c #DCA289",
+"L$ c #EAE3E3",
+"M$ c #ECF2FF",
+"N$ c #E7F0FB",
+"O$ c #E7F3FA",
+"P$ c #E7EFF2",
+"Q$ c #FEF7F9",
+"R$ c #B49DA0",
+"S$ c #C0A5A8",
+"T$ c #F7F6FB",
+"U$ c #E9EAFB",
+"V$ c #E9F0F8",
+"W$ c #E9F0FA",
+"X$ c #F5F1FA",
+"Y$ c #DBAD8E",
+"Z$ c #EF975E",
+"`$ c #FBA16A",
+" % c #F7A065",
+".% c #F6A165",
+"+% c #F6A067",
+"@% c #F6A570",
+"#% c #F4A673",
+"$% c #EC9A6C",
+"%% c #D1794A",
+"&% c #E68752",
+"*% c #FDA26F",
+"=% c #F2A374",
+"-% c #F9C29B",
+";% c #FFE0C1",
+">% c #FDDDBC",
+",% c #F4C29D",
+"'% c #E09266",
+")% c #D67F46",
+"!% c #FB9E5C",
+"~% c #FF9D63",
+"{% c #FBA972",
+"]% c #CE805C",
+"^% c #C8A39D",
+"/% c #F2F5FD",
+"(% c #EAF1F4",
+"_% c #E6F2F3",
+":% c #E6F5F4",
+"<% c #E7F1F1",
+"[% c #EAEDED",
+"}% c #E6E0E3",
+"|% c #E7F3F7",
+"1% c #DEF1FD",
+"2% c #E7F2FB",
+"3% c #EBF3FB",
+"4% c #E7D7DC",
+"5% c #D5916A",
+"6% c #FCA265",
+"7% c #F89E68",
+"8% c #F8A066",
+"9% c #F29F67",
+"0% c #EFA56E",
+"a% c #FBC490",
+"b% c #F6BC8A",
+"c% c #E9A26E",
+"d% c #D8834F",
+"e% c #E58456",
+"f% c #FF9B6E",
+"g% c #FAA16D",
+"h% c #EDB075",
+"i% c #F3C790",
+"j% c #FCD7AD",
+"k% c #FED4B6",
+"l% c #F6BB94",
+"m% c #CE8350",
+"n% c #D6854A",
+"o% c #FBA16F",
+"p% c #F39F6D",
+"q% c #F1A86D",
+"r% c #E89568",
+"s% c #D79F8D",
+"t% c #F4EDEE",
+"u% c #F0EEF8",
+"v% c #ECEEF6",
+"w% c #ECEFF9",
+"x% c #ECEDF7",
+"y% c #F1F0FC",
+"z% c #F0F4FA",
+"A% c #E6F2F5",
+"B% c #DCF5FD",
+"C% c #E3EBF7",
+"D% c #F9FBFF",
+"E% c #C19A96",
+"F% c #D57E55",
+"G% c #FDA366",
+"H% c #F99F67",
+"I% c #F99F63",
+"J% c #FA9F63",
+"K% c #F99E64",
+"L% c #F8A86F",
+"M% c #F1A66F",
+"N% c #F8B985",
+"O% c #FDD4A2",
+"P% c #F2BD89",
+"Q% c #F5A971",
+"R% c #E28955",
+"S% c #D97847",
+"T% c #F69962",
+"U% c #F4A66A",
+"V% c #E9A46A",
+"W% c #F2AA79",
+"X% c #F9AE84",
+"Y% c #F6AB7C",
+"Z% c #EA9B63",
+"`% c #E49159",
+" & c #FFA572",
+".& c #FBA36B",
+"+& c #F8A363",
+"@& c #FFA66F",
+"#& c #CE7F5A",
+"$& c #E9CAC3",
+"%& c #F2F3FF",
+"&& c #EBEDFD",
+"*& c #F1EFFF",
+"=& c #F8F1FF",
+"-& c #FAEFFE",
+";& c #FDF8FF",
+">& c #FCF4F9",
+",& c #F4F9FA",
+"'& c #F9F7FF",
+")& c #FDE9EB",
+"!& c #D99781",
+"~& c #F59668",
+"{& c #F8A165",
+"]& c #F8A164",
+"^& c #F7A063",
+"/& c #F9A164",
+"(& c #FBA069",
+"_& c #D98350",
+":& c #DA8954",
+"<& c #E79A68",
+"[& c #FAB887",
+"}& c #F6B181",
+"|& c #F5A46D",
+"1& c #F4A15F",
+"2& c #E6914E",
+"3& c #D37D41",
+"4& c #EA9569",
+"5& c #F8A078",
+"6& c #FC9E6C",
+"7& c #FE9D5C",
+"8& c #FF9F5B",
+"9& c #FFA46B",
+"0& c #E58B5F",
+"a& c #F09769",
+"b& c #F39562",
+"c& c #F09762",
+"d& c #EF9A6A",
+"e& c #D67F58",
+"f& c #BB8678",
+"g& c #F6F6FF",
+"h& c #F7F4FF",
+"i& c #EADFE9",
+"j& c #D8C4CE",
+"k& c #DABEC8",
+"l& c #E3C8DB",
+"m& c #E9CAD1",
+"n& c #ECD7D4",
+"o& c #EEDFE4",
+"p& c #B98787",
+"q& c #D9805B",
+"r& c #F9A266",
+"s& c #F6A360",
+"t& c #F79E64",
+"u& c #F6A466",
+"v& c #F6A465",
+"w& c #F9A065",
+"x& c #FD9E67",
+"y& c #DC7E4D",
+"z& c #C7693C",
+"A& c #ED9167",
+"B& c #F4976B",
+"C& c #FBA160",
+"D& c #FFAC67",
+"E& c #F49B60",
+"F& c #D6784A",
+"G& c #E5895F",
+"H& c #F09662",
+"I& c #FFA866",
+"J& c #FFAD6E",
+"K& c #E07F5D",
+"L& c #7B2B1B",
+"M& c #853D24",
+"N& c #963E27",
+"O& c #8D472B",
+"P& c #824730",
+"Q& c #843A2A",
+"R& c #712A23",
+"S& c #BA9092",
+"T& c #DABABA",
+"U& c #8B6E6B",
+"V& c #4D3232",
+"W& c #5D2D3D",
+"X& c #68353A",
+"Y& c #734744",
+"Z& c #6A4A4C",
+"`& c #663235",
+" * c #934833",
+".* c #DF8766",
+"+* c #F99766",
+"@* c #FB9E61",
+"#* c #FFA66E",
+"$* c #FCA16D",
+"%* c #F99E69",
+"&* c #F7A169",
+"** c #F3A266",
+"=* c #F4A365",
+"-* c #FB9F68",
+";* c #F6A16A",
+">* c #F6A16B",
+",* c #FCA06C",
+"'* c #FC9D69",
+")* c #FF9D6B",
+"!* c #FF9E6C",
+"~* c #F69563",
+"{* c #D67949",
+"]* c #D47348",
+"^* c #F79567",
+"/* c #FA9F68",
+"(* c #F9A265",
+"_* c #FFA166",
+":* c #FC9B65",
+"<* c #E98D5B",
+"[* c #C4683A",
+"}* c #BE6339",
+"|* c #B06D4E",
+"1* c #732F25",
+"2* c #64201E",
+"3* c #8B463B",
+"4* c #B6573A",
+"5* c #D06B39",
+"6* c #D37A42",
+"7* c #F4986B",
+"8* c #FC9C73",
+"9* c #F99F6C",
+"0* c #F4A766",
+"a* c #F1A561",
+"b* c #F49E63",
+"c* c #FB9E6B",
+"d* c #F7A069",
+"e* c #F9A16A",
+"f* c #FCA16C",
+"g* c #FE9F6C",
+"h* c #FFA06C",
+"i* c #FBA468",
+"j* c #F49D5F",
+"k* c #ED925B",
+"l* c #C86A3A",
+"m* c #DF8653",
+"n* c #FBA26F",
+"o* c #F9A369",
+"p* c #FFA673",
+"q* c #F6936D",
+"r* c #7C1705",
+"s* c #7C3625",
+"t* c #C76E51",
+"u* c #DE7B53",
+"v* c #CA693D",
+"w* c #BF633B",
+"x* c #E88C57",
+"y* c #E98E54",
+"z* c #F9A267",
+"A* c #FEA86F",
+"B* c #F4A167",
+"C* c #F6A362",
+"D* c #F19C5B",
+"E* c #DD8848",
+"F* c #E89255",
+"G* c #E68F53",
+"H* c #F49D63",
+"I* c #FEA76D",
+"J* c #FCA36A",
+"K* c #FAA466",
+"L* c #F29B5B",
+"M* c #EC8E5C",
+"N* c #DB8154",
+"O* c #D6874F",
+"P* c #E79659",
+"Q* c #FFA778",
+"R* c #D07B64",
+"S* c #6E1913",
+"T* c #6C1F18",
+"U* c #963729",
+"V* c #EC9366",
+"W* c #FFB374",
+"X* c #E98F56",
+"Y* c #B24C23",
+"Z* c #ED8661",
+"`* c #E78B58",
+" = c #FAA561",
+".= c #F8A262",
+"+= c #F6A164",
+"@= c #F7A466",
+"#= c #E49459",
+"$= c #C16E36",
+"%= c #E08C58",
+"&= c #E1895C",
+"*= c #EF9265",
+"== c #FFA372",
+"-= c #FEA36A",
+";= c #F5A268",
+">= c #F6AA6A",
+",= c #DC8545",
+"'= c #D47440",
+")= c #C87153",
+"!= c #69241A",
+"~= c #AB5E46",
+"{= c #E88666",
+"]= c #E37B53",
+"^= c #D26E43",
+"/= c #F4996C",
+"(= c #CC6C39",
+"_= c #E5834A",
+":= c #F39462",
+"<= c #FA9F6F",
+"[= c #F6A16D",
+"}= c #F49F6B",
+"|= c #F69E6D",
+"1= c #DD7F55",
+"2= c #C7653C",
+"3= c #E7825E",
+"4= c #E4895D",
+"5= c #F1A364",
+"6= c #FFAC66",
+"7= c #FEA067",
+"8= c #CD7151",
+"9= c #6E2215",
+"0= c #7F2427",
+"a= c #902F20",
+"b= c #E5895A",
+"c= c #FFB175",
+"d= c #F2915D",
+"e= c #B7522B",
+"f= c #C05D34",
+"g= c #D67649",
+"h= c #F69E68",
+"i= c #FDA46B",
+"j= c #FCA069",
+"k= c #FFA46E",
+"l= c #F49460",
+"m= c #EB8E5D",
+"n= c #D06F41",
+"o= c #C9683C",
+"p= c #D67D55",
+"q= c #A55135",
+"r= c #682616",
+"s= c #8F4C2E",
+"t= c #DE8C68",
+"u= c #CA6E51",
+"v= c #C4654C",
+"w= c #FFA579",
+"x= c #F09360",
+"y= c #CC7345",
+"z= c #DA844C",
+"A= c #EE9556",
+"B= c #F59D5E",
+"C= c #FFB174",
+"D= c #FFB075",
+"E= c #FFB073",
+"F= c #FFA472",
+"G= c #B85D49",
+"H= c #6C1515",
+"I= c #8B5446",
+"J= c #73251B",
+"K= c #95402C",
+"L= c #E48F68",
+"M= c #FFAA79",
+"N= c #F59D70",
+"O= c #EB9061",
+"P= c #E48A59",
+"Q= c #C57046",
+"R= c #B26340",
+"S= c #B16947",
+"T= c #B36943",
+"U= c #A65D40",
+"V= c #7B3629",
+"W= c #6A230D",
+"X= c #BA6848",
+"Y= c #D57C5E",
+"Z= c #D1745E",
+"`= c #CE7260",
+" - c #923C2D",
+".- c #84382F",
+"+- c #813F39",
+"@- c #7B423B",
+" ",
+" ",
+" ",
+" ",
+" . + @ # $ % & * ",
+" = - ; > , ' ) ! ~ { ] ^ / ( _ : < ",
+"[ } | 1 2 3 4 5 6 7 8 9 0 a b c d e f g h i j k l ",
+"m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W ",
+"X Y Z ` ...+. at .#.$. %.&.*.=.-.;.>.,.'.).!.~.{.].^./.9 (._.:.<.[.}.|.1.2.3.4.5.6.7.8.9.0.",
+"R a.b.c.d.e.f.R W g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.",
+"R T.U.V.W.X.Y.V Z.`. +.+++ at +#+$+%+&+*+=+-+;+>+,+'+)+!+~+{+]+^+/+(+_+:+<+[+}+|+1+2+3+4+5+6+7+8+9+",
+"0+a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z+A+B+C+D+E+F+G+H+I+J+K+L+M+N+O+P+Q+R+S+T+U+",
+"V+W+X+Y+Z+`+ @. at +@@@#@$@%@&@*@=@-@;@>@,@'@)@!@~@{@]@^@/@(@_@:@<@[@}@|@1 at 2@3 at 4@5 at 6@7 at 8@9 at 0@a at b@R ",
+"c at d@e at f@g at h@i at j@k at l@m at n@o at p@q at r@s at t@u at v@w at x@y at z@A at B@C at D@E at F@G at H@I at J@K at L@M at N@O at P@Q at R@S at T@U at V@W at X@",
+"Y at Z@`@ #.#+#@###$#%#&#*#=#-#;#>#,#'#)#!#~#{#]#^#/#(#_#:#<#[#}#|#1#2#3#4#5#6#7#8#9#0#a#b#c#d#e#f#",
+"g#h#i#j#k#l#m#n#o#p#~@q#r#s#s#s#t#u#v#w#x#y#z#A#B#C#D#E#F#G#H#I#J#K#L#M#N#O#P#Q#R#S#T#U#V#W#X#Y#",
+"Z#`# $.$+$@$#$$$%$&$&$*$=$-$r#r#;$>$,$'$)$)$!$~${$]$^$/$($_$:$<$[$}$|$1$2$~@3$4$5$6$7$8$9$0$a$b$",
+"c$d$e$f$g$h$i$j$k$A@;$=$;$;$l$m$m$n$o$p$q$r$s$t$u$v$w$x$y$z$A$B$C$D$E$F$G$H$I$J$K$L$M$N$O$P$Q$R$",
+"S$T$U$V$W$X$Y$Z$`$;$=$;$=$=$;$;$;$ % %.% %+%@%#%$%%%&%*%=%-%D ;%>%,%'%)%!%~%t#{%]%^%/%(%_%:%<%[%",
+"}%|%1%2%3%4%5%6%7%r#=$m$;$;$=$;$8%&$&$q$+%9%0%a%b%c%d%e%f%g%h%i%j%k%l%m%n%o%p%q%r%s%t%u%v%w%x%y%",
+"z%A%B%C%D%E%F%G%H%=$=$;$;$;$=$;$m$I%J%K%v at L%M%N%O%P%Q%R%S%T%U%V%W%X%Y%Z%`% &.&+&@&#&$&%&&&*&=&-&",
+";&>&,&'&)&!&~&{&]&;$;$;$;$;$;$;$;$^&/&K%(&_&:&<&[&}&|&1&2&3&4&5&6&7&8&9&0&a&b&c&d&e&f&g&h&i&j&k&",
+"l&m&n&o&p&q&=.r&s&t&t&r$;$;$m$;$r$u&v&w&x&t$y&z&A&B&x at C&D&E&F&G&H&I&J&K&L&M&N&O&P&Q&R&S&T&U&V& ",
+"W&X&Y&Z&`& *.*+*@*#*$*%*&***=*A at -*;*>*,*'*)*!*~*{*]*^*/*(*_*:*<*[*}*|*1* 2* ",
+" 3*4*5*6*7*8*9*0*a*b*c*d*e*f*g*h*z at i*j*k*l*m*n*8%o*p*q*r* ",
+" s*t*u*v*w*x*y*z*A*B*C*D*E*F*G*H*I*J*K*L*M*N*O*P*Q*R*S* ",
+" T*U*V*W*X*Y*Z*`* =.=+=@=#=$=%=&=*===-=;=>=,='=)=!= ",
+" ~={=]=^=/=(=_=:=<=n*[=}=|=1=2=3=4=5=6=7=8=9= ",
+" 0=a=b=c=d=e=f=g=o%h=i=j=k=l=m=n=o=p=q=r= ",
+" s=t=u=v=w=x=y=z=A=B=C=D=E=F=G=H= ",
+" I=J=K=L=M=N=O=P=Q=R=S=T=U=V= ",
+" W=X=Y=Z=`= -.-+- at - ",
+" ",
+" ",
+" "};
diff --git a/src/misc/re.cxx b/src/misc/re.cxx
new file mode 100644
index 0000000..d59d545
--- /dev/null
+++ b/src/misc/re.cxx
@@ -0,0 +1,143 @@
+// ----------------------------------------------------------------------------
+// re.cxx
+//
+// Copyright (C) 2008-2009
+// Stelios Bounanos, M0GLD
+//
+// This file is part of fldigi.
+//
+// fldigi is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// fldigi is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+// ----------------------------------------------------------------------------
+
+#include <config.h>
+
+#include <vector>
+#include <string>
+
+#include "re.h"
+
+using namespace std;
+
+
+re_t::re_t(const char* pattern_, int cflags_)
+ : pattern(pattern_), cflags(cflags_), eflags(0), error(false)
+{
+ compile();
+}
+
+re_t::re_t(const re_t& re)
+ : pattern(re.pattern), cflags(re.cflags), eflags(re.eflags),
+ suboffsets(re.suboffsets), substrings(re.substrings)
+{
+ compile();
+}
+
+re_t::~re_t()
+{
+ if (!error)
+ regfree(&preg);
+}
+
+re_t& re_t::operator=(const re_t& rhs)
+{
+ if (&rhs == this)
+ return *this;
+
+ pattern = rhs.pattern;
+ cflags = rhs.cflags;
+ eflags = rhs.eflags;
+ suboffsets = rhs.suboffsets;
+ substrings = rhs.substrings;
+ if (!error)
+ regfree(&preg);
+ compile();
+
+ return *this;
+}
+
+void re_t::recompile(const char* pattern_)
+{
+ pattern = pattern_;
+ if (!error)
+ regfree(&preg);
+ compile();
+}
+
+void re_t::compile(void)
+{
+ error = regcomp(&preg, pattern.c_str(), cflags);
+ if (!error && !(cflags & REG_NOSUB) && preg.re_nsub > 0)
+ suboffsets.resize(preg.re_nsub + 1);
+}
+
+bool re_t::match(const char* str, int eflags_)
+{
+ if (error)
+ return false;
+
+ eflags = eflags_;
+ bool nosub = cflags & REG_NOSUB || preg.re_nsub == 0;
+ bool found = !regexec(&preg, str, (nosub ? 0 : preg.re_nsub+1),
+ (nosub ? NULL : &suboffsets[0]), eflags_);
+ substrings.clear();
+ if (found && !nosub) {
+ size_t n = suboffsets.size();
+ substrings.resize(n);
+ for (size_t i = 0; i < n; i++)
+ if (suboffsets[i].rm_so != -1)
+ substrings[i].assign(str + suboffsets[i].rm_so,
+ suboffsets[i].rm_eo - suboffsets[i].rm_so);
+ }
+
+ return found;
+}
+
+const string& re_t::submatch(size_t n) const
+{
+ return substrings[n];
+}
+
+void re_t::suboff(size_t n, int* start, int* end) const
+{
+ if (n < nsub()) {
+ if (start) *start = suboffsets[n].rm_so;
+ if (end) *end = suboffsets[n].rm_eo;
+ }
+ else {
+ if (start) *start = -1;
+ if (end) *end = -1;
+ }
+}
+
+#include <tr1/functional>
+
+size_t re_t::hash(void) const
+{
+ size_t h = tr1::hash<string>()(pattern);
+ return h ^ (tr1::hash<int>()(cflags) + 0x9e3779b9 + (h << 6) + (h >> 2));
+}
+
+// ------------------------------------------------------------------------
+
+fre_t::fre_t(const char* pattern_, int cflags_) : re_t(pattern_, cflags_) { }
+
+bool fre_t::match(const char* str, int eflags_)
+{
+ if (error)
+ return false;
+
+ bool nosub = cflags & REG_NOSUB || preg.re_nsub == 0;
+ return !regexec(&preg, str, (nosub ? 0 : preg.re_nsub+1),
+ (nosub ? NULL : &suboffsets[0]), eflags_);
+}
diff --git a/src/misc/serial.cxx b/src/misc/serial.cxx
new file mode 100644
index 0000000..52b5167
--- /dev/null
+++ b/src/misc/serial.cxx
@@ -0,0 +1,761 @@
+//-----------------------------------------------------------------------------
+//
+// Serial i/o class
+//
+// copyright Dave Freese 2006, w1hkj at w1hkj.com
+//
+//-----------------------------------------------------------------------------
+
+#include <string>
+
+#include "serial.h"
+#include "debug.h"
+
+LOG_FILE_SOURCE(debug::LOG_RIGCONTROL);
+
+
+#ifndef __WIN32__
+#include <cstdio>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include <sys/time.h>
+
+#include <memory>
+
+using namespace std;
+
+Cserial::Cserial() {
+ device = "/dev/ttyS0";
+ baud = 1200;
+ timeout = 50; //msec
+ retries = 5;
+ rts = dtr = false;
+ rtsptt = dtrptt = false;
+ rtscts = false;
+ status = 0;
+ stopbits = 2;
+ fd = -1;
+}
+
+Cserial::~Cserial() {
+ ClosePort();
+}
+
+
+
+///////////////////////////////////////////////////////
+// Function name : Cserial::OpenPort
+// Description : Opens the port specified by strPortName
+// Return type : bool
+// Argument : c_string strPortName
+///////////////////////////////////////////////////////
+bool Cserial::CheckPort(string dev) {
+ int testfd = open( dev.c_str(), O_RDWR | O_NOCTTY | O_NDELAY);
+ if (testfd < 0)
+ return false;
+ close(fd);
+ return true;
+}
+
+///////////////////////////////////////////////////////
+// Function name : Cserial::OpenPort
+// Description : Opens the port specified by strPortName
+// Return type : bool
+// Argument : c_string strPortName
+///////////////////////////////////////////////////////
+bool Cserial::OpenPort() {
+
+ if ((fd = open( device.c_str(), O_RDWR | O_NOCTTY | O_NDELAY )) < 0)
+ return false;
+// save current port settings
+ tcflush (fd, TCIFLUSH);
+
+ tcgetattr (fd, &oldtio);
+ newtio = oldtio;
+
+ // 8 data bits
+ newtio.c_cflag &= ~CSIZE;
+ newtio.c_cflag |= CS8;
+ // enable receiver, set local mode
+ newtio.c_cflag |= (CLOCAL | CREAD);
+ // no parity
+ newtio.c_cflag &= ~PARENB;
+
+ if (stopbits == 1)
+ // 1 stop bit
+ newtio.c_cflag &= ~CSTOPB;
+ else
+ // 2 stop bit
+ newtio.c_cflag |= CSTOPB;
+
+ if (rtscts)
+ // h/w handshake
+ newtio.c_cflag |= CRTSCTS;
+ else
+ // no h/w handshake
+ newtio.c_cflag &= ~CRTSCTS;
+
+ // raw input
+ newtio.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
+ // raw output
+ newtio.c_oflag &= ~OPOST;
+ // software flow control disabled
+ newtio.c_iflag &= ~IXON;
+ // do not translate CR to NL
+ newtio.c_iflag &= ~ICRNL;
+
+ switch(baud) {
+ case 300:
+ speed = B300;
+ break;
+ case 1200:
+ speed = B1200;
+ break;
+ case 2400:
+ speed = B2400;
+ break;
+ case 4800:
+ speed = B4800;
+ break;
+ case 9600:
+ speed = B9600;
+ break;
+ case 19200:
+ speed = B19200;
+ break;
+ case 38400:
+ speed = B38400;
+ break;
+ case 57600:
+ speed = B57600;
+ break;
+ case 115200:
+ speed = B115200;
+ break;
+ default:
+ speed = B1200;
+ }
+ cfsetispeed(&newtio, speed);
+ cfsetospeed(&newtio, speed);
+
+ tcsetattr (fd, TCSANOW, &newtio);
+
+ ioctl(fd, TIOCMGET, &status);
+ origstatus = status;
+
+ if (dtr)
+ status |= TIOCM_DTR; // set the DTR bit
+ else
+ status &= ~TIOCM_DTR; // clear the DTR bit
+
+ if (rtscts == false) { // rts OK for ptt if RTSCTS not used
+ if (rts)
+ status |= TIOCM_RTS; // set the RTS bit
+ else
+ status &= ~TIOCM_RTS; // clear the RTS bit
+ }
+ ioctl(fd, TIOCMSET, &status);
+
+ FlushBuffer();
+
+ return true;
+}
+
+///////////////////////////////////////////////////////
+// Function name : Cserial::setPTT
+// Return type : void
+///////////////////////////////////////////////////////
+void Cserial::SetPTT(bool ON)
+{
+ if (fd < 0) {
+ LOG_DEBUG("ptt fd < 0");
+ return;
+ }
+ if (dtrptt || rtsptt) {
+ LOG_INFO("PTT %d, DTRptt %d, DTR %d, RTSptt %d, RTS %d, RTSCTS %d",
+ ON, dtrptt, dtr, rtsptt, rts, rtscts);
+ ioctl(fd, TIOCMGET, &status);
+ if (ON) { // ptt enabled
+ if (dtrptt && dtr) status &= ~TIOCM_DTR; // toggle low
+ if (dtrptt && !dtr) status |= TIOCM_DTR; // toggle high
+ if (!rtscts) {
+ if (rtsptt && rts) status &= ~TIOCM_RTS; // toggle low
+ if (rtsptt && !rts) status |= TIOCM_RTS; // toggle high
+ }
+ } else { // ptt disabled
+ if (dtrptt && dtr) status |= TIOCM_DTR; // toggle high
+ if (dtrptt && !dtr) status &= ~TIOCM_DTR; // toggle low
+ if (!rtscts) {
+ if (rtsptt && rts) status |= TIOCM_RTS; // toggle high
+ if (rtsptt && !rts) status &= ~TIOCM_RTS; // toggle low
+ }
+ }
+// LOG_INFO("Status %02X, %s", status & 0xFF, uint2bin(status, 8));
+ ioctl(fd, TIOCMSET, &status);
+ }
+// LOG_DEBUG("No ptt specified");
+}
+
+void Cserial::setRTS(bool b)
+{
+ if (fd < 0)
+ return;
+
+ ioctl(fd, TIOCMGET, &status);
+ if (b == true)
+ status |= TIOCM_RTS; // toggle high
+ else
+ status &= ~TIOCM_RTS; // toggle low
+ ioctl(fd, TIOCMSET, &status);
+
+}
+
+void Cserial::setDTR(bool b)
+{
+ if (fd < 0)
+ return;
+
+ ioctl(fd, TIOCMGET, &status);
+ if (b == true)
+ status |= TIOCM_DTR; // toggle high
+ else
+ status &= ~TIOCM_DTR; // toggle low
+ ioctl(fd, TIOCMSET, &status);
+
+}
+
+///////////////////////////////////////////////////////
+// Function name : Cserial::ClosePort
+// Description : Closes the Port
+// Return type : void
+///////////////////////////////////////////////////////
+void Cserial::ClosePort()
+{
+ if (fd < 0) return;
+ int myfd = fd;
+ fd = -1;
+// LOG_INFO("Serial port closed, fd = %d", myfd);
+ ioctl(myfd, TIOCMSET, &origstatus);
+ tcsetattr (myfd, TCSANOW, &oldtio);
+ close(myfd);
+ fd = -1;
+ return;
+}
+
+bool Cserial::IOselect ()
+{
+ fd_set rfds;
+ struct timeval tv;
+ int retval;
+
+ FD_ZERO (&rfds);
+ FD_SET (fd, &rfds);
+ tv.tv_sec = timeout/1000;
+ tv.tv_usec = (timeout % 1000) * 1000;
+ retval = select (FD_SETSIZE, &rfds, (fd_set *)0, (fd_set *)0, &tv);
+ if (retval <= 0) // no response from serial port or error returned
+ return false;
+ return true;
+}
+
+
+bool Cserial::ReadByte(unsigned char &resp)
+{
+ if (!IOselect()) {
+ resp = 0;
+ return false;
+ }
+ return (read (fd, &resp, 1));
+}
+
+
+///////////////////////////////////////////////////////
+// Function name : Cserial::ReadBuffer
+// Description : Reads upto nchars from the selected port
+// Return type : # characters received
+// Argument : pointer to buffer; # chars to read
+///////////////////////////////////////////////////////
+int Cserial::ReadBuffer (char *buf, int nchars)
+{
+ if (fd < 0) return 0;
+ int retnum, nread = 0;
+ while (nchars > 0) {
+ if (!IOselect()) {
+ return nread;
+ }
+ retnum = read (fd, (char *)(buf + nread), nchars);
+ if (retnum < 0)
+ return 0;//nread;
+ if (retnum == 0)
+ return nread;
+ nread += retnum;
+ nchars -= retnum;
+ }
+ return nread;
+}
+
+///////////////////////////////////////////////////////
+// Function name : Cserial::WriteBuffer
+// Description : Writes a string to the selected port
+// Return type : bool
+// Argument : BYTE by
+///////////////////////////////////////////////////////
+int Cserial::WriteBuffer(const char *buff, int n)
+{
+ if (fd < 0) return 0;
+ int ret = write (fd, buff, n);
+ return ret;
+}
+
+///////////////////////////////////////////////////////
+// Function name : Cserial::FlushBuffer
+// Description : flushes the pending rx chars
+// Return type : void
+///////////////////////////////////////////////////////
+void Cserial::FlushBuffer()
+{
+ if (fd < 0)
+ return;
+ tcflush (fd, TCIFLUSH);
+}
+
+//=============================================================================
+// WIN32 serial implementation
+//=============================================================================
+
+#else // __WIN32__
+
+using namespace std;
+
+///////////////////////////////////////////////////////
+// Function name : Cserial::CheckPort
+// Description : Checks the port specified by strPortName
+// Return type : bool
+// Argument : c_string strPortName
+///////////////////////////////////////////////////////
+bool Cserial::CheckPort(string dev) {
+ static HANDLE hTest;
+ string COMportname = "//./";
+
+ COMportname.append(dev);
+
+ hTest = CreateFile(COMportname.c_str(),
+ GENERIC_READ | GENERIC_WRITE,
+ 0,
+ 0,
+ OPEN_EXISTING,
+ 0,
+ 0);
+
+ if(hTest == INVALID_HANDLE_VALUE)
+ return false;
+ CloseHandle(hTest);
+ return true;
+}
+
+///////////////////////////////////////////////////////
+// Function name : Cserial::OpenPort
+// Description : Opens the port specified by strPortName
+// Return type : bool
+// Argument : CString strPortName
+///////////////////////////////////////////////////////
+bool Cserial::OpenPort()
+{
+ string COMportname = "//./";
+ COMportname.append(device);
+
+ hComm = CreateFile(COMportname.c_str(),
+ GENERIC_READ | GENERIC_WRITE,
+ 0,
+ 0,
+ OPEN_EXISTING,
+ 0,
+ 0);
+
+ if(!hComm)
+ return false;
+
+ ConfigurePort( baud, 8, false, NOPARITY, stopbits);
+//LOG_INFO("Comm port %s open; handle = %d", device.c_str(), hComm);
+ FlushBuffer();
+ return true;
+}
+
+
+///////////////////////////////////////////////////////
+// Function name : Cserial::ClosePort
+// Description : Closes the Port
+// Return type : void
+///////////////////////////////////////////////////////
+void Cserial::ClosePort()
+{
+ if (hComm) {
+ bPortReady = SetCommTimeouts (hComm, &CommTimeoutsSaved);
+ CloseHandle(hComm);
+ }
+ hComm = 0;
+ return;
+}
+
+bool Cserial::IsOpen()
+{
+ if (!hComm) return false;
+ return true;
+}
+
+///////////////////////////////////////////////////////
+// Function name : Cserial::GetBytesRead
+// Description :
+// Return type : DWORD
+///////////////////////////////////////////////////////
+DWORD Cserial::GetBytesRead()
+{
+ return nBytesRead;
+}
+
+///////////////////////////////////////////////////////
+// Function name : Cserial::GetBytesWritten
+// Description : returns total number of bytes written to port
+// Return type : DWORD
+///////////////////////////////////////////////////////
+DWORD Cserial::GetBytesWritten()
+{
+ return nBytesWritten;
+}
+
+
+///////////////////////////////////////////////////////
+// Function name : Cserial::ReadByte
+// Description : Reads a byte from the selected port
+// Return type : bool
+// Argument : BYTE& by
+///////////////////////////////////////////////////////
+bool Cserial::ReadByte(unsigned char & by)
+{
+static BYTE byResByte[1024];
+static DWORD dwBytesTxD=0;
+
+ if (!hComm) return false;
+ if (ReadFile (hComm, &byResByte[0], 1, &dwBytesTxD, 0)) {
+ if (dwBytesTxD == 1) {
+ by = (UCHAR)byResByte[0];
+ return true;
+ }
+ }
+ by = 0;
+ return false;
+}
+
+int Cserial::ReadData (char *buf, int nchars)
+{
+ DWORD dwRead = 0;
+ if (!ReadFile(hComm, buf, nchars, &dwRead, NULL))
+ return 0;
+ return (int) dwRead;
+}
+
+int Cserial::ReadChars (char *buf, int nchars, int msec)
+{
+ if (msec) Sleep(msec);
+ return ReadData (buf, nchars);
+}
+
+void Cserial::FlushBuffer()
+{
+ unsigned char c;
+ int count = 200;
+ while (ReadByte(c) == true) {
+ if (count-- == 0) break;
+ }
+}
+
+///////////////////////////////////////////////////////
+// Function name : Cserial::WriteByte
+// Description : Writes a Byte to teh selected port
+// Return type : bool
+// Argument : BYTE by
+///////////////////////////////////////////////////////
+bool Cserial::WriteByte(char by)
+{
+ if (!hComm) return false;
+ nBytesWritten = 0;
+ if (WriteFile(hComm,&by,1,&nBytesWritten,NULL)==0)
+ return false;
+ return true;
+}
+
+///////////////////////////////////////////////////////
+// Function name : Cserial::WriteBuffer
+// Description : Writes a string to the selected port
+// Return type : bool
+// Argument : BYTE by
+///////////////////////////////////////////////////////
+int Cserial::WriteBuffer(const char *buff, int n)
+{
+ if (!hComm)
+ return 0;
+ WriteFile (hComm, buff, n, &nBytesWritten, NULL);
+ return nBytesWritten;
+}
+
+
+///////////////////////////////////////////////////////
+// Function name : Cserial::SetCommunicationTimeouts
+// Description : Sets the timeout for the selected port
+// Return type : bool
+// Argument : DWORD ReadIntervalTimeout
+// Argument : DWORD ReadTotalTimeoutMultiplier
+// Argument : DWORD ReadTotalTimeoutConstant
+// Argument : DWORD WriteTotalTimeoutMultiplier
+// Argument : DWORD WriteTotalTimeoutConstant
+///////////////////////////////////////////////////////
+bool Cserial::SetCommunicationTimeouts(
+ DWORD ReadIntervalTimeout, // msec
+ DWORD ReadTotalTimeoutMultiplier,
+ DWORD ReadTotalTimeoutConstant,
+ DWORD WriteTotalTimeoutMultiplier,
+ DWORD WriteTotalTimeoutConstant
+)
+{
+ if((bPortReady = GetCommTimeouts (hComm, &CommTimeoutsSaved))==0) {
+ return false;
+ }
+ LOG_DEBUG("\n\
+Read Interval Timeout............... %ld\n\
+Read Total Timeout Multiplier....... %ld\n\
+Read Total Timeout Constant Timeout. %ld\n\
+Write Total Timeout Constant........ %ld\n\
+Write Total Timeout Multiplier...... %ld",
+ CommTimeoutsSaved.ReadIntervalTimeout,
+ CommTimeoutsSaved.ReadTotalTimeoutMultiplier,
+ CommTimeoutsSaved.ReadTotalTimeoutConstant,
+ CommTimeoutsSaved.WriteTotalTimeoutConstant,
+ CommTimeoutsSaved.WriteTotalTimeoutMultiplier);
+
+ CommTimeouts.ReadIntervalTimeout = ReadIntervalTimeout;
+ CommTimeouts.ReadTotalTimeoutMultiplier = ReadTotalTimeoutMultiplier;
+ CommTimeouts.ReadTotalTimeoutConstant = ReadTotalTimeoutConstant;
+ CommTimeouts.WriteTotalTimeoutConstant = WriteTotalTimeoutConstant;
+ CommTimeouts.WriteTotalTimeoutMultiplier = WriteTotalTimeoutMultiplier;
+
+ bPortReady = SetCommTimeouts (hComm, &CommTimeouts);
+
+ if(bPortReady ==0) {
+ CloseHandle(hComm);
+ return false;
+ }
+
+ return true;
+}
+
+/*
+ * Remarks
+ *
+ * WriteTotalTimeoutMultiplier
+ *
+ * The multiplier used to calculate the total time-out period for write
+ * operations, in milliseconds. For each write operation, this value is
+ * multiplied by the number of bytes to be written.
+ *
+ * WriteTotalTimeoutConstant
+ *
+ * A constant used to calculate the total time-out period for write operations,
+ * in milliseconds. For each write operation, this value is added to the product
+ * of the WriteTotalTimeoutMultiplier member and the number of bytes to be
+ * written.
+ *
+ * A value of zero for both the WriteTotalTimeoutMultiplier and
+ * WriteTotalTimeoutConstant members indicates that total time-outs are not
+ * used for write operations.
+ *
+ *
+ * If an application sets ReadIntervalTimeout and ReadTotalTimeoutMultiplier to
+ * MAXDWORD and sets ReadTotalTimeoutConstant to a value greater than zero and
+ * less than MAXDWORD, one of the following occurs when the ReadFile function
+ * is called:
+ *
+ * If there are any bytes in the input buffer, ReadFile returns immediately
+ * with the bytes in the buffer.
+ *
+ * If there are no bytes in the input buffer, ReadFile waits until a byte
+ * arrives and then returns immediately.
+ *
+ * *********************************************************************
+ *
+ * If no bytes arrive within the time specified by ReadTotalTimeoutConstant,
+ * ReadFile times out.
+ *
+ * ReadIntervalTimeout
+ *
+ * The maximum time allowed to elapse between the arrival of two bytes on the
+ * communications line, in milliseconds. During a ReadFile operation, the time
+ * period begins when the first byte is received. If the interval between the
+ * arrival of any two bytes exceeds this amount, the ReadFile operation is
+ * completed and any buffered data is returned. A value of zero indicates that
+ * interval time-outs are not used.
+ *
+ * A value of MAXDWORD, combined with zero values for both the
+ * ReadTotalTimeoutConstant and ReadTotalTimeoutMultiplier members, specifies
+ * that the read operation is to return immediately with the bytes that have
+ * already been received, even if no bytes have been received.
+ *
+ * ReadTotalTimeoutMultiplier
+ *
+ * The multiplier used to calculate the total time-out period for read
+ * operations, in milliseconds. For each read operation, this value is
+ * multiplied by the requested number of bytes to be read.
+ *
+ * ReadTotalTimeoutConstant
+ *
+ * A constant used to calculate the total time-out period for read operations,
+ * in milliseconds. For each read operation, this value is added to the product
+ * of the ReadTotalTimeoutMultiplier member and the requested number of bytes.
+ *
+ * A value of zero for both the ReadTotalTimeoutMultiplier and
+ * ReadTotalTimeoutConstant members indicates that total time-outs are not
+ * used for read operations.
+ *
+*/
+
+bool Cserial::SetCommTimeout() {
+ return SetCommunicationTimeouts (
+ 0, // Read Interval Timeout
+ 0, // Read Total Timeout Multiplier
+ 50, // Read Total Timeout Constant
+ 50, // Write Total Timeout Constant
+ 0 // Write Total Timeout Multiplier
+ );
+}
+
+///////////////////////////////////////////////////////
+// Function name : ConfigurePort
+// Description : Configures the Port
+// Return type : bool
+// Argument : DWORD BaudRate
+// Argument : BYTE ByteSize
+// Argument : DWORD fParity
+// Argument : BYTE Parity
+// Argument : BYTE StopBits
+///////////////////////////////////////////////////////
+bool Cserial::ConfigurePort(
+ DWORD BaudRate,
+ BYTE ByteSize,
+ DWORD dwParity,
+ BYTE Parity,
+ BYTE StopBits)
+{
+ if((bPortReady = GetCommState(hComm, &dcb))==0) {
+// LOG_ERROR("GetCommState Error on %s", device.c_str());
+ CloseHandle(hComm);
+ return false;
+ }
+
+ dcb.BaudRate = BaudRate;
+ dcb.ByteSize = ByteSize;
+ dcb.Parity = Parity ;
+ dcb.StopBits = (StopBits == 1 ? ONESTOPBIT : TWOSTOPBITS);
+ dcb.fBinary = true;
+ dcb.fDsrSensitivity = false;
+ dcb.fParity = dwParity;
+ dcb.fOutX = false;
+ dcb.fInX = false;
+ dcb.fNull = false;
+ dcb.fAbortOnError = true;
+ dcb.fOutxCtsFlow = false;
+ dcb.fOutxDsrFlow = false;
+
+ if (dtr)
+ dcb.fDtrControl = DTR_CONTROL_ENABLE;
+ else
+ dcb.fDtrControl = DTR_CONTROL_DISABLE;
+
+ dcb.fDsrSensitivity = false;
+
+ if (rtscts) dcb.fRtsControl = RTS_CONTROL_ENABLE;
+ else {
+ if (rts)
+ dcb.fRtsControl = RTS_CONTROL_ENABLE;
+ else
+ dcb.fRtsControl = RTS_CONTROL_DISABLE;
+ }
+
+ bPortReady = SetCommState(hComm, &dcb);
+ if(bPortReady == 0) {
+ CloseHandle(hComm);
+ return false;
+ }
+ return SetCommTimeout();
+}
+
+///////////////////////////////////////////////////////
+// Function name : Cserial::setPTT
+// Return type : void
+///////////////////////////////////////////////////////
+void Cserial::SetPTT(bool ON)
+{
+ if(!hComm) {
+ LOG_ERROR("Invalid handle");
+ return;
+ }
+ if ( !(dtrptt || rtsptt) )
+ return;
+
+ LOG_INFO("PTT %d, DTRptt %d, DTR %d, RTSptt %d, RTS %d, RTSCTS %d",
+ ON, dtrptt, dtr, rtsptt, rts, rtscts);
+
+ if (ON) {
+ if (dtrptt && dtr)
+ dcb.fDtrControl = DTR_CONTROL_DISABLE;
+ if (dtrptt && !dtr)
+ dcb.fDtrControl = DTR_CONTROL_ENABLE;
+ if (!rtscts) {
+ if (rtsptt && rts)
+ dcb.fRtsControl = RTS_CONTROL_DISABLE;
+ if (rtsptt && !rts)
+ dcb.fRtsControl = RTS_CONTROL_ENABLE;
+ }
+ } else {
+ if (dtrptt && dtr)
+ dcb.fDtrControl = DTR_CONTROL_ENABLE;
+ if (dtrptt && !dtr)
+ dcb.fDtrControl = DTR_CONTROL_DISABLE;
+ if (!rtscts) {
+ if (rtsptt && rts)
+ dcb.fRtsControl = RTS_CONTROL_ENABLE;
+ if (rtsptt && !rts)
+ dcb.fRtsControl = RTS_CONTROL_DISABLE;
+ }
+ }
+ SetCommState(hComm, &dcb);
+}
+
+void Cserial::setRTS(bool b)
+{
+ if(!hComm)
+ return;
+
+ if (b == true)
+ dcb.fRtsControl = RTS_CONTROL_ENABLE;
+ else
+ dcb.fRtsControl = RTS_CONTROL_DISABLE;
+
+ SetCommState(hComm, &dcb);
+}
+
+void Cserial::setDTR(bool b)
+{
+ if(!hComm)
+ return;
+
+ if (b == true)
+ dcb.fDtrControl = DTR_CONTROL_ENABLE;
+ else
+ dcb.fDtrControl = DTR_CONTROL_DISABLE;
+
+ SetCommState(hComm, &dcb);
+}
+
+#endif
diff --git a/src/misc/status.cxx b/src/misc/status.cxx
new file mode 100644
index 0000000..53aba8a
--- /dev/null
+++ b/src/misc/status.cxx
@@ -0,0 +1,261 @@
+/* -----------------------------------------------------------------------------
+ * status structure / methods
+ *
+ * A part of "rig", a rig control program compatible with fldigi / xmlrpc i/o
+ *
+ * copyright Dave Freese 2009, w1hkj at w1hkj.com
+ *
+*/
+
+#include <iostream>
+#include <fstream>
+#include <string>
+
+#include <FL/Fl_Preferences.H>
+#include <FL/Fl_Progress.H>
+
+#include "status.h"
+#include "util.h"
+#include "flwkey.h"
+#include "support.h"
+#include "config.h"
+#include "wkey_dialogs.h"
+#include "debug.h"
+
+#include "logsupport.h"
+
+string last_xcvr_used = "none";
+
+status progStatus = {
+ 50, // int mainX;
+ 50, // int mainY;
+ "NONE", // string serial_port_name;
+ 1200, // int comm_baudrate;
+ 2, // int stopbits;
+ 2, // int comm_retries;
+ 5, // int comm_wait;
+ 50, // int comm_timeout;
+ false, // bool comm_echo;
+ 5, // int serloop_timing;
+// wkeyer defaults
+ 0xC4, // unsigned char mode_register;
+ 18, // unsigned char speed_wpm;
+ 6, // unsigned char sidetone;
+ 50, // unsigned char weight;
+ 0, // unsigned char lead_in_time;
+ 0, // unsigned char tail_time;
+ 10, // unsigned char min_wpm;
+ 25, // unsigned char max_wpm;
+ 0, // unsigned char first_extension;
+ 0, // unsigned char key_compensation;
+ 0, // unsigned char farnsworth_wpm;
+ 50, // unsigned char paddle_setpoint;
+ 50, // unsigned char dit_dah_ratio;
+ 7, // unsigned char pin_configuration;
+ 255, // unsigned char dont_care;
+
+ false, // bool cut_zeronine;
+ 18, // unsigned char cmd_wpm;
+ true, // bool use_pot
+
+// message store
+ "CQ", // string label_1;
+ "CQ CQ CQ DE <CLL> <CLL> K ", // string edit_msg1;
+ "call", // string label_2;
+ "<STA> DE <CLL> <CLL> K", // string edit_msg2;
+ "m 3", // string label_3;
+ "", // string edit_msg3;
+ "m 4", // string label_4;
+ "", // string edit_msg4;
+ "Xout", // string label_5;
+ "R <#> <X>", // string edit_msg5;
+ "Xlog", // string label_6;
+ "<LOG><+>", // string edit_msg6;
+ "X--", // string label_7;
+ "<->", // string edit_msg7;
+ "X++", // string label_8;
+ "<+>", // string edit_msg8;
+ "LOG", // string label_9;
+ "<LOG>", // string edit_msg9;
+ "m 10", // string label_10;
+ "", // string edit_msg10;
+ "m 11", // string label_11;
+ "", // string edit_msg11;
+ "m 12", // string label_12;
+ "", // string edit_msg12;
+
+ "", //string tag_call;
+ "", //string tag_qth;
+ "", //string tag_loc;
+ "", //string tag_op;
+
+ "", //string logbookfilename
+ false, //bool xml_logbook
+ "localhost", //string log_address
+ "8421", //string log_port
+
+ 1, // int serial_nbr;
+ 0, // int time_span;
+ 1, // bool band;
+ true, // bool zeros;
+ false, // bool dups;
+ "" // string xout
+
+};
+
+void status::saveLastState()
+{
+ Fl_Preferences spref(WKeyHomeDir.c_str(), "w1hkj.com", PACKAGE_TARNAME);
+
+ int mX = mainwindow->x();
+ int mY = mainwindow->y();
+ if (mX >= 0 && mX >= 0) {
+ mainX = mX;
+ mainY = mY;
+ }
+
+ spref.set("version", PACKAGE_VERSION);
+ spref.set("mainx", mX);
+ spref.set("mainy", mY);
+
+ spref.set("serial_port_name", serial_port_name.c_str());
+
+ spref.set("label1", label_1.c_str());
+ spref.set("msg1", edit_msg1.c_str());
+ spref.set("label2", label_2.c_str());
+ spref.set("msg2", edit_msg2.c_str());
+ spref.set("label3", label_3.c_str());
+ spref.set("msg3", edit_msg3.c_str());
+ spref.set("label4", label_4.c_str());
+ spref.set("msg4", edit_msg4.c_str());
+ spref.set("label5", label_5.c_str());
+ spref.set("msg5", edit_msg5.c_str());
+ spref.set("label6", label_6.c_str());
+ spref.set("msg6", edit_msg6.c_str());
+ spref.set("label7", label_7.c_str());
+ spref.set("msg7", edit_msg7.c_str());
+ spref.set("label8", label_8.c_str());
+ spref.set("msg8", edit_msg8.c_str());
+ spref.set("label9", label_9.c_str());
+ spref.set("msg9", edit_msg9.c_str());
+ spref.set("label10", label_10.c_str());
+ spref.set("msg10", edit_msg10.c_str());
+ spref.set("label11", label_11.c_str());
+ spref.set("msg11", edit_msg11.c_str());
+ spref.set("label12", label_12.c_str());
+ spref.set("msg12", edit_msg12.c_str());
+
+ spref.set("mode_register", mode_register);
+ spref.set("speed_wpm", speed_wpm);
+ spref.set("cmd_wpm", cmd_wpm);
+ spref.set("sidetone", sidetone);
+ spref.set("weight", weight);
+ spref.set("lead_in_time", lead_in_time);
+ spref.set("tail_time", tail_time);
+ spref.set("min_wpm", min_wpm);
+ spref.set("rng_wpm", rng_wpm);
+ spref.set("1st_ext", first_extension);
+ spref.set("key_comp", key_compensation);
+ spref.set("farnsworth", farnsworth_wpm);
+ spref.set("paddle_set", paddle_setpoint);
+ spref.set("dit_dah_ratio", dit_dah_ratio);
+ spref.set("pin_config", pin_configuration);
+
+ spref.set("tag_cll", tag_cll.c_str());
+ spref.set("tag_qth", tag_qth.c_str());
+ spref.set("tag_loc", tag_loc.c_str());
+ spref.set("tag_opr", tag_opr.c_str());
+
+ spref.set("logbook_filename", logbookfilename.c_str());
+ xml_logbook = mnu_log_client->value();
+ spref.set("xml_logbook", xml_logbook);
+
+ spref.set("logbook_ser_nbr", serial_nbr);
+ spref.set("logbook_time_span", time_span);
+ spref.set("logbook_zeros", zeros);
+ spref.set("logbook_dups", dups);
+ spref.set("logbook_band", band);
+ spref.set("logbook_xout", xout.c_str());
+
+}
+
+void status::loadLastState()
+{
+ Fl_Preferences spref(WKeyHomeDir.c_str(), "w1hkj.com", PACKAGE_TARNAME);
+
+ if (spref.entryExists("version")) {
+ char defbuffer[200];
+
+ spref.get("mainx", mainX, mainX);
+ spref.get("mainy", mainY, mainY);
+
+ spref.get("serial_port_name", defbuffer, "NONE", 199);
+ serial_port_name = defbuffer;
+ if (serial_port_name.find("tty") == 0)
+ serial_port_name.insert(0, "/dev/");
+
+ spref.get("label1", defbuffer, "msg1", 199); label_1 = defbuffer;
+ spref.get("msg1", defbuffer, "", 199); edit_msg1 = defbuffer;
+ spref.get("label2", defbuffer, "msg2", 199); label_2 = defbuffer;
+ spref.get("msg2", defbuffer, "", 199); edit_msg2 = defbuffer;
+ spref.get("label3", defbuffer, "msg3", 199); label_3 = defbuffer;
+ spref.get("msg3", defbuffer, "", 199); edit_msg3 = defbuffer;
+ spref.get("label4", defbuffer, "msg4", 199); label_4 = defbuffer;
+ spref.get("msg4", defbuffer, "", 199); edit_msg4 = defbuffer;
+ spref.get("label5", defbuffer, "msg5", 199); label_5 = defbuffer;
+ spref.get("msg5", defbuffer, "", 199); edit_msg5 = defbuffer;
+ spref.get("label6", defbuffer, "msg6", 199); label_6 = defbuffer;
+ spref.get("msg6", defbuffer, "", 199); edit_msg6 = defbuffer;
+ spref.get("label7", defbuffer, "msg7", 199); label_7 = defbuffer;
+ spref.get("msg7", defbuffer, "", 199); edit_msg7 = defbuffer;
+ spref.get("label8", defbuffer, "msg8", 199); label_8 = defbuffer;
+ spref.get("msg8", defbuffer, "", 199); edit_msg8 = defbuffer;
+ spref.get("label9", defbuffer, "msg9", 199); label_9 = defbuffer;
+ spref.get("msg9", defbuffer, "", 199); edit_msg9 = defbuffer;
+ spref.get("label10", defbuffer, "msg10", 199); label_10 = defbuffer;
+ spref.get("msg10", defbuffer, "", 199); edit_msg10 = defbuffer;
+ spref.get("label11", defbuffer, "msg11", 199); label_11 = defbuffer;
+ spref.get("msg11", defbuffer, "", 199); edit_msg11 = defbuffer;
+ spref.get("label12", defbuffer, "msg11", 199); label_12 = defbuffer;
+ spref.get("msg12", defbuffer, "", 199); edit_msg12 = defbuffer;
+
+ int ichar;
+ spref.get("mode_register", ichar, mode_register); mode_register = ichar & 0xFF;
+ spref.get("speed_wpm", ichar, speed_wpm); speed_wpm = ichar & 0xFF;
+ spref.get("cmd_wpm", ichar, cmd_wpm); cmd_wpm = ichar & 0xFF;
+ spref.get("sidetone", ichar, sidetone); sidetone = ichar & 0xFF;
+ spref.get("weight", ichar, weight); weight = ichar & 0xFF;
+ spref.get("lead_in_time", ichar, lead_in_time); lead_in_time = ichar & 0xFF;
+ spref.get("tail_time", ichar, tail_time); tail_time = ichar & 0xFF;
+ spref.get("min_wpm", ichar, min_wpm); min_wpm = ichar & 0xFF;
+ spref.get("rng_wpm", ichar, rng_wpm); rng_wpm = ichar & 0xFF;
+ spref.get("1st_ext", ichar, first_extension); first_extension = ichar & 0xFF;
+ spref.get("key_comp", ichar, key_compensation); key_compensation = ichar & 0xFF;
+ spref.get("farnsworth", ichar, farnsworth_wpm); farnsworth_wpm = ichar & 0xFF;
+ spref.get("paddle_set", ichar, paddle_setpoint); paddle_setpoint = ichar & 0xFF;
+ spref.get("dit_dah_ratio", ichar, dit_dah_ratio); dit_dah_ratio = ichar & 0xFF;
+ spref.get("pin_config", ichar, pin_configuration); pin_configuration = ichar & 0xFF;
+
+ spref.get("tag_cll", defbuffer, "", 199); tag_cll = defbuffer;
+ spref.get("tag_qth", defbuffer, "", 199); tag_qth = defbuffer;
+ spref.get("tag_loc", defbuffer, "", 199); tag_loc = defbuffer;
+ spref.get("tag_opr", defbuffer, "", 199); tag_opr = defbuffer;
+
+ spref.get("logbook_filename", defbuffer, "", 199); logbookfilename = defbuffer;
+ spref.get("xml_logbook", ichar, ichar); xml_logbook = (ichar == 1);
+
+ spref.get("logbook_ser_nbr", serial_nbr, serial_nbr);
+ spref.get("logbook_time_span", time_span, time_span);
+ spref.get("logbook_zeros", ichar, ichar); zeros = (ichar == 1);
+ spref.get("logbook_dups", ichar, ichar); dups = (ichar == 1);
+ spref.get("logbook_band", ichar, ichar); band = (ichar == 1);
+ spref.get("logbook_xout", defbuffer, "", 199); xout = defbuffer;
+
+ update_msg_labels();
+ if (xml_logbook) {
+ mnu_log_client->set();
+ connect_to_server();
+ }
+ }
+}
+
diff --git a/src/misc/support.cxx b/src/misc/support.cxx
new file mode 100644
index 0000000..f62495d
--- /dev/null
+++ b/src/misc/support.cxx
@@ -0,0 +1,805 @@
+#include <stdlib.h>
+#include <iostream>
+#include <fstream>
+#include <vector>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <pthread.h>
+
+#include <FL/Fl.H>
+#include <FL/Fl_Box.H>
+#include <FL/Enumerations.H>
+
+#include "support.h"
+#include "debug.h"
+#include "gettext.h"
+#include "wkey_io.h"
+#include "dialogs.h"
+#include "wkey_dialogs.h"
+#include "status.h"
+#include "logbook.h"
+
+using namespace std;
+
+Cserial WKEY_serial;
+
+//=============================================================================
+// WinKey command sequences
+//=============================================================================
+// ADMIN MODE
+const char ADMIN = '\x00';
+const char CALIBRATE = '\x00';
+const char RESET = '\x01';
+const char HOST_OPEN = '\x02';
+const char HOST_CLOSE = '\x03';
+const char ECHO_TEST = '\x04';
+const char PADDLE_A2D = '\x05';
+const char SPEED_A2D = '\x06';
+const char GET_VALUES = '\x07';
+const char GET_CAL = '\x09';
+const char WK1_MODE = '\x0A';
+const char WK2_MODE = '\x0B';
+const char DUMP_EEPROM = '\x0C';
+const char LOAD_EEPROM = '\x0D';
+
+const char *SEND_MSG_NBR = "\x0E";
+
+// HOST MODE
+const char *SIDETONE = "\x01"; // N see table page 6 Interface Manual
+const char *SET_WPM = "\x02"; // 5 .. N .. 99 in WPM
+const char *SET_WEIGHT = "\x03"; // 10 .. N .. 90 %
+const char *SET_PTT_LT = "\x04"; // A - lead time, B - tail time
+ // both 0..250 in 10 msec steps
+ // "0x04<01><A0> = 10 msec lead, 1.6 sec tail
+const char *SET_SPEED_POT = "\x05"; // A = min, B = range, C anything
+const char *PAUSE = "\x06"; // 1 = pause, 0 = release
+const char *GET_SPEED_POT = "\x07"; // return values as per page 7/8
+const char *BACKSPACE = "\x08";
+const char *SET_PIN_CONFIG = "\x09"; // N as per tables page 8
+const char *CLEAR_BUFFER = "\x0A";
+const char *KEY_IMMEDIATE = "\x0B"; // 0 = keyup, 1 = keydown
+const char *HSCW = "\x0C"; // N = lpm / 100
+const char *FARNS_WPM = "\x0D"; // 10 .. N .. 99
+const char *SET_WK2_MODE = "\x0E"; // N as per table page 9
+const char *LOAD_DEFAULTS = "\x0F";
+ // A = MODE REGISTER B = SPEED IN WPM C = SIDETONE FREQ
+ // D = WEIGHT E = LEAD-IN TIME F = TAIL TIME
+ // G = MIN_WPM H = WPM RANGE I = 1ST EXTENSION
+ // J = KEY COMPENSATION K = FARNSWORTH WPM L = PADDLE SETPOINT
+ // M = DIT/DAH RATIO N = PIN_CONFIGURATION O = DONT CARE ==> zero
+const char *FIRST_EXT = "\x10"; // see page 10/11
+const char *SET_KEY_COMP = "\x11"; // see page 11
+const char *NULL_CMD = "\023\023\023";
+const char *PADDLE_SW_PNT = "\x12"; // 10 .. N .. 90%
+const char *SOFT_PADDLE = "\x14"; // 0 - up, 1 - dit, 2 - dah, 3 - both
+const char *GET_STATUS = "\x15"; // request status byte, see page 12
+const char *POINTER_CMD = "\x16"; // see page 12
+const char *SET_DIT_DAH = "\x17"; // 33 .. N .. 66 N = ratio * 50 / 3
+
+// BUFFERED COMMANDS
+const char *PTT_ON_OFF = "\x18"; // 1 = on 0 = off
+const char *KEY_BUFFERED = "\x19"; // 0 .. N .. 99 seconds
+const char *WAIT = "\x1A"; // 0 .. N .. 99 seconds
+const char *MERGE = "\x1B"; // merger CD into prosign, ie AR, SK etc
+const char *CHANGE_BFR_SPD = "\x1C"; // 5 .. N .. 99
+const char *CHANGE_HSCW_SPD = "\x1D"; // N = lpm / 100
+const char *CANCEL_BFR_SPD = "\x1E";
+const char *BUFFER_NOP = "\x1F";
+
+//=============================================================================
+// loop for serial i/o thread
+// runs continuously until program is closed
+// only accesses the serial port if it has been successfully opened
+//=============================================================================
+
+void version_(int);
+void echo_test(int);
+void status_(int);
+void speed_(int);
+void echo_(int);
+void eeprom_(int);
+
+bool bypass_serial_thread_loop = true;
+bool run_serial_thread = true;
+
+bool PTT = false;
+int powerlevel = 0;
+
+string str_out;
+bool get_version = false;
+bool test_echo = false;
+bool host_is_up = false;
+bool wk2_version = false;
+bool read_EEPROM = false;
+
+int wkeyer_ready = true;
+
+void upcase(string &s)
+{
+ for (size_t n = 0; n < s.length(); n++) s[n] = toupper(s[n]);
+}
+
+void noctrl(string &s)
+{
+ for (size_t n = 0; n < s.length(); n++)
+ if (s[n] < ' ' || s[n] > 'Z') s[n] = ' ';
+}
+
+enum {NOTHING, WAIT_ECHO, WAIT_VERSION};
+void sendCommand(string &cmd, int what = NOTHING)
+{
+ int cnt = 101;
+ while (cnt-- && !str_out.empty()) MilliSleep(1);
+ if (!str_out.empty())
+ LOG_ERROR("output string not cleared!");
+ pthread_mutex_lock(&mutex_serial);
+ upcase(cmd);
+ str_out = cmd;
+ switch (what) {
+ case WAIT_ECHO :
+ test_echo = true;
+ break;
+ case WAIT_VERSION :
+ get_version = true;
+ break;
+ default: ;
+ }
+ pthread_mutex_unlock(&mutex_serial);
+}
+
+void sendText(string &cmd)
+{
+ int cnt = 101;
+ while (cnt-- && !str_out.empty()) MilliSleep(1);
+ if (!str_out.empty())
+ LOG_ERROR("output string not cleared!");
+ pthread_mutex_lock(&mutex_serial);
+ upcase(cmd);
+ noctrl(cmd);
+ str_out = cmd;
+ pthread_mutex_unlock(&mutex_serial);
+}
+
+bool echo_ok = true;
+
+void send_char()
+{
+ if (!btn_send->value() || !wkeyer_ready)
+ return;
+
+ char c;
+ c = txt_to_send->nextChar();
+ if (c > -1) {
+ c = toupper(c);
+ if (c < ' ') c = ' ';
+ if (c == '0' && progStatus.cut_zeronine) c = 'T';
+ if (c == '9' && progStatus.cut_zeronine) c = 'N';
+ str_out = c;
+ echo_ok = false;
+ }
+}
+
+void * serial_thread_loop(void *d)
+{
+unsigned char byte;
+ for(;;) {
+ if (!run_serial_thread) break;
+
+ MilliSleep(progStatus.serloop_timing);
+
+ if (bypass_serial_thread_loop ||
+ !WKEY_serial.IsOpen()) goto serial_bypass_loop;
+
+ pthread_mutex_lock(&mutex_serial);
+// process outgoing
+ if (!str_out.empty()) {
+ sendString(str_out, true);
+ str_out.clear();
+ } else if (echo_ok)
+ send_char();
+
+ if (WKEY_serial.ReadByte(byte)) {
+ if ((byte == 0xA5 || read_EEPROM))
+ eeprom_(byte);
+ else if ((byte & 0xC0) == 0xC0)
+ status_(byte);
+ else if ((byte & 0xC0) == 0x80)
+ speed_(byte);
+ else if (test_echo)
+ echo_test(byte);
+ else if (get_version)
+ version_(byte);
+ else
+ echo_(byte);
+ echo_ok = true;
+ }
+ pthread_mutex_unlock(&mutex_serial);
+serial_bypass_loop: ;
+ }
+ return NULL;
+}
+
+void display_byte(void *d)
+{
+ long lch = (long)d;
+ char ch = (char)lch;
+ txt_sent->add(ch);
+}
+
+void display_chars(void *d)
+{
+ char *sz_chars = (char *)d;
+ txt_sent->add(sz_chars);
+}
+
+void echo_(int byte)
+{
+ if (WKEY_DEBUG)
+ LOG_WARN("%2x", byte & 0xFF);
+ Fl::awake(display_byte, (void*)byte);
+}
+
+void echo_test(int byte)
+{
+ if (WKEY_DEBUG)
+ LOG_WARN("%02X", byte & 0xFF);
+ if (byte == 'U') {
+ if (WKEY_DEBUG)
+ LOG_WARN("passed %c", byte & 0xFF);
+ } else
+ LOG_ERROR("failed %c", byte & 0xFF);
+ test_echo = false;
+}
+
+void version_(int byte)
+{
+ if (WKEY_DEBUG)
+ LOG_WARN("%02X", byte & 0xFF);
+ static char ver[200];
+ snprintf(ver, sizeof(ver), "Flwkey version: %s\nWkeyer version %d\n",
+ PACKAGE_VERSION, byte & 0xFF);
+ host_is_up = true;
+ get_version = false;
+ Fl::awake(display_chars, ver);
+ if (byte >= 20) wk2_version = true;
+}
+
+void show_status_change(void *d)
+{
+ int byte = (int)(reinterpret_cast<long>(d));
+
+ box_wait->color((byte & 0x10) == 0x10 ? FL_RED : FL_BACKGROUND2_COLOR);
+ box_wait->redraw();
+
+ box_keydown->color((byte & 0x08) == 0x08 ? FL_RED : FL_BACKGROUND2_COLOR);
+ box_keydown->redraw();
+
+ box_busy->color((byte & 0x04) == 0x04 ? FL_RED : FL_BACKGROUND2_COLOR);
+ box_busy->redraw();
+
+ box_break_in->color((byte & 0x02) == 0x02 ? FL_RED : FL_BACKGROUND2_COLOR);
+ box_break_in->redraw();
+
+ box_xoff->color((byte & 0x01) == 0x01 ? FL_RED : FL_BACKGROUND2_COLOR);
+ box_xoff->redraw();
+}
+
+void status_(int byte)
+{
+ if (WKEY_DEBUG)
+ LOG_WARN("%02X", byte & 0xFF);
+ if ((byte & 0x04)== 0x04) wkeyer_ready = false;
+ else wkeyer_ready = true;
+ if (WKEY_DEBUG)
+ LOG_WARN("Wait %c, Keydown %c, Busy %c, Breakin %c, Xoff %c",
+ byte & 0x10 ? 'T' : 'F',
+ byte & 0x08 ? 'T' : 'F',
+ byte & 0x04 ? 'T' : 'F',
+ byte & 0x02 ? 'T' : 'F',
+ byte & 0x01 ? 'T' : 'F');
+ Fl::awake(show_status_change, (void *)byte);
+}
+
+void show_speed_change(void *d)
+{
+ long wpm = (long)d;
+ int iwpm = (int)wpm;
+ static char szwpm[8];
+ snprintf(szwpm, sizeof(szwpm), "%3d", iwpm);
+ txt_wpm->value(szwpm);
+ txt_wpm->redraw();
+ if (!progStatus.use_pot) return;
+ string cmd = SET_WPM;
+ cmd += iwpm;
+ sendCommand(cmd);
+}
+
+void speed_(int byte)
+{
+ if (WKEY_DEBUG)
+ LOG_WARN("%02X", byte & 0xFF);
+ int val = (byte & 0x3F) + progStatus.min_wpm;
+ Fl::awake(show_speed_change, (void *)(val));
+ if (WKEY_DEBUG)
+ LOG_WARN("wpm: %d", val);
+}
+
+void set_wpm()
+{
+ int wpm = (int)cntr_wpm->value();
+ progStatus.speed_wpm = wpm;
+ if (progStatus.use_pot) return;
+ string cmd = SET_WPM;
+ cmd += wpm;
+ sendCommand(cmd);
+}
+
+void use_pot_changed()
+{
+ progStatus.use_pot = btn_use_pot->value();
+ if (progStatus.use_pot) {
+ string cmd = GET_SPEED_POT;
+ sendCommand(cmd);
+ } else {
+ string cmd = SET_WPM;
+ cmd += (int)cntr_wpm->value();
+ sendCommand(cmd);
+ }
+}
+
+char eeprom_image[256];
+int eeprom_ptr = 0;
+void eeprom_(int byte)
+{
+ if (WKEY_DEBUG)
+ LOG_WARN("%02X", byte & 0xFF);
+ if (byte == 0xA5) {
+ memset( eeprom_image, 0, 256);
+ eeprom_ptr = 0;
+ read_EEPROM = true;
+ }
+ if (eeprom_ptr < 256)
+ eeprom_image[eeprom_ptr++] = byte;
+ if (eeprom_ptr == 256) {
+ read_EEPROM = false;
+ if (WKEY_DEBUG)
+ LOG_WARN("\n%s", str2hex(eeprom_image, 256));
+ eeprom_ptr = 0;
+ }
+}
+
+void cbExit()
+{
+// shutdown serial thread
+ pthread_mutex_lock(&mutex_serial);
+ run_serial_thread = false;
+ pthread_mutex_unlock(&mutex_serial);
+ pthread_join(*serial_thread, NULL);
+
+// close host and close down the serial port
+ if (host_is_up) {
+ string cmd = " ";
+ cmd += HOST_CLOSE;
+ cmd[0] = ADMIN;
+ sendString(cmd, true);
+ }
+
+ WKEY_serial.ClosePort();
+
+ progStatus.saveLastState();
+
+ close_logbook();
+
+ exit(0);
+}
+
+
+void open_wkeyer()
+{
+ int cnt = 0;
+ string cmd = NULL_CMD;
+ sendCommand(cmd);
+
+ cmd = ADMIN;
+ cmd += ECHO_TEST;
+ cmd += 'U';
+ sendCommand(cmd, WAIT_ECHO);
+
+ cnt = 200;
+ while (test_echo == true && cnt) {
+ MilliSleep(10);
+ cnt--;
+ }
+
+ if (test_echo) {
+ debug::show();
+ LOG_ERROR("%s", "Winkeyer not responding");
+ test_echo = false;
+ pthread_mutex_lock(&mutex_serial);
+ bypass_serial_thread_loop = true;
+ pthread_mutex_unlock(&mutex_serial);
+ WKEY_serial.ClosePort();
+ progStatus.serial_port_name = "NONE";
+ selectCommPort->value(progStatus.serial_port_name.c_str());
+ return;
+ }
+
+/*
+ cmd = ADMIN;
+ cmd += DUMP_EEPROM;
+ sendCommand(cmd);
+ read_EEPROM = true;
+
+ cnt = 4000;
+ while (read_EEPROM == true && cnt) {
+ MilliSleep(10);
+ cnt--;
+ }
+ if (WKEY_DEBUG)
+ LOG_WARN("EEprom read time %.2f sec", (4000 - cnt) * 0.01);
+*/
+
+ cmd = " ";
+ cmd += HOST_OPEN;
+ cmd[0] = ADMIN;
+ sendCommand(cmd, WAIT_VERSION);
+
+ cnt = 200;
+ while (get_version == true && cnt) {
+ MilliSleep(10);
+ cnt--;
+ }
+
+ cntr_wpm->minimum(progStatus.min_wpm);
+ cntr_wpm->maximum(progStatus.rng_wpm + progStatus.min_wpm);
+ btn_use_pot->value(progStatus.use_pot);
+
+ load_defaults();
+
+ cmd = GET_SPEED_POT;
+ sendCommand(cmd);
+
+ cmd = SET_WPM;
+ cmd += progStatus.speed_wpm;
+ sendCommand(cmd);
+
+ if (wk2_version) {
+ cmd = ADMIN;
+ cmd += WK2_MODE;
+ sendCommand(cmd);
+ }
+
+ cmd = SET_SPEED_POT;
+ cmd += progStatus.min_wpm;
+ cmd += progStatus.rng_wpm;
+ cmd += 0xFF;
+ sendCommand(cmd);
+
+ cmd = GET_SPEED_POT;
+ sendCommand(cmd);
+
+}
+
+void load_defaults()
+{
+ string cmd = LOAD_DEFAULTS;
+ cmd += progStatus.mode_register;
+ cmd += '\0';//progStatus.speed_wpm;
+ cmd += progStatus.sidetone;
+ cmd += progStatus.weight;
+ cmd += progStatus.lead_in_time;
+ cmd += progStatus.tail_time;
+ cmd += progStatus.min_wpm;
+ cmd += progStatus.rng_wpm;
+ cmd += progStatus.first_extension;
+ cmd += progStatus.key_compensation;
+ cmd += progStatus.farnsworth_wpm;
+ cmd += progStatus.paddle_setpoint;
+ cmd += progStatus.dit_dah_ratio;
+ cmd += progStatus.pin_configuration;
+ cmd += progStatus.dont_care;
+ sendCommand(cmd);
+}
+
+void cb_send_button()
+{
+ Fl::focus(txt_to_send);
+}
+
+void cb_clear_text_to_send()
+{
+ txt_to_send->clear();
+ Fl::focus(txt_to_send);
+}
+
+void cb_cancel_transmit()
+{
+ string cmd = CLEAR_BUFFER;
+ sendCommand(cmd);
+ cb_clear_text_to_send();
+ Fl::focus(txt_to_send);
+}
+
+void cb_tune()
+{
+ string cmd = KEY_IMMEDIATE;
+ if (btn_tune->value()) cmd += '\1';
+ else cmd += '\0';
+ sendCommand(cmd);
+ Fl::focus(txt_to_send);
+}
+
+void expand_msg(string &msg)
+{
+ size_t ptr;
+ upcase(msg);
+ while ((ptr = msg.find("<STA>")) != string::npos)
+ msg.replace(ptr, 5, txt_sta->value());
+ while ((ptr = msg.find("<NAM>")) != string::npos)
+ msg.replace(ptr, 5, txt_name->value());
+ while ((ptr = msg.find("<CLL>")) != string::npos)
+ msg.replace(ptr, 5, progStatus.tag_cll);
+ while ((ptr = msg.find("<QTH>")) != string::npos)
+ msg.replace(ptr, 5, progStatus.tag_qth);
+ while ((ptr = msg.find("<LOC>")) != string::npos)
+ msg.replace(ptr, 5, progStatus.tag_loc);
+ while ((ptr = msg.find("<OPR>")) != string::npos)
+ msg.replace(ptr, 5, progStatus.tag_opr);
+ while ((ptr = msg.find("<X>")) != string::npos)
+ msg.replace(ptr, 3, progStatus.xout);
+
+ char snbr[8] = "";
+ if (progStatus.zeros && progStatus.serial_nbr < 100)
+ snprintf(snbr, sizeof(snbr), "0%d", progStatus.serial_nbr);
+ else
+ snprintf(snbr, sizeof(snbr), "%d", progStatus.serial_nbr);
+ while ((ptr = msg.find("<#>")) != string::npos)
+ msg.replace(ptr, 3, snbr);
+
+ if ((ptr = msg.find("<LOG>")) != string::npos) {
+ if (mnu_log_client->value())
+ xml_add_record();
+ else
+ AddRecord();
+ msg.replace(ptr, 5, "");
+ }
+
+ while ((ptr = msg.find("<+>")) != string::npos) {
+ progStatus.serial_nbr++;
+ msg.replace(ptr, 3, "");
+ }
+ while ((ptr = msg.find("<->")) != string::npos) {
+ progStatus.serial_nbr--;
+ msg.replace(ptr, 3, "");
+ }
+ if (progStatus.serial_nbr < 1) progStatus.serial_nbr = 1;
+
+ snprintf(snbr, sizeof(snbr), "%d", progStatus.serial_nbr);
+ txt_serial_nbr->value(snbr);
+ txt_serial_nbr->redraw();
+
+}
+
+void serial_nbr()
+{
+ progStatus.serial_nbr = atoi(txt_serial_nbr->value());
+}
+
+void time_span()
+{
+ progStatus.time_span = atoi(txt_time_span->value());
+}
+
+void zeros()
+{
+ progStatus.zeros = btn_zeros->value();
+ check_call();
+}
+
+void dups()
+{
+ progStatus.dups = btn_dups->value();
+ check_call();
+}
+
+void ck_band()
+{
+ progStatus.band = btn_ck_band->value();
+ check_call();
+}
+
+void do_config_messages(void *)
+{
+ config_messages();
+}
+
+void send_message(string msg)
+{
+ if (Fl::event_button() == FL_RIGHT_MOUSE) {
+ Fl::awake(do_config_messages, 0);
+ return;
+ }
+ if (msg.empty()) return;
+ expand_msg(msg);
+ txt_to_send->add(msg.c_str());
+}
+
+void exec_msg1()
+{
+ send_message(progStatus.edit_msg1);
+ Fl::focus(txt_to_send);
+}
+
+void exec_msg2()
+{
+ send_message(progStatus.edit_msg2);
+ Fl::focus(txt_to_send);
+}
+
+void exec_msg3()
+{
+ send_message(progStatus.edit_msg3);
+ Fl::focus(txt_to_send);
+}
+
+void exec_msg4()
+{
+ send_message(progStatus.edit_msg4);
+ Fl::focus(txt_to_send);
+}
+
+void exec_msg5()
+{
+ send_message(progStatus.edit_msg5);
+ Fl::focus(txt_to_send);
+}
+
+void exec_msg6()
+{
+ send_message(progStatus.edit_msg6);
+ Fl::focus(txt_to_send);
+}
+
+void exec_msg7()
+{
+ send_message(progStatus.edit_msg7);
+ Fl::focus(txt_to_send);
+}
+
+void exec_msg8()
+{
+ send_message(progStatus.edit_msg8);
+ Fl::focus(txt_to_send);
+}
+
+void exec_msg9()
+{
+ send_message(progStatus.edit_msg9);
+ Fl::focus(txt_to_send);
+}
+
+void exec_msg10()
+{
+ send_message(progStatus.edit_msg10);
+ Fl::focus(txt_to_send);
+}
+
+void exec_msg11()
+{
+ send_message(progStatus.edit_msg11);
+ Fl::focus(txt_to_send);
+}
+
+void exec_msg12()
+{
+ send_message(progStatus.edit_msg12);
+ Fl::focus(txt_to_send);
+}
+
+int main_handler(int event)
+{
+ if (event != FL_SHORTCUT)
+ return 0;
+ Fl_Widget* w = Fl::focus();
+
+ if (w == mainwindow || w->window() == mainwindow) {
+ int key = Fl::event_key();
+ int state = Fl::event_state();
+ if (key == FL_Escape) return 1;
+ if ((key == 't') && ((state & FL_ALT) == FL_ALT)) {
+ if (btn_tune->value() == 1) btn_tune->value(0);
+ else btn_tune->value(1);
+ cb_tune();
+ return 1;
+ }
+ if ((key == 's') && ((state & FL_ALT) == FL_ALT)) {
+ if (btn_send->value() == 1) btn_send->value(0);
+ else btn_send->value(1);
+ return 1;
+ }
+ if ((key == 'l') && ((state & FL_ALT) == FL_ALT)) {
+ if (mnu_log_client->value())
+ xml_add_record();
+ else
+ AddRecord();
+ return 1;
+ }
+ if ((key > FL_F) && key <= (FL_F + 12)) {
+ switch (key) {
+ case (FL_F + 1):
+ send_message(progStatus.edit_msg1);
+ break;
+ case (FL_F + 2):
+ send_message(progStatus.edit_msg2);
+ break;
+ case (FL_F + 3):
+ send_message(progStatus.edit_msg3);
+ break;
+ case (FL_F + 4):
+ send_message(progStatus.edit_msg4);
+ break;
+ case (FL_F + 5):
+ send_message(progStatus.edit_msg5);
+ break;
+ case (FL_F + 6):
+ send_message(progStatus.edit_msg6);
+ break;
+ case (FL_F + 7):
+ send_message(progStatus.edit_msg7);
+ break;
+ case (FL_F + 8):
+ send_message(progStatus.edit_msg8);
+ break;
+ case (FL_F + 9):
+ send_message(progStatus.edit_msg9);
+ break;
+ case (FL_F + 10):
+ send_message(progStatus.edit_msg10);
+ break;
+ case (FL_F + 11):
+ send_message(progStatus.edit_msg11);
+ break;
+ case (FL_F + 12):
+ send_message(progStatus.edit_msg12);
+ break;
+ default: break;
+ }
+ Fl::focus(txt_to_send);
+ return 1;
+ }
+ }
+ return 0;
+}
+
+void check_call()
+{
+ string chkcall = txt_sta->value();
+ txt_sta->color(FL_BACKGROUND2_COLOR);
+ txt_sta->redraw();
+
+ if (chkcall.empty()) {
+ txt_name->value("");
+ return;
+ }
+ upcase(chkcall);
+ size_t pos = txt_sta->position();
+
+ txt_sta->value(chkcall.c_str());
+ txt_sta->position(pos);
+
+ if (strlen(txt_sta->value()) < 3) return;
+
+ if (btn_dups->value())
+ if (mnu_log_client->value())
+ xml_check_dup();
+ else
+ DupCheck();
+ else
+ if (mnu_log_client->value())
+ xml_get_record(txt_sta->value());
+ else
+ SearchLastQSO(txt_sta->value());
+}
diff --git a/src/misc/timeops.cxx b/src/misc/timeops.cxx
new file mode 100644
index 0000000..332482c
--- /dev/null
+++ b/src/misc/timeops.cxx
@@ -0,0 +1,203 @@
+// ----------------------------------------------------------------------------
+// timeops.cxx
+//
+// Copyright (C) 2007-2009
+// Stelios Bounanos, M0GLD
+//
+// This file is part of fldigi.
+//
+// fldigi is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// fldigi is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+// ----------------------------------------------------------------------------
+
+#include <config.h>
+
+#include "timeops.h"
+#ifdef __MINGW32__
+# include "compat.h"
+#endif
+
+#if !HAVE_CLOCK_GETTIME
+# ifdef __APPLE__
+# include <mach/mach_time.h>
+# endif
+# if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# endif
+# include <errno.h>
+int clock_gettime(clockid_t clock_id, struct timespec* tp)
+{
+ if (clock_id == CLOCK_REALTIME) {
+ struct timeval t;
+ if (gettimeofday(&t, NULL) != 0)
+ return -1;
+ tp->tv_sec = t.tv_sec;
+ tp->tv_nsec = t.tv_usec * 1000;
+ }
+ else if (clock_id == CLOCK_MONOTONIC) {
+#if defined(__WOE32__)
+ int32_t msec = GetTickCount();
+ tp->tv_sec = msec / 1000;
+ tp->tv_nsec = (msec % 1000) * 1000000;
+#elif defined(__APPLE__)
+ static mach_timebase_info_data_t info = { 0, 0 };
+ if (info.denom == 0)
+ mach_timebase_info(&info);
+ uint64_t t = mach_absolute_time() * info.numer / info.denom;
+ tp->tv_sec = t / 1000000000;
+ tp->tv_nsec = t % 1000000000;
+#endif
+ }
+ else {
+ errno = EINVAL;
+ return -1;
+ }
+
+ return 0;
+}
+#endif // !HAVE_CLOCK_GETTIME
+
+struct timespec operator+(const struct timespec &t0, const double &t)
+{
+ struct timespec r;
+ r.tv_sec = t0.tv_sec + static_cast<time_t>(t);
+ r.tv_nsec = t0.tv_nsec + static_cast<long>((t - static_cast<time_t>(t)) * 1e9);
+ if (r.tv_nsec > 1000000000) {
+ r.tv_nsec -= 1000000000;
+ r.tv_sec++;
+ }
+ return r;
+}
+
+struct timespec operator-(const struct timespec &t0, const struct timespec &t1)
+{
+ struct timespec r = t0;
+
+ if (r.tv_nsec < t1.tv_nsec) {
+ --r.tv_sec;
+ r.tv_nsec += 1000000000L;
+ }
+ r.tv_sec -= t1.tv_sec;
+ r.tv_nsec -= t1.tv_nsec;
+
+ return r;
+}
+
+struct timespec& operator-=(struct timespec &t0, const struct timespec &t1)
+{
+ if (t0.tv_nsec < t1.tv_nsec) {
+ --t0.tv_sec;
+ t0.tv_nsec += 1000000000L;
+ }
+ t0.tv_sec -= t1.tv_sec;
+ t0.tv_nsec -= t1.tv_nsec;
+
+ return t0;
+}
+
+bool operator>(const struct timespec &t0, const struct timespec &t1)
+{
+ if (t0.tv_sec == t1.tv_sec)
+ return t0.tv_nsec > t1.tv_nsec;
+ else if (t0.tv_sec > t1.tv_sec)
+ return true;
+ else
+ return false;
+}
+
+bool operator==(const struct timespec &t0, const struct timespec &t1)
+{
+ return t0.tv_sec == t1.tv_sec && t0.tv_nsec == t1.tv_nsec;
+}
+
+
+struct timeval operator+(const struct timeval &t0, const double &t)
+{
+ struct timeval r;
+ r.tv_sec = t0.tv_sec + static_cast<time_t>(t);
+ r.tv_usec = t0.tv_usec + static_cast<suseconds_t>((t - static_cast<time_t>(t)) * 1e9);
+ if (r.tv_usec > 1000000) {
+ r.tv_usec -= 1000000;
+ r.tv_sec++;
+ }
+ return r;
+}
+
+struct timeval operator-(const struct timeval &t0, const struct timeval &t1)
+{
+ struct timeval r = t0;
+
+ if (r.tv_usec < t1.tv_usec) {
+ --r.tv_sec;
+ r.tv_usec += 1000000;
+ }
+ r.tv_sec -= t1.tv_sec;
+ r.tv_usec -= t1.tv_usec;
+
+ return r;
+}
+
+struct timeval& operator-=(struct timeval &t0, const struct timeval &t1)
+{
+ if (t0.tv_usec < t1.tv_usec) {
+ --t0.tv_sec;
+ t0.tv_usec += 1000000L;
+ }
+ t0.tv_sec -= t1.tv_sec;
+ t0.tv_usec -= t1.tv_usec;
+
+ return t0;
+}
+
+bool operator>(const struct timeval &t0, const struct timeval &t1)
+{
+ if (t0.tv_sec == t1.tv_sec)
+ return t0.tv_usec > t1.tv_usec;
+ else if (t0.tv_sec > t1.tv_sec)
+ return true;
+ else
+ return false;
+}
+
+bool operator==(const struct timeval &t0, const struct timeval &t1)
+{
+ return t0.tv_sec == t1.tv_sec && t0.tv_usec == t1.tv_usec;
+}
+
+
+#ifndef HAVE_GMTIME_R
+#include <pthread.h>
+
+static pthread_mutex_t gmtime_r_mutex = PTHREAD_MUTEX_INITIALIZER;
+
+struct tm *gmtime_r(const time_t *_Time, struct tm *_Tm)
+{
+ pthread_mutex_lock (&gmtime_r_mutex);
+ struct tm *p = gmtime(_Time);
+ if (p && _Tm) memcpy (_Tm, p, sizeof (struct tm));
+ pthread_mutex_unlock (&gmtime_r_mutex);
+ return p;
+}
+
+static pthread_mutex_t gmtime_local_mutex = PTHREAD_MUTEX_INITIALIZER;
+
+struct tm *localtime_r(const time_t *_Time,struct tm *_Tm)
+{
+ pthread_mutex_lock (&gmtime_local_mutex);
+ struct tm *p = localtime(_Time);
+ if (p && _Tm) memcpy (_Tm, p, sizeof (struct tm));
+ pthread_mutex_unlock (&gmtime_local_mutex);
+ return p;
+}
+
+#endif
diff --git a/src/misc/util.cxx b/src/misc/util.cxx
new file mode 100644
index 0000000..5da1ef9
--- /dev/null
+++ b/src/misc/util.cxx
@@ -0,0 +1,264 @@
+#include <string.h>
+#include <time.h>
+#include "util.h"
+#ifdef __MINGW32__
+# include "compat.h"
+#endif
+
+/* Return the smallest power of 2 not less than n */
+uint32_t ceil2(uint32_t n)
+{
+ --n;
+ n |= n >> 1;
+ n |= n >> 2;
+ n |= n >> 4;
+ n |= n >> 8;
+ n |= n >> 16;
+ return n + 1;
+}
+
+/* Return the largest power of 2 not greater than n */
+uint32_t floor2(uint32_t n)
+{
+ n |= n >> 1;
+ n |= n >> 2;
+ n |= n >> 4;
+ n |= n >> 8;
+ n |= n >> 16;
+ return n - (n >> 1);
+}
+
+#include <stdlib.h>
+unsigned long ver2int(const char* version)
+{
+ unsigned long v;
+ char* p;
+
+ v = (unsigned long)(strtod(version, &p) * 1e7 + 0.5);
+ while (*p)
+ v += *p++;
+
+ return v;
+}
+
+
+#if !HAVE_STRCASESTR || __WIN32__
+# include <ctype.h>
+// from git 1.6.1.2 compat/strcasestr.c
+char *strcasestr(const char *haystack, const char *needle)
+{
+ int nlen = strlen(needle);
+ int hlen = strlen(haystack) - nlen + 1;
+ int i;
+
+ for (i = 0; i < hlen; i++) {
+ int j;
+ for (j = 0; j < nlen; j++) {
+ unsigned char c1 = haystack[i+j];
+ unsigned char c2 = needle[j];
+ if (toupper(c1) != toupper(c2))
+ goto next;
+ }
+ return (char *) haystack + i;
+ next: ;
+ }
+ return NULL;
+}
+#endif // !HAVE_STRCASESTR
+
+
+#if !HAVE_STRLCPY || __win32__
+// from git 1.6.1.2 compat/strcasestr.c
+size_t strlcpy(char *dest, const char *src, size_t size)
+{
+ size_t ret = strlen(src);
+
+ if (size) {
+ size_t len = (ret >= size) ? size - 1 : ret;
+ memcpy(dest, src, len);
+ dest[len] = '\0';
+ }
+ return ret;
+}
+#endif // !HAVE_STRLCPY
+
+
+#ifdef __WIN32__
+int set_cloexec(int fd, unsigned char v) { return 0; }
+#else
+# include <unistd.h>
+# include <fcntl.h>
+int set_cloexec(int fd, unsigned char v)
+{
+ int f = fcntl(fd, F_GETFD);
+ return f == -1 ? f : fcntl(fd, F_SETFD, (v ? f | FD_CLOEXEC : f & ~FD_CLOEXEC));
+}
+#endif // __WIN32__
+
+
+int set_nonblock(int fd, unsigned char v)
+{
+#ifndef __WIN32__
+ int f = fcntl(fd, F_GETFL);
+ return f == -1 ? f : fcntl(fd, F_SETFL, (v ? f | O_NONBLOCK : f & ~O_NONBLOCK));
+#else // __WIN32__
+ u_long v_ = (u_long)v;
+ errno = 0;
+ if (ioctlsocket(fd, FIONBIO, &v_) == SOCKET_ERROR) {
+ errno = WSAGetLastError();
+ return -1;
+ }
+ else
+ return 0;
+#endif // __WIN32__
+}
+
+#ifndef __WIN32__
+# include <sys/types.h>
+# include <sys/socket.h>
+# include <netinet/in.h>
+# include <netinet/tcp.h>
+#endif
+int set_nodelay(int fd, unsigned char v)
+{
+ int val = v;
+ return setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (const char*)&val, sizeof(val));
+}
+
+
+#ifdef __WIN32__
+# include <ws2tcpip.h>
+#endif
+
+int get_bufsize(int fd, int dir, int* len)
+{
+ socklen_t optlen = sizeof(*len);
+ return getsockopt(fd, SOL_SOCKET, (dir == 0 ? SO_RCVBUF : SO_SNDBUF),
+ (char*)len, &optlen);
+}
+int set_bufsize(int fd, int dir, int len)
+{
+ return setsockopt(fd, SOL_SOCKET, (dir == 0 ? SO_RCVBUF : SO_SNDBUF),
+ (const char*)&len, sizeof(len));
+}
+
+#ifndef __WIN32__
+#include <pthread.h>
+#include <signal.h>
+#ifndef NSIG
+# define NSIG 64
+#endif
+static size_t nsig = 0;
+static struct sigaction* sigact = 0;
+static pthread_mutex_t sigmutex = PTHREAD_MUTEX_INITIALIZER;
+#endif
+
+void save_signals(void)
+{
+#ifndef __WIN32__
+ pthread_mutex_lock(&sigmutex);
+ if (!sigact)
+ sigact = new struct sigaction[NSIG];
+ for (nsig = 1; nsig <= NSIG; nsig++)
+ if (sigaction(nsig, NULL, &sigact[nsig-1]) == -1)
+ break;
+ pthread_mutex_unlock(&sigmutex);
+#endif
+}
+
+void restore_signals(void)
+{
+#ifndef __WIN32__
+ pthread_mutex_lock(&sigmutex);
+ for (size_t i = 1; i <= nsig; i++)
+ sigaction(i, &sigact[i-1], NULL);
+ delete [] sigact;
+ sigact = 0;
+ nsig = 0;
+ pthread_mutex_unlock(&sigmutex);
+#endif
+}
+
+
+uint32_t simple_hash_data(const unsigned char* buf, size_t len, uint32_t code)
+{
+ for (size_t i = 0; i < len; i++)
+ code = ((code << 4) | (code >> (32 - 4))) ^ (uint32_t)buf[i];
+
+ return code;
+}
+uint32_t simple_hash_str(const unsigned char* str, uint32_t code)
+{
+ while (*str)
+ code = ((code << 4) | (code >> (32 - 4))) ^ (uint32_t)*str++;
+ return code;
+}
+
+#include <vector>
+#include <climits>
+
+static const char hexsym[] = "0123456789ABCDEF";
+static std::vector<char>* hexbuf;
+const char* str2hex(const unsigned char* str, size_t len)
+{
+ if (unlikely(len == 0))
+ return "";
+ if (unlikely(!hexbuf)) {
+ hexbuf = new std::vector<char>;
+ hexbuf->reserve(192);
+ }
+ if (unlikely(hexbuf->size() < len * 3))
+ hexbuf->resize(len * 3);
+
+ char* p = &(*hexbuf)[0];
+ size_t i;
+ for (i = 0; i < len; i++) {
+ *p++ = hexsym[str[i] >> 4];
+ *p++ = hexsym[str[i] & 0xF];
+ *p++ = ' ';
+ }
+ *(p - 1) = '\0';
+
+ return &(*hexbuf)[0];
+}
+
+const char* str2hex(const char* str, size_t len)
+{
+ return str2hex((const unsigned char*)str, len ? len : strlen(str));
+}
+
+static std::vector<char>* binbuf;
+const char* uint2bin(unsigned u, size_t len)
+{
+ if (unlikely(len == 0))
+ len = sizeof(u) * CHAR_BIT;
+
+ if (unlikely(!binbuf)) {
+ binbuf = new std::vector<char>;
+ binbuf->reserve(sizeof(u) * CHAR_BIT);
+ }
+ if (unlikely(binbuf->size() < len + 1))
+ binbuf->resize(len + 1);
+
+ for (size_t i = 0; i < len; i++) {
+ (*binbuf)[len - i - 1] = '0' + (u & 1);
+ u >>= 1;
+ }
+ (*binbuf)[len] = '\0';
+
+ return &(*binbuf)[0];
+}
+
+void MilliSleep(long msecs)
+{
+#ifndef __WIN32__
+ struct timespec tv;
+ tv.tv_sec = msecs / 1000;
+ tv.tv_nsec = (msecs - tv.tv_sec * 1000) * 1000000L;
+ nanosleep(&tv, NULL);
+#else
+ Sleep(msecs);
+#endif
+
+}
+
diff --git a/src/misc/xmlrpc_log.cxx b/src/misc/xmlrpc_log.cxx
new file mode 100644
index 0000000..1e7844a
--- /dev/null
+++ b/src/misc/xmlrpc_log.cxx
@@ -0,0 +1,221 @@
+// =====================================================================
+//
+// xmlrpc_io.cxx
+//
+// connect to logbook xmlrpc server
+//
+// =====================================================================
+
+#include <iostream>
+#include <cmath>
+#include <cstring>
+#include <stdlib.h>
+
+#include <FL/Fl.H>
+#include <FL/filename.H>
+#include <FL/fl_ask.H>
+
+#include "XmlRpc.h"
+
+#include "support.h"
+#include "wkey_dialogs.h"
+#include "config.h"
+#include "lgbook.h"
+#include "icons.h"
+#include "gettext.h"
+#include "debug.h"
+#include "util.h"
+#include "date.h"
+#include "logbook.h"
+
+using namespace XmlRpc;
+
+XmlRpcClient *log_client = (XmlRpcClient *)0;
+
+bool test_connection()
+{
+ XmlRpcValue result;
+ if (log_client->execute("system.listMethods", XmlRpcValue(), result))
+ return true;
+ LOG_ERROR("Cannot connect to %s, %s",
+ progStatus.log_address.c_str(),
+ progStatus.log_port.c_str());
+
+ return false;
+}
+
+void xml_get_record(const char *callsign)
+{
+ XmlRpcValue oneArg, result;
+ if (!test_connection()) {
+ fl_alert2(_("Logbook server down!\nUsing internal logbook"));
+ txt_name->value("");
+ mnu_log_client->clear();
+ mnu_display_log->activate();
+ mnu_new_log->activate();
+ mnu_open_logbook->activate();
+ mnu_save_logbook->activate();
+ mnu_merge_logbook->activate();
+ mnu_export_adif->activate();
+ mnu_export_logbook_text->activate();
+ mnu_export_logbook_csv->activate();
+ mnu_export_cabrillo->activate();
+ start_logbook();
+ }
+ oneArg[0] = callsign;
+ if (log_client->execute("log.get_record", oneArg, result)) {
+ string adifline = std::string(result);
+ size_t pos1 = adifline.find("<NAME:");
+ if (pos1 == std::string::npos) {
+ txt_name->value("");
+ return;
+ }
+ pos1 = adifline.find(">", pos1) + 1;
+ size_t pos2 = adifline.find("<", pos1);
+ string name = adifline.substr(pos1, pos2 - pos1);
+ txt_name->value(name.c_str());
+ } else {
+ txt_name->value("");
+ }
+// else
+// std::cout << "Error calling 'log.get_record'\n\n";
+}
+
+void xml_add_record()
+{
+ if (txt_sta->value()[0] == 0) return;
+
+ if (!test_connection()) {
+ fl_alert2(_("Logbook server down!\nUsing internal logbook"));
+ mnu_log_client->clear();
+ mnu_display_log->activate();
+ mnu_new_log->activate();
+ mnu_open_logbook->activate();
+ mnu_save_logbook->activate();
+ mnu_merge_logbook->activate();
+ mnu_export_adif->activate();
+ mnu_export_logbook_text->activate();
+ mnu_export_logbook_csv->activate();
+ mnu_export_cabrillo->activate();
+ start_logbook();
+ }
+
+ char *szt = szTime(2);
+ char *szdt = szDate(0x86);
+ char sznbr[6];
+ string call = txt_sta->value();
+ string freq = txt_freq->value();
+ string name = txt_name->value();
+ string xin = txt_xchg->value();
+ snprintf(sznbr, sizeof(sznbr), "%d", progStatus.serial_nbr);
+
+ XmlRpcValue oneArg, result;
+ char adifrec[200];
+ snprintf(adifrec, sizeof(adifrec), "\
+<FREQ:%d>%s\
+<CALL:%d>%s\
+<NAME:%d>%s\
+<MODE:2>CW\
+<QSO_DATE:8>%s<TIME_ON:4>%s<TIME_OFF:4>%s\
+<STX:%d>%s\
+<STX_STRING:%d>%s\
+<SRX_STRING:%d>%s\
+<RST_RCVD:3>599<RST_SENT:3>599<EOR>",
+ freq.length(), freq.c_str(),
+ call.length(), call.c_str(),
+ name.length(), name.c_str(),
+ szdt, szt, szt,
+ strlen(sznbr), sznbr,
+ progStatus.xout.length(), progStatus.xout.c_str(),
+ xin.length(), xin.c_str());
+ oneArg[0] = adifrec;
+ log_client->execute("log.add_record", oneArg, result);
+// std::cout << "log.add_record result " << result << "\n\n";
+}
+
+void xml_check_dup()
+{
+ Fl_Color call_clr = FL_BACKGROUND2_COLOR;
+ XmlRpcValue sixargs, result;
+ sixargs[0] = txt_sta->value();
+ sixargs[1] = "CW";
+ sixargs[2] = "0";
+ sixargs[3] = "0";
+ sixargs[4] = "0";
+ sixargs[5] = "0";
+ if (log_client->execute("log.check_dup", sixargs, result)) {
+ string res = std::string(result);
+ if (res == "true")
+ call_clr = fl_rgb_color( 255, 110, 180);
+ }
+ txt_sta->color(call_clr);
+ txt_sta->redraw();
+}
+
+void connect_to_server()
+{
+ if (log_client) delete log_client;
+ if (mnu_log_client->value()) {
+ try {
+ log_client = new XmlRpcClient(
+ progStatus.log_address.c_str(),
+ atol(progStatus.log_port.c_str()));
+ mnu_log_client->set();
+ } catch (...) {
+ LOG_ERROR("Cannot create %s, %s",
+ progStatus.log_address.c_str(),
+ progStatus.log_port.c_str());
+ progStatus.xml_logbook = false;
+ mnu_log_client->clear();
+ mnu_display_log->activate();
+ mnu_new_log->activate();
+ mnu_open_logbook->activate();
+ mnu_save_logbook->activate();
+ mnu_merge_logbook->activate();
+ mnu_export_adif->activate();
+ mnu_export_logbook_text->activate();
+ mnu_export_logbook_csv->activate();
+ mnu_export_cabrillo->activate();
+ start_logbook();
+ return;
+ }
+ if (test_connection()) {
+ close_logbook();
+ if (dlgLogbook) dlgLogbook->hide();
+ mnu_display_log->deactivate();
+ mnu_new_log->deactivate();
+ mnu_open_logbook->deactivate();
+ mnu_save_logbook->deactivate();
+ mnu_merge_logbook->deactivate();
+ mnu_export_adif->deactivate();
+ mnu_export_logbook_text->deactivate();
+ mnu_export_logbook_csv->deactivate();
+ mnu_export_cabrillo->deactivate();
+ } else {
+ fl_alert2(_("Cannot connect to logbook server!\nUsing internal logbook"));
+ progStatus.xml_logbook = false;
+ mnu_log_client->clear();
+ mnu_display_log->activate();
+ mnu_new_log->activate();
+ mnu_open_logbook->activate();
+ mnu_save_logbook->activate();
+ mnu_merge_logbook->activate();
+ mnu_export_adif->activate();
+ mnu_export_logbook_text->activate();
+ mnu_export_logbook_csv->activate();
+ mnu_export_cabrillo->activate();
+ start_logbook();
+ }
+ } else {
+ mnu_display_log->activate();
+ mnu_new_log->activate();
+ mnu_open_logbook->activate();
+ mnu_save_logbook->activate();
+ mnu_merge_logbook->activate();
+ mnu_export_adif->activate();
+ mnu_export_logbook_text->activate();
+ mnu_export_logbook_csv->activate();
+ mnu_export_cabrillo->activate();
+ start_logbook();
+ }
+}
diff --git a/src/widgets/FTextRXTX.cxx b/src/widgets/FTextRXTX.cxx
new file mode 100644
index 0000000..16694d0
--- /dev/null
+++ b/src/widgets/FTextRXTX.cxx
@@ -0,0 +1,585 @@
+// ----------------------------------------------------------------------------
+// FTextRXTX.cxx
+//
+// Copyright (C) 2007-2010
+// Stelios Bounanos, M0GLD
+//
+// Copyright (C) 2008-2010
+// Dave Freese, W1HKJ
+//
+// This file is part of fldigi.
+//
+// fldigi is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// fldigi is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+// ----------------------------------------------------------------------------
+
+#include <config.h>
+
+#include <string>
+#include <cstring>
+#include <cstdlib>
+#include <cstdio>
+#include <sys/stat.h>
+#include <map>
+#include <iostream>
+#include <fstream>
+#include <sstream>
+#include <algorithm>
+#include <iomanip>
+
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Tooltip.H>
+
+#include "FTextRXTX.h"
+#include "FTextView.h"
+
+#include "fileselect.h"
+#include "icons.h"
+
+//#include "re.h"
+//#include "strutil.h"
+
+#include "gettext.h"
+
+#include "debug.h"
+
+#include "timeops.h"
+
+using namespace std;
+
+Fl_Menu_Item FTextRX::menu[] = {
+ { 0 }, // VIEW_MENU_COPY
+ { 0 }, // VIEW_MENU_CLEAR
+ { 0 }, // VIEW_MENU_SELECT_ALL
+ { 0 }, // VIEW_MENU_SAVE
+ { 0 }, // VIEW_MENU_WRAP
+ { 0 }
+};
+
+/// FTextRX constructor.
+/// We remove \c Fl_Text_Display_mod::buffer_modified_cb from the list of callbacks
+/// because we want to scroll depending on the visibility of the last line; @see
+/// changed_cb.
+/// @param x
+/// @param y
+/// @param w
+/// @param h
+/// @param l
+FTextRX::FTextRX(int x, int y, int w, int h, const char *l)
+ : FTextView(x, y, w, h, l)
+{
+ memcpy(menu + RX_MENU_COPY, FTextView::menu, (FTextView::menu->size() - 1) * sizeof(*FTextView::menu));
+ context_menu = menu;
+ init_context_menu();
+}
+
+FTextRX::~FTextRX()
+{
+}
+
+/// Handles fltk events for this widget.
+
+/// We only care about mouse presses (to display the popup menu and prevent
+/// pasting) and keyboard events (to make sure no text can be inserted).
+/// Everything else is passed to the base class handle().
+///
+/// @param event
+///
+/// @return
+///
+int FTextRX::handle(int event)
+{
+ static Fl_Cursor cursor;
+
+ switch (event) {
+ case FL_PUSH:
+ if (!Fl::event_inside(this))
+ break;
+ switch (Fl::event_button()) {
+ case FL_LEFT_MOUSE:
+ goto out;
+ case FL_MIDDLE_MOUSE:
+ goto out;
+ case FL_RIGHT_MOUSE:
+ handle_context_menu();
+ return 1;
+ default:
+ goto out;
+ }
+ break;
+ case FL_DRAG:
+ if (Fl::event_button() != FL_LEFT_MOUSE)
+ return 1;
+ break;
+ case FL_RELEASE:
+ { int eb = Fl::event_button();
+ if (cursor == FL_CURSOR_HAND && eb == FL_LEFT_MOUSE &&
+ Fl::event_is_click() && !Fl::event_clicks()) {
+ handle_clickable(Fl::event_x() - x(), Fl::event_y() - y());
+ return 1;
+ }
+ break;
+ }
+ case FL_MOVE: {
+ int p = xy_to_position(Fl::event_x(), Fl::event_y(), Fl_Text_Display_mod::CURSOR_POS);
+#if FLWKEY_FLTK_API_MAJOR == 1 && FLWKEY_FLTK_API_MINOR == 3
+ if (sbuf->char_at(p) >= CLICK_START + FTEXT_DEF) {
+#else
+ if (sbuf->character(p) >= CLICK_START + FTEXT_DEF) {
+#endif
+ if (cursor != FL_CURSOR_HAND)
+ window()->cursor(cursor = FL_CURSOR_HAND);
+ return 1;
+ }
+ else
+ cursor = FL_CURSOR_INSERT;
+ break;
+ }
+ // catch some text-modifying events that are not handled by kf_* functions
+ case FL_KEYBOARD:
+ break;
+ case FL_ENTER:
+ break;
+ case FL_LEAVE:
+ break;
+ }
+out:
+ return FTextView::handle(event);
+}
+
+/// Adds a char to the buffer
+///
+/// @param c The character
+/// @param attr The attribute (@see enum text_attr_e); RECV if omitted.
+///
+void FTextRX::add(unsigned char c, int attr)
+{
+ if (c == '\r')
+ return;
+
+ // The user may have moved the cursor by selecting text or
+ // scrolling. Place it at the end of the buffer.
+ if (mCursorPos != tbuf->length())
+ insert_position(tbuf->length());
+
+ switch (c) {
+ case '\b':
+ // we don't call kf_backspace because it kills selected text
+ tbuf->remove(tbuf->length() - 1, tbuf->length());
+ sbuf->remove(sbuf->length() - 1, sbuf->length());
+ break;
+ case '\n':
+ // maintain the scrollback limit, if we have one
+ if (max_lines > 0 && tbuf->count_lines(0, tbuf->length()) >= max_lines) {
+ int le = tbuf->line_end(0) + 1; // plus 1 for the newline
+ tbuf->remove(0, le);
+ sbuf->remove(0, le);
+ }
+ // fall-through
+ default:
+ char s[] = { '\0', '\0', FTEXT_DEF + attr, '\0' };
+ const char *cp;
+
+ if ((c < ' ' || c == 127) && attr != CTRL) // look it up
+ cp = "";//cp = ascii[(unsigned char)c];
+ else { // insert verbatim
+ s[0] = c;
+ cp = &s[0];
+ }
+
+ for (int i = 0; cp[i]; ++i)
+ sbuf->append(s + 2);
+ insert(cp);
+ break;
+ }
+}
+
+void FTextRX::mark(FTextBase::TEXT_ATTR attr)
+{
+ if (attr == NATTR)
+ attr = CLICK_START;
+}
+
+void FTextRX::clear(void)
+{
+ FTextBase::clear();
+}
+
+void FTextRX::setFont(Fl_Font f, int attr)
+{
+ FTextBase::setFont(f, attr);
+}
+
+void FTextRX::handle_clickable(int x, int y)
+{
+ int pos, style;
+
+ pos = xy_to_position(x + this->x(), y + this->y(), CURSOR_POS);
+ // return unless clickable style
+#if FLWKEY_FLTK_API_MAJOR == 1 && FLWKEY_FLTK_API_MINOR == 3
+ if ((style = sbuf->char_at(pos)) < CLICK_START + FTEXT_DEF)
+#else
+ if ((style = sbuf->character(pos)) < CLICK_START + FTEXT_DEF)
+#endif
+ return;
+
+ int start, end;
+ for (start = pos-1; start >= 0; start--)
+#if FLWKEY_FLTK_API_MAJOR == 1 && FLWKEY_FLTK_API_MINOR == 3
+ if (sbuf->char_at(start) != style)
+#else
+ if (sbuf->character(start) != style)
+#endif
+ break;
+ start++;
+ int len = sbuf->length();
+ for (end = pos+1; end < len; end++)
+#if FLWKEY_FLTK_API_MAJOR == 1 && FLWKEY_FLTK_API_MINOR == 3
+ if (sbuf->char_at(end) != style)
+#else
+ if (sbuf->character(end) != style)
+#endif
+ break;
+}
+
+void FTextRX::handle_context_menu(void)
+{
+// availability of editing items depend on buffer state
+ set_active(&menu[RX_MENU_COPY], tbuf->selected());
+ set_active(&menu[RX_MENU_CLEAR], tbuf->length());
+ set_active(&menu[RX_MENU_SELECT_ALL], tbuf->length());
+ set_active(&menu[RX_MENU_SAVE], tbuf->length());
+
+ if (wrap)
+ menu[RX_MENU_WRAP].set();
+ else
+ menu[RX_MENU_WRAP].clear();
+
+ show_context_menu();
+}
+
+/// The context menu handler
+///
+/// @param val
+///
+void FTextRX::menu_cb(size_t item)
+{
+ switch (item) {
+ case RX_MENU_COPY:
+ kf_copy(Fl::event_key(), this);
+ break;
+ case RX_MENU_CLEAR:
+ clear();
+ break;
+ case RX_MENU_SELECT_ALL:
+ tbuf->select(0, tbuf->length());
+ break;
+ case RX_MENU_SAVE:
+ saveFile();
+ break;
+ case RX_MENU_WRAP:
+ set_word_wrap(!wrap);
+ break;
+ }
+}
+
+// ----------------------------------------------------------------------------
+
+Fl_Menu_Item FTextTX::menu[] = {
+ { 0 }, // EDIT_MENU_CUT
+ { 0 }, // EDIT_MENU_COPY
+ { 0 }, // EDIT_MENU_PASTE
+ { 0 }, // EDIT_MENU_CLEAR
+ { 0 }, // EDIT_MENU_READ
+ { 0 }, // EDIT_MENU_WRAP
+ { 0 }
+};
+
+// needed by our static kf functions, which may restrict editing depending on
+// the transmit cursor position
+int *FTextTX::ptxpos;
+
+FTextTX::FTextTX(int x, int y, int w, int h, const char *l)
+ : FTextEdit(x, y, w, h, l),
+ PauseBreak(false), txpos(0), bkspaces(0)
+{
+ ptxpos = &txpos;
+
+ change_keybindings();
+
+ memcpy(menu + TX_MENU_CUT, FTextEdit::menu, (FTextEdit::menu->size() - 1) * sizeof(*FTextEdit::menu));
+ context_menu = menu;
+ init_context_menu();
+}
+
+/// Handles fltk events for this widget.
+/// We pass keyboard events to handle_key() and handle mouse3 presses to show
+/// the popup menu. We also disallow mouse2 events in the transmitted text area.
+/// Everything else is passed to the base class handle().
+///
+/// @param event
+///
+/// @return
+///
+int FTextTX::handle(int event)
+{
+ if ( !(Fl::event_inside(this) || (event == FL_KEYBOARD && Fl::focus() == this)) )
+ return FTextEdit::handle(event);
+
+ switch (event) {
+ case FL_KEYBOARD:
+ return handle_key(Fl::event_key()) ? 1 : FTextEdit::handle(event);
+ case FL_PUSH:
+ if (Fl::event_button() == FL_MIDDLE_MOUSE &&
+ xy_to_position(Fl::event_x(), Fl::event_y(), CHARACTER_POS) < txpos)
+ return 1; // ignore mouse2 text pastes inside the transmitted text
+ }
+
+ return FTextEdit::handle(event);
+}
+
+/// Clears the buffer.
+/// Also resets the transmit position, stored backspaces and tx pause flag.
+///
+void FTextTX::clear(void)
+{
+ FTextEdit::clear();
+ txpos = 0;
+ bkspaces = 0;
+ PauseBreak = false;
+}
+
+/// Clears the sent text.
+/// Also resets the transmit position, stored backspaces and tx pause flag.
+///
+void FTextTX::clear_sent(void)
+{
+ tbuf->remove(0, txpos);
+ txpos = 0;
+ bkspaces = 0;
+ PauseBreak = false;
+}
+
+/// Returns boolean <eot> end of text
+///
+/// true if empty buffer
+/// false if characters remain
+///
+bool FTextTX::eot(void)
+{
+ return (insert_position() == txpos);
+}
+
+/// Returns the next character to be transmitted.
+///
+/// @return The next character, or ETX if the transmission has been paused, or
+/// NUL if no text should be transmitted.
+///
+int FTextTX::nextChar(void)
+{
+ int c;
+ if (insert_position() <= txpos) // empty buffer or cursor inside transmitted text
+ c = -1;
+ else {
+#if FLWKEY_FLTK_API_MAJOR == 1 && FLWKEY_FLTK_API_MINOR == 3
+ if ((c = static_cast<unsigned char>(tbuf->char_at(txpos)))) {
+#else
+ if ((c = static_cast<unsigned char>(tbuf->character(txpos)))) {
+#endif
+ ++txpos;
+ changed_cb(txpos, 0, 0,-1, static_cast<const char *>(0), this);
+ }
+ }
+
+ return c;
+}
+
+void FTextTX::setFont(Fl_Font f, int attr)
+{
+ FTextBase::setFont(f, attr);
+}
+
+/// Handles keyboard events to override Fl_Text_Editor_mod's handling of some
+/// keystrokes.
+///
+/// @param key
+///
+/// @return
+///
+int FTextTX::handle_key(int key)
+{
+ switch (key) {
+ case FL_Escape: // set stop flag and clear
+ {
+ static time_t t[2] = { 0, 0 };
+ static unsigned char i = 0;
+ if (t[i] == time(&t[!i])) { // two presses in a second: abort transmission
+ t[i = !i] = 0;
+ return 1;
+ }
+ i = !i;
+ }
+ clear();
+ return 1;
+ case FL_Tab:
+ return 1;
+ case FL_BackSpace:
+ return 0;
+ default:
+ break;
+ }
+
+ if (insert_position() < txpos)
+ return 1;
+
+ return 0;
+}
+
+int FTextTX::handle_dnd_drag(int pos)
+{
+ if (pos >= txpos) {
+ return FTextEdit::handle_dnd_drag(pos);
+ }
+ else // refuse drop inside transmitted text
+ return 0;
+}
+
+/// Handles mouse-3 clicks by displaying the context menu
+///
+/// @param val
+///
+void FTextTX::handle_context_menu(void)
+{
+ bool modify_text_ok = insert_position() >= txpos;
+ bool selected = tbuf->selected();
+ set_active(&menu[TX_MENU_CLEAR], tbuf->length());
+ set_active(&menu[TX_MENU_CUT], selected && modify_text_ok);
+ set_active(&menu[TX_MENU_COPY], selected);
+ set_active(&menu[TX_MENU_PASTE], modify_text_ok);
+ set_active(&menu[TX_MENU_READ], modify_text_ok);
+
+ if (wrap)
+ menu[TX_MENU_WRAP].set();
+ else
+ menu[TX_MENU_WRAP].clear();
+
+ show_context_menu();
+}
+
+/// The context menu handler
+///
+/// @param val
+///
+void FTextTX::menu_cb(size_t item)
+{
+ switch (item) {
+ case TX_MENU_CLEAR:
+ clear();
+ break;
+ case TX_MENU_CUT:
+ kf_cut(0, this);
+ break;
+ case TX_MENU_COPY:
+ kf_copy(0, this);
+ break;
+ case TX_MENU_PASTE:
+ kf_paste(0, this);
+ break;
+ case TX_MENU_READ: {
+ readFile();
+ break;
+ }
+ case TX_MENU_WRAP:
+ set_word_wrap(!wrap);
+ break;
+ }
+}
+
+/// Overrides some useful Fl_Text_Edit keybindings that we want to keep working,
+/// provided that they don't try to change chunks of transmitted text.
+///
+void FTextTX::change_keybindings(void)
+{
+ struct {
+ Fl_Text_Editor_mod::Key_Func function, override;
+ } fbind[] = {
+ { Fl_Text_Editor_mod::kf_default, FTextTX::kf_default },
+ { Fl_Text_Editor_mod::kf_enter, FTextTX::kf_enter },
+ { Fl_Text_Editor_mod::kf_delete, FTextTX::kf_delete },
+ { Fl_Text_Editor_mod::kf_cut, FTextTX::kf_cut },
+ { Fl_Text_Editor_mod::kf_paste, FTextTX::kf_paste }
+ };
+ int n = sizeof(fbind) / sizeof(fbind[0]);
+
+ // walk the keybindings linked list and replace items containing
+ // functions for which we have an override in fbind
+ for (Fl_Text_Editor_mod::Key_Binding *k = key_bindings; k; k = k->next) {
+ for (int i = 0; i < n; i++)
+ if (fbind[i].function == k->function)
+ k->function = fbind[i].override;
+ }
+}
+
+// The kf_* functions below call the corresponding Fl_Text_Editor_mod routines, but
+// may make adjustments so that no transmitted text is modified.
+
+int FTextTX::kf_default(int c, Fl_Text_Editor_mod* e)
+{
+ return e->insert_position() < *ptxpos ? 1 : Fl_Text_Editor_mod::kf_default(c, e);
+}
+
+int FTextTX::kf_enter(int c, Fl_Text_Editor_mod* e)
+{
+ return e->insert_position() < *ptxpos ? 1 : Fl_Text_Editor_mod::kf_enter(c, e);
+}
+
+int FTextTX::kf_delete(int c, Fl_Text_Editor_mod* e)
+{
+ // single character
+ if (!e->buffer()->selected()) {
+ if (e->insert_position() >= *ptxpos &&
+ e->insert_position() != e->buffer()->length())
+ return Fl_Text_Editor_mod::kf_delete(c, e);
+ else
+ return 1;
+ }
+
+ // region: delete as much as we can
+ int start, end;
+ e->buffer()->selection_position(&start, &end);
+ if (*ptxpos >= end)
+ return 1;
+ if (*ptxpos > start)
+ e->buffer()->select(*ptxpos, end);
+
+ return Fl_Text_Editor_mod::kf_delete(c, e);
+}
+
+int FTextTX::kf_cut(int c, Fl_Text_Editor_mod* e)
+{
+ if (e->buffer()->selected()) {
+ int start, end;
+ e->buffer()->selection_position(&start, &end);
+ if (*ptxpos >= end)
+ return 1;
+ if (*ptxpos > start)
+ e->buffer()->select(*ptxpos, end);
+ }
+
+ return Fl_Text_Editor_mod::kf_cut(c, e);
+}
+
+int FTextTX::kf_paste(int c, Fl_Text_Editor_mod* e)
+{
+ return e->insert_position() < *ptxpos ? 1 : Fl_Text_Editor_mod::kf_paste(c, e);
+}
diff --git a/src/widgets/FTextView.cxx b/src/widgets/FTextView.cxx
new file mode 100644
index 0000000..bf6e2dc
--- /dev/null
+++ b/src/widgets/FTextView.cxx
@@ -0,0 +1,935 @@
+// ----------------------------------------------------------------------------
+// FTextView.cxx
+//
+// Copyright (C) 2007-2009
+// Stelios Bounanos, M0GLD
+//
+// Copyright (C) 2008-2009
+// Dave Freese, W1HKJ
+//
+// This file is part of fldigi.
+//
+// fldigi is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// fldigi is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+// ----------------------------------------------------------------------------
+
+#include <config.h>
+
+#include <cstring>
+#include <cstdlib>
+#include <cstdio>
+#include <cmath>
+#include <sys/stat.h>
+#include <map>
+#include <fstream>
+#include <sstream>
+#include <algorithm>
+#include <iomanip>
+
+#include <string>
+
+#include <FL/Fl_Tooltip.H>
+
+#include "util.h"
+
+#include "fileselect.h"
+//#include "font_browser.h"
+#include "icons.h"
+#include "gettext.h"
+
+#include "FTextView.h"
+
+using namespace std;
+
+#if FLWKEY_FLTK_API_MAJOR == 1 && FLMSG_FLTK_API_MINOR < 3
+# define Fl_Text_Buffer_mod Fl_Text_Buffer
+#endif
+
+/// FTextBase constructor.
+/// Word wrapping is enabled by default at column 80, but see \c reset_wrap_col.
+/// @param x
+/// @param y
+/// @param w
+/// @param h
+/// @param l
+FTextBase::FTextBase(int x, int y, int w, int h, const char *l)
+ : Fl_Text_Editor_mod(x, y, w, h, l),
+ wrap(true), wrap_col(80), max_lines(0), scroll_hint(false)
+{
+ oldw = oldh = olds = -1;
+ oldf = (Fl_Font)-1;
+ textfont(FL_COURIER);
+ textsize(FL_NORMAL_SIZE);
+ textcolor(FL_FOREGROUND_COLOR);
+
+ tbuf = new Fl_Text_Buffer_mod;
+ sbuf = new Fl_Text_Buffer_mod;
+
+ buffer(tbuf);
+ highlight_data(sbuf, styles, NATTR, FTEXT_DEF, 0, 0);
+ cursor_style(Fl_Text_Editor_mod::NORMAL_CURSOR);
+
+ wrap_mode(wrap, wrap_col);
+ restore_wrap = wrap;
+// wrap_restore = true;
+
+ // Do we want narrower scrollbars? The default width is 16.
+ // scrollbar_width((int)floor(scrollbar_width() * 3.0/4.0));
+
+ reset_styles(SET_FONT | SET_SIZE | SET_COLOR);
+}
+
+void FTextBase::clear()
+{
+ tbuf->text("");
+ sbuf->text("");
+ set_word_wrap(restore_wrap);
+}
+
+int FTextBase::handle(int event)
+{
+ if (event == FL_MOUSEWHEEL && !Fl::event_inside(this))
+ return 1;
+
+ // Fl_Text_Editor::handle() calls window()->cursor(FL_CURSOR_DONE) when
+ // it receives an FL_KEYBOARD event, which crashes some buggy X drivers
+ // (e.g. Intel on the Asus Eee PC). Call handle_key directly to work
+ // around this problem.
+ if (event == FL_KEYBOARD)
+ return Fl_Text_Editor_mod::handle_key();
+ else
+ return Fl_Text_Editor_mod::handle(event);
+}
+
+/// @see FTextRX::add
+///
+/// @param s
+/// @param attr
+///
+void FTextBase::add(const char *s, int attr)
+{
+ // handle the text attribute first
+ int n = strlen(s);
+ char a[n + 1];
+ memset(a, FTEXT_DEF + attr, n);
+ a[n] = '\0';
+ sbuf->replace(insert_position(), insert_position() + n, a);
+
+ insert(s);
+}
+
+/// @see FTextBase::add
+///
+/// @param s
+/// @param attr
+///
+void FTextBase::add(unsigned char c, int attr)
+{
+ char s[] = { FTEXT_DEF + attr, '\0' };
+ sbuf->replace(insert_position(), insert_position() + 1, s);
+
+ s[0] = c;
+ insert(s);
+}
+
+void FTextBase::set_word_wrap(bool b)
+{
+ wrap_mode((wrap = b), wrap_col);
+ show_insert_position();
+}
+
+void FTextBase::setFont(Fl_Font f, int attr)
+{
+ set_style(attr, f, textsize(), textcolor(), SET_FONT);
+}
+
+void FTextBase::setFontSize(int s, int attr)
+{
+ set_style(attr, textfont(), s, textcolor(), SET_SIZE);
+}
+
+void FTextBase::setFontColor(Fl_Color c, int attr)
+{
+ set_style(attr, textfont(), textsize(), c, SET_COLOR);
+}
+
+/// Resizes the text widget.
+/// The real work is done by \c Fl_Text_Editor_mod::resize or, if \c HSCROLLBAR_KLUDGE
+/// is defined, a version of that code modified so that no horizontal
+/// scrollbars are displayed when word wrapping.
+///
+/// @param X
+/// @param Y
+/// @param W
+/// @param H
+///
+void FTextBase::resize(int X, int Y, int W, int H)
+{
+ bool need_wrap_reset = false;
+ bool need_margin_reset = false;
+
+ if (unlikely(text_area.w != oldw)) {
+ oldw = text_area.w;
+ need_wrap_reset = true;
+ }
+ if (unlikely(text_area.h != oldh)) {
+ oldh = text_area.h;
+ need_margin_reset = true;
+ }
+ if (unlikely(textfont() != oldf || textsize() != olds)) {
+ oldf = textfont();
+ olds = textsize();
+ need_wrap_reset = need_margin_reset = true;
+ }
+
+ if (need_wrap_reset)
+ reset_wrap_col();
+
+#if FLWKEY_FLTK_API_MAJOR == 1 && FLWKEY_FLTK_API_MINOR == 3
+#else
+ if (need_margin_reset && textsize() > 0) {
+ TOP_MARGIN = DEFAULT_TOP_MARGIN;
+ int r = H - Fl::box_dh(box()) - TOP_MARGIN - BOTTOM_MARGIN;
+ if (mHScrollBar->visible())
+ r -= scrollbar_width();
+ if (r %= textsize())
+ TOP_MARGIN += r;
+ }
+#endif
+ if (scroll_hint) {
+ mTopLineNumHint = mNBufferLines;
+ mHorizOffsetHint = 0;
+// display_insert_position_hint = 1;
+ scroll_hint = false;
+ }
+
+ bool hscroll_visible = mHScrollBar->visible();
+ Fl_Text_Editor_mod::resize(X, Y, W, H);
+ if (hscroll_visible != mHScrollBar->visible())
+ oldh = 0; // reset margins next time
+}
+
+/// Checks the new widget height.
+/// This is registered with Fl_Tile_check and then called with horizontal
+/// and vertical size increments every time the Fl_Tile boundary is moved.
+///
+/// @param arg The callback argument; should be a pointer to a FTextBase object
+/// @param xd The horizontal increment (ignored)
+/// @param yd The vertical increment
+///
+/// @return True if the widget is visible, and the new text area height would be
+/// a multiple of the font height.
+///
+bool FTextBase::wheight_mult_tsize(void *arg, int, int yd)
+{
+ FTextBase *v = reinterpret_cast<FTextBase *>(arg);
+ if (!v->visible())
+ return true;
+ return v->mMaxsize > 0 && (v->text_area.h + yd) % v->mMaxsize == 0;
+}
+
+/// Changes text style attributes
+///
+/// @param attr The attribute name to change, or \c NATTR to change all styles.
+/// @param f The new font
+/// @param s The new font size
+/// @param c The new font color
+/// @param set One or more (OR'd together) SET operations; @see set_style_op_e
+///
+void FTextBase::set_style(int attr, Fl_Font f, int s, Fl_Color c, int set)
+{
+ int start, end;
+
+ if (attr == NATTR) { // update all styles
+ start = 0;
+ end = NATTR;
+ if (set & SET_FONT)
+ Fl_Text_Display_mod::textfont(f);
+ if (set & SET_SIZE)
+ textsize(s);
+ if (set & SET_COLOR)
+ textcolor(c);
+ }
+ else {
+ start = attr;
+ end = start + 1;
+ }
+ for (int i = start; i < end; i++) {
+ styles[i].attr = 0;
+ if (set & SET_FONT)
+ styles[i].font = f;
+ if (set & SET_SIZE)
+ styles[i].size = s;
+ if (set & SET_COLOR)
+ styles[i].color = c;
+ if (i == SKIP) // clickable styles always same as SKIP for now
+ for (int j = CLICK_START; j < NATTR; j++)
+ memcpy(&styles[j], &styles[i], sizeof(styles[j]));
+ }
+ if (set & SET_COLOR)
+ mCursor_color = styles[0].color;
+
+ resize(x(), y(), w(), h()); // to redraw and recalculate the wrap column
+}
+
+/// Reads a file and inserts its contents.
+/// change all occurrences of ^ to ^^ to prevent get_tx_char from
+/// treating the carat as a control sequence, ie: ^r ^R ^t ^T ^L ^C
+/// get_tx_char passes ^^ as a single ^
+///
+/// @return 0 on success, -1 on error
+int FTextBase::readFile(const char* fn)
+{
+ if ( !(fn || (fn = FSEL::select(_("Insert text"), "Text\t*.txt"))) )
+ return -1;
+
+ int ret = 0, pos = insert_position();
+
+#ifdef __WOE32__
+ FILE* tfile = fopen(fn, "rt");
+#else
+ FILE* tfile = fopen(fn, "r");
+#endif
+ if (!tfile)
+ return -1;
+ char buf[BUFSIZ+1];
+ std::string newbuf;
+ size_t p;
+ memset(buf, 0, BUFSIZ+1);
+ if (pos == tbuf->length()) { // optimise for append
+ while (fgets(buf, sizeof(buf), tfile)) {
+ newbuf = buf;
+ p = 0;
+ while ((p = newbuf.find('^',p)) != string::npos) {
+ newbuf.insert(p, "^");
+ p += 2;
+ }
+ tbuf->append(newbuf.c_str());
+ memset(buf, 0, BUFSIZ+1);
+ }
+ if (ferror(tfile))
+ ret = -1;
+ pos = tbuf->length();
+ }
+ else {
+ while (fgets(buf, sizeof(buf), tfile)) {
+ newbuf = buf;
+ p = 0;
+ while ((p = newbuf.find('^',p)) != string::npos) {
+ newbuf.insert(p, "^");
+ p += 2;
+ }
+ tbuf->insert(pos, newbuf.c_str());
+ pos += strlen(buf);
+ memset(buf, 0, BUFSIZ+1);
+ }
+ if (ferror(tfile))
+ ret = -1;
+ }
+ fclose(tfile);
+
+ insert_position(pos);
+ show_insert_position();
+
+ return ret;
+}
+
+/// Writes all buffer text out to a file.
+///
+///
+void FTextBase::saveFile(void)
+{
+ const char *fn = FSEL::saveas(_("Save text as"), "Text\t*.txt");
+ if (fn) {
+#ifdef __WOE32__
+ ofstream tfile(fn);
+ if (!tfile)
+ return;
+
+ char *p1, *p2, *text = tbuf->text();
+ for (p1 = p2 = text; *p1; p1 = p2) {
+ while (*p2 != '\0' && *p2 != '\n')
+ p2++;
+ if (*p2 == '\n') {
+ *p2 = '\0';
+ tfile << p1 << "\r\n";
+ p2++;
+
+ }
+ else
+ tfile << p1;
+ }
+ free(text);
+#else
+ tbuf->outputfile(fn, 0, tbuf->length());
+#endif
+ }
+}
+
+/// Returns a character string containing the selected word, if any,
+/// or the word at (\a x, \a y) relative to the widget's \c x() and \c y().
+/// If \a ontext is true, this function will return text only if the
+/// mouse cursor position is inside the text range.
+///
+/// @param x
+/// @param y
+///
+/// @return The selection, or the word text at (x,y). <b>Must be freed by the caller</b>.
+///
+#if FLWKEY_FLTK_API_MAJOR == 1 && FLWKEY_FLTK_API_MINOR < 3
+char* FTextBase::get_word(int x, int y, const char* nwchars, bool ontext)
+#else
+char* FTextBase::get_word(int x, int y, bool ontext)
+#endif
+{
+ int p = xy_to_position(x + this->x(), y + this->y(), Fl_Text_Display_mod::CURSOR_POS);
+ int start, end;
+
+ if (tbuf->selected()) {
+ if (ontext && tbuf->selection_position(&start, &end) && (p < start || p >= end))
+ return 0;
+ else
+ return tbuf->selection_text();
+ }
+
+#if FLWKEY_FLTK_API_MAJOR == 1 && FLWKEY_FLTK_API_MINOR == 3
+ start = tbuf->word_start(p);
+ end = tbuf->word_end(p);
+#else
+ string nonword = nwchars;
+ nonword.append(" \t\n");
+ if (!tbuf->findchars_backward(p, nonword.c_str(), &start))
+ start = 0;
+ else
+ start++;
+ if (!tbuf->findchars_forward(p, nonword.c_str(), &end))
+ end = tbuf->length();
+#endif
+
+ if (ontext && (p < start || p >= end))
+ return 0;
+ else
+ return tbuf->text_range(start, end);
+}
+
+/// Initialised the menu pointed to by \c context_menu. The menu items' user_data
+/// field is used to store the initialisation flag.
+void FTextBase::init_context_menu(void)
+{
+ for (int i = 0; i < context_menu->size() - 1; i++) {
+ if (context_menu[i].user_data() == 0 &&
+ context_menu[i].labeltype() == _FL_MULTI_LABEL) {
+ set_icon_label(&context_menu[i]);
+ context_menu[i].user_data(this);
+ }
+ }
+}
+
+/// Displays the menu pointed to by \c context_menu and calls the menu function;
+/// @see call_cb.
+///
+void FTextBase::show_context_menu(void)
+{
+ const Fl_Menu_Item *m;
+ int xpos = Fl::event_x();
+ int ypos = Fl::event_y();
+
+ popx = xpos - x();
+ popy = ypos - y();
+// window()->cursor(FL_CURSOR_DEFAULT);
+ m = context_menu->popup(xpos, ypos, 0, 0, 0);
+ if (m)
+ menu_cb(m - context_menu);
+}
+
+/// Recalculates the wrap margin when the font is changed or the widget resized.
+/// Line wrapping works with proportional fonts but may be very slow.
+///
+int FTextBase::reset_wrap_col(void)
+{
+ if (!wrap || text_area.w == 0)
+ return wrap_col;
+
+ int old_wrap_col = wrap_col;
+// if (Font_Browser::fixed_width(textfont())) {
+// fl_font(textfont(), textsize());
+// wrap_col = (int)floorf(text_area.w / fl_width('X'));
+// }
+// else // use slower (but accurate) wrapping for variable width fonts
+ wrap_col = 0;
+ // wrap_mode triggers a resize; don't call it if wrap_col hasn't changed
+ if (old_wrap_col != wrap_col)
+ wrap_mode(wrap, wrap_col);
+
+ return old_wrap_col;
+}
+
+void FTextBase::reset_styles(int set)
+{
+ set_style(NATTR, FL_COURIER, FL_NORMAL_SIZE, FL_FOREGROUND_COLOR, set);
+ set_style(XMIT, FL_COURIER, FL_NORMAL_SIZE, FL_RED, set);
+ set_style(CTRL, FL_COURIER, FL_NORMAL_SIZE, FL_DARK_GREEN, set);
+ set_style(SKIP, FL_COURIER, FL_NORMAL_SIZE, FL_BLUE, set);
+ set_style(ALTR, FL_COURIER, FL_NORMAL_SIZE, FL_DARK_MAGENTA, set);
+}
+
+// ----------------------------------------------------------------------------
+
+Fl_Menu_Item FTextView::menu[] = {
+ { make_icon_label(_("Copy"), edit_copy_icon), 0, 0, 0, 0, _FL_MULTI_LABEL },
+ { make_icon_label(_("Clear"), edit_clear_icon), 0, 0, 0, 0, _FL_MULTI_LABEL },
+ { make_icon_label(_("Select All"), edit_select_all_icon), 0, 0, 0, FL_MENU_DIVIDER, _FL_MULTI_LABEL },
+ { make_icon_label(_("Save as..."), save_as_icon), 0, 0, 0, FL_MENU_DIVIDER, _FL_MULTI_LABEL },
+ { _("Word wrap"), 0, 0, 0, FL_MENU_TOGGLE, FL_NORMAL_LABEL },
+ { 0 }
+};
+
+/// FTextView constructor.
+/// We remove \c Fl_Text_Display_mod::buffer_modified_cb from the list of callbacks
+/// because we want to scroll depending on the visibility of the last line; @see
+/// changed_cb.
+/// @param x
+/// @param y
+/// @param w
+/// @param h
+/// @param l
+FTextView::FTextView(int x, int y, int w, int h, const char *l)
+ : FTextBase(x, y, w, h, l), quick_entry(false)
+{
+ tbuf->remove_modify_callback(buffer_modified_cb, this);
+ tbuf->add_modify_callback(changed_cb, this);
+ tbuf->canUndo(0);
+
+ // disable some keybindings that are not allowed in FTextView buffers
+ change_keybindings();
+
+ context_menu = menu;
+ init_context_menu();
+}
+
+/// Handles fltk events for this widget.
+
+/// We only care about mouse presses (to display the popup menu and prevent
+/// pasting) and keyboard events (to make sure no text can be inserted).
+/// Everything else is passed to the base class handle().
+///
+/// @param event
+///
+/// @return
+///
+int FTextView::handle(int event)
+{
+ switch (event) {
+ case FL_PUSH:
+ if (!Fl::event_inside(this))
+ break;
+ if (Fl::event_button() == FL_RIGHT_MOUSE) {
+ handle_context_menu();
+ return 1;
+ }
+ break;
+ case FL_DRAG:
+ if (Fl::event_button() != FL_LEFT_MOUSE)
+ return 1;
+ break;
+ // catch some text-modifying events that are not handled by kf_* functions
+ case FL_KEYBOARD:
+ int k;
+ if (Fl::compose(k))
+ return 1;
+ k = Fl::event_key();
+ if (k == FL_BackSpace)
+ return 1;
+ else if (k == FL_Tab)
+ return Fl_Widget::handle(event);
+ }
+
+ return FTextBase::handle(event);
+}
+
+void FTextView::handle_context_menu(void)
+{
+ set_active(&menu[VIEW_MENU_COPY], tbuf->selected());
+ set_active(&menu[VIEW_MENU_CLEAR], tbuf->length());
+ set_active(&menu[VIEW_MENU_SELECT_ALL], tbuf->length());
+ set_active(&menu[VIEW_MENU_SAVE], tbuf->length());
+ if (wrap)
+ menu[VIEW_MENU_WRAP].set();
+ else
+ menu[VIEW_MENU_WRAP].clear();
+
+ show_context_menu();
+}
+
+/// The context menu handler
+///
+/// @param val
+///
+void FTextView::menu_cb(size_t item)
+{
+ switch (item) {
+ case VIEW_MENU_COPY:
+ kf_copy(Fl::event_key(), this);
+ break;
+ case VIEW_MENU_CLEAR:
+ clear();
+ break;
+ case VIEW_MENU_SELECT_ALL:
+ tbuf->select(0, tbuf->length());
+ break;
+ case VIEW_MENU_SAVE:
+ saveFile();
+ break;
+ case VIEW_MENU_WRAP:
+ set_word_wrap(!wrap);
+ restore_wrap = wrap;
+ break;
+ }
+}
+
+/// Scrolls down if the buffer has been modified and the last line is
+/// visible. See Fl_Text_Buffer::add_modify_callback() for parameter details.
+///
+/// @param pos
+/// @param nins
+/// @param ndel
+/// @param nsty
+/// @param dtext
+/// @param arg
+///
+inline
+void FTextView::changed_cb(int pos, int nins, int ndel, int nsty, const char *dtext, void *arg)
+{
+ FTextView *v = reinterpret_cast<FTextView *>(arg);
+
+ if (v->mTopLineNum + v->mNVisibleLines - 1 == v->mNBufferLines)
+ v->scroll_hint = true;
+
+ v->buffer_modified_cb(pos, nins, ndel, nsty, dtext, v);
+}
+
+/// Removes Fl_Text_Edit keybindings that would modify text and put it out of
+/// sync with the style buffer. At some point we may decide that we want
+/// FTextView to be editable (e.g., to insert comments about a QSO), in which
+/// case we'll keep the keybindings and add some code to changed_cb to update
+/// the style buffer.
+///
+void FTextView::change_keybindings(void)
+{
+ Fl_Text_Editor_mod::Key_Func fdelete[] = { Fl_Text_Editor_mod::kf_default,
+ Fl_Text_Editor_mod::kf_enter,
+ Fl_Text_Editor_mod::kf_delete,
+ Fl_Text_Editor_mod::kf_cut,
+ Fl_Text_Editor_mod::kf_paste };
+ int n = sizeof(fdelete) / sizeof(fdelete[0]);
+
+ // walk the keybindings linked list and delete items containing elements
+ // of fdelete
+loop:
+ for (Fl_Text_Editor_mod::Key_Binding *k = key_bindings; k; k = k->next) {
+ for (int i = 0; i < n; i++) {
+ if (k->function == fdelete[i]) {
+ remove_key_binding(k->key, k->state);
+ goto loop;
+ }
+ }
+ }
+}
+
+// ----------------------------------------------------------------------------
+
+
+Fl_Menu_Item FTextEdit::menu[] = {
+ { make_icon_label(_("Cut"), edit_cut_icon), 0, 0, 0, 0, _FL_MULTI_LABEL },
+ { make_icon_label(_("Copy"), edit_copy_icon), 0, 0, 0, 0, _FL_MULTI_LABEL },
+ { make_icon_label(_("Paste"), edit_paste_icon), 0, 0, 0, 0, _FL_MULTI_LABEL },
+ { make_icon_label(_("Clear"), edit_clear_icon), 0, 0, 0, FL_MENU_DIVIDER, _FL_MULTI_LABEL },
+ { make_icon_label(_("Insert file..."), file_open_icon), 0, 0, 0, FL_MENU_DIVIDER, _FL_MULTI_LABEL },
+ { _("Word wrap"), 0, 0, 0, FL_MENU_TOGGLE, FL_NORMAL_LABEL } ,
+ { 0 }
+};
+
+FTextEdit::FTextEdit(int x, int y, int w, int h, const char *l)
+ : FTextBase(x, y, w, h, l)
+{
+ tbuf->remove_modify_callback(buffer_modified_cb, this);
+ tbuf->add_modify_callback(changed_cb, this);
+
+ ascii_cnt = 0;
+ ascii_chr = 0;
+
+ context_menu = menu;
+ init_context_menu();
+
+ dnd_paste = false;
+}
+
+/// Handles fltk events for this widget.
+/// We pass keyboard events to handle_key() and handle mouse3 presses to show
+/// the popup menu. We also disallow mouse2 events in the transmitted text area.
+/// Everything else is passed to the base class handle().
+///
+/// @param event
+///
+/// @return
+///
+int FTextEdit::handle(int event)
+{
+ if ( !(Fl::event_inside(this) || (event == FL_KEYBOARD && Fl::focus() == this)) )
+ return FTextBase::handle(event);
+
+ switch (event) {
+ case FL_KEYBOARD:
+ return handle_key(Fl::event_key()) ? 1 : FTextBase::handle(event);
+ case FL_DND_RELEASE:
+ dnd_paste = true;
+ // fall through
+ case FL_DND_ENTER: case FL_DND_LEAVE:
+ return 1;
+ case FL_DND_DRAG:
+ return handle_dnd_drag(xy_to_position(Fl::event_x(), Fl::event_y(), CHARACTER_POS));
+ case FL_PASTE:
+ {
+ int r = dnd_paste ? handle_dnd_drop() : FTextBase::handle(event);
+ dnd_paste = false;
+ return r;
+ }
+ case FL_PUSH:
+ {
+ int eb = Fl::event_button();
+ if (eb == FL_RIGHT_MOUSE) {
+ handle_context_menu();
+ return 1;
+ }
+ }
+ default:
+ break;
+ }
+
+ return FTextBase::handle(event);
+}
+
+/// Handles keyboard events to override Fl_Text_Editor_mod's handling of some
+/// keystrokes.
+///
+/// @param key
+///
+/// @return
+///
+int FTextEdit::handle_key(int key)
+{
+// read ctl-ddd, where d is a digit, as ascii characters (in base 10)
+// and insert verbatim; e.g. ctl-001 inserts a <soh>
+ if (Fl::event_state() & FL_CTRL && (isdigit(key) || isdigit(key - FL_KP)))
+ return handle_key_ascii(key);
+ ascii_cnt = 0; // restart the numeric keypad entries.
+ ascii_chr = 0;
+
+ return 0;
+}
+
+/// Composes ascii characters and adds them to the FTextEdit buffer.
+/// Control characters are inserted with the CTRL style. Values larger than 127
+/// (0x7f) are ignored. We cannot really add NULs for the time being.
+///
+/// @param key A digit character
+///
+/// @return 1
+///
+int FTextEdit::handle_key_ascii(int key)
+{
+ if (key >= FL_KP)
+ key -= FL_KP;
+ key -= '0';
+ ascii_cnt++;
+ for (int i = 0; i < 3 - ascii_cnt; i++)
+ key *= 10;
+ ascii_chr += key;
+ if (ascii_cnt == 3) {
+ if (ascii_chr < 0x100) //0x7F)
+ add(ascii_chr, (iscntrl(ascii_chr) ? CTRL : RECV));
+ ascii_cnt = ascii_chr = 0;
+ }
+
+ return 1;
+}
+
+/// Handles FL_DND_DRAG events by scrolling and moving the cursor
+///
+/// @return 1
+int FTextEdit::handle_dnd_drag(int pos)
+{
+ // Scroll if the pointer is being dragged inside the scrollbars,
+ // otherwise obtain keyboard focus and set the insert position.
+ if (mVScrollBar->visible() && Fl::event_inside(mVScrollBar))
+ mVScrollBar->handle(FL_DRAG);
+ else if (mHScrollBar->visible() && Fl::event_inside(mHScrollBar))
+ mHScrollBar->handle(FL_DRAG);
+ else {
+ if (Fl::focus() != this)
+ take_focus();
+ insert_position(pos);
+ }
+
+ return 1;
+}
+
+/// Handles FL_PASTE events by inserting text
+///
+/// @return 1 or FTextBase::handle(FL_PASTE)
+int FTextEdit::handle_dnd_drop(void)
+{
+ restore_wrap = wrap;
+ set_word_wrap(false);
+
+ if (Fl::event_shift())
+ return FTextBase::handle(FL_PASTE);
+
+#if !defined(__APPLE__) && !defined(__WOE32__)
+ if (strncmp(Fl::event_text(), "file://", 7))
+ return FTextBase::handle(FL_PASTE);
+#endif
+
+ string text = Fl::event_text();
+#if defined(__APPLE__) || defined(__WOE32__)
+ const char sep[] = "\n";
+ text += sep;
+#else
+ const char sep[] = "\r\n";
+#endif
+
+ string::size_type p, len = text.length();
+ while ((p = text.find(sep)) != string::npos) {
+ text[p] = '\0';
+#if !defined(__APPLE__) && !defined(__WOE32__)
+ if (text.find("file://") == 0) {
+ text.erase(0, 7);
+ p -= 7;
+ }
+#endif
+ // paste everything verbatim if we couldn't read the first file
+ if (readFile(text.c_str()) == -1 && len == text.length())
+ return FTextBase::handle(FL_PASTE);
+ text.erase(0, p + sizeof(sep) - 1);
+ }
+
+ return 1;
+}
+
+/// Handles mouse-3 clicks by displaying the context menu
+///
+/// @param val
+///
+void FTextEdit::handle_context_menu(void)
+{
+ bool selected = tbuf->selected();
+ set_active(&menu[EDIT_MENU_CUT], selected);
+ set_active(&menu[EDIT_MENU_COPY], selected);
+ set_active(&menu[EDIT_MENU_CLEAR], tbuf->length());
+
+ if (wrap)
+ menu[EDIT_MENU_WRAP].set();
+ else
+ menu[EDIT_MENU_WRAP].clear();
+
+ show_context_menu();
+}
+
+/// The context menu handler
+///
+/// @param val
+///
+void FTextEdit::menu_cb(size_t item)
+{
+ switch (item) {
+ case EDIT_MENU_CLEAR:
+ clear();
+ break;
+ case EDIT_MENU_CUT:
+ kf_cut(0, this);
+ break;
+ case EDIT_MENU_COPY:
+ kf_copy(0, this);
+ break;
+ case EDIT_MENU_PASTE:
+ kf_paste(0, this);
+ break;
+ case EDIT_MENU_READ:
+ readFile();
+ break;
+ case EDIT_MENU_WRAP:
+ set_word_wrap(!wrap);
+ restore_wrap = wrap;
+ break;
+ }
+}
+
+/// This function is called by Fl_Text_Buffer when the buffer is modified, and
+/// also by nextChar when a character has been passed up the transmit path. In
+/// the first case either nins or ndel will be nonzero, and we change a
+/// corresponding amount of text in the style buffer.
+///
+/// In the latter case, nins, ndel, pos and nsty are all zero and we update the
+/// style buffer to mark the last character in the buffer with the XMIT
+/// attribute.
+///
+/// @param pos
+/// @param nins
+/// @param ndel
+/// @param nsty
+/// @param dtext
+/// @param arg
+///
+void FTextEdit::changed_cb(int pos, int nins, int ndel, int nsty, const char *dtext, void *arg)
+{
+ FTextEdit *e = reinterpret_cast<FTextEdit *>(arg);
+
+ if (nins == 0 && ndel == 0) {
+ if (nsty == -1) { // called by nextChar to update transmitted text style
+ char s[] = { FTEXT_DEF + XMIT, '\0' };
+ e->sbuf->replace(pos - 1, pos, s);
+ e->redisplay_range(pos - 1, pos);
+ }
+ else if (nsty > 0) // restyled, e.g. selected, text
+ return e->buffer_modified_cb(pos, nins, ndel, nsty, dtext, e);
+
+ // No changes, e.g., a paste with an empty clipboard.
+ return;
+ }
+ else if (nins > 0 && e->sbuf->length() < e->tbuf->length()) {
+ // New text not inserted by our add() methods, i.e., via a file
+ // read, mouse-2 paste or, most likely, direct keyboard entry.
+ int n = e->tbuf->length() - e->sbuf->length();
+ if (n == 1) {
+ char s[] = { FTEXT_DEF, '\0' };
+ e->sbuf->append(s);
+ }
+ else {
+ char *s = new char [n + 1];
+ memset(s, FTEXT_DEF, n);
+ s[n] = '\0';
+ e->sbuf->append(s);
+ delete [] s;
+ }
+ }
+ else if (ndel > 0)
+ e->sbuf->remove(pos, pos + ndel);
+
+ e->sbuf->select(pos, pos + nins - ndel);
+
+ e->buffer_modified_cb(pos, nins, ndel, nsty, dtext, e);
+ // We may need to scroll if the text was inserted by the
+ // add() methods, e.g. by a macro
+ if (e->mTopLineNum + e->mNVisibleLines - 1 <= e->mNBufferLines)
+ e->show_insert_position();
+}
diff --git a/src/widgets/Fl_Native_File_Chooser.cxx b/src/widgets/Fl_Native_File_Chooser.cxx
new file mode 100644
index 0000000..a23499a
--- /dev/null
+++ b/src/widgets/Fl_Native_File_Chooser.cxx
@@ -0,0 +1,47 @@
+//
+// Fl_Native_File_Chooser.cxx -- FLTK native OS file chooser widget
+//
+// Copyright 2004 by Greg Ercolano.
+//
+// This library 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 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+
+
+#include <config.h>
+
+#if FLWKEY_FLTK_API_MAJOR == 1 && FLWKEY_FLTK_API_MINOR < 3
+
+// Use Windows' chooser
+# if defined(__WIN32__) || defined(__CYGWIN__)
+# include "Fl_Native_File_Chooser_WIN32.cxx"
+# endif
+
+// Use Apple's chooser
+# ifdef __APPLE__
+# include "Fl_Native_File_Chooser_MAC.cxx"
+# endif
+
+// All else falls back to FLTK's own chooser
+# if ! defined(__APPLE__) && !defined(_WIN32) && !defined(__CYGWIN__)
+# include "Fl_Native_File_Chooser_FLTK.cxx"
+# endif
+
+#else
+# ifdef __WIN32__
+# include "Fl_Native_File_Chooser_WIN32.cxx"
+# endif
+
+#endif
diff --git a/src/widgets/Fl_Native_File_Chooser_FLTK.cxx b/src/widgets/Fl_Native_File_Chooser_FLTK.cxx
new file mode 100644
index 0000000..458fd4f
--- /dev/null
+++ b/src/widgets/Fl_Native_File_Chooser_FLTK.cxx
@@ -0,0 +1,376 @@
+//
+// Fl_Native_File_Chooser_FLTK.cxx -- FLTK native OS file chooser widget
+//
+// Copyright 2004 by Greg Ercolano.
+// API changes + filter improvements by Nathan Vander Wilt 2005
+//
+// This library 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 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please keep code 80 column compliant.
+//
+// 10 20 30 40 50 60 70
+// | | | | | | |
+// 4567890123456789012345678901234567890123456789012345678901234567890123456789
+//
+
+#define FLTK1
+
+#ifdef FLTK1
+//
+// FLTK1
+//
+#include <FL/Fl_Native_File_Chooser.H>
+#define FNFC_CLASS Fl_Native_File_Chooser
+#define FNFC_CTOR Fl_Native_File_Chooser
+#define FLTK_CHOOSER_SINGLE Fl_File_Chooser::SINGLE
+#define FLTK_CHOOSER_DIRECTORY Fl_File_Chooser::DIRECTORY
+#define FLTK_CHOOSER_MULTI Fl_File_Chooser::MULTI
+#define FLTK_CHOOSER_CREATE Fl_File_Chooser::CREATE
+#else
+//
+// FLTK2
+//
+#include <fltk/NativeFileChooser.h>
+#include <fltk/run.h>
+#define FNFC_CTOR NativeFileChooser
+#define FNFC_CLASS fltk::FNFC_CTOR
+#define FLTK_CHOOSER_SINGLE fltk::FileChooser::SINGLE
+#define FLTK_CHOOSER_DIRECTORY fltk::FileChooser::DIRECTORY
+#define FLTK_CHOOSER_MULTI fltk::FileChooser::MULTI
+#define FLTK_CHOOSER_CREATE fltk::FileChooser::CREATE
+#endif
+
+#include "flnfc_common.cxx"
+#include <sys/stat.h>
+
+// CTOR
+FNFC_CLASS::FNFC_CTOR(int val) {
+ static int init = 0; // 'first time' initialize flag
+ if ( init == 0 ) {
+ // Initialize when instanced for first time
+ load_system_icons();
+ init = 1;
+ }
+ _btype = val;
+ _options = NO_OPTIONS;
+ _filter = NULL;
+ _filtvalue = 0;
+ _parsedfilt = NULL;
+ _preset_file = NULL;
+ _prevvalue = NULL;
+ _directory = NULL;
+ _errmsg = NULL;
+#ifdef FLTK1
+ file_chooser = new Fl_File_Chooser(NULL, NULL, 0, NULL);
+#else
+ file_chooser = new fltk::FileChooser(NULL, NULL, 0, NULL);
+#endif
+ type(val); // do this after file_chooser created
+ _nfilters = 0;
+}
+
+// DTOR
+FNFC_CLASS::~FNFC_CTOR() {
+ delete file_chooser;
+ _filter = strfree(_filter);
+ _parsedfilt = strfree(_parsedfilt);
+ _preset_file = strfree(_preset_file);
+ _prevvalue = strfree(_prevvalue);
+ _directory = strfree(_directory);
+ _errmsg = strfree(_errmsg);
+}
+
+// PRIVATE: SET ERROR MESSAGE
+void FNFC_CLASS::errmsg(const char *msg) {
+ _errmsg = strfree(_errmsg);
+ _errmsg = strnew(msg);
+}
+
+// PRIVATE: translate Native types to Fl_File_Chooser types
+int FNFC_CLASS::type_fl_file(int val) {
+ switch (val) {
+ case BROWSE_FILE:
+ return(FLTK_CHOOSER_SINGLE);
+ case BROWSE_DIRECTORY:
+ return(FLTK_CHOOSER_SINGLE | FLTK_CHOOSER_DIRECTORY);
+ case BROWSE_MULTI_FILE:
+ return(FLTK_CHOOSER_MULTI);
+ case BROWSE_MULTI_DIRECTORY:
+ return(FLTK_CHOOSER_DIRECTORY | FLTK_CHOOSER_MULTI);
+ case BROWSE_SAVE_FILE:
+ return(FLTK_CHOOSER_SINGLE | FLTK_CHOOSER_CREATE);
+ case BROWSE_SAVE_DIRECTORY:
+ return(FLTK_CHOOSER_DIRECTORY | FLTK_CHOOSER_MULTI | FLTK_CHOOSER_CREATE);
+ default:
+ return(FLTK_CHOOSER_SINGLE);
+ }
+}
+
+void FNFC_CLASS::type(int val) {
+ _btype = val;
+ file_chooser->type(type_fl_file(val));
+}
+
+int FNFC_CLASS::type() const {
+ return(_btype);
+}
+
+// SET OPTIONS
+void FNFC_CLASS::options(int val) {
+ _options = val;
+}
+
+// GET OPTIONS
+int FNFC_CLASS::options() const {
+ return(_options);
+}
+
+// Show chooser, blocks until done.
+// RETURNS:
+// 0 - user picked a file
+// 1 - user cancelled
+// -1 - failed; errmsg() has reason
+//
+int FNFC_CLASS::show() {
+ // FILTER
+ if ( _parsedfilt ) {
+ file_chooser->filter(_parsedfilt);
+ }
+
+ // FILTER VALUE
+ // Set this /after/ setting the filter
+ //
+ file_chooser->filter_value(_filtvalue);
+
+ // DIRECTORY
+ if ( _directory && _directory[0] ) {
+ file_chooser->directory(_directory);
+ } else {
+ file_chooser->directory(_prevvalue);
+ }
+
+ // PRESET FILE
+ if ( _preset_file ) {
+ file_chooser->value(_preset_file);
+ }
+
+ // OPTIONS: PREVIEW
+ file_chooser->preview( (options() & PREVIEW) ? 1 : 0);
+
+ // OPTIONS: NEW FOLDER
+ if ( options() & NEW_FOLDER )
+ file_chooser->type(file_chooser->type() |
+ FLTK_CHOOSER_CREATE); // on
+
+ // SHOW
+ file_chooser->show();
+
+#ifdef FLTK1
+ // FLTK1: BLOCK WHILE BROWSER SHOWN
+ while ( file_chooser->shown() ) {
+ Fl::wait();
+ }
+#else
+ // FLTK2: BLOCK WHILE BROWSER SHOWN
+ while ( file_chooser->visible() ) {
+ fltk::wait();
+ }
+#endif
+
+ if ( file_chooser->value() && file_chooser->value()[0] ) {
+ _prevvalue = strfree(_prevvalue);
+ _prevvalue = strnew(file_chooser->value());
+ _filtvalue = file_chooser->filter_value(); // update filter value
+
+ // HANDLE SHOWING 'SaveAs' CONFIRM
+ if ( options() & SAVEAS_CONFIRM && type() == BROWSE_SAVE_FILE ) {
+ struct stat buf;
+ if ( stat(file_chooser->value(), &buf) != -1 ) {
+ if ( buf.st_mode & S_IFREG ) { // Regular file + exists?
+ if ( exist_dialog() == 0 ) {
+ return(1);
+ }
+ }
+ }
+ }
+ }
+
+ if ( file_chooser->count() ) return(0);
+ else return(1);
+}
+
+// RETURN ERROR MESSAGE
+const char *FNFC_CLASS::errmsg() const {
+ return(_errmsg ? _errmsg : "No error");
+}
+
+// GET FILENAME
+const char* FNFC_CLASS::filename() const {
+ if ( file_chooser->count() > 0 ) return(file_chooser->value());
+ return("");
+}
+
+// GET FILENAME FROM LIST OF FILENAMES
+const char* FNFC_CLASS::filename(int i) const {
+ if ( i < file_chooser->count() )
+ return(file_chooser->value(i+1)); // convert fltk 1 based to our 0 based
+ return("");
+}
+
+// SET TITLE
+// Can be NULL if no title desired.
+//
+void FNFC_CLASS::title(const char *val) {
+ file_chooser->label(val);
+}
+
+// GET TITLE
+// Can return NULL if none set.
+//
+const char *FNFC_CLASS::title() const {
+ return(file_chooser->label());
+}
+
+// SET FILTER
+// Can be NULL if no filter needed
+//
+void FNFC_CLASS::filter(const char *val) {
+ _filter = strfree(_filter);
+ _filter = strnew(val);
+ parse_filter();
+}
+
+// GET FILTER
+const char *FNFC_CLASS::filter() const {
+ return(_filter);
+}
+
+// SET SELECTED FILTER
+void FNFC_CLASS::filter_value(int val) {
+ _filtvalue = val;
+}
+
+// RETURN SELECTED FILTER
+int FNFC_CLASS::filter_value() const {
+ return(_filtvalue);
+}
+
+// GET TOTAL FILENAMES CHOSEN
+int FNFC_CLASS::count() const {
+ return(file_chooser->count());
+}
+
+// PRESET PATHNAME
+// Can be NULL if no preset is desired.
+//
+void FNFC_CLASS::directory(const char *val) {
+ _directory = strfree(_directory);
+ _directory = strnew(val);
+}
+
+// GET PRESET PATHNAME
+// Can return NULL if none set.
+//
+const char *FNFC_CLASS::directory() const {
+ return(_directory);
+}
+
+// Convert our filter format to fltk's chooser format
+// FROM TO (FLTK)
+// ------------------------- --------------------------
+// "*.cxx" "*.cxx Files(*.cxx)"
+// "C Files\t*.{cxx,h}" "C Files(*.{cxx,h})"
+// "C Files\t*.{cxx,h}\nText Files\t*.txt" "C Files(*.{cxx,h})\tText Files(*.txt)"
+//
+// Returns a modified version of the filter that the caller is responsible
+// for freeing with strfree().
+//
+void FNFC_CLASS::parse_filter() {
+ _parsedfilt = strfree(_parsedfilt); // clear previous parsed filter (if any)
+ _nfilters = 0;
+ char *in = _filter;
+ if ( !in ) return;
+
+ int has_name = strchr(in, '\t') ? 1 : 0;
+
+ char mode = has_name ? 'n' : 'w'; // parse mode: n=title, w=wildcard
+ char wildcard[1024] = ""; // parsed wildcard
+ char name[1024] = "";
+
+ // Parse filter user specified
+ for ( ; 1; in++ ) {
+
+ /*** DEBUG
+ printf("WORKING ON '%c': mode=<%c> name=<%s> wildcard=<%s>\n",
+ *in, mode, name, wildcard);
+ ***/
+
+ switch (*in) {
+ // FINISHED PARSING NAME?
+ case '\t':
+ if ( mode != 'n' ) goto regchar;
+ mode = 'w';
+ break;
+
+ // ESCAPE NEXT CHAR
+ case '\\':
+ ++in;
+ goto regchar;
+
+ // FINISHED PARSING ONE OF POSSIBLY SEVERAL FILTERS?
+ case '\r':
+ case '\n':
+ case '\0':
+ // APPEND NEW FILTER TO LIST
+ if ( wildcard[0] ) {
+ // OUT: "name(wild)\tname(wild)"
+ char comp[2048];
+ snprintf(comp, sizeof(comp), "%s%.511s(%.511s)", ((_parsedfilt)?"\t":""),
+ name, wildcard);
+ _parsedfilt = strapp(_parsedfilt, comp);
+ _nfilters++;
+ //DEBUG printf("DEBUG: PARSED FILT NOW <%s>\n", _parsedfilt);
+ }
+ // RESET
+ wildcard[0] = name[0] = '\0';
+ mode = strchr(in, '\t') ? 'n' : 'w';
+ // DONE?
+ if ( *in == '\0' ) return; // done
+ else continue; // not done yet, more filters
+
+ // Parse all other chars
+ default: // handle all non-special chars
+ regchar: // handle regular char
+ switch ( mode ) {
+ case 'n': chrcat(name, *in); continue;
+ case 'w': chrcat(wildcard, *in); continue;
+ }
+ break;
+ }
+ }
+ //NOTREACHED
+}
+
+// SET PRESET FILENAME
+void FNFC_CLASS::preset_file(const char* val) {
+ _preset_file = strfree(_preset_file);
+ _preset_file = strnew(val);
+}
+
+// GET PRESET FILENAME
+const char* FNFC_CLASS::preset_file() const {
+ return(_preset_file);
+}
diff --git a/src/widgets/Fl_Native_File_Chooser_MAC.cxx b/src/widgets/Fl_Native_File_Chooser_MAC.cxx
new file mode 100644
index 0000000..19f40f7
--- /dev/null
+++ b/src/widgets/Fl_Native_File_Chooser_MAC.cxx
@@ -0,0 +1,865 @@
+//
+// Fl_Native_File_Chooser_MAC.cxx -- FLTK native OS file chooser widget
+//
+// Copyright 2004 by Greg Ercolano.
+// FLTK2/MAC port by Greg Ercolano 2007.
+//
+// This library 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 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please keep code 80 column compliant.
+//
+// 10 20 30 40 50 60 70
+// | | | | | | |
+// 4567890123456789012345678901234567890123456789012345678901234567890123456789
+//
+// TODO:
+// o When doing 'open file', only dir is preset, not filename.
+// Possibly 'preset_file' could be used to select the filename.
+//
+#include "flnfc_common.cxx" // strnew/strfree/strapp/chrcat
+
+#define FLTK1
+
+#ifdef FLTK1
+//
+// FLTK1
+//
+#include <FL/Fl.H>
+#include <FL/Fl_Native_File_Chooser.H>
+#include <FL/filename.H>
+#define FNFC_CLASS Fl_Native_File_Chooser
+#define FNFC_CTOR Fl_Native_File_Chooser
+#else
+//
+// FLTK2
+//
+#include <fltk/NativeFileChooser.h>
+#include <fltk/run.h>
+#include <fltk/filename.h>
+#define FNFC_CTOR NativeFileChooser
+#define FNFC_CLASS fltk::FNFC_CTOR
+#define fl_filename_match filename_match // fltk1 name -> fltk2 name
+#define fl_filename_isdir filename_isdir // fltk1 name -> fltk2 name
+#endif
+
+// TRY TO CONVERT AN AEDesc TO AN FSSpec
+// As per Apple Technical Q&A QA1274
+// eg: http://developer.apple.com/qa/qa2001/qa1274.html
+// Returns 'noErr' if OK,
+// or an 'OSX result code' on error.
+//
+static int AEDescToFSSpec(const AEDesc* desc, FSSpec* fsspec) {
+ OSStatus err = noErr;
+ AEDesc coerceDesc;
+ // If AEDesc isn't already an FSSpec, convert it to one
+ if ( desc->descriptorType != typeFSS ) {
+ if ( ( err = AECoerceDesc(desc, typeFSS, &coerceDesc) ) == noErr ) {
+ // Get FSSpec out of AEDesc
+ err = AEGetDescData(&coerceDesc, fsspec, sizeof(FSSpec));
+ AEDisposeDesc(&coerceDesc);
+ }
+ } else {
+ err = AEGetDescData(desc, fsspec, sizeof(FSSpec));
+ }
+ return( err );
+}
+
+// CONVERT AN FSSpec TO A PATHNAME
+static void FSSpecToPath(const FSSpec &spec, char *buff, int bufflen) {
+ FSRef fsRef;
+ FSpMakeFSRef(&spec, &fsRef);
+ FSRefMakePath(&fsRef, (UInt8*)buff, bufflen);
+}
+
+// CONVERT REGULAR PATH -> FSSpec
+// If file does not exist, expect fnfErr.
+// Returns 'noErr' if OK,
+// or an 'OSX result code' on error.
+//
+static OSStatus PathToFSSpec(const char *path, FSSpec &spec) {
+ OSStatus err;
+ FSRef ref;
+ if ((err = FSPathMakeRef((const UInt8*)path, &ref, NULL)) != noErr) {
+ return(err);
+ }
+ // FSRef -> FSSpec
+ if ((err = FSGetCatalogInfo(&ref, kFSCatInfoNone, NULL, NULL, &spec,
+ NULL)) != noErr) {
+ return(err);
+ }
+ return(noErr);
+}
+
+// NAVREPLY: CTOR
+FNFC_CLASS::NavReply::NavReply() {
+ _valid_reply = 0;
+}
+
+// NAVREPLY: DTOR
+FNFC_CLASS::NavReply::~NavReply() {
+ if ( _valid_reply ) {
+ NavDisposeReply(&_reply);
+ }
+}
+
+// GET REPLY FROM THE NAV* DIALOG
+int FNFC_CLASS::NavReply::get_reply(NavDialogRef& ref) {
+ if ( _valid_reply ) {
+ NavDisposeReply(&_reply); // dispose of previous
+ _valid_reply = 0;
+ }
+ if ( ref == NULL || NavDialogGetReply(ref, &_reply) != noErr ) {
+ return(-1);
+ }
+ _valid_reply = 1;
+ return(0);
+}
+
+// RETURN THE BASENAME USER WANTS TO 'Save As'
+int FNFC_CLASS::NavReply::get_saveas_basename(char *s, int slen) {
+ if (CFStringGetCString(_reply.saveFileName, s, slen-1,
+ kCFStringEncodingUTF8) == false) {
+ s[0] = '\0';
+ return(-1);
+ }
+ return(0);
+}
+
+// RETURN THE DIRECTORY NAME
+// Returns 0 on success, -1 on error.
+//
+int FNFC_CLASS::NavReply::get_dirname(char *s, int slen) {
+ FSSpec fsspec;
+ if ( AEDescToFSSpec(&_reply.selection, &fsspec) != noErr ) {
+ // Conversion failed? Return empty name
+ s[0] = 0;
+ return(-1);
+ }
+ FSSpecToPath(fsspec, s, slen);
+ return(0);
+}
+
+// RETURN MULTIPLE DIRECTORIES
+// Returns: 0 on success with pathnames[] containing pathnames selected,
+// -1 on error
+//
+int FNFC_CLASS::NavReply::get_pathnames(char **&pathnames,
+ int& tpathnames) {
+ // How many items selected?
+ long count = 0;
+ if ( AECountItems(&_reply.selection, &count) != noErr )
+ { return(-1); }
+
+ // Allocate space for that many pathnames
+ pathnames = new char*[count];
+ memset((void*)pathnames, 0, count*sizeof(char*));
+ tpathnames = count;
+
+ // Walk list of pathnames selected
+ for (short index=1; index<=count; index++) {
+ AEKeyword keyWord;
+ AEDesc desc;
+ if (AEGetNthDesc(&_reply.selection, index, typeFSS, &keyWord,
+ &desc) != noErr) {
+ pathnames[index-1] = strnew("");
+ continue;
+ }
+ FSSpec fsspec;
+ if (AEGetDescData(&desc, &fsspec, sizeof(FSSpec)) != noErr ) {
+ pathnames[index-1] = strnew("");
+ continue;
+ }
+ char s[4096];
+ FSSpecToPath(fsspec, s, sizeof(s)-1);
+ pathnames[index-1] = strnew(s);
+ AEDisposeDesc(&desc);
+ }
+ return(0);
+}
+
+// FREE PATHNAMES ARRAY, IF IT HAS ANY CONTENTS
+void FNFC_CLASS::clear_pathnames() {
+ if ( _pathnames ) {
+ while ( --_tpathnames >= 0 ) {
+ _pathnames[_tpathnames] = strfree(_pathnames[_tpathnames]);
+ }
+ delete [] _pathnames;
+ _pathnames = NULL;
+ }
+ _tpathnames = 0;
+}
+
+// SET A SINGLE PATHNAME
+void FNFC_CLASS::set_single_pathname(const char *s) {
+ clear_pathnames();
+ _pathnames = new char*[1];
+ _pathnames[0] = strnew(s);
+ _tpathnames = 1;
+}
+
+// GET THE 'Save As' FILENAME
+// Returns -1 on error, errmsg() has reason, filename == "".
+// 0 if OK, filename() has filename chosen.
+//
+int FNFC_CLASS::get_saveas_basename(NavDialogRef& ref) {
+ if ( ref == NULL ) {
+ errmsg("get_saveas_basename: ref is NULL");
+ return(-1);
+ }
+ NavReply reply;
+ OSStatus err;
+ if ((err = reply.get_reply(ref)) != noErr ) {
+ errmsg("NavReply::get_reply() failed");
+ clear_pathnames();
+ return(-1);
+ }
+
+ char pathname[4096] = "";
+ // Directory name..
+ // -2 leaves room to append '/'
+ //
+ if ( reply.get_dirname(pathname, sizeof(pathname)-2) < 0 ) {
+ clear_pathnames();
+ errmsg("NavReply::get_dirname() failed");
+ return(-1);
+ }
+ // Append '/'
+ int len = strlen(pathname);
+ pathname[len++] = '/';
+ pathname[len] = '\0';
+ // Basename..
+ if ( reply.get_saveas_basename(pathname+len, sizeof(pathname)-len) < 0 ) {
+ clear_pathnames();
+ errmsg("NavReply::get_saveas_basename() failed");
+ return(-1);
+ }
+ set_single_pathname(pathname);
+ return(0);
+}
+
+// GET (POTENTIALLY) MULTIPLE FILENAMES
+// Returns:
+// -1 -- error, errmsg() has reason, filename == ""
+// 0 -- OK, pathnames()/filename() has pathname(s) chosen
+//
+int FNFC_CLASS::get_pathnames(NavDialogRef& ref) {
+ if ( ref == NULL ) {
+ errmsg("get_saveas_basename: ref is NULL");
+ return(-1);
+ }
+ NavReply reply;
+ OSStatus err;
+ if ((err = reply.get_reply(ref)) != noErr ) {
+ errmsg("NavReply::get_reply() failed");
+ clear_pathnames();
+ return(-1);
+ }
+ // First, clear pathnames array of any previous contents
+ clear_pathnames();
+ if ( reply.get_pathnames(_pathnames, _tpathnames) < 0 ) {
+ clear_pathnames();
+ errmsg("NavReply::get_dirname() failed");
+ return(-1);
+ }
+ return(0);
+}
+
+// NAV CALLBACK EVENT HANDLER
+void FNFC_CLASS::event_handler(
+ NavEventCallbackMessage callBackSelector,
+ NavCBRecPtr cbparm,
+ void *data) {
+ OSStatus err;
+ FNFC_CLASS *nfb = (FNFC_CLASS*)data;
+ switch (callBackSelector) {
+ case kNavCBStart:
+ if ( nfb->directory() || nfb->preset_file() ) {
+ const char *pathname = nfb->directory()
+ ? nfb->directory()
+ : nfb->preset_file();
+ FSSpec spec;
+ if ( ( err = PathToFSSpec(pathname, spec) ) != noErr ) {
+ fprintf(stderr, "PathToFSSpec(%s) failed: err=%d\n",
+ pathname, (int)err);
+ break;
+ }
+ AEDesc desc;
+ if ((err = AECreateDesc(typeFSS, &spec, sizeof(FSSpec),
+ &desc)) != noErr) {
+ fprintf(stderr, "AECreateDesc() failed: err=%d\n",
+ (int)err);
+ }
+ if ((err = NavCustomControl(cbparm->context,
+ kNavCtlSetLocation,
+ &desc)) != noErr) {
+ fprintf(stderr, "NavCustomControl() failed: err=%d\n",
+ (int)err);
+ }
+ AEDisposeDesc(&desc);
+ }
+ if ( nfb->_btype == BROWSE_SAVE_FILE && nfb->preset_file() ) {
+ CFStringRef namestr =
+ CFStringCreateWithCString(NULL,
+ nfb->preset_file(),
+ kCFStringEncodingASCII);
+ NavDialogSetSaveFileName(cbparm->context, namestr);
+ CFRelease(namestr);
+ }
+ NavCustomControl(cbparm->context,
+ kNavCtlSetActionState,
+ &nfb->_keepstate );
+
+ // Select the right filter in pop-up menu
+ if ( nfb->_filt_value == nfb->_filt_total ) {
+ // Select All Documents
+ NavPopupMenuItem kAll = kNavAllFiles;
+ NavCustomControl(cbparm->context, kNavCtlSelectAllType, &kAll);
+ } else if (nfb->_filt_value < nfb->_filt_total) {
+ // Select custom filter
+ nfb->_tempitem.version = kNavMenuItemSpecVersion;
+ nfb->_tempitem.menuCreator = 'extn';
+ nfb->_tempitem.menuType = nfb->_filt_value;
+ *nfb->_tempitem.menuItemName = '\0'; // needed on 10.3+
+ NavCustomControl(cbparm->context,
+ kNavCtlSelectCustomType,
+ &(nfb->_tempitem));
+ }
+ break;
+
+ case kNavCBPopupMenuSelect:
+ NavMenuItemSpecPtr ptr;
+ // they really buried this one!
+ ptr = (NavMenuItemSpecPtr)cbparm->eventData.eventDataParms.param;
+ if ( ptr->menuCreator ) {
+ // Gets index to filter ( menuCreator = 'extn' )
+ nfb->_filt_value = ptr->menuType;
+ } else {
+ // All docs filter selected ( menuCreator = '\0\0\0\0' )
+ nfb->_filt_value = nfb->_filt_total;
+ }
+ break;
+
+ case kNavCBSelectEntry:
+ NavActionState astate;
+ switch ( nfb->_btype ) {
+ // these don't need selection override
+ case BROWSE_MULTI_FILE:
+ case BROWSE_MULTI_DIRECTORY:
+ case BROWSE_SAVE_FILE:
+ break;
+
+ // These need to allow only one item, so disable
+ // Open button if user tries to select multiple files
+ case BROWSE_SAVE_DIRECTORY:
+ case BROWSE_DIRECTORY:
+ case BROWSE_FILE:
+ SInt32 selectcount;
+ AECountItems((AEDescList*)cbparm->
+ eventData.eventDataParms.param,
+ &selectcount);
+ if ( selectcount > 1 ) {
+ NavCustomControl(cbparm->context,
+ kNavCtlSetSelection,
+ NULL);
+ astate = nfb->_keepstate |
+ kNavDontOpenState |
+ kNavDontChooseState;
+ NavCustomControl(cbparm->context,
+ kNavCtlSetActionState,
+ &astate );
+ }
+ else {
+ astate= nfb->_keepstate | kNavNormalState;
+ NavCustomControl(cbparm->context,
+ kNavCtlSetActionState,
+ &astate );
+ }
+ break;
+ }
+ break;
+ }
+}
+
+// CONSTRUCTOR
+FNFC_CLASS::FNFC_CTOR(int val) {
+ _btype = val;
+ NavGetDefaultDialogCreationOptions(&_opts);
+ _opts.optionFlags |= kNavDontConfirmReplacement; // no confirms for "save as"
+ _options = NO_OPTIONS;
+ _ref = NULL;
+ memset(&_tempitem, 0, sizeof(_tempitem));
+ _pathnames = NULL;
+ _tpathnames = 0;
+ _title = NULL;
+ _filter = NULL;
+ _filt_names = NULL;
+ memset(_filt_patt, 0, sizeof(char*) * MAXFILTERS);
+ _filt_total = 0;
+ _filt_value = 0;
+ _directory = NULL;
+ _preset_file = NULL;
+ _errmsg = NULL;
+ _keepstate = kNavNormalState;
+}
+
+// DESTRUCTOR
+FNFC_CLASS::~FNFC_CTOR() {
+ // _opts // nothing to manage
+ if (_ref) { NavDialogDispose(_ref); _ref = NULL; }
+ // _options // nothing to manage
+ // _keepstate // nothing to manage
+ // _tempitem // nothing to manage
+ clear_pathnames();
+ _directory = strfree(_directory);
+ _title = strfree(_title);
+ _preset_file = strfree(_preset_file);
+ _filter = strfree(_filter);
+ //_filt_names // managed by clear_filters()
+ //_filt_patt[i] // managed by clear_filters()
+ //_filt_total // managed by clear_filters()
+ clear_filters();
+ //_filt_value // nothing to manage
+ _errmsg = strfree(_errmsg);
+}
+
+// SET THE TYPE OF BROWSER
+void FNFC_CLASS::type(int val) {
+ _btype = val;
+}
+
+// GET TYPE OF BROWSER
+int FNFC_CLASS::type() const {
+ return(_btype);
+}
+
+// SET OPTIONS
+void FNFC_CLASS::options(int val) {
+ _options = val;
+}
+
+// GET OPTIONS
+int FNFC_CLASS::options() const {
+ return(_options);
+}
+
+// SHOW THE BROWSER WINDOW
+// Returns:
+// 0 - user picked a file
+// 1 - user cancelled
+// -1 - failed; errmsg() has reason
+//
+int FNFC_CLASS::show() {
+
+ // Make sure fltk interface updates before posting our dialog
+#ifdef FLTK1
+ Fl::flush();
+#else
+ fltk::flush();
+#endif
+
+ // BROWSER TITLE
+ CFStringRef cfs_title;
+ cfs_title = CFStringCreateWithCString(NULL,
+ _title ? _title : "No Title",
+ kCFStringEncodingASCII);
+ _opts.windowTitle = cfs_title;
+
+ _keepstate = kNavNormalState;
+
+ // BROWSER FILTERS
+ CFArrayRef filter_array = NULL;
+ {
+ // One or more filters specified?
+ if ( _filt_total ) {
+ // NAMES -> CFArrayRef
+ CFStringRef tab = CFSTR("\t");
+ CFStringRef tmp_cfs;
+ tmp_cfs = CFStringCreateWithCString(NULL, _filt_names,
+ kCFStringEncodingASCII);
+ filter_array = CFStringCreateArrayBySeparatingStrings(
+ NULL, tmp_cfs, tab);
+ CFRelease(tmp_cfs);
+ CFRelease(tab);
+ _opts.popupExtension = filter_array;
+ _opts.optionFlags |= kNavAllFilesInPopup;
+ } else {
+ filter_array = NULL;
+ _opts.popupExtension = NULL;
+ _opts.optionFlags |= kNavAllFilesInPopup;
+ }
+ }
+
+ // HANDLE OPTIONS WE SUPPORT
+ if ( _options & SAVEAS_CONFIRM ) {
+ _opts.optionFlags &= ~kNavDontConfirmReplacement; // enables confirm
+ } else {
+ _opts.optionFlags |= kNavDontConfirmReplacement; // disables confirm
+ }
+
+ // POST BROWSER
+ int err = post();
+
+ // RELEASE _FILT_ARR
+ if ( filter_array ) CFRelease(filter_array);
+ filter_array = NULL;
+ _opts.popupExtension = NULL;
+ _filt_total = 0;
+
+ // RELEASE TITLE
+ if ( cfs_title ) CFRelease(cfs_title);
+ cfs_title = NULL;
+
+ return(err);
+}
+
+// POST BROWSER
+// Internal use only.
+// Assumes '_opts' has been initialized.
+//
+// Returns:
+// 0 - user picked a file
+// 1 - user cancelled
+// -1 - failed; errmsg() has reason
+//
+int FNFC_CLASS::post() {
+
+ // INITIALIZE BROWSER
+ OSStatus err;
+ if ( _filt_total == 0 ) { // Make sure they match
+ _filt_value = 0; // TBD: move to someplace more logical?
+ }
+
+ switch (_btype) {
+ case BROWSE_FILE:
+ case BROWSE_MULTI_FILE:
+ //_keepstate = kNavDontNewFolderState;
+ // Prompt user for one or more files
+ if ((err = NavCreateGetFileDialog(
+ &_opts, // options
+ 0, // file types
+ event_handler, // event handler
+ 0, // preview callback
+ filter_proc_cb, // filter callback
+ (void*)this, // callback data
+ &_ref)) != noErr ) { // dialog ref
+ errmsg("NavCreateGetFileDialog: failed");
+ return(-1);
+ }
+ break;
+
+ case BROWSE_DIRECTORY:
+ case BROWSE_MULTI_DIRECTORY:
+ _keepstate = kNavDontNewFolderState;
+ //FALLTHROUGH
+
+ case BROWSE_SAVE_DIRECTORY:
+ // Prompts user for one or more files or folders
+ if ((err = NavCreateChooseFolderDialog(
+ &_opts, // options
+ event_handler, // event callback
+ 0, // filter callback
+ (void*)this, // callback data
+ &_ref)) != noErr ) { // dialog ref
+ errmsg("NavCreateChooseFolderDialog: failed");
+ return(-1);
+ }
+ break;
+
+ case BROWSE_SAVE_FILE:
+ // Prompt user for filename to 'save as'
+ if ((err = NavCreatePutFileDialog(
+ &_opts, // options
+ 0, // file types
+ 0, // file creator
+ event_handler, // event handler
+ (void*)this, // callback data
+ &_ref)) != noErr ) { // dialog ref
+ errmsg("NavCreatePutFileDialog: failed");
+ return(-1);
+ }
+ break;
+ }
+
+ // SHOW THE DIALOG
+ if ( ( err = NavDialogRun(_ref) ) != 0 ) {
+ char msg[80];
+ sprintf(msg, "NavDialogRun: failed (err=%d)", (int)err);
+ errmsg(msg);
+ return(-1);
+ }
+
+ // WHAT ACTION DID USER CHOOSE?
+ NavUserAction act = NavDialogGetUserAction(_ref);
+ if ( act == kNavUserActionNone ) {
+ errmsg("Nothing happened yet (dialog still open)");
+ return(-1);
+ }
+ else if ( act == kNavUserActionCancel ) { // user chose 'cancel'
+ return(1);
+ }
+ else if ( act == kNavUserActionSaveAs ) { // user chose 'save as'
+ return(get_saveas_basename(_ref));
+ }
+
+ // TOO MANY FILES CHOSEN?
+ int ret = get_pathnames(_ref);
+ if ( _btype == BROWSE_FILE && ret == 0 && _tpathnames != 1 ) {
+ char msg[80];
+ sprintf(msg, "Expected only one file to be chosen.. you chose %d.",
+ (int)_tpathnames);
+ errmsg(msg);
+ return(-1);
+ }
+ return(err);
+}
+
+// SET ERROR MESSAGE
+// Internal use only.
+//
+void FNFC_CLASS::errmsg(const char *msg) {
+ _errmsg = strfree(_errmsg);
+ _errmsg = strnew(msg);
+}
+
+// RETURN ERROR MESSAGE
+const char *FNFC_CLASS::errmsg() const {
+ return(_errmsg ? _errmsg : "No error");
+}
+
+// GET FILENAME
+const char* FNFC_CLASS::filename() const {
+ if ( _pathnames && _tpathnames > 0 ) return(_pathnames[0]);
+ return("");
+}
+
+// GET FILENAME FROM LIST OF FILENAMES
+const char* FNFC_CLASS::filename(int i) const {
+ if ( _pathnames && i < _tpathnames ) return(_pathnames[i]);
+ return("");
+}
+
+// GET TOTAL FILENAMES CHOSEN
+int FNFC_CLASS::count() const {
+ return(_tpathnames);
+}
+
+// PRESET PATHNAME
+// Value can be NULL for none.
+//
+void FNFC_CLASS::directory(const char *val) {
+ _directory = strfree(_directory);
+ _directory = strnew(val);
+}
+
+// GET PRESET PATHNAME
+// Returned value can be NULL if none set.
+//
+const char* FNFC_CLASS::directory() const {
+ return(_directory);
+}
+
+// SET TITLE
+// Value can be NULL if no title desired.
+//
+void FNFC_CLASS::title(const char *val) {
+ _title = strfree(_title);
+ _title = strnew(val);
+}
+
+// GET TITLE
+// Returned value can be NULL if none set.
+//
+const char *FNFC_CLASS::title() const {
+ return(_title);
+}
+
+// SET FILTER
+// Can be NULL if no filter needed
+//
+void FNFC_CLASS::filter(const char *val) {
+ _filter = strfree(_filter);
+ _filter = strnew(val);
+
+ // Parse filter user specified
+ // IN: _filter = "C Files\t*.{cxx,h}\nText Files\t*.txt"
+ // OUT: _filt_names = "C Files\tText Files"
+ // _filt_patt[0] = "*.{cxx,h}"
+ // _filt_patt[1] = "*.txt"
+ // _filt_total = 2
+ //
+ parse_filter(_filter);
+}
+
+// GET FILTER
+// Returned value can be NULL if none set.
+//
+const char *FNFC_CLASS::filter() const {
+ return(_filter);
+}
+
+// CLEAR ALL FILTERS
+// Internal use only.
+//
+void FNFC_CLASS::clear_filters() {
+ _filt_names = strfree(_filt_names);
+ for (int i=0; i<_filt_total; i++) {
+ _filt_patt[i] = strfree(_filt_patt[i]);
+ }
+ _filt_total = 0;
+}
+
+// PARSE USER'S FILTER SPEC
+// Parses user specified filter ('in'),
+// breaks out into _filt_patt[], _filt_names, and _filt_total.
+//
+// Handles:
+// IN: OUT:_filt_names OUT: _filt_patt
+// ------------------------------------ ------------------ ---------------
+// "*.{ma,mb}" "*.{ma,mb} Files" "*.{ma,mb}"
+// "*.[abc]" "*.[abc] Files" "*.[abc]"
+// "*.txt" "*.txt Files" "*.c"
+// "C Files\t*.[ch]" "C Files" "*.[ch]"
+// "C Files\t*.[ch]\nText Files\t*.cxx" "C Files" "*.[ch]"
+//
+// Parsing Mode:
+// IN:"C Files\t*.{cxx,h}"
+// ||||||| |||||||||
+// mode: nnnnnnn wwwwwwwww
+// \_____/ \_______/
+// Name Wildcard
+//
+void FNFC_CLASS::parse_filter(const char *in) {
+ clear_filters();
+ if ( ! in ) return;
+ int has_name = strchr(in, '\t') ? 1 : 0;
+
+ char mode = has_name ? 'n' : 'w'; // parse mode: n=title, w=wildcard
+ char wildcard[1024] = ""; // parsed wildcard
+ char name[1024] = "";
+
+ // Parse filter user specified
+ for ( ; 1; in++ ) {
+
+ //// DEBUG
+ //// printf("WORKING ON '%c': mode=<%c> name=<%s> wildcard=<%s>\n",
+ //// *in, mode, name, wildcard);
+
+ switch (*in) {
+ // FINISHED PARSING NAME?
+ case '\t':
+ if ( mode != 'n' ) goto regchar;
+ mode = 'w';
+ break;
+
+ // ESCAPE NEXT CHAR
+ case '\\':
+ ++in;
+ goto regchar;
+
+ // FINISHED PARSING ONE OF POSSIBLY SEVERAL FILTERS?
+ case '\r':
+ case '\n':
+ case '\0':
+ // TITLE
+ // If user didn't specify a name, make one
+ //
+ if ( name[0] == '\0' ) {
+ sprintf(name, "%.*s Files", (int)sizeof(name)-10, wildcard);
+ }
+ // APPEND NEW FILTER TO LIST
+ if ( wildcard[0] ) {
+ // Add to filtername list
+ // Tab delimit if more than one. We later break
+ // tab delimited string into CFArray with
+ // CFStringCreateArrayBySeparatingStrings()
+ //
+ if ( _filt_total ) {
+ _filt_names = strapp(_filt_names, "\t");
+ }
+ _filt_names = strapp(_filt_names, name);
+
+ // Add filter to the pattern array
+ _filt_patt[_filt_total++] = strnew(wildcard);
+ }
+ // RESET
+ wildcard[0] = name[0] = '\0';
+ mode = strchr(in, '\t') ? 'n' : 'w';
+ // DONE?
+ if ( *in == '\0' ) return; // done
+ else continue; // not done yet, more filters
+
+ // Parse all other chars
+ default: // handle all non-special chars
+ regchar: // handle regular char
+ switch ( mode ) {
+ case 'n': chrcat(name, *in); continue;
+ case 'w': chrcat(wildcard, *in); continue;
+ }
+ break;
+ }
+ }
+ //NOTREACHED
+}
+
+// STATIC: FILTER CALLBACK
+Boolean FNFC_CLASS::filter_proc_cb(AEDesc *theItem,
+ void *info,
+ void *callBackUD,
+ NavFilterModes filterMode) {
+ return((FNFC_CLASS*)callBackUD)->filter_proc_cb2(
+ theItem, info, callBackUD, filterMode);
+}
+
+// FILTER CALLBACK
+// Return true if match,
+// false if no match.
+//
+Boolean FNFC_CLASS::filter_proc_cb2(AEDesc *theItem,
+ void *info,
+ void *callBackUD,
+ NavFilterModes filterMode) {
+ // All files chosen or no filters
+ if ( _filt_value == _filt_total ) return(true);
+
+ FSSpec fsspec;
+ char pathname[4096];
+
+ // On fail, filter should return true by default
+ if ( AEDescToFSSpec(theItem, &fsspec) != noErr ) {
+ return(true);
+ }
+ FSSpecToPath(fsspec, pathname, sizeof(pathname)-1);
+
+ if ( fl_filename_isdir(pathname) ) return(true);
+ if ( fl_filename_match(pathname, _filt_patt[_filt_value]) ) return(true);
+ else return(false);
+}
+
+// SET PRESET FILE
+// Value can be NULL for none.
+//
+void FNFC_CLASS::preset_file(const char* val) {
+ _preset_file = strfree(_preset_file);
+ _preset_file = strnew(val);
+}
+
+// PRESET FILE
+// Returned value can be NULL if none set.
+//
+const char* FNFC_CLASS::preset_file() {
+ return(_preset_file);
+}
+
diff --git a/src/widgets/Fl_Native_File_Chooser_WIN32.cxx b/src/widgets/Fl_Native_File_Chooser_WIN32.cxx
new file mode 100644
index 0000000..8251ec8
--- /dev/null
+++ b/src/widgets/Fl_Native_File_Chooser_WIN32.cxx
@@ -0,0 +1,805 @@
+//
+// Fl_Native_File_Chooser_WIN32.cxx -- FLTK native OS file chooser widget
+//
+// Copyright 2004 by Greg Ercolano.
+// API changes + filter improvements by Nathan Vander Wilt 2005
+// FLTK2/WIN32 port by Greg Ercolano
+//
+// This library 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 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please keep code 80 column compliant.
+//
+// 10 20 30 40 50 60 70
+// | | | | | | |
+// 4567890123456789012345678901234567890123456789012345678901234567890123456789
+//
+
+// Any application to multi-folder implementation:
+// http://www.codeproject.com/dialog/selectfolder.asp
+//
+
+#include <stdio.h> // debugging
+#include "flnfc_common.cxx" // strnew/strfree/strapp/chrcat
+
+#define FLTK1
+
+#ifdef FLTK1
+//
+// FLTK1
+//
+#include <FL/Fl_Native_File_Chooser.H>
+#define FNFC_CLASS Fl_Native_File_Chooser
+#define FNFC_CTOR Fl_Native_File_Chooser
+#else
+//
+// FLTK2
+//
+#include <fltk/NativeFileChooser.h>
+#include <fltk/run.h>
+#define FNFC_CTOR NativeFileChooser
+#define FNFC_CLASS fltk::FNFC_CTOR
+#endif
+
+#define LCURLY_CHR '{'
+#define RCURLY_CHR '}'
+#define LBRACKET_CHR '['
+#define RBRACKET_CHR ']'
+#define MAXFILTERS 80
+
+#if 0
+// STATIC: PRINT WINDOWS 'DOUBLE NULL' STRING (DEBUG)
+static void dnullprint(char *wp) {
+ if ( ! wp ) return;
+ for ( int t=0; true; t++ ) {
+ if ( wp[t] == '\0' && wp[t+1] == '\0' ) {
+ printf("\\0\\0");
+ fflush(stdout);
+ return;
+ } else if ( wp[t] == '\0' ) {
+ printf("\\0");
+ } else {
+ printf("%c",wp[t]);
+ }
+ }
+}
+#endif
+
+// RETURN LENGTH OF DOUBLENULL STRING
+// Includes single nulls in count, excludes trailing doublenull.
+//
+// 1234 567
+// |||/\|||
+// IN: "one\0two\0\0"
+// OUT: 7
+//
+static int dnulllen(const char *wp) {
+ int len = 0;
+ while ( ! ( *(wp+0) == 0 && *(wp+1) == 0 ) )
+ { ++wp; ++len; }
+ return(len);
+}
+
+// STATIC: Append a string to another, leaving terminated with DOUBLE NULL.
+// Automatically handles extending length of string.
+// wp can be NULL (a new wp will be allocated and initialized).
+// string must be NULL terminated.
+// The pointer wp may be modified on return.
+//
+static void dnullcat(char*&wp, const char *string, int n = -1 ) {
+ //DEBUG printf("DEBUG: dnullcat IN: <"); dnullprint(wp); printf(">\n");
+ int inlen = ( n < 0 ) ? strlen(string) : n;
+ if ( ! wp ) {
+ wp = new char[inlen + 4];
+ *(wp+0) = '\0';
+ *(wp+1) = '\0';
+ } else {
+ int wplen = dnulllen(wp);
+ // Make copy of wp into larger buffer
+ char *tmp = new char[wplen + inlen + 4];
+ memcpy(tmp, wp, wplen+2); // copy of wp plus doublenull
+ delete [] wp; // delete old wp
+ wp = tmp; // use new copy
+ //DEBUG printf("DEBUG: dnullcat COPY: <"); dnullprint(wp); printf("> (wplen=%d)\n", wplen);
+ }
+
+ // Find end of double null string
+ // *wp2 is left pointing at second null.
+ //
+ char *wp2 = wp;
+ if ( *(wp2+0) != '\0' && *(wp2+1) != '\0' ) {
+ for ( ; 1; wp2++ )
+ if ( *(wp2+0) == '\0' && *(wp2+1) == '\0' )
+ { wp2++; break; }
+ }
+
+ if ( n == -1 ) n = strlen(string);
+ strncpy(wp2, string, n);
+
+ // Leave string double-null terminated
+ *(wp2+n+0) = '\0';
+ *(wp2+n+1) = '\0';
+ //DEBUG printf("DEBUG: dnullcat OUT: <"); dnullprint(wp); printf(">\n\n");
+}
+
+// CTOR
+FNFC_CLASS::FNFC_CTOR(int val) {
+ _btype = val;
+ _options = NO_OPTIONS;
+ memset((void*)&_ofn, 0, sizeof(OPENFILENAME));
+ _ofn.lStructSize = sizeof(OPENFILENAME);
+ _ofn.hwndOwner = NULL;
+ memset((void*)&_binf, 0, sizeof(BROWSEINFO));
+ _pathnames = NULL;
+ _tpathnames = 0;
+ _directory = NULL;
+ _title = NULL;
+ _filter = NULL;
+ _parsedfilt = NULL;
+ _nfilters = 0;
+ _preset_file = NULL;
+ _errmsg = NULL;
+}
+
+// DTOR
+FNFC_CLASS::~FNFC_CTOR() {
+ //_pathnames // managed by clear_pathnames()
+ //_tpathnames // managed by clear_pathnames()
+ _directory = strfree(_directory);
+ _title = strfree(_title);
+ _filter = strfree(_filter);
+ //_parsedfilt // managed by clear_filters()
+ //_nfilters // managed by clear_filters()
+ _preset_file = strfree(_preset_file);
+ _errmsg = strfree(_errmsg);
+ clear_filters();
+ clear_pathnames();
+ ClearOFN();
+ ClearBINF();
+}
+
+// SET TYPE OF BROWSER
+void FNFC_CLASS::type(int val) {
+ _btype = val;
+}
+
+// GET TYPE OF BROWSER
+int FNFC_CLASS::type() const {
+ return( _btype );
+}
+
+// SET OPTIONS
+void FNFC_CLASS::options(int val) {
+ _options = val;
+}
+
+// GET OPTIONS
+int FNFC_CLASS::options() const {
+ return(_options);
+}
+
+// PRIVATE: SET ERROR MESSAGE
+void FNFC_CLASS::errmsg(const char *val) {
+ _errmsg = strfree(_errmsg);
+ _errmsg = strnew(val);
+}
+
+// FREE PATHNAMES ARRAY, IF IT HAS ANY CONTENTS
+void FNFC_CLASS::clear_pathnames() {
+ if ( _pathnames ) {
+ while ( --_tpathnames >= 0 ) {
+ _pathnames[_tpathnames] = strfree(_pathnames[_tpathnames]);
+ }
+ delete [] _pathnames;
+ _pathnames = NULL;
+ }
+ _tpathnames = 0;
+}
+
+// SET A SINGLE PATHNAME
+void FNFC_CLASS::set_single_pathname(const char *s) {
+ clear_pathnames();
+ _pathnames = new char*[1];
+ _pathnames[0] = strnew(s);
+ _tpathnames = 1;
+}
+
+// ADD PATHNAME TO EXISTING ARRAY
+void FNFC_CLASS::add_pathname(const char *s) {
+ if ( ! _pathnames ) {
+ // Create first element in array
+ ++_tpathnames;
+ _pathnames = new char*[_tpathnames];
+ } else {
+ // Grow array by 1
+ char **tmp = new char*[_tpathnames+1]; // create new buffer
+ memcpy((void*)tmp, (void*)_pathnames,
+ sizeof(char*)*_tpathnames); // copy old
+ delete [] _pathnames; // delete old
+ _pathnames = tmp; // use new
+ ++_tpathnames;
+ }
+ _pathnames[_tpathnames-1] = strnew(s);
+}
+
+// FREE A PIDL (Pointer to IDentity List)
+void FNFC_CLASS::FreePIDL(ITEMIDLIST *pidl) {
+ IMalloc *imalloc = NULL;
+ if ( SUCCEEDED(SHGetMalloc(&imalloc)) )
+ { imalloc->Free(pidl); imalloc->Release(); imalloc = NULL; }
+}
+
+// CLEAR MICROSOFT OFN (OPEN FILE NAME) CLASS
+void FNFC_CLASS::ClearOFN() {
+ // Free any previously allocated lpstrFile before zeroing out _ofn
+ if ( _ofn.lpstrFile ) {
+ _ofn.lpstrFile = strfree((char*)_ofn.lpstrFile);
+ }
+ if ( _ofn.lpstrInitialDir ) {
+ _ofn.lpstrInitialDir = (LPCSTR)strfree((char*)_ofn.lpstrInitialDir);
+ }
+ _ofn.lpstrFilter = NULL; // (deleted elsewhere)
+ int temp = _ofn.nFilterIndex; // keep the filter_value
+ memset((void*)&_ofn, 0, sizeof(_ofn));
+ _ofn.lStructSize = sizeof(OPENFILENAME);
+ _ofn.nFilterIndex = temp;
+}
+
+// CLEAR MICROSOFT BINF (BROWSER INFO) CLASS
+void FNFC_CLASS::ClearBINF() {
+ if ( _binf.pidlRoot ) {
+ FreePIDL((ITEMIDLIST*)_binf.pidlRoot);
+ _binf.pidlRoot = NULL;
+ }
+ memset((void*)&_binf, 0, sizeof(_binf));
+}
+
+// CONVERT WINDOWS BACKSLASHES TO UNIX FRONTSLASHES
+void FNFC_CLASS::Win2Unix(char *s) {
+ for ( ; *s; s++ )
+ if ( *s == '\\' ) *s = '/';
+}
+
+// CONVERT UNIX FRONTSLASHES TO WINDOWS BACKSLASHES
+void FNFC_CLASS::Unix2Win(char *s) {
+ for ( ; *s; s++ )
+ if ( *s == '/' ) *s = '\\';
+}
+
+// SHOW FILE BROWSER
+int FNFC_CLASS::showfile() {
+ ClearOFN();
+ clear_pathnames();
+ size_t fsize = 2048;
+ _ofn.Flags |= OFN_NOVALIDATE; // prevent disabling of front slashes
+ _ofn.Flags |= OFN_HIDEREADONLY; // hide goofy readonly flag
+ // USE NEW BROWSER
+ _ofn.Flags |= OFN_EXPLORER; // use newer explorer windows
+ _ofn.Flags |= OFN_ENABLESIZING; // allow window to be resized (hey, why not?)
+
+ // XXX: The docs for OFN_NOCHANGEDIR says the flag is 'ineffective' on XP/2K/NT!
+ // But let's set it anyway..
+ //
+ _ofn.Flags |= OFN_NOCHANGEDIR; // prevent dialog for messing up the cwd
+
+ switch ( _btype ) {
+ case BROWSE_DIRECTORY:
+ case BROWSE_MULTI_DIRECTORY:
+ case BROWSE_SAVE_DIRECTORY:
+ abort(); // never happens: handled by showdir()
+ case BROWSE_FILE:
+ fsize = 65536; // XXX: there must be a better way
+ break;
+ case BROWSE_MULTI_FILE:
+ _ofn.Flags |= OFN_ALLOWMULTISELECT;
+ fsize = 65536; // XXX: there must be a better way
+ break;
+ case BROWSE_SAVE_FILE:
+ if ( options() & SAVEAS_CONFIRM && type() == BROWSE_SAVE_FILE ) {
+ _ofn.Flags |= OFN_OVERWRITEPROMPT;
+ }
+ break;
+ }
+ // SPACE FOR RETURNED FILENAME
+ _ofn.lpstrFile = new char[fsize];
+ _ofn.nMaxFile = fsize-1;
+ _ofn.lpstrFile[0] = '\0';
+ _ofn.lpstrFile[1] = '\0'; // dnull
+ // PARENT WINDOW
+ _ofn.hwndOwner = GetForegroundWindow();
+ // DIALOG TITLE
+ _ofn.lpstrTitle = _title ? _title : NULL;
+ // FILTER
+ _ofn.lpstrFilter = _parsedfilt ? _parsedfilt : NULL;
+ // PRESET FILE
+ // If set, supercedes _directory. See KB Q86920 for details
+ //
+ if ( _preset_file ) {
+ size_t len = strlen(_preset_file);
+ if ( len >= _ofn.nMaxFile ) {
+ char msg[80];
+ sprintf(msg, "preset_file() filename is too long: %ld is >=%ld",
+ (long)len, (long)fsize);
+ return(-1);
+ }
+ strncpy(_ofn.lpstrFile, _preset_file, _ofn.nMaxFile);
+ Unix2Win(_ofn.lpstrFile);
+ _ofn.lpstrFile[len+0] = 0; // multiselect needs dnull
+ _ofn.lpstrFile[len+1] = 0;
+ }
+ if ( _directory ) {
+ // PRESET DIR
+ // XXX: See KB Q86920 for doc bug:
+ // http://support.microsoft.com/default.aspx?scid=kb;en-us;86920
+ //
+ _ofn.lpstrInitialDir = strnew(_directory);
+ Unix2Win((char*)_ofn.lpstrInitialDir);
+ }
+ // SAVE THE CURRENT DIRECTORY
+ // XXX: Save the cwd because GetOpenFileName() is probably going to
+ // change it, in spite of the OFN_NOCHANGEDIR flag, due to its docs
+ // saying the flag is 'ineffective'. %^(
+ //
+ char oldcwd[MAX_PATH];
+ GetCurrentDirectory(MAX_PATH, oldcwd);
+ oldcwd[MAX_PATH-1] = '\0';
+ // OPEN THE DIALOG WINDOW
+ int err;
+ if ( _btype == BROWSE_SAVE_FILE ) {
+ err = GetSaveFileName(&_ofn);
+ } else {
+ err = GetOpenFileName(&_ofn);
+ }
+ if ( err == 0 ) {
+ // EXTENDED ERROR CHECK
+ int err = CommDlgExtendedError();
+ // CANCEL?
+ if ( err == 0 )
+ return(1); // user hit 'cancel'
+ // AN ERROR OCCURRED
+ char msg[80];
+ sprintf(msg, "CommDlgExtendedError() code=%d", err);
+ errmsg(msg);
+ // XXX: RESTORE CWD
+ if ( oldcwd[0] ) SetCurrentDirectory(oldcwd);
+ return(-1);
+ }
+ // XXX: RESTORE CWD
+ if ( oldcwd[0] ) {
+ SetCurrentDirectory(oldcwd);
+ }
+ // PREPARE PATHNAMES FOR RETURN
+ switch ( _btype ) {
+ case BROWSE_FILE:
+ case BROWSE_SAVE_FILE:
+ set_single_pathname(_ofn.lpstrFile);
+ Win2Unix(_pathnames[_tpathnames-1]);
+ break;
+ case BROWSE_MULTI_FILE: {
+ // EXTRACT MULTIPLE FILENAMES
+ const char *dirname = _ofn.lpstrFile;
+ int dirlen = strlen(dirname);
+ if ( dirlen > 0 ) {
+ // WALK STRING SEARCHING FOR 'DOUBLE-NULL'
+ // eg. "/dir/name\0foo1\0foo2\0foo3\0\0"
+ //
+ char pathname[2048];
+ for ( const char *s = _ofn.lpstrFile + dirlen + 1;
+ *s; s+= (strlen(s)+1)) {
+ strcpy(pathname, dirname);
+ strcat(pathname, "\\");
+ strcat(pathname, s);
+ add_pathname(pathname);
+ Win2Unix(_pathnames[_tpathnames-1]);
+ }
+ }
+ // XXX
+ // Work around problem where pasted forward-slash pathname
+ // into the file browser causes new "Explorer" interface
+ // not to grok forward slashes, passing back as a 'filename'..!
+ //
+ if ( _tpathnames == 0 ) {
+ add_pathname(dirname);
+ Win2Unix(_pathnames[_tpathnames-1]);
+ }
+ break;
+ }
+ case BROWSE_DIRECTORY:
+ case BROWSE_MULTI_DIRECTORY:
+ case BROWSE_SAVE_DIRECTORY:
+ abort(); // never happens: handled by showdir()
+ }
+ return(0);
+}
+
+// Used by SHBrowseForFolder(), sets initial selected dir.
+// Ref: Usenet: microsoft.public.vc.mfc, Dec 8 2000, 1:38p David Lowndes
+// Subject: How to specify to select an initial folder .."
+//
+int CALLBACK FNFC_CLASS::Dir_CB(HWND win, UINT msg,
+ LPARAM param, LPARAM data) {
+ switch (msg) {
+ case BFFM_INITIALIZED:
+ if (data) ::SendMessage(win, BFFM_SETSELECTION, TRUE, data);
+ break;
+ case BFFM_SELCHANGED:
+ TCHAR path[MAX_PATH];
+ if ( SHGetPathFromIDList((ITEMIDLIST*)param, path) ) {
+ ::SendMessage(win, BFFM_ENABLEOK, 0, 1);
+ } else {
+ //disable ok button if not a path
+ ::SendMessage(win, BFFM_ENABLEOK, 0, 0);
+ }
+ break;
+ case BFFM_VALIDATEFAILED:
+ // we could pop up an annoying message here.
+ // also needs set ulFlags |= BIF_VALIDATE
+ break;
+ default:
+ break;
+ }
+ return(0);
+}
+
+// SHOW DIRECTORY BROWSER
+int FNFC_CLASS::showdir() {
+ OleInitialize(NULL); // init needed by BIF_USENEWUI
+ ClearBINF();
+ clear_pathnames();
+ // PARENT WINDOW
+ _binf.hwndOwner = GetForegroundWindow();
+ // DIALOG TITLE
+ _binf.lpszTitle = _title ? _title : NULL;
+ // FLAGS
+ _binf.ulFlags = 0; // initialize
+
+ // TBD: make sure matches to runtime system, if need be.
+ //( what if _WIN32_IE doesn't match system? does the program not run? )
+ // TBD: match all 3 types of directories
+
+#if defined(BIF_NONEWFOLDERBUTTON) // Version 6.0
+ if ( _btype == BROWSE_DIRECTORY ) _binf.ulFlags |= BIF_NONEWFOLDERBUTTON;
+ _binf.ulFlags |= BIF_USENEWUI | BIF_SHAREABLE | BIF_RETURNONLYFSDIRS;
+#elif defined(BIF_USENEWUI) // Version 5.0
+ if ( _btype == BROWSE_DIRECTORY ) _binf.ulFlags |= BIF_EDITBOX;
+ else if ( _btype == BROWSE_SAVE_DIRECTORY ) _binf.ulFlags |= BIF_USENEWUI;
+ _binf.ulFlags |= BIF_SHAREABLE | BIF_RETURNONLYFSDIRS;
+#elif defined(BIF_EDITBOX) // Version 4.71
+ _binf.ulFlags |= BIF_RETURNONLYFSDIRS | BIF_EDITBOX;
+#else // Version Old
+ _binf.ulFlags |= BIF_RETURNONLYFSDIRS;
+#endif
+
+ // BUFFER
+ char displayname[MAX_PATH];
+ _binf.pszDisplayName = displayname;
+ // PRESET DIR
+ char presetname[MAX_PATH];
+ if ( _directory ) {
+ strcpy(presetname, _directory);
+ Unix2Win(presetname);
+ _binf.lParam = (LPARAM)presetname;
+ }
+ else _binf.lParam = 0;
+ _binf.lpfn = Dir_CB;
+ // OPEN BROWSER
+ ITEMIDLIST *pidl = SHBrowseForFolder(&_binf);
+ // CANCEL?
+ if ( pidl == NULL ) return(1);
+
+ // GET THE PATHNAME(S) THE USER SELECTED
+ // TBD: expand NetHood shortcuts from this PIDL??
+ // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/functions/shbrowseforfolder.asp
+
+ TCHAR path[MAX_PATH];
+ if ( SHGetPathFromIDList(pidl, path) ) {
+ Win2Unix(path);
+ add_pathname(path);
+ }
+ FreePIDL(pidl);
+ if ( !strlen(path) ) return(1); // don't return empty pathnames
+ return(0);
+}
+
+// RETURNS:
+// 0 - user picked a file
+// 1 - user cancelled
+// -1 - failed; errmsg() has reason
+//
+int FNFC_CLASS::show() {
+ if ( _btype == BROWSE_DIRECTORY ||
+ _btype == BROWSE_MULTI_DIRECTORY ||
+ _btype == BROWSE_SAVE_DIRECTORY ) {
+ return(showdir());
+ } else {
+ return(showfile());
+ }
+}
+
+// RETURN ERROR MESSAGE
+const char *FNFC_CLASS::errmsg() const {
+ return(_errmsg ? _errmsg : "No error");
+}
+
+// GET FILENAME
+const char* FNFC_CLASS::filename() const {
+ if ( _pathnames && _tpathnames > 0 ) return(_pathnames[0]);
+ return("");
+}
+
+// GET FILENAME FROM LIST OF FILENAMES
+const char* FNFC_CLASS::filename(int i) const {
+ if ( _pathnames && i < _tpathnames ) return(_pathnames[i]);
+ return("");
+}
+
+// GET TOTAL FILENAMES CHOSEN
+int FNFC_CLASS::count() const {
+ return(_tpathnames);
+}
+
+// PRESET PATHNAME
+// Can be NULL if no preset is desired.
+//
+void FNFC_CLASS::directory(const char *val) {
+ _directory = strfree(_directory);
+ _directory = strnew(val);
+}
+
+// GET PRESET PATHNAME
+// Can return NULL if none set.
+//
+const char *FNFC_CLASS::directory() const {
+ return(_directory);
+}
+
+// SET TITLE
+// Can be NULL if no title desired.
+//
+void FNFC_CLASS::title(const char *val) {
+ _title = strfree(_title);
+ _title = strnew(val);
+}
+
+// GET TITLE
+// Can return NULL if none set.
+//
+const char *FNFC_CLASS::title() const {
+ return(_title);
+}
+
+// SET FILTER
+// Can be NULL if no filter needed
+//
+void FNFC_CLASS::filter(const char *val) {
+ _filter = strfree(_filter);
+ clear_filters();
+ if ( val ) {
+ _filter = strnew(val);
+ parse_filter(_filter);
+ }
+ add_filter("All Files", "*.*"); // always include 'all files' option
+
+#ifdef DEBUG
+ nullprint(_parsedfilt);
+#endif /*DEBUG*/
+}
+
+// GET FILTER
+// Can return NULL if none set.
+//
+const char *FNFC_CLASS::filter() const {
+ return(_filter);
+}
+
+// CLEAR FILTERS
+void FNFC_CLASS::clear_filters() {
+ _nfilters = 0;
+ _parsedfilt = strfree(_parsedfilt);
+}
+
+// ADD A FILTER
+void FNFC_CLASS::add_filter(
+ const char *name_in, // name of filter (optional: can be null)
+ const char *winfilter // windows style filter (eg. "*.cxx;*.h")
+ ) {
+ // No name? Make one..
+ char name[1024];
+ if ( !name_in || name_in[0] == '\0' ) {
+ sprintf(name, "%.*s Files", sizeof(name)-10, winfilter);
+ } else {
+ sprintf(name, "%.*s", sizeof(name)-10, name_in);
+ }
+ dnullcat(_parsedfilt, name);
+ dnullcat(_parsedfilt, winfilter);
+ _nfilters++;
+ //DEBUG printf("DEBUG: ADD FILTER name=<%s> winfilter=<%s>\n", name, winfilter);
+}
+
+// CONVERT FLTK STYLE PATTERN MATCHES TO WINDOWS 'DOUBLENULL' PATTERN
+// Handles:
+// IN OUT
+// ----------- -----------------------------
+// *.{ma,mb} "*.{ma,mb} Files\0*.ma;*.mb\0\0"
+// *.[abc] "*.[abc] Files\0*.a;*.b;*.c\0\0"
+// *.txt "*.txt Files\0*.txt\0\0"
+// C Files\t*.[ch] "C Files\0*.c;*.h\0\0"
+//
+// Example:
+// IN: "*.{ma,mb}"
+// OUT: "*.ma;*.mb Files\0*.ma;*.mb\0All Files\0*.*\0\0"
+// --------------- --------- --------- ---
+// | | | |
+// Title Wildcards Title Wildcards
+//
+// Parsing Mode:
+// IN:"C Files\t*.{cxx,h}"
+// ||||||| |||||||||
+// mode: nnnnnnn ww{{{{{{{
+// \_____/ \_______/
+// Name Wildcard
+//
+void FNFC_CLASS::parse_filter(const char *in) {
+ clear_filters();
+ if ( ! in ) return;
+
+ int has_name = strchr(in, '\t') ? 1 : 0;
+
+ char mode = has_name ? 'n' : 'w'; // parse mode: n=name, w=wildcard
+ int nwildcards = 0;
+ char wildcards[MAXFILTERS][1024]; // parsed wildcards (can be several)
+ char wildprefix[512] = "";
+ char name[512] = "";
+
+ // Init
+ int t;
+ for ( t=0; t<MAXFILTERS; t++ ) {
+ wildcards[t][0] = '\0';
+ }
+
+ // Parse
+ for ( ; 1; in++ ) {
+
+ //// DEBUG
+ //// printf("WORKING ON '%c': mode=<%c> name=<%s> wildprefix=<%s> nwildcards=%d wildcards[n]=<%s>\n",
+ //// *in, mode, name, wildprefix, nwildcards, wildcards[nwildcards]);
+
+ switch (*in) {
+ case ',':
+ case '|':
+ if ( mode == LCURLY_CHR ) {
+ // create new wildcard, copy in prefix
+ strcat(wildcards[nwildcards++], wildprefix);
+ continue;
+ } else {
+ goto regchar;
+ }
+ continue;
+
+ // FINISHED PARSING A NAME?
+ case '\t':
+ if ( mode != 'n' ) goto regchar;
+ // finish parsing name? switch to wildcard mode
+ mode = 'w';
+ break;
+
+ // ESCAPE NEXT CHAR
+ case '\\':
+ ++in;
+ goto regchar;
+
+ // FINISHED PARSING ONE OF POSSIBLY SEVERAL FILTERS?
+ case '\r':
+ case '\n':
+ case '\0':
+ {
+ if ( mode == 'w' ) { // finished parsing wildcard?
+ if ( nwildcards == 0 ) {
+ strcpy(wildcards[nwildcards++], wildprefix);
+ }
+ // Append wildcards in Microsoft's "*.one;*.two" format
+ char comp[4096] = "";
+ for ( t=0; t<nwildcards; t++ ) {
+ if ( t != 0 ) strcat(comp, ";");
+ strcat(comp, wildcards[t]);
+ }
+ // Add if not empty
+ if ( comp[0] ) {
+ add_filter(name, comp);
+ }
+ }
+ // RESET
+ for ( t=0; t<MAXFILTERS; t++ ) {
+ wildcards[t][0] = '\0';
+ }
+ nwildcards = 0;
+ wildprefix[0] = name[0] = '\0';
+ mode = strchr(in,'\t') ? 'n' : 'w';
+ // DONE?
+ if ( *in == '\0' ) return; // done
+ continue; // not done yet, more filters
+ }
+
+ // STARTING A WILDCARD?
+ case LBRACKET_CHR:
+ case LCURLY_CHR:
+ mode = *in;
+ if ( *in == LCURLY_CHR ) {
+ // create new wildcard
+ strcat(wildcards[nwildcards++], wildprefix);
+ }
+ continue;
+
+ // ENDING A WILDCARD?
+ case RBRACKET_CHR:
+ case RCURLY_CHR:
+ mode = 'w'; // back to wildcard mode
+ continue;
+
+ // ALL OTHER NON-SPECIAL CHARACTERS
+ default:
+ regchar: // handle regular char
+ switch ( mode ) {
+ case LBRACKET_CHR:
+ // create new wildcard
+ ++nwildcards;
+ // copy in prefix
+ strcpy(wildcards[nwildcards-1], wildprefix);
+ // append search char
+ chrcat(wildcards[nwildcards-1], *in);
+ continue;
+
+ case LCURLY_CHR:
+ if ( nwildcards > 0 ) {
+ chrcat(wildcards[nwildcards-1], *in);
+ }
+ continue;
+
+ case 'n':
+ chrcat(name, *in);
+ continue;
+
+ case 'w':
+ chrcat(wildprefix, *in);
+ for ( t=0; t<nwildcards; t++ ) {
+ chrcat(wildcards[t], *in);
+ }
+ continue;
+ }
+ break;
+ }
+ }
+}
+
+// SET 'CURRENTLY SELECTED FILTER'
+void FNFC_CLASS::filter_value(int i) {
+ _ofn.nFilterIndex = i + 1;
+}
+
+// RETURN VALUE OF 'CURRENTLY SELECTED FILTER'
+int FNFC_CLASS::filter_value() const {
+ return(_ofn.nFilterIndex ? _ofn.nFilterIndex-1 : _nfilters+1);
+}
+
+// PRESET FILENAME FOR 'SAVE AS' CHOOSER
+void FNFC_CLASS::preset_file(const char* val) {
+ _preset_file = strfree(_preset_file);
+ _preset_file = strnew(val);
+}
+
+// GET PRESET FILENAME FOR 'SAVE AS' CHOOSER
+const char* FNFC_CLASS::preset_file() const {
+ return(_preset_file);
+}
diff --git a/src/widgets/Fl_Text_Display_mod.cxx b/src/widgets/Fl_Text_Display_mod.cxx
new file mode 100644
index 0000000..ac6d530
--- /dev/null
+++ b/src/widgets/Fl_Text_Display_mod.cxx
@@ -0,0 +1,7 @@
+#include <config.h>
+
+#if FLWKEY_FLTK_API_MAJOR == 1 && FLWKEY_FLTK_API_MINOR < 3
+# include "Fl_Text_Display_mod_1_1.cxx"
+#elif FLWKEY_FLTK_API_MAJOR == 1 && FLWKEY_FLTK_API_MINOR == 3
+# include "Fl_Text_Display_mod_1_3.cxx"
+#endif
diff --git a/src/widgets/Fl_Text_Display_mod_1_1.cxx b/src/widgets/Fl_Text_Display_mod_1_1.cxx
new file mode 100644
index 0000000..fe0e957
--- /dev/null
+++ b/src/widgets/Fl_Text_Display_mod_1_1.cxx
@@ -0,0 +1,3267 @@
+//
+// "$Id: Fl_Text_Display.cxx 5848 2007-05-20 16:18:31Z mike $"
+//
+// Copyright 2001-2006 by Bill Spitzak and others.
+// Original code Copyright Mark Edel. Permission to distribute under
+// the LGPL for the FLTK library granted by Mark Edel.
+//
+// This library 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 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+// http://www.fltk.org/str.php
+//
+
+#include <config.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <limits.h>
+#include <ctype.h>
+#include <FL/Fl.H>
+#include "Fl_Text_Display_mod.H"
+#include <FL/Fl_Window.H>
+
+#undef min
+#undef max
+
+// Text area margins. Left & right margins should be at least 3 so that
+// there is some room for the overhanging parts of the cursor!
+const int Fl_Text_Display_mod::DEFAULT_TOP_MARGIN = 1;
+const int Fl_Text_Display_mod::DEFAULT_BOTTOM_MARGIN = 1;
+const int Fl_Text_Display_mod::DEFAULT_LEFT_MARGIN = 3;
+const int Fl_Text_Display_mod::DEFAULT_RIGHT_MARGIN = 3;
+
+#define NO_HINT -1
+
+/* Masks for text drawing methods. These are or'd together to form an
+ integer which describes what drawing calls to use to draw a string */
+#define FILL_MASK 0x0100
+#define SECONDARY_MASK 0x0200
+#define PRIMARY_MASK 0x0400
+#define HIGHLIGHT_MASK 0x0800
+#define BG_ONLY_MASK 0x1000
+#define TEXT_ONLY_MASK 0x2000
+#define STYLE_LOOKUP_MASK 0xff
+
+/* Maximum displayable line length (how many characters will fit across the
+ widest window). This amount of memory is temporarily allocated from the
+ stack in the draw_vline() method for drawing strings */
+#define MAX_DISP_LINE_LEN 1000
+
+static int max( int i1, int i2 );
+static int min( int i1, int i2 );
+static int countlines( const char *string );
+
+/* The variables below are used in a timer event to allow smooth
+ scrolling of the text area when the pointer has left the area. */
+static int scroll_direction = 0;
+static int scroll_amount = 0;
+static int scroll_y = 0;
+static int scroll_x = 0;
+
+// CET - FIXME
+#define TMPFONTWIDTH 6
+
+Fl_Text_Display_mod::Fl_Text_Display_mod(int X, int Y, int W, int H, const char* l)
+ : Fl_Group(X, Y, W, H, l) {
+ int i;
+
+ TOP_MARGIN = DEFAULT_TOP_MARGIN;
+ BOTTOM_MARGIN = DEFAULT_BOTTOM_MARGIN;
+ LEFT_MARGIN = DEFAULT_LEFT_MARGIN;
+ RIGHT_MARGIN = DEFAULT_RIGHT_MARGIN;
+
+ mMaxsize = 0;
+ damage_range1_start = damage_range1_end = -1;
+ damage_range2_start = damage_range2_end = -1;
+ dragPos = dragType = dragging = 0;
+ display_insert_position_hint = 0;
+
+ color(FL_BACKGROUND2_COLOR, FL_SELECTION_COLOR);
+// box(FL_DOWN_FRAME);
+ box(FL_DOWN_BOX); // DO NOT USE FRAME OR TILED GROUP WILL NOT CORRECTLY DRAW THE BORDERS !!
+ textsize((uchar)FL_NORMAL_SIZE);
+ textcolor(FL_FOREGROUND_COLOR);
+ textfont(FL_HELVETICA);
+
+ text_area.x = 0;
+ text_area.y = 0;
+ text_area.w = 0;
+ text_area.h = 0;
+
+ mVScrollBar = new Fl_Scrollbar(0,0,1,1);
+ mVScrollBar->callback((Fl_Callback*)v_scrollbar_cb, this);
+ mHScrollBar = new Fl_Scrollbar(0,0,1,1);
+ mHScrollBar->callback((Fl_Callback*)h_scrollbar_cb, this);
+ mHScrollBar->type(FL_HORIZONTAL);
+
+ end();
+
+ scrollbar_width(16);
+ scrollbar_align(FL_ALIGN_BOTTOM_RIGHT);
+
+ mCursorOn = 0;
+ mCursorPos = 0;
+ mCursorOldY = -100;
+ mCursorToHint = NO_HINT;
+ mCursorStyle = NORMAL_CURSOR;
+ mCursorPreferredCol = -1;
+ mBuffer = 0;
+ mFirstChar = 0;
+ mLastChar = 0;
+ mNBufferLines = 0;
+ mTopLineNum = mTopLineNumHint = 1;
+ mAbsTopLineNum = 1;
+ mNeedAbsTopLineNum = 0;
+ mHorizOffset = mHorizOffsetHint = 0;
+
+ mCursor_color = FL_FOREGROUND_COLOR;
+
+ mFixedFontWidth = -1;
+ mStyleBuffer = 0;
+ mStyleTable = 0;
+ mNStyles = 0;
+ mNVisibleLines = 1;
+ mLineStarts = new int[mNVisibleLines];
+ mLineStarts[0] = 0;
+ for (i=1; i<mNVisibleLines; i++)
+ mLineStarts[i] = -1;
+ mSuppressResync = 0;
+ mNLinesDeleted = 0;
+ mModifyingTabDistance = 0;
+
+ mUnfinishedStyle = 0;
+ mUnfinishedHighlightCB = 0;
+ mHighlightCBArg = 0;
+
+ mLineNumLeft = mLineNumWidth = 0;
+ mContinuousWrap = 0;
+ mWrapMargin = 0;
+ mSuppressResync = mNLinesDeleted = mModifyingTabDistance = 0;
+}
+
+/*
+** Free a text display and release its associated memory. Note, the text
+** BUFFER that the text display displays is a separate entity and is not
+** freed, nor are the style buffer or style table.
+*/
+Fl_Text_Display_mod::~Fl_Text_Display_mod() {
+ if (scroll_direction) {
+ Fl::remove_timeout(scroll_timer_cb, this);
+ scroll_direction = 0;
+ }
+ // sb
+ // if (mBuffer) {
+ // mBuffer->remove_modify_callback(buffer_modified_cb, this);
+ // mBuffer->remove_predelete_callback(buffer_predelete_cb, this);
+ // }
+ if (mLineStarts) delete[] mLineStarts;
+}
+
+/*
+** Attach a text buffer to display, replacing the current buffer (if any)
+*/
+void Fl_Text_Display_mod::buffer( Fl_Text_Buffer_mod*buf ) {
+ /* If the text display is already displaying a buffer, clear it off
+ of the display and remove our callback from it */
+ if ( buf == mBuffer) return;
+ if ( mBuffer != 0 ) {
+ buffer_modified_cb( 0, 0, mBuffer->length(), 0, 0, this );
+ mNBufferLines = 0;
+ mBuffer->remove_modify_callback( buffer_modified_cb, this );
+ mBuffer->remove_predelete_callback( buffer_predelete_cb, this );
+ }
+
+ /* Add the buffer to the display, and attach a callback to the buffer for
+ receiving modification information when the buffer contents change */
+ mBuffer = buf;
+ if (mBuffer) {
+ mBuffer->add_modify_callback( buffer_modified_cb, this );
+ mBuffer->add_predelete_callback( buffer_predelete_cb, this );
+
+ /* Update the display */
+ buffer_modified_cb( 0, buf->length(), 0, 0, 0, this );
+ }
+
+ /* Resize the widget to update the screen... */
+ resize(x(), y(), w(), h());
+}
+
+/*
+** Attach (or remove) highlight information in text display and redisplay.
+** Highlighting information consists of a style buffer which parallels the
+** normal text buffer, but codes font and color information for the display;
+** a style table which translates style buffer codes (indexed by buffer
+** character - 'A') into fonts and colors; and a callback mechanism for
+** as-needed highlighting, triggered by a style buffer entry of
+** "unfinishedStyle". Style buffer can trigger additional redisplay during
+** a normal buffer modification if the buffer contains a primary Fl_Text_Selection
+** (see extendRangeForStyleMods for more information on this protocol).
+**
+** Style buffers, tables and their associated memory are managed by the caller.
+*/
+void
+Fl_Text_Display_mod::highlight_data(Fl_Text_Buffer_mod*styleBuffer,
+ const Style_Table_Entry *styleTable,
+ int nStyles, char unfinishedStyle,
+ Unfinished_Style_Cb unfinishedHighlightCB,
+ void *cbArg ) {
+ mStyleBuffer = styleBuffer;
+ mStyleTable = styleTable;
+ mNStyles = nStyles;
+ mUnfinishedStyle = unfinishedStyle;
+ mUnfinishedHighlightCB = unfinishedHighlightCB;
+ mHighlightCBArg = cbArg;
+
+ mStyleBuffer->canUndo(0);
+#if 0
+ // FIXME: this is in nedit code -- is it needed?
+ /* Call TextDSetFont to combine font information from style table and
+ primary font, adjust font-related parameters, and then redisplay */
+ TextDSetFont(textD, textD->fontStruct);
+#endif
+ damage(FL_DAMAGE_EXPOSE);
+}
+
+#if 0
+ // FIXME: this is in nedit code -- is it needed?
+/*
+** Change the (non highlight) font
+*/
+void TextDSetFont(textDisp *textD, XFontStruct *fontStruct) {
+ Display *display = XtDisplay(textD->w);
+ int i, maxAscent = fontStruct->ascent, maxDescent = fontStruct->descent;
+ int width, height, fontWidth;
+ Pixel bgPixel, fgPixel, selectFGPixel, selectBGPixel;
+ Pixel highlightFGPixel, highlightBGPixel;
+ XGCValues values;
+ XFontStruct *styleFont;
+
+ /* If font size changes, cursor will be redrawn in a new position */
+ blankCursorProtrusions(textD);
+
+ /* If there is a (syntax highlighting) style table in use, find the new
+ maximum font height for this text display */
+ for (i=0; i<textD->nStyles; i++) {
+ styleFont = textD->styleTable[i].font;
+ if (styleFont != NULL && styleFont->ascent > maxAscent)
+ maxAscent = styleFont->ascent;
+ if (styleFont != NULL && styleFont->descent > maxDescent)
+ maxDescent = styleFont->descent;
+ }
+ textD->ascent = maxAscent;
+ textD->descent = maxDescent;
+
+ /* If all of the current fonts are fixed and match in width, compute */
+ fontWidth = fontStruct->max_bounds.width;
+ if (fontWidth != fontStruct->min_bounds.width)
+ fontWidth = -1;
+ else {
+ for (i=0; i<textD->nStyles; i++) {
+ styleFont = textD->styleTable[i].font;
+ if (styleFont != NULL && (styleFont->max_bounds.width != fontWidth ||
+ styleFont->max_bounds.width != styleFont->min_bounds.width))
+ fontWidth = -1;
+ }
+ }
+ textD->fixedFontWidth = fontWidth;
+
+ /* Don't let the height dip below one line, or bad things can happen */
+ if (textD->height < maxAscent + maxDescent)
+ textD->height = maxAscent + maxDescent;
+
+ /* Change the font. In most cases, this means re-allocating the
+ affected GCs (they are shared with other widgets, and if the primary
+ font changes, must be re-allocated to change it). Unfortunately,
+ this requres recovering all of the colors from the existing GCs */
+ textD->fontStruct = fontStruct;
+ XGetGCValues(display, textD->gc, GCForeground|GCBackground, &values);
+ fgPixel = values.foreground;
+ bgPixel = values.background;
+ XGetGCValues(display, textD->selectGC, GCForeground|GCBackground, &values);
+ selectFGPixel = values.foreground;
+ selectBGPixel = values.background;
+ XGetGCValues(display, textD->highlightGC,GCForeground|GCBackground,&values);
+ highlightFGPixel = values.foreground;
+ highlightBGPixel = values.background;
+ releaseGC(textD->w, textD->gc);
+ releaseGC(textD->w, textD->selectGC);
+ releaseGC(textD->w, textD->highlightGC);
+ releaseGC(textD->w, textD->selectBGGC);
+ releaseGC(textD->w, textD->highlightBGGC);
+ if (textD->lineNumGC != NULL)
+ releaseGC(textD->w, textD->lineNumGC);
+ textD->lineNumGC = NULL;
+ allocateFixedFontGCs(textD, fontStruct, bgPixel, fgPixel, selectFGPixel,
+ selectBGPixel, highlightFGPixel, highlightBGPixel);
+ XSetFont(display, textD->styleGC, fontStruct->fid);
+
+ /* Do a full resize to force recalculation of font related parameters */
+ width = textD->width;
+ height = textD->height;
+ textD->width = textD->height = 0;
+ TextDResize(textD, width, height);
+
+ /* Redisplay */
+ TextDRedisplayRect(textD, textD->left, textD->top, textD->width,
+ textD->height);
+
+ /* Clean up line number area in case spacing has changed */
+ draw_line_numbers(textD, True);
+}
+
+int TextDMinFontWidth(textDisp *textD, Boolean considerStyles) {
+ int fontWidth = textD->fontStruct->max_bounds.width;
+ int i;
+
+ if (considerStyles) {
+ for (i = 0; i < textD->nStyles; ++i) {
+ int thisWidth = (textD->styleTable[i].font)->min_bounds.width;
+ if (thisWidth < fontWidth) {
+ fontWidth = thisWidth;
+ }
+ }
+ }
+ return(fontWidth);
+}
+
+int TextDMaxFontWidth(textDisp *textD, Boolean considerStyles) {
+ int fontWidth = textD->fontStruct->max_bounds.width;
+ int i;
+
+ if (considerStyles) {
+ for (i = 0; i < textD->nStyles; ++i) {
+ int thisWidth = (textD->styleTable[i].font)->max_bounds.width;
+ if (thisWidth > fontWidth) {
+ fontWidth = thisWidth;
+ }
+ }
+ }
+ return(fontWidth);
+}
+#endif
+
+int Fl_Text_Display_mod::longest_vline() {
+ int longest = 0;
+ for (int i = 0; i < mNVisibleLines; i++)
+ longest = max(longest, measure_vline(i));
+ return longest;
+}
+
+/*
+** Change the size of the displayed text area
+*/
+void Fl_Text_Display_mod::resize(int X, int Y, int W, int H) {
+#ifdef DEBUG
+ printf("Fl_Text_Display_mod::resize(X=%d, Y=%d, W=%d, H=%d)\n", X, Y, W, H);
+#endif // DEBUG
+ const int oldWidth = w();
+#ifdef DEBUG
+ printf(" oldWidth=%d, mContinuousWrap=%d, mWrapMargin=%d\n", oldWidth,
+ mContinuousWrap, mWrapMargin);
+#endif // DEBUG
+ Fl_Widget::resize(X,Y,W,H);
+ if (!buffer()) return;
+ X += Fl::box_dx(box());
+ Y += Fl::box_dy(box());
+ W -= Fl::box_dw(box());
+ H -= Fl::box_dh(box());
+
+ text_area.x = X+LEFT_MARGIN;
+ text_area.y = Y+TOP_MARGIN;
+ text_area.w = W-LEFT_MARGIN-RIGHT_MARGIN;
+ text_area.h = H-TOP_MARGIN-BOTTOM_MARGIN;
+ int i = 0;
+
+ /* Find the new maximum font height for this text display */
+ for (i = 0, mMaxsize = fl_height(textfont(), textsize()); i < mNStyles; i++)
+ mMaxsize = max(mMaxsize, fl_height(mStyleTable[i].font, mStyleTable[i].size));
+
+ // did we have scrollbars initially?
+ int hscrollbarvisible = mHScrollBar->visible();
+ int vscrollbarvisible = mVScrollBar->visible();
+
+ // try without scrollbars first
+ mVScrollBar->clear_visible();
+ mHScrollBar->clear_visible();
+
+ for (int again = 1; again;) {
+ again = 0;
+ /* In continuous wrap mode, a change in width affects the total number of
+ lines in the buffer, and can leave the top line number incorrect, and
+ the top character no longer pointing at a valid line start */
+ if (mContinuousWrap && !mWrapMargin && W!=oldWidth) {
+ int oldFirstChar = mFirstChar;
+ mNBufferLines = count_lines(0, buffer()->length(), true);
+ mFirstChar = line_start(mFirstChar);
+ mTopLineNum = count_lines(0, mFirstChar, true)+1;
+ absolute_top_line_number(oldFirstChar);
+
+#ifdef DEBUG
+ printf(" mNBufferLines=%d\n", mNBufferLines);
+#endif // DEBUG
+ }
+
+ /* reallocate and update the line starts array, which may have changed
+ size and / or contents. */
+ int nvlines = (text_area.h + mMaxsize - 1) / mMaxsize;
+ if (nvlines < 1) nvlines = 1;
+ if (mNVisibleLines != nvlines) {
+ mNVisibleLines = nvlines;
+ if (mLineStarts) delete[] mLineStarts;
+ mLineStarts = new int [mNVisibleLines];
+ }
+
+ calc_line_starts(0, mNVisibleLines);
+ calc_last_char();
+
+ // figure the scrollbars
+ if (scrollbar_width()) {
+ /* Decide if the vertical scroll bar needs to be visible */
+ if (scrollbar_align() & (FL_ALIGN_LEFT|FL_ALIGN_RIGHT) &&
+ mNBufferLines >= mNVisibleLines - 1)
+ {
+ if (!mVScrollBar->visible())
+ again = 1;
+ mVScrollBar->set_visible();
+ if (scrollbar_align() & FL_ALIGN_LEFT) {
+ text_area.x = X+scrollbar_width()+LEFT_MARGIN;
+ text_area.w = W-scrollbar_width()-LEFT_MARGIN-RIGHT_MARGIN;
+ mVScrollBar->resize(X, text_area.y-TOP_MARGIN, scrollbar_width(),
+ text_area.h+TOP_MARGIN+BOTTOM_MARGIN);
+ } else {
+ text_area.x = X+LEFT_MARGIN;
+ text_area.w = W-scrollbar_width()-LEFT_MARGIN-RIGHT_MARGIN;
+ mVScrollBar->resize(X+W-scrollbar_width(), text_area.y-TOP_MARGIN,
+ scrollbar_width(), text_area.h+TOP_MARGIN+BOTTOM_MARGIN);
+ }
+ }
+
+ /*
+ Decide if the horizontal scroll bar needs to be visible. If there
+ is a vertical scrollbar, a horizontal is always created too. This
+ is because the alternatives are unatractive:
+ * Dynamically creating a horizontal scrollbar based on the currently
+ visible lines is what the original nedit does, but it always wastes
+ space for the scrollbar even when it's not used. Since the FLTK
+ widget dynamically allocates the space for the scrollbar and
+ rearranges the widget to make room for it, this would create a very
+ visually displeasing "bounce" effect when the vertical scrollbar is
+ dragged. Trust me, I tried it and it looks really bad.
+ * The other alternative would be to keep track of what the longest
+ line in the entire buffer is and base the scrollbar on that. I
+ didn't do this because I didn't see any easy way to do that using
+ the nedit code and this could involve a lengthy calculation for
+ large buffers. If an efficient and non-costly way of doing this
+ can be found, this might be a way to go.
+ */
+ /* WAS: Suggestion: Try turning the horizontal scrollbar on when
+ you first see a line that is too wide in the window, but then
+ don't turn it off (ie mix both of your solutions). */
+ if (!mContinuousWrap && scrollbar_align() & (FL_ALIGN_TOP|FL_ALIGN_BOTTOM) &&
+ (mVScrollBar->visible() || longest_vline() > text_area.w))
+ {
+ if (!mHScrollBar->visible()) {
+ mHScrollBar->set_visible();
+ again = 1; // loop again to see if we now need vert. & recalc sizes
+ }
+ if (scrollbar_align() & FL_ALIGN_TOP) {
+ text_area.y = Y + scrollbar_width()+TOP_MARGIN;
+ text_area.h = H - scrollbar_width()-TOP_MARGIN-BOTTOM_MARGIN;
+ mHScrollBar->resize(text_area.x-LEFT_MARGIN, Y,
+ text_area.w+LEFT_MARGIN+RIGHT_MARGIN, scrollbar_width());
+ } else {
+ text_area.y = Y+TOP_MARGIN;
+ text_area.h = H - scrollbar_width()-TOP_MARGIN-BOTTOM_MARGIN;
+ mHScrollBar->resize(text_area.x-LEFT_MARGIN, Y+H-scrollbar_width(),
+ text_area.w+LEFT_MARGIN+RIGHT_MARGIN, scrollbar_width());
+ }
+ }
+ }
+ }
+
+ // user request to change viewport
+ if (mTopLineNumHint != mTopLineNum || mHorizOffsetHint != mHorizOffset)
+ scroll_(mTopLineNumHint, mHorizOffsetHint);
+
+ // everything will fit in the viewport
+ if (mNBufferLines < mNVisibleLines || mBuffer == NULL || mBuffer->length() == 0)
+ scroll_(1, mHorizOffset);
+ /* if empty lines become visible, there may be an opportunity to
+ display more text by scrolling down */
+ else while (mLineStarts[mNVisibleLines-2] == -1)
+ scroll_(mTopLineNum-1, mHorizOffset);
+
+ // user request to display insert position
+ if (display_insert_position_hint)
+ display_insert();
+
+ // in case horizontal offset is now greater than longest line
+ int maxhoffset = max(0, longest_vline()-text_area.w);
+ if (mHorizOffset > maxhoffset)
+ scroll_(mTopLineNumHint, maxhoffset);
+
+ mTopLineNumHint = mTopLineNum;
+ mHorizOffsetHint = mHorizOffset;
+ display_insert_position_hint = 0;
+
+ if (mContinuousWrap ||
+ hscrollbarvisible != mHScrollBar->visible() ||
+ vscrollbarvisible != mVScrollBar->visible())
+ redraw();
+
+ update_v_scrollbar();
+ update_h_scrollbar();
+}
+
+/*
+** Refresh a rectangle of the text display. left and top are in coordinates of
+** the text drawing window
+*/
+void Fl_Text_Display_mod::draw_text( int left, int top, int width, int height ) {
+ int fontHeight, firstLine, lastLine, line;
+
+ /* find the line number range of the display */
+ fontHeight = mMaxsize ? mMaxsize : textsize_;
+ firstLine = ( top - text_area.y - fontHeight + 1 ) / fontHeight;
+ lastLine = ( top + height - text_area.y ) / fontHeight + 1;
+
+ fl_push_clip( left, top, width, height );
+
+ /* draw the lines */
+ for ( line = firstLine; line <= lastLine; line++ )
+ draw_vline( line, left, left + width, 0, INT_MAX );
+
+ /* draw the line numbers if exposed area includes them */
+ if (mLineNumWidth != 0 && left <= mLineNumLeft + mLineNumWidth)
+ draw_line_numbers(false);
+
+ fl_pop_clip();
+}
+
+void Fl_Text_Display_mod::redisplay_range(int startpos, int endpos) {
+ if (damage_range1_start == -1 && damage_range1_end == -1) {
+ damage_range1_start = startpos;
+ damage_range1_end = endpos;
+ } else if ((startpos >= damage_range1_start && startpos <= damage_range1_end) ||
+ (endpos >= damage_range1_start && endpos <= damage_range1_end)) {
+ damage_range1_start = min(damage_range1_start, startpos);
+ damage_range1_end = max(damage_range1_end, endpos);
+ } else if (damage_range2_start == -1 && damage_range2_end == -1) {
+ damage_range2_start = startpos;
+ damage_range2_end = endpos;
+ } else {
+ damage_range2_start = min(damage_range2_start, startpos);
+ damage_range2_end = max(damage_range2_end, endpos);
+ }
+ damage(FL_DAMAGE_SCROLL);
+}
+/*
+** Refresh all of the text between buffer positions "start" and "end"
+** not including the character at the position "end".
+** If end points beyond the end of the buffer, refresh the whole display
+** after pos, including blank lines which are not technically part of
+** any range of characters.
+*/
+void Fl_Text_Display_mod::draw_range(int startpos, int endpos) {
+ int i, startLine, lastLine, startIndex, endIndex;
+
+ /* If the range is outside of the displayed text, just return */
+ if ( endpos < mFirstChar || ( startpos > mLastChar &&
+ !empty_vlines() ) ) return;
+
+ /* Clean up the starting and ending values */
+ if ( startpos < 0 ) startpos = 0;
+ if ( startpos > mBuffer->length() ) startpos = mBuffer->length();
+ if ( endpos < 0 ) endpos = 0;
+ if ( endpos > mBuffer->length() ) endpos = mBuffer->length();
+
+ /* Get the starting and ending lines */
+ if ( startpos < mFirstChar )
+ startpos = mFirstChar;
+ if ( !position_to_line( startpos, &startLine ) )
+ startLine = mNVisibleLines - 1;
+ if ( endpos >= mLastChar ) {
+ lastLine = mNVisibleLines - 1;
+ } else {
+ if ( !position_to_line( endpos, &lastLine ) ) {
+ /* shouldn't happen */
+ lastLine = mNVisibleLines - 1;
+ }
+ }
+
+ /* Get the starting and ending positions within the lines */
+ startIndex = mLineStarts[ startLine ] == -1 ? 0 :
+ startpos - mLineStarts[ startLine ];
+ if ( endpos >= mLastChar )
+ endIndex = INT_MAX;
+ else if ( mLineStarts[ lastLine ] == -1 )
+ endIndex = 0;
+ else
+ endIndex = endpos - mLineStarts[ lastLine ];
+
+ /* If the starting and ending lines are the same, redisplay the single
+ line between "start" and "end" */
+ if ( startLine == lastLine ) {
+ draw_vline( startLine, 0, INT_MAX, startIndex, endIndex );
+ return;
+ }
+
+ /* Redisplay the first line from "start" */
+ draw_vline( startLine, 0, INT_MAX, startIndex, INT_MAX );
+
+ /* Redisplay the lines in between at their full width */
+ for ( i = startLine + 1; i < lastLine; i++ )
+ draw_vline( i, 0, INT_MAX, 0, INT_MAX );
+
+ /* Redisplay the last line to "end" */
+ draw_vline( lastLine, 0, INT_MAX, 0, endIndex );
+}
+
+/*
+** Set the position of the text insertion cursor for text display
+*/
+void Fl_Text_Display_mod::insert_position( int newPos ) {
+ /* make sure new position is ok, do nothing if it hasn't changed */
+ if ( newPos == mCursorPos )
+ return;
+ if ( newPos < 0 ) newPos = 0;
+ if ( newPos > mBuffer->length() ) newPos = mBuffer->length();
+
+ /* cursor movement cancels vertical cursor motion column */
+ mCursorPreferredCol = -1;
+
+ /* erase the cursor at it's previous position */
+ redisplay_range(mCursorPos - 1, mCursorPos + 1);
+
+ mCursorPos = newPos;
+
+ /* draw cursor at its new position */
+ redisplay_range(mCursorPos - 1, mCursorPos + 1);
+}
+
+void Fl_Text_Display_mod::show_cursor(int b) {
+ mCursorOn = b;
+ redisplay_range(mCursorPos - 1, mCursorPos + 1);
+}
+
+void Fl_Text_Display_mod::cursor_style(int style) {
+ mCursorStyle = style;
+ if (mCursorOn) show_cursor();
+}
+
+void Fl_Text_Display_mod::wrap_mode(int wrap, int wrapMargin) {
+ mWrapMargin = wrapMargin;
+ mContinuousWrap = wrap;
+
+ if (buffer()) {
+ /* wrapping can change the total number of lines, re-count */
+ mNBufferLines = count_lines(0, buffer()->length(), true);
+
+ /* changing wrap margins or changing from wrapped mode to non-wrapped
+ can leave the character at the top no longer at a line start, and/or
+ change the line number */
+ mFirstChar = line_start(mFirstChar);
+ mTopLineNum = count_lines(0, mFirstChar, true) + 1;
+
+ reset_absolute_top_line_number();
+
+ /* update the line starts array */
+ calc_line_starts(0, mNVisibleLines);
+ calc_last_char();
+ } else {
+ // No buffer, so just clear the state info for later...
+ mNBufferLines = 0;
+ mFirstChar = 0;
+ mTopLineNum = 1;
+ mAbsTopLineNum = 0;
+ }
+
+ resize(x(), y(), w(), h());
+}
+
+/*
+** Insert "text" at the current cursor location. This has the same
+** effect as inserting the text into the buffer using BufInsert and
+** then moving the insert position after the newly inserted text, except
+** that it's optimized to do less redrawing.
+*/
+void Fl_Text_Display_mod::insert(const char* text) {
+ int pos = mCursorPos;
+
+ mCursorToHint = pos + strlen( text );
+ mBuffer->insert( pos, text );
+ mCursorToHint = NO_HINT;
+}
+
+/*
+** Insert "text" (which must not contain newlines), overstriking the current
+** cursor location.
+*/
+void Fl_Text_Display_mod::overstrike(const char* text) {
+ int startPos = mCursorPos;
+ Fl_Text_Buffer_mod*buf = mBuffer;
+ int lineStart = buf->line_start( startPos );
+ int textLen = strlen( text );
+ int i, p, endPos, indent, startIndent, endIndent;
+ const char *c;
+ char ch, *paddedText = NULL;
+
+ /* determine how many displayed character positions are covered */
+ startIndent = mBuffer->count_displayed_characters( lineStart, startPos );
+ indent = startIndent;
+ for ( c = text; *c != '\0'; c++ )
+ indent += Fl_Text_Buffer_mod::character_width( *c, indent, buf->tab_distance(), buf->null_substitution_character() );
+ endIndent = indent;
+
+ /* find which characters to remove, and if necessary generate additional
+ padding to make up for removed control characters at the end */
+ indent = startIndent;
+ for ( p = startPos; ; p++ ) {
+ if ( p == buf->length() )
+ break;
+ ch = buf->character( p );
+ if ( ch == '\n' )
+ break;
+ indent += Fl_Text_Buffer_mod::character_width( ch, indent, buf->tab_distance(), buf->null_substitution_character() );
+ if ( indent == endIndent ) {
+ p++;
+ break;
+ } else if ( indent > endIndent ) {
+ if ( ch != '\t' ) {
+ p++;
+ paddedText = new char [ textLen + FL_TEXT_MAX_EXP_CHAR_LEN + 1 ];
+ strcpy( paddedText, text );
+ for ( i = 0; i < indent - endIndent; i++ )
+ paddedText[ textLen + i ] = ' ';
+ paddedText[ textLen + i ] = '\0';
+ }
+ break;
+ }
+ }
+ endPos = p;
+
+ mCursorToHint = startPos + textLen;
+ buf->replace( startPos, endPos, paddedText == NULL ? text : paddedText );
+ mCursorToHint = NO_HINT;
+ if ( paddedText != NULL )
+ delete [] paddedText;
+}
+
+/*
+** Translate a buffer text position to the XY location where the top left
+** of the cursor would be positioned to point to that character. Returns
+** 0 if the position is not displayed because it is VERTICALLY out
+** of view. If the position is horizontally out of view, returns the
+** X coordinate where the position would be if it were visible.
+*/
+
+int Fl_Text_Display_mod::position_to_xy( int pos, int* X, int* Y ) {
+ int charIndex, lineStartPos, fontHeight, lineLen;
+ int visLineNum, charLen, outIndex, xStep, charStyle;
+ char expandedChar[ FL_TEXT_MAX_EXP_CHAR_LEN ];
+ const char *lineStr;
+
+// printf("position_to_xy(pos=%d, X=%p, Y=%p)\n", pos, X, Y);
+
+ /* If position is not displayed, return false */
+ if (pos < mFirstChar || (pos > mLastChar && !empty_vlines())) {
+// printf(" returning 0\n"
+// " mFirstChar=%d, mLastChar=%d, empty_vlines()=0\n",
+// mFirstChar, mLastChar);
+ return 0;
+ }
+
+ /* Calculate Y coordinate */
+ if (!position_to_line(pos, &visLineNum)) {
+// puts(" returning 0\n"
+// " position_to_line()=0");
+ return 0;
+ }
+
+ if (visLineNum < 0 || visLineNum > mNBufferLines) {
+// printf(" returning 0\n"
+// " visLineNum=%d, mNBufferLines=%d\n",
+// visLineNum, mNBufferLines);
+ return 0;
+ }
+
+ fontHeight = mMaxsize;
+ *Y = text_area.y + visLineNum * fontHeight;
+
+ /* Get the text, length, and buffer position of the line. If the position
+ is beyond the end of the buffer and should be at the first position on
+ the first empty line, don't try to get or scan the text */
+ lineStartPos = mLineStarts[visLineNum];
+ if ( lineStartPos == -1 ) {
+ *X = text_area.x - mHorizOffset;
+ return 1;
+ }
+ lineLen = vline_length( visLineNum );
+ lineStr = mBuffer->text_range( lineStartPos, lineStartPos + lineLen );
+
+ /* Step through character positions from the beginning of the line
+ to "pos" to calculate the X coordinate */
+ xStep = text_area.x - mHorizOffset;
+ outIndex = 0;
+ for ( charIndex = 0; charIndex < lineLen && charIndex < pos - lineStartPos; charIndex++ ) {
+ charLen = Fl_Text_Buffer_mod::expand_character( lineStr[ charIndex ], outIndex, expandedChar,
+ mBuffer->tab_distance(), mBuffer->null_substitution_character() );
+ charStyle = position_style( lineStartPos, lineLen, charIndex,
+ outIndex );
+ xStep += string_width( expandedChar, charLen, charStyle );
+ outIndex += charLen;
+ }
+ *X = xStep;
+ free((char *)lineStr);
+ return 1;
+}
+
+/*
+** Find the line number of position "pos". Note: this only works for
+** displayed lines. If the line is not displayed, the function returns
+** 0 (without the mLineStarts array it could turn in to very long
+** calculation involving scanning large amounts of text in the buffer).
+** If continuous wrap mode is on, returns the absolute line number (as opposed
+** to the wrapped line number which is used for scrolling).
+*/
+int Fl_Text_Display_mod::position_to_linecol( int pos, int* lineNum, int* column ) {
+ int retVal;
+
+ /* In continuous wrap mode, the absolute (non-wrapped) line count is
+ maintained separately, as needed. Only return it if we're actually
+ keeping track of it and pos is in the displayed text */
+ if (mContinuousWrap) {
+ if (!maintaining_absolute_top_line_number() ||
+ pos < mFirstChar || pos > mLastChar)
+ return 0;
+ *lineNum = mAbsTopLineNum + buffer()->count_lines(mFirstChar, pos);
+ *column
+ = buffer()->count_displayed_characters(buffer()->line_start(pos), pos);
+ return 1;
+ }
+
+ retVal = position_to_line( pos, lineNum );
+ if ( retVal ) {
+ *column = mBuffer->count_displayed_characters(
+ mLineStarts[ *lineNum ], pos );
+ *lineNum += mTopLineNum;
+ }
+ return retVal;
+}
+
+/*
+** Return 1 if position (X, Y) is inside of the primary Fl_Text_Selection
+*/
+int Fl_Text_Display_mod::in_selection( int X, int Y ) {
+ int row, column, pos = xy_to_position( X, Y, CHARACTER_POS );
+ Fl_Text_Buffer_mod*buf = mBuffer;
+
+ xy_to_rowcol( X, Y, &row, &column, CHARACTER_POS );
+ if (range_touches_selection(buf->primary_selection(), mFirstChar, mLastChar))
+ column = wrapped_column(row, column);
+ return buf->primary_selection()->includes(pos, buf->line_start( pos ), column);
+}
+
+/*
+** Correct a column number based on an unconstrained position (as returned by
+** TextDXYToUnconstrainedPosition) to be relative to the last actual newline
+** in the buffer before the row and column position given, rather than the
+** last line start created by line wrapping. This is an adapter
+** for rectangular selections and code written before continuous wrap mode,
+** which thinks that the unconstrained column is the number of characters
+** from the last newline. Obviously this is time consuming, because it
+** invloves character re-counting.
+*/
+int Fl_Text_Display_mod::wrapped_column(int row, int column) {
+ int lineStart, dispLineStart;
+
+ if (!mContinuousWrap || row < 0 || row > mNVisibleLines)
+ return column;
+ dispLineStart = mLineStarts[row];
+ if (dispLineStart == -1)
+ return column;
+ lineStart = buffer()->line_start(dispLineStart);
+ return column
+ + buffer()->count_displayed_characters(lineStart, dispLineStart);
+}
+
+/*
+** Correct a row number from an unconstrained position (as returned by
+** TextDXYToUnconstrainedPosition) to a straight number of newlines from the
+** top line of the display. Because rectangular selections are based on
+** newlines, rather than display wrapping, and anywhere a rectangular selection
+** needs a row, it needs it in terms of un-wrapped lines.
+*/
+int Fl_Text_Display_mod::wrapped_row(int row) {
+ if (!mContinuousWrap || row < 0 || row > mNVisibleLines)
+ return row;
+ return buffer()->count_lines(mFirstChar, mLineStarts[row]);
+}
+
+/*
+** Scroll the display to bring insertion cursor into view.
+**
+** Note: it would be nice to be able to do this without counting lines twice
+** (scroll_() counts them too) and/or to count from the most efficient
+** starting point, but the efficiency of this routine is not as important to
+** the overall performance of the text display.
+*/
+void Fl_Text_Display_mod::display_insert() {
+ int hOffset, topLine, X, Y;
+ hOffset = mHorizOffset;
+ topLine = mTopLineNum;
+
+// FIXME: I don't understand this well enough to know if it is correct
+// it is different than nedit 5.3
+ if (insert_position() < mFirstChar) {
+ topLine -= count_lines(insert_position(), mFirstChar, false);
+ } else if (mLineStarts[mNVisibleLines-2] != -1) {
+ int lastChar = line_end(mLineStarts[mNVisibleLines-2],true);
+ if (insert_position() >= lastChar)
+ topLine
+ += count_lines(lastChar - (wrap_uses_character(mLastChar) ? 0 : 1),
+ insert_position(), false);
+ }
+
+ /* Find the new setting for horizontal offset (this is a bit ungraceful).
+ If the line is visible, just use PositionToXY to get the position
+ to scroll to, otherwise, do the vertical scrolling first, then the
+ horizontal */
+ if (!position_to_xy( mCursorPos, &X, &Y )) {
+ scroll_(topLine, hOffset);
+ if (!position_to_xy( mCursorPos, &X, &Y )) {
+ #ifdef DEBUG
+ printf ("*** display_insert/position_to_xy # GIVE UP !\n"); fflush(stdout);
+ #endif // DEBUG
+ return; /* Give up, it's not worth it (but why does it fail?) */
+ }
+ }
+ if (X > text_area.x + text_area.w)
+ hOffset += X-(text_area.x + text_area.w);
+ else if (X < text_area.x)
+ hOffset += X-text_area.x;
+
+ /* Do the scroll */
+ if (topLine != mTopLineNum || hOffset != mHorizOffset)
+ scroll_(topLine, hOffset);
+}
+
+void Fl_Text_Display_mod::show_insert_position() {
+ display_insert_position_hint = 1;
+ resize(x(), y(), w(), h());
+}
+
+/*
+** Cursor movement functions
+*/
+int Fl_Text_Display_mod::move_right() {
+ if ( mCursorPos >= mBuffer->length() )
+ return 0;
+ insert_position( mCursorPos + 1 );
+ return 1;
+}
+
+int Fl_Text_Display_mod::move_left() {
+ if ( mCursorPos <= 0 )
+ return 0;
+ insert_position( mCursorPos - 1 );
+ return 1;
+}
+
+int Fl_Text_Display_mod::move_up() {
+ int lineStartPos, column, prevLineStartPos, newPos, visLineNum;
+
+ /* Find the position of the start of the line. Use the line starts array
+ if possible */
+ if ( position_to_line( mCursorPos, &visLineNum ) )
+ lineStartPos = mLineStarts[ visLineNum ];
+ else {
+ lineStartPos = line_start( mCursorPos );
+ visLineNum = -1;
+ }
+ if ( lineStartPos == 0 )
+ return 0;
+
+ /* Decide what column to move to, if there's a preferred column use that */
+ column = mCursorPreferredCol >= 0 ? mCursorPreferredCol :
+ mBuffer->count_displayed_characters( lineStartPos, mCursorPos );
+
+ /* count forward from the start of the previous line to reach the column */
+ if ( visLineNum != -1 && visLineNum != 0 )
+ prevLineStartPos = mLineStarts[ visLineNum - 1 ];
+ else
+ prevLineStartPos = rewind_lines( lineStartPos, 1 );
+ newPos = mBuffer->skip_displayed_characters( prevLineStartPos, column );
+ if (mContinuousWrap)
+ newPos = min(newPos, line_end(prevLineStartPos, true));
+
+ /* move the cursor */
+ insert_position( newPos );
+
+ /* if a preferred column wasn't aleady established, establish it */
+ mCursorPreferredCol = column;
+ return 1;
+}
+
+int Fl_Text_Display_mod::move_down() {
+ int lineStartPos, column, nextLineStartPos, newPos, visLineNum;
+
+ if ( mCursorPos == mBuffer->length() )
+ return 0;
+ if ( position_to_line( mCursorPos, &visLineNum ) )
+ lineStartPos = mLineStarts[ visLineNum ];
+ else {
+ lineStartPos = line_start( mCursorPos );
+ visLineNum = -1;
+ }
+ column = mCursorPreferredCol >= 0 ? mCursorPreferredCol :
+ mBuffer->count_displayed_characters( lineStartPos, mCursorPos );
+ nextLineStartPos = skip_lines( lineStartPos, 1, true );
+ newPos = mBuffer->skip_displayed_characters( nextLineStartPos, column );
+ if (mContinuousWrap)
+ newPos = min(newPos, line_end(nextLineStartPos, true));
+
+ insert_position( newPos );
+ mCursorPreferredCol = column;
+ return 1;
+}
+
+/*
+** Same as BufCountLines, but takes in to account wrapping if wrapping is
+** turned on. If the caller knows that startPos is at a line start, it
+** can pass "startPosIsLineStart" as True to make the call more efficient
+** by avoiding the additional step of scanning back to the last newline.
+*/
+int Fl_Text_Display_mod::count_lines(int startPos, int endPos,
+ bool startPosIsLineStart) {
+ int retLines, retPos, retLineStart, retLineEnd;
+
+#ifdef DEBUG
+ printf("Fl_Text_Display_mod::count_lines(startPos=%d, endPos=%d, startPosIsLineStart=%d\n",
+ startPos, endPos, startPosIsLineStart);
+#endif // DEBUG
+
+ /* If we're not wrapping use simple (and more efficient) BufCountLines */
+ if (!mContinuousWrap)
+ return buffer()->count_lines(startPos, endPos);
+
+ wrapped_line_counter(buffer(), startPos, endPos, INT_MAX,
+ startPosIsLineStart, 0, &retPos, &retLines, &retLineStart,
+ &retLineEnd);
+
+#ifdef DEBUG
+ printf(" # after WLC: retPos=%d, retLines=%d, retLineStart=%d, retLineEnd=%d\n",
+ retPos, retLines, retLineStart, retLineEnd);
+#endif // DEBUG
+
+ return retLines;
+}
+
+/*
+** Same as BufCountForwardNLines, but takes in to account line breaks when
+** wrapping is turned on. If the caller knows that startPos is at a line start,
+** it can pass "startPosIsLineStart" as True to make the call more efficient
+** by avoiding the additional step of scanning back to the last newline.
+*/
+int Fl_Text_Display_mod::skip_lines(int startPos, int nLines,
+ bool startPosIsLineStart) {
+ int retLines, retPos, retLineStart, retLineEnd;
+
+ /* if we're not wrapping use more efficient BufCountForwardNLines */
+ if (!mContinuousWrap)
+ return buffer()->skip_lines(startPos, nLines);
+
+ /* wrappedLineCounter can't handle the 0 lines case */
+ if (nLines == 0)
+ return startPos;
+
+ /* use the common line counting routine to count forward */
+ wrapped_line_counter(buffer(), startPos, buffer()->length(),
+ nLines, startPosIsLineStart, 0, &retPos, &retLines, &retLineStart,
+ &retLineEnd);
+ return retPos;
+}
+
+/*
+** Same as BufEndOfLine, but takes in to account line breaks when wrapping
+** is turned on. If the caller knows that startPos is at a line start, it
+** can pass "startPosIsLineStart" as True to make the call more efficient
+** by avoiding the additional step of scanning back to the last newline.
+**
+** Note that the definition of the end of a line is less clear when continuous
+** wrap is on. With continuous wrap off, it's just a pointer to the newline
+** that ends the line. When it's on, it's the character beyond the last
+** DISPLAYABLE character on the line, where a whitespace character which has
+** been "converted" to a newline for wrapping is not considered displayable.
+** Also note that, a line can be wrapped at a non-whitespace character if the
+** line had no whitespace. In this case, this routine returns a pointer to
+** the start of the next line. This is also consistent with the model used by
+** visLineLength.
+*/
+int Fl_Text_Display_mod::line_end(int pos, bool startPosIsLineStart) {
+ int retLines, retPos, retLineStart, retLineEnd;
+
+ /* If we're not wrapping use more efficien BufEndOfLine */
+ if (!mContinuousWrap)
+ return buffer()->line_end(pos);
+
+ if (pos == buffer()->length())
+ return pos;
+ wrapped_line_counter(buffer(), pos, buffer()->length(), 1,
+ startPosIsLineStart, 0, &retPos, &retLines, &retLineStart,
+ &retLineEnd);
+ return retLineEnd;
+}
+
+/*
+** Same as BufStartOfLine, but returns the character after last wrap point
+** rather than the last newline.
+*/
+int Fl_Text_Display_mod::line_start(int pos) {
+ int retLines, retPos, retLineStart, retLineEnd;
+
+ /* If we're not wrapping, use the more efficient BufStartOfLine */
+ if (!mContinuousWrap)
+ return buffer()->line_start(pos);
+
+ wrapped_line_counter(buffer(), buffer()->line_start(pos), pos, INT_MAX, true, 0,
+ &retPos, &retLines, &retLineStart, &retLineEnd);
+ return retLineStart;
+}
+
+/*
+** Same as BufCountBackwardNLines, but takes in to account line breaks when
+** wrapping is turned on.
+*/
+int Fl_Text_Display_mod::rewind_lines(int startPos, int nLines) {
+ Fl_Text_Buffer_mod*buf = buffer();
+ int pos, lineStart, retLines, retPos, retLineStart, retLineEnd;
+
+ /* If we're not wrapping, use the more efficient BufCountBackwardNLines */
+ if (!mContinuousWrap)
+ return buf->rewind_lines(startPos, nLines);
+
+ pos = startPos;
+ for (;;) {
+ lineStart = buf->line_start(pos);
+ wrapped_line_counter(buf, lineStart, pos, INT_MAX,
+ true, 0, &retPos, &retLines, &retLineStart, &retLineEnd, false);
+ if (retLines > nLines)
+ return skip_lines(lineStart, retLines-nLines,
+ true);
+ nLines -= retLines;
+ pos = lineStart - 1;
+ if (pos < 0)
+ return 0;
+ nLines -= 1;
+ }
+}
+
+static inline int fl_isseparator(int c) {
+ return c != '$' && c != '_' && (isspace(c) || ispunct(c));
+}
+
+void Fl_Text_Display_mod::next_word() {
+ int pos = insert_position();
+ while (pos < buffer()->length() && !fl_isseparator(buffer()->character(pos))) {
+ pos++;
+ }
+ while (pos < buffer()->length() && fl_isseparator(buffer()->character(pos))) {
+ pos++;
+ }
+
+ insert_position( pos );
+}
+
+void Fl_Text_Display_mod::previous_word() {
+ int pos = insert_position();
+ if (pos==0) return;
+ pos--;
+ while (pos && fl_isseparator(buffer()->character(pos))) {
+ pos--;
+ }
+ while (pos && !fl_isseparator(buffer()->character(pos))) {
+ pos--;
+ }
+ if (fl_isseparator(buffer()->character(pos))) pos++;
+
+ insert_position( pos );
+}
+
+/*
+** Callback attached to the text buffer to receive delete information before
+** the modifications are actually made.
+*/
+void Fl_Text_Display_mod::buffer_predelete_cb(int pos, int nDeleted, void *cbArg) {
+ Fl_Text_Display_mod *textD = (Fl_Text_Display_mod *)cbArg;
+ if (textD->mContinuousWrap &&
+ (textD->mFixedFontWidth == -1 || textD->mModifyingTabDistance))
+ /* Note: we must perform this measurement, even if there is not a
+ single character deleted; the number of "deleted" lines is the
+ number of visual lines spanned by the real line in which the
+ modification takes place.
+ Also, a modification of the tab distance requires the same
+ kind of calculations in advance, even if the font width is "fixed",
+ because when the width of the tab characters changes, the layout
+ of the text may be completely different. */
+ textD->measure_deleted_lines(pos, nDeleted);
+ else
+ textD->mSuppressResync = 0; /* Probably not needed, but just in case */
+}
+
+/*
+** Callback attached to the text buffer to receive modification information
+*/
+void Fl_Text_Display_mod::buffer_modified_cb( int pos, int nInserted, int nDeleted,
+ int nRestyled, const char *deletedText, void *cbArg ) {
+ int linesInserted, linesDeleted, startDispPos, endDispPos;
+ Fl_Text_Display_mod *textD = ( Fl_Text_Display_mod * ) cbArg;
+ Fl_Text_Buffer_mod*buf = textD->mBuffer;
+ int oldFirstChar = textD->mFirstChar;
+ int scrolled, origCursorPos = textD->mCursorPos;
+ int wrapModStart, wrapModEnd;
+
+ /* buffer modification cancels vertical cursor motion column */
+ if ( nInserted != 0 || nDeleted != 0 )
+ textD->mCursorPreferredCol = -1;
+
+ /* Count the number of lines inserted and deleted, and in the case
+ of continuous wrap mode, how much has changed */
+ if (textD->mContinuousWrap) {
+ textD->find_wrap_range(deletedText, pos, nInserted, nDeleted,
+ &wrapModStart, &wrapModEnd, &linesInserted, &linesDeleted);
+ } else {
+ linesInserted = nInserted == 0 ? 0 :
+ buf->count_lines( pos, pos + nInserted );
+ linesDeleted = nDeleted == 0 ? 0 : countlines( deletedText );
+ }
+
+ /* Update the line starts and mTopLineNum */
+ if ( nInserted != 0 || nDeleted != 0 ) {
+ if (textD->mContinuousWrap) {
+ textD->update_line_starts( wrapModStart, wrapModEnd-wrapModStart,
+ nDeleted + pos-wrapModStart + (wrapModEnd-(pos+nInserted)),
+ linesInserted, linesDeleted, &scrolled );
+ } else {
+ textD->update_line_starts( pos, nInserted, nDeleted, linesInserted,
+ linesDeleted, &scrolled );
+ }
+ } else
+ scrolled = 0;
+
+ /* If we're counting non-wrapped lines as well, maintain the absolute
+ (non-wrapped) line number of the text displayed */
+ if (textD->maintaining_absolute_top_line_number() &&
+ (nInserted != 0 || nDeleted != 0)) {
+ if (pos + nDeleted < oldFirstChar)
+ textD->mAbsTopLineNum += buf->count_lines(pos, pos + nInserted) -
+ countlines(deletedText);
+ else if (pos < oldFirstChar)
+ textD->reset_absolute_top_line_number();
+ }
+
+ /* Update the line count for the whole buffer */
+ textD->mNBufferLines += linesInserted - linesDeleted;
+
+ /* Update the cursor position */
+ if ( textD->mCursorToHint != NO_HINT ) {
+ textD->mCursorPos = textD->mCursorToHint;
+ textD->mCursorToHint = NO_HINT;
+ } else if ( textD->mCursorPos > pos ) {
+ if ( textD->mCursorPos < pos + nDeleted )
+ textD->mCursorPos = pos;
+ else
+ textD->mCursorPos += nInserted - nDeleted;
+ }
+
+ // refigure scrollbars & stuff
+ textD->resize(textD->x(), textD->y(), textD->w(), textD->h());
+
+ // don't need to do anything else if not visible?
+ if (!textD->visible_r()) return;
+
+ /* If the changes caused scrolling, re-paint everything and we're done. */
+ if ( scrolled ) {
+ textD->damage(FL_DAMAGE_EXPOSE);
+ if ( textD->mStyleBuffer ) /* See comments in extendRangeForStyleMods */
+ textD->mStyleBuffer->primary_selection()->selected(0);
+ return;
+ }
+
+ /* If the changes didn't cause scrolling, decide the range of characters
+ that need to be re-painted. Also if the cursor position moved, be
+ sure that the redisplay range covers the old cursor position so the
+ old cursor gets erased, and erase the bits of the cursor which extend
+ beyond the left and right edges of the text. */
+ startDispPos = textD->mContinuousWrap ? wrapModStart : pos;
+ if ( origCursorPos == startDispPos && textD->mCursorPos != startDispPos )
+ startDispPos = min( startDispPos, origCursorPos - 1 );
+ if ( linesInserted == linesDeleted ) {
+ if ( nInserted == 0 && nDeleted == 0 )
+ endDispPos = pos + nRestyled;
+ else {
+ endDispPos = textD->mContinuousWrap ? wrapModEnd :
+ buf->line_end( pos + nInserted ) + 1;
+ // CET - FIXME if ( origCursorPos >= startDispPos &&
+ // ( origCursorPos <= endDispPos || endDispPos == buf->length() ) )
+ }
+
+ if (linesInserted > 1) textD->draw_line_numbers(false);
+ } else {
+ endDispPos = textD->mLastChar + 1;
+ // CET - FIXME if ( origCursorPos >= pos )
+ /* If more than one line is inserted/deleted, a line break may have
+ been inserted or removed in between, and the line numbers may
+ have changed. If only one line is altered, line numbers cannot
+ be affected (the insertion or removal of a line break always
+ results in at least two lines being redrawn). */
+ textD->draw_line_numbers(false);
+ }
+
+ /* If there is a style buffer, check if the modification caused additional
+ changes that need to be redisplayed. (Redisplaying separately would
+ cause double-redraw on almost every modification involving styled
+ text). Extend the redraw range to incorporate style changes */
+ if ( textD->mStyleBuffer )
+ textD->extend_range_for_styles( &startDispPos, &endDispPos );
+
+ /* Redisplay computed range */
+ textD->redisplay_range( startDispPos, endDispPos );
+}
+
+/*
+** In continuous wrap mode, internal line numbers are calculated after
+** wrapping. A separate non-wrapped line count is maintained when line
+** numbering is turned on. There is some performance cost to maintaining this
+** line count, so normally absolute line numbers are not tracked if line
+** numbering is off. This routine allows callers to specify that they still
+** want this line count maintained (for use via TextDPosToLineAndCol).
+** More specifically, this allows the line number reported in the statistics
+** line to be calibrated in absolute lines, rather than post-wrapped lines.
+*/
+void Fl_Text_Display_mod::maintain_absolute_top_line_number(int state) {
+ mNeedAbsTopLineNum = state;
+ reset_absolute_top_line_number();
+}
+
+/*
+** Returns the absolute (non-wrapped) line number of the first line displayed.
+** Returns 0 if the absolute top line number is not being maintained.
+*/
+int Fl_Text_Display_mod::get_absolute_top_line_number() {
+ if (!mContinuousWrap)
+ return mTopLineNum;
+ if (maintaining_absolute_top_line_number())
+ return mAbsTopLineNum;
+ return 0;
+}
+
+/*
+** Re-calculate absolute top line number for a change in scroll position.
+*/
+void Fl_Text_Display_mod::absolute_top_line_number(int oldFirstChar) {
+ if (maintaining_absolute_top_line_number()) {
+ if (mFirstChar < oldFirstChar)
+ mAbsTopLineNum -= buffer()->count_lines(mFirstChar, oldFirstChar);
+ else
+ mAbsTopLineNum += buffer()->count_lines(oldFirstChar, mFirstChar);
+ }
+}
+
+/*
+** Return true if a separate absolute top line number is being maintained
+** (for displaying line numbers or showing in the statistics line).
+*/
+int Fl_Text_Display_mod::maintaining_absolute_top_line_number() {
+ return mContinuousWrap &&
+ (mLineNumWidth != 0 || mNeedAbsTopLineNum);
+}
+
+/*
+** Count lines from the beginning of the buffer to reestablish the
+** absolute (non-wrapped) top line number. If mode is not continuous wrap,
+** or the number is not being maintained, does nothing.
+*/
+void Fl_Text_Display_mod::reset_absolute_top_line_number() {
+ mAbsTopLineNum = 1;
+ absolute_top_line_number(0);
+}
+
+/*
+** Find the line number of position "pos" relative to the first line of
+** displayed text. Returns 0 if the line is not displayed.
+*/
+//int Fl_Text_Display_mod::position_to_line( int pos, int *lineNum ) {
+int Fl_Text_Display_mod::position_to_line( size_t pos, int *lineNum ) {
+ int i;
+
+ *lineNum = 0;
+ if ( pos < (unsigned int)mFirstChar ) return 0;
+ if ( pos > (unsigned int)mLastChar ) {
+ if ( empty_vlines() ) {
+ if ( mLastChar < mBuffer->length() ) {
+ if ( !position_to_line( mLastChar, lineNum ) ) {
+#ifdef DEBUG
+ Fl::error("Fl_Text_Display_mod::position_to_line(): Consistency check ptvl failed");
+#endif
+ return 0;
+ }
+ return ++( *lineNum ) <= mNVisibleLines - 1;
+ } else {
+ position_to_line( mLastChar - 1, lineNum );
+ return 1;
+ }
+ }
+ return 0;
+ }
+
+ for ( i = mNVisibleLines - 1; i >= 0; i-- ) {
+ if ( mLineStarts[ i ] != -1 && pos >= (unsigned int)mLineStarts[ i ] ) {
+ *lineNum = i;
+ return 1;
+ }
+ }
+ return 0; /* probably never be reached */
+}
+
+/*
+** Draw the text on a single line represented by "visLineNum" (the
+** number of lines down from the top of the display), limited by
+** "leftClip" and "rightClip" window coordinates and "leftCharIndex" and
+** "rightCharIndex" character positions (not including the character at
+** position "rightCharIndex").
+*/
+void Fl_Text_Display_mod::draw_vline(int visLineNum, int leftClip, int rightClip,
+ int leftCharIndex, int rightCharIndex) {
+ Fl_Text_Buffer_mod* buf = mBuffer;
+ int i, X, Y, startX, charIndex, lineStartPos, lineLen, fontHeight;
+ int stdCharWidth, charWidth, startIndex, charStyle, style;
+ int charLen, outStartIndex, outIndex;
+ int dispIndexOffset;
+ char expandedChar[ FL_TEXT_MAX_EXP_CHAR_LEN ], outStr[ MAX_DISP_LINE_LEN ];
+ char *outPtr;
+ const char *lineStr;
+
+// printf("draw_vline(visLineNum=%d, leftClip=%d, rightClip=%d, leftCharIndex=%d, rightCharIndex=%d)\n",
+// visLineNum, leftClip, rightClip, leftCharIndex, rightCharIndex);
+// printf("nNVisibleLines=%d\n", mNVisibleLines);
+
+ /* If line is not displayed, skip it */
+ if ( visLineNum < 0 || visLineNum >= mNVisibleLines )
+ return;
+
+ /* Calculate Y coordinate of the string to draw */
+ fontHeight = mMaxsize;
+ Y = text_area.y + visLineNum * fontHeight;
+
+ /* Get the text, length, and buffer position of the line to display */
+ lineStartPos = mLineStarts[ visLineNum ];
+// printf("lineStartPos=%d\n", lineStartPos);
+ if ( lineStartPos == -1 ) {
+ lineLen = 0;
+ lineStr = NULL;
+ } else {
+ lineLen = vline_length( visLineNum );
+ lineStr = buf->text_range( lineStartPos, lineStartPos + lineLen );
+ }
+
+ /* Space beyond the end of the line is still counted in units of characters
+ of a standardized character width (this is done mostly because style
+ changes based on character position can still occur in this region due
+ to rectangular Fl_Text_Selections). stdCharWidth must be non-zero to
+ prevent a potential infinite loop if X does not advance */
+ stdCharWidth = TMPFONTWIDTH; //mFontStruct->max_bounds.width;
+ if ( stdCharWidth <= 0 ) {
+ Fl::error("Fl_Text_Display_mod::draw_vline(): bad font measurement");
+ free((void *)lineStr);
+ return;
+ }
+
+ /* Shrink the clipping range to the active display area */
+ leftClip = max( text_area.x, leftClip );
+ rightClip = min( rightClip, text_area.x + text_area.w );
+
+ /* Rectangular Fl_Text_Selections are based on "real" line starts (after
+ a newline or start of buffer). Calculate the difference between the
+ last newline position and the line start we're using. Since scanning
+ back to find a newline is expensive, only do so if there's actually a
+ rectangular Fl_Text_Selection which needs it */
+ if (mContinuousWrap && (range_touches_selection(buf->primary_selection(),
+ lineStartPos, lineStartPos + lineLen) || range_touches_selection(
+ buf->secondary_selection(), lineStartPos, lineStartPos + lineLen) ||
+ range_touches_selection(buf->highlight_selection(), lineStartPos,
+ lineStartPos + lineLen))) {
+ dispIndexOffset = buf->count_displayed_characters(
+ buf->line_start(lineStartPos), lineStartPos);
+ } else
+ dispIndexOffset = 0;
+
+ /* Step through character positions from the beginning of the line (even if
+ that's off the left edge of the displayed area) to find the first
+ character position that's not clipped, and the X coordinate for drawing
+ that character */
+ X = text_area.x - mHorizOffset;
+ outIndex = 0;
+ for ( charIndex = 0; ; charIndex++ ) {
+ charLen = charIndex >= lineLen ? 1 :
+ Fl_Text_Buffer_mod::expand_character( lineStr[ charIndex ], outIndex,
+ expandedChar, buf->tab_distance(), buf->null_substitution_character() );
+ style = position_style( lineStartPos, lineLen, charIndex,
+ outIndex + dispIndexOffset );
+ charWidth = charIndex >= lineLen ? stdCharWidth :
+ string_width( expandedChar, charLen, style );
+ if ( X + charWidth >= leftClip && charIndex >= leftCharIndex ) {
+ startIndex = charIndex;
+ outStartIndex = outIndex;
+ startX = X;
+ break;
+ }
+ X += charWidth;
+ outIndex += charLen;
+ }
+
+ /* Scan character positions from the beginning of the clipping range, and
+ draw parts whenever the style changes (also note if the cursor is on
+ this line, and where it should be drawn to take advantage of the x
+ position which we've gone to so much trouble to calculate) */
+ /* since characters between style may overlap, we draw the full
+ background first */
+ int sX = startX;
+ outPtr = outStr;
+ outIndex = outStartIndex;
+ X = startX;
+ for ( charIndex = startIndex; charIndex < rightCharIndex; charIndex++ ) {
+ charLen = charIndex >= lineLen ? 1 :
+ Fl_Text_Buffer_mod::expand_character( lineStr[ charIndex ], outIndex, expandedChar,
+ buf->tab_distance(), buf->null_substitution_character() );
+ charStyle = position_style( lineStartPos, lineLen, charIndex,
+ outIndex + dispIndexOffset );
+ for ( i = 0; i < charLen; i++ ) {
+ if ( i != 0 && charIndex < lineLen && lineStr[ charIndex ] == '\t' )
+ charStyle = position_style( lineStartPos, lineLen,
+ charIndex, outIndex + dispIndexOffset );
+ if ( charStyle != style ) {
+ draw_string( style|BG_ONLY_MASK, sX, Y, X, outStr, outPtr - outStr );
+ outPtr = outStr;
+ sX = X;
+ style = charStyle;
+ }
+ if ( charIndex < lineLen ) {
+ *outPtr = expandedChar[ i ];
+ charWidth = string_width( &expandedChar[ i ], 1, charStyle );
+ } else
+ charWidth = stdCharWidth;
+ outPtr++;
+ X += charWidth;
+ outIndex++;
+ }
+ if ( outPtr - outStr + FL_TEXT_MAX_EXP_CHAR_LEN >= MAX_DISP_LINE_LEN || X >= rightClip )
+ break;
+ }
+ draw_string( style|BG_ONLY_MASK, sX, Y, X, outStr, outPtr - outStr );
+
+ /* now draw the text over the previously erased background */
+ outPtr = outStr;
+ outIndex = outStartIndex;
+ X = startX;
+ for ( charIndex = startIndex; charIndex < rightCharIndex; charIndex++ ) {
+ charLen = charIndex >= lineLen ? 1 :
+ Fl_Text_Buffer_mod::expand_character( lineStr[ charIndex ], outIndex, expandedChar,
+ buf->tab_distance(), buf->null_substitution_character() );
+ charStyle = position_style( lineStartPos, lineLen, charIndex,
+ outIndex + dispIndexOffset );
+ for ( i = 0; i < charLen; i++ ) {
+ if ( i != 0 && charIndex < lineLen && lineStr[ charIndex ] == '\t' )
+ charStyle = position_style( lineStartPos, lineLen,
+ charIndex, outIndex + dispIndexOffset );
+ if ( charStyle != style ) {
+ draw_string( style|TEXT_ONLY_MASK, startX, Y, X, outStr, outPtr - outStr );
+ outPtr = outStr;
+ startX = X;
+ style = charStyle;
+ }
+ if ( charIndex < lineLen ) {
+ *outPtr = expandedChar[ i ];
+ charWidth = string_width( &expandedChar[ i ], 1, charStyle );
+ } else
+ charWidth = stdCharWidth;
+ outPtr++;
+ X += charWidth;
+ outIndex++;
+ }
+ if ( outPtr - outStr + FL_TEXT_MAX_EXP_CHAR_LEN >= MAX_DISP_LINE_LEN || X >= rightClip )
+ break;
+ }
+
+ /* Draw the remaining style segment */
+ draw_string( style|TEXT_ONLY_MASK, startX, Y, X, outStr, outPtr - outStr );
+
+ /* Draw the cursor if part of it appeared on the redisplayed part of
+ this line. Also check for the cases which are not caught as the
+ line is scanned above: when the cursor appears at the very end
+ of the redisplayed section. */
+ /* CET - FIXME
+ if ( mCursorOn )
+ {
+ if ( hasCursor )
+ draw_cursor( cursorX, Y );
+ else if ( charIndex < lineLen && ( lineStartPos + charIndex + 1 == cursorPos )
+ && X == rightClip )
+ {
+ if ( cursorPos >= buf->length() )
+ draw_cursor( X - 1, Y );
+ else
+ {
+ draw_cursor( X - 1, Y );
+ }
+ }
+ }
+ */
+ if ( lineStr != NULL )
+ free((void *)lineStr);
+}
+
+/*
+** Draw a string or blank area according to parameter "style", using the
+** appropriate colors and drawing method for that style, with top left
+** corner at X, y. If style says to draw text, use "string" as source of
+** characters, and draw "nChars", if style is FILL, erase
+** rectangle where text would have drawn from X to toX and from Y to
+** the maximum Y extent of the current font(s).
+*/
+void Fl_Text_Display_mod::draw_string( int style, int X, int Y, int toX,
+ const char *string, int nChars ) {
+ const Style_Table_Entry * styleRec;
+
+ /* Draw blank area rather than text, if that was the request */
+ if ( style & FILL_MASK ) {
+ if (style & TEXT_ONLY_MASK) return;
+ clear_rect( style, X, Y, toX - X, mMaxsize );
+ return;
+ }
+
+ /* Set font, color, and gc depending on style. For normal text, GCs
+ for normal drawing, or drawing within a Fl_Text_Selection or highlight are
+ pre-allocated and pre-configured. For syntax highlighting, GCs are
+ configured here, on the fly. */
+
+ Fl_Font font = textfont();
+ int fsize = textsize();
+ Fl_Color foreground;
+ Fl_Color background;
+
+ if ( style & STYLE_LOOKUP_MASK ) {
+ int si = (style & STYLE_LOOKUP_MASK) - 'A';
+ if (si < 0) si = 0;
+ else if (si >= mNStyles) si = mNStyles - 1;
+
+ styleRec = mStyleTable + si;
+ font = styleRec->font;
+ fsize = styleRec->size;
+
+ if (style & (HIGHLIGHT_MASK | PRIMARY_MASK)) {
+ if (Fl::focus() == this) background = selection_color();
+ else background = fl_color_average(color(), selection_color(), 0.8f);
+ } else
+ background = color();
+ foreground = fl_contrast(styleRec->color, background);
+ } else if (style & (HIGHLIGHT_MASK | PRIMARY_MASK)) {
+ if (Fl::focus() == this) background = selection_color();
+ else background = fl_color_average(color(), selection_color(), 0.5f);
+ foreground = fl_contrast(textcolor(), background);
+ } else {
+ foreground = textcolor();
+ background = color();
+ }
+
+ if (!(style & TEXT_ONLY_MASK)) {
+ fl_color( background );
+ fl_rectf( X, Y, toX - X, mMaxsize );
+ }
+ if (!(style & BG_ONLY_MASK)) {
+ fl_color( foreground );
+ fl_font( font, fsize );
+ fl_draw( string, nChars, X, Y + mMaxsize - fl_descent());
+ }
+
+ // CET - FIXME
+ /* If any space around the character remains unfilled (due to use of
+ different sized fonts for highlighting), fill in above or below
+ to erase previously drawn characters */
+ /*
+ if (fs->ascent < mAscent)
+ clear_rect( style, X, Y, toX - X, mAscent - fs->ascent);
+ if (fs->descent < mDescent)
+ clear_rect( style, X, Y + mAscent + fs->descent, toX - x,
+ mDescent - fs->descent);
+ */
+ /* Underline if style is secondary Fl_Text_Selection */
+
+ /*
+ if (style & SECONDARY_MASK)
+ XDrawLine(XtDisplay(mW), XtWindow(mW), gc, x,
+ y + mAscent, toX - 1, Y + fs->ascent);
+ */
+}
+
+/*
+** Clear a rectangle with the appropriate background color for "style"
+*/
+void Fl_Text_Display_mod::clear_rect( int style, int X, int Y,
+ int width, int height ) {
+ /* A width of zero means "clear to end of window" to XClearArea */
+ if ( width == 0 )
+ return;
+
+ if ( Fl::focus() != this ) {
+ if (style & (HIGHLIGHT_MASK | PRIMARY_MASK)) {
+ fl_color(fl_color_average(color(), selection_color(), 0.5f));
+ } else {
+ fl_color( color() );
+ }
+ fl_rectf( X, Y, width, height );
+ } else if ( style & HIGHLIGHT_MASK ) {
+ fl_color( fl_contrast(textcolor(), color()) );
+ fl_rectf( X, Y, width, height );
+ } else if ( style & PRIMARY_MASK ) {
+ fl_color( selection_color() );
+ fl_rectf( X, Y, width, height );
+ } else {
+ fl_color( color() );
+ fl_rectf( X, Y, width, height );
+ }
+}
+
+
+
+/*
+** Draw a cursor with top center at X, y.
+*/
+void Fl_Text_Display_mod::draw_cursor( int X, int Y ) {
+ typedef struct {
+ int x1, y1, x2, y2;
+ }
+ Segment;
+
+ Segment segs[ 5 ];
+ int left, right, cursorWidth, midY;
+ // int fontWidth = mFontStruct->min_bounds.width, nSegs = 0;
+ int fontWidth = TMPFONTWIDTH; // CET - FIXME
+ int nSegs = 0;
+ int fontHeight = mMaxsize;
+ int bot = Y + fontHeight - 1;
+
+ if ( X < text_area.x - 1 || X > text_area.x + text_area.w )
+ return;
+
+ /* For cursors other than the block, make them around 2/3 of a character
+ width, rounded to an even number of pixels so that X will draw an
+ odd number centered on the stem at x. */
+ cursorWidth = 4; //(fontWidth/3) * 2;
+ left = X - cursorWidth / 2;
+ right = left + cursorWidth;
+
+ /* Create segments and draw cursor */
+ if ( mCursorStyle == CARET_CURSOR ) {
+ midY = bot - fontHeight / 5;
+ segs[ 0 ].x1 = left; segs[ 0 ].y1 = bot; segs[ 0 ].x2 = X; segs[ 0 ].y2 = midY;
+ segs[ 1 ].x1 = X; segs[ 1 ].y1 = midY; segs[ 1 ].x2 = right; segs[ 1 ].y2 = bot;
+ segs[ 2 ].x1 = left; segs[ 2 ].y1 = bot; segs[ 2 ].x2 = X; segs[ 2 ].y2 = midY - 1;
+ segs[ 3 ].x1 = X; segs[ 3 ].y1 = midY - 1; segs[ 3 ].x2 = right; segs[ 3 ].y2 = bot;
+ nSegs = 4;
+ } else if ( mCursorStyle == NORMAL_CURSOR ) {
+ segs[ 0 ].x1 = left; segs[ 0 ].y1 = Y; segs[ 0 ].x2 = right; segs[ 0 ].y2 = Y;
+ segs[ 1 ].x1 = X; segs[ 1 ].y1 = Y; segs[ 1 ].x2 = X; segs[ 1 ].y2 = bot;
+ segs[ 2 ].x1 = left; segs[ 2 ].y1 = bot; segs[ 2 ].x2 = right; segs[ 2 ].y2 = bot;
+ nSegs = 3;
+ } else if ( mCursorStyle == HEAVY_CURSOR ) {
+ segs[ 0 ].x1 = X - 1; segs[ 0 ].y1 = Y; segs[ 0 ].x2 = X - 1; segs[ 0 ].y2 = bot;
+ segs[ 1 ].x1 = X; segs[ 1 ].y1 = Y; segs[ 1 ].x2 = X; segs[ 1 ].y2 = bot;
+ segs[ 2 ].x1 = X + 1; segs[ 2 ].y1 = Y; segs[ 2 ].x2 = X + 1; segs[ 2 ].y2 = bot;
+ segs[ 3 ].x1 = left; segs[ 3 ].y1 = Y; segs[ 3 ].x2 = right; segs[ 3 ].y2 = Y;
+ segs[ 4 ].x1 = left; segs[ 4 ].y1 = bot; segs[ 4 ].x2 = right; segs[ 4 ].y2 = bot;
+ nSegs = 5;
+ } else if ( mCursorStyle == DIM_CURSOR ) {
+ midY = Y + fontHeight / 2;
+ segs[ 0 ].x1 = X; segs[ 0 ].y1 = Y; segs[ 0 ].x2 = X; segs[ 0 ].y2 = Y;
+ segs[ 1 ].x1 = X; segs[ 1 ].y1 = midY; segs[ 1 ].x2 = X; segs[ 1 ].y2 = midY;
+ segs[ 2 ].x1 = X; segs[ 2 ].y1 = bot; segs[ 2 ].x2 = X; segs[ 2 ].y2 = bot;
+ nSegs = 3;
+ } else if ( mCursorStyle == BLOCK_CURSOR ) {
+ right = X + fontWidth;
+ segs[ 0 ].x1 = X; segs[ 0 ].y1 = Y; segs[ 0 ].x2 = right; segs[ 0 ].y2 = Y;
+ segs[ 1 ].x1 = right; segs[ 1 ].y1 = Y; segs[ 1 ].x2 = right; segs[ 1 ].y2 = bot;
+ segs[ 2 ].x1 = right; segs[ 2 ].y1 = bot; segs[ 2 ].x2 = X; segs[ 2 ].y2 = bot;
+ segs[ 3 ].x1 = X; segs[ 3 ].y1 = bot; segs[ 3 ].x2 = X; segs[ 3 ].y2 = Y;
+ nSegs = 4;
+ }
+ fl_color( mCursor_color );
+
+ for ( int k = 0; k < nSegs; k++ ) {
+ fl_line( segs[ k ].x1, segs[ k ].y1, segs[ k ].x2, segs[ k ].y2 );
+ }
+}
+
+/*
+** Determine the drawing method to use to draw a specific character from "buf".
+** "lineStartPos" gives the character index where the line begins, "lineIndex",
+** the number of characters past the beginning of the line, and "dispIndex",
+** the number of displayed characters past the beginning of the line. Passing
+** lineStartPos of -1 returns the drawing style for "no text".
+**
+** Why not just: position_style(pos)? Because style applies to blank areas
+** of the window beyond the text boundaries, and because this routine must also
+** decide whether a position is inside of a rectangular Fl_Text_Selection, and do
+** so efficiently, without re-counting character positions from the start of the
+** line.
+**
+** Note that style is a somewhat incorrect name, drawing method would
+** be more appropriate.
+*/
+int Fl_Text_Display_mod::position_style( int lineStartPos,
+ int lineLen, int lineIndex, int dispIndex ) {
+ Fl_Text_Buffer_mod* buf = mBuffer;
+ Fl_Text_Buffer_mod*styleBuf = mStyleBuffer;
+ int pos, style = 0;
+
+ if ( lineStartPos == -1 || buf == NULL )
+ return FILL_MASK;
+
+ pos = lineStartPos + min( lineIndex, lineLen );
+
+ if ( lineIndex >= lineLen )
+ style = FILL_MASK;
+ else if ( styleBuf != NULL ) {
+ style = ( unsigned char ) styleBuf->character( pos );
+ if (style == mUnfinishedStyle && mUnfinishedHighlightCB) {
+ /* encountered "unfinished" style, trigger parsing */
+ (mUnfinishedHighlightCB)( pos, mHighlightCBArg);
+ style = (unsigned char) styleBuf->character( pos);
+ }
+ }
+ if (buf->primary_selection()->includes(pos, lineStartPos, dispIndex))
+ style |= PRIMARY_MASK;
+ if (buf->highlight_selection()->includes(pos, lineStartPos, dispIndex))
+ style |= HIGHLIGHT_MASK;
+ if (buf->secondary_selection()->includes(pos, lineStartPos, dispIndex))
+ style |= SECONDARY_MASK;
+ return style;
+}
+
+/*
+** Find the width of a string in the font of a particular style
+*/
+int Fl_Text_Display_mod::string_width( const char *string, int length, int style ) {
+ Fl_Font font;
+ int fsize;
+
+ if ( style & STYLE_LOOKUP_MASK ) {
+ int si = (style & STYLE_LOOKUP_MASK) - 'A';
+ if (si < 0) si = 0;
+ else if (si >= mNStyles) si = mNStyles - 1;
+
+ font = mStyleTable[si].font;
+ fsize = mStyleTable[si].size;
+ } else {
+ font = textfont();
+ fsize = textsize();
+ }
+ fl_font( font, fsize );
+
+ return ( int ) ( fl_width( string, length ) );
+}
+
+/*
+** Translate window coordinates to the nearest (insert cursor or character
+** cell) text position. The parameter posType specifies how to interpret the
+** position: CURSOR_POS means translate the coordinates to the nearest cursor
+** position, and CHARACTER_POS means return the position of the character
+** closest to (X, Y).
+*/
+int Fl_Text_Display_mod::xy_to_position( int X, int Y, int posType ) {
+ int charIndex, lineStart, lineLen, fontHeight;
+ int charWidth, charLen, charStyle, visLineNum, xStep, outIndex;
+ char expandedChar[ FL_TEXT_MAX_EXP_CHAR_LEN ];
+ const char *lineStr;
+
+ /* Find the visible line number corresponding to the Y coordinate */
+ fontHeight = mMaxsize;
+ visLineNum = ( Y - text_area.y ) / fontHeight;
+ if ( visLineNum < 0 )
+ return mFirstChar;
+ if ( visLineNum >= mNVisibleLines )
+ visLineNum = mNVisibleLines - 1;
+
+ /* Find the position at the start of the line */
+ lineStart = mLineStarts[ visLineNum ];
+
+ /* If the line start was empty, return the last position in the buffer */
+ if ( lineStart == -1 )
+ return mBuffer->length();
+
+ /* Get the line text and its length */
+ lineLen = vline_length( visLineNum );
+ lineStr = mBuffer->text_range( lineStart, lineStart + lineLen );
+
+ /* Step through character positions from the beginning of the line
+ to find the character position corresponding to the X coordinate */
+ xStep = text_area.x - mHorizOffset;
+ outIndex = 0;
+ for ( charIndex = 0; charIndex < lineLen; charIndex++ ) {
+ charLen = Fl_Text_Buffer_mod::expand_character( lineStr[ charIndex ], outIndex, expandedChar,
+ mBuffer->tab_distance(), mBuffer->null_substitution_character() );
+ charStyle = position_style( lineStart, lineLen, charIndex, outIndex );
+ charWidth = string_width( expandedChar, charLen, charStyle );
+ if ( X < xStep + ( posType == CURSOR_POS ? charWidth / 2 : charWidth ) ) {
+ free((char *)lineStr);
+ return lineStart + charIndex;
+ }
+ xStep += charWidth;
+ outIndex += charLen;
+ }
+
+ /* If the X position was beyond the end of the line, return the position
+ of the newline at the end of the line */
+ free((char *)lineStr);
+ return lineStart + lineLen;
+}
+
+/*
+** Translate window coordinates to the nearest row and column number for
+** positioning the cursor. This, of course, makes no sense when the font is
+** proportional, since there are no absolute columns. The parameter posType
+** specifies how to interpret the position: CURSOR_POS means translate the
+** coordinates to the nearest position between characters, and CHARACTER_POS
+** means translate the position to the nearest character cell.
+*/
+void Fl_Text_Display_mod::xy_to_rowcol( int X, int Y, int *row,
+ int *column, int posType ) {
+ int fontHeight = mMaxsize;
+ int fontWidth = TMPFONTWIDTH; //mFontStruct->max_bounds.width;
+
+ /* Find the visible line number corresponding to the Y coordinate */
+ *row = ( Y - text_area.y ) / fontHeight;
+ if ( *row < 0 ) * row = 0;
+ if ( *row >= mNVisibleLines ) * row = mNVisibleLines - 1;
+ *column = ( ( X - text_area.x ) + mHorizOffset +
+ ( posType == CURSOR_POS ? fontWidth / 2 : 0 ) ) / fontWidth;
+ if ( *column < 0 ) * column = 0;
+}
+
+/*
+** Offset the line starts array, mTopLineNum, mFirstChar and lastChar, for a new
+** vertical scroll position given by newTopLineNum. If any currently displayed
+** lines will still be visible, salvage the line starts values, otherwise,
+** count lines from the nearest known line start (start or end of buffer, or
+** the closest value in the mLineStarts array)
+*/
+void Fl_Text_Display_mod::offset_line_starts( int newTopLineNum ) {
+ int oldTopLineNum = mTopLineNum;
+ int oldFirstChar = mFirstChar;
+ int lineDelta = newTopLineNum - oldTopLineNum;
+ int nVisLines = mNVisibleLines;
+ int *lineStarts = mLineStarts;
+ int i, lastLineNum;
+ Fl_Text_Buffer_mod*buf = mBuffer;
+
+ /* If there was no offset, nothing needs to be changed */
+ if ( lineDelta == 0 )
+ return;
+
+ /* Find the new value for mFirstChar by counting lines from the nearest
+ known line start (start or end of buffer, or the closest value in the
+ lineStarts array) */
+ lastLineNum = oldTopLineNum + nVisLines - 1;
+ if ( newTopLineNum < oldTopLineNum && newTopLineNum < -lineDelta ) {
+ mFirstChar = skip_lines( 0, newTopLineNum - 1, true );
+ } else if ( newTopLineNum < oldTopLineNum ) {
+ mFirstChar = rewind_lines( mFirstChar, -lineDelta );
+ } else if ( newTopLineNum < lastLineNum ) {
+ mFirstChar = lineStarts[ newTopLineNum - oldTopLineNum ];
+ } else if ( newTopLineNum - lastLineNum < mNBufferLines - newTopLineNum ) {
+ mFirstChar = skip_lines( lineStarts[ nVisLines - 1 ],
+ newTopLineNum - lastLineNum, true );
+ } else {
+ mFirstChar = rewind_lines( buf->length(), mNBufferLines - newTopLineNum + 1 );
+ }
+
+ /* Fill in the line starts array */
+ if ( lineDelta < 0 && -lineDelta < nVisLines ) {
+ for ( i = nVisLines - 1; i >= -lineDelta; i-- )
+ lineStarts[ i ] = lineStarts[ i + lineDelta ];
+ calc_line_starts( 0, -lineDelta );
+ } else if ( lineDelta > 0 && lineDelta < nVisLines ) {
+ for ( i = 0; i < nVisLines - lineDelta; i++ )
+ lineStarts[ i ] = lineStarts[ i + lineDelta ];
+ calc_line_starts( nVisLines - lineDelta, nVisLines - 1 );
+ } else
+ calc_line_starts( 0, nVisLines );
+
+ /* Set lastChar and mTopLineNum */
+ calc_last_char();
+ mTopLineNum = newTopLineNum;
+
+ /* If we're numbering lines or being asked to maintain an absolute line
+ number, re-calculate the absolute line number */
+ absolute_top_line_number(oldFirstChar);
+}
+
+/*
+** Update the line starts array, mTopLineNum, mFirstChar and lastChar for text
+** display "textD" after a modification to the text buffer, given by the
+** position where the change began "pos", and the nmubers of characters
+** and lines inserted and deleted.
+*/
+void Fl_Text_Display_mod::update_line_starts( int pos, int charsInserted,
+ int charsDeleted, int linesInserted, int linesDeleted, int *scrolled ) {
+ int * lineStarts = mLineStarts;
+ int i, lineOfPos, lineOfEnd, nVisLines = mNVisibleLines;
+ int charDelta = charsInserted - charsDeleted;
+ int lineDelta = linesInserted - linesDeleted;
+
+ /* If all of the changes were before the displayed text, the display
+ doesn't change, just update the top line num and offset the line
+ start entries and first and last characters */
+ if ( pos + charsDeleted < mFirstChar ) {
+ mTopLineNum += lineDelta;
+ for ( i = 0; i < nVisLines && lineStarts[i] != -1; i++ )
+ lineStarts[ i ] += charDelta;
+ mFirstChar += charDelta;
+ mLastChar += charDelta;
+ *scrolled = 0;
+ return;
+ }
+
+ /* The change began before the beginning of the displayed text, but
+ part or all of the displayed text was deleted */
+ if ( pos < mFirstChar ) {
+ /* If some text remains in the window, anchor on that */
+ if ( position_to_line( pos + charsDeleted, &lineOfEnd ) &&
+ ++lineOfEnd < nVisLines && lineStarts[ lineOfEnd ] != -1 ) {
+ mTopLineNum = max( 1, mTopLineNum + lineDelta );
+ mFirstChar = rewind_lines(
+ lineStarts[ lineOfEnd ] + charDelta, lineOfEnd );
+ /* Otherwise anchor on original line number and recount everything */
+ } else {
+ if ( mTopLineNum > mNBufferLines + lineDelta ) {
+ mTopLineNum = 1;
+ mFirstChar = 0;
+ } else
+ mFirstChar = skip_lines( 0, mTopLineNum - 1, true );
+ }
+ calc_line_starts( 0, nVisLines - 1 );
+ /* calculate lastChar by finding the end of the last displayed line */
+ calc_last_char();
+ *scrolled = 1;
+ return;
+ }
+
+ /* If the change was in the middle of the displayed text (it usually is),
+ salvage as much of the line starts array as possible by moving and
+ offsetting the entries after the changed area, and re-counting the
+ added lines or the lines beyond the salvaged part of the line starts
+ array */
+ if ( pos <= mLastChar ) {
+ /* find line on which the change began */
+ position_to_line( pos, &lineOfPos );
+ /* salvage line starts after the changed area */
+ if ( lineDelta == 0 ) {
+ for ( i = lineOfPos + 1; i < nVisLines && lineStarts[ i ] != -1; i++ )
+ lineStarts[ i ] += charDelta;
+ } else if ( lineDelta > 0 ) {
+ for ( i = nVisLines - 1; i >= lineOfPos + lineDelta + 1; i-- )
+ lineStarts[ i ] = lineStarts[ i - lineDelta ] +
+ ( lineStarts[ i - lineDelta ] == -1 ? 0 : charDelta );
+ } else /* (lineDelta < 0) */ {
+ for ( i = max( 0, lineOfPos + 1 ); i < nVisLines + lineDelta; i++ )
+ lineStarts[ i ] = lineStarts[ i - lineDelta ] +
+ ( lineStarts[ i - lineDelta ] == -1 ? 0 : charDelta );
+ }
+ /* fill in the missing line starts */
+ if ( linesInserted >= 0 )
+ calc_line_starts( lineOfPos + 1, lineOfPos + linesInserted );
+ if ( lineDelta < 0 )
+ calc_line_starts( nVisLines + lineDelta, nVisLines );
+ /* calculate lastChar by finding the end of the last displayed line */
+ calc_last_char();
+ *scrolled = 0;
+ return;
+ }
+
+ /* Change was past the end of the displayed text, but displayable by virtue
+ of being an insert at the end of the buffer into visible blank lines */
+ if ( empty_vlines() ) {
+ position_to_line( pos, &lineOfPos );
+ calc_line_starts( lineOfPos, lineOfPos + linesInserted );
+ calc_last_char();
+ *scrolled = 0;
+ return;
+ }
+
+ /* Change was beyond the end of the buffer and not visible, do nothing */
+ *scrolled = 0;
+}
+
+/*
+** Scan through the text in the "textD"'s buffer and recalculate the line
+** starts array values beginning at index "startLine" and continuing through
+** (including) "endLine". It assumes that the line starts entry preceding
+** "startLine" (or mFirstChar if startLine is 0) is good, and re-counts
+** newlines to fill in the requested entries. Out of range values for
+** "startLine" and "endLine" are acceptable.
+*/
+void Fl_Text_Display_mod::calc_line_starts( int startLine, int endLine ) {
+ int startPos, bufLen = mBuffer->length();
+ int line, lineEnd, nextLineStart, nVis = mNVisibleLines;
+ int *lineStarts = mLineStarts;
+
+ /* Clean up (possibly) messy input parameters */
+ if ( endLine < 0 ) endLine = 0;
+ if ( endLine >= nVis ) endLine = nVis - 1;
+ if ( startLine < 0 ) startLine = 0;
+ if ( startLine >= nVis ) startLine = nVis - 1;
+ if ( startLine > endLine )
+ return;
+
+ /* Find the last known good line number -> position mapping */
+ if ( startLine == 0 ) {
+ lineStarts[ 0 ] = mFirstChar;
+ startLine = 1;
+ }
+ startPos = lineStarts[ startLine - 1 ];
+
+ /* If the starting position is already past the end of the text,
+ fill in -1's (means no text on line) and return */
+ if ( startPos == -1 ) {
+ for ( line = startLine; line <= endLine; line++ )
+ lineStarts[ line ] = -1;
+ return;
+ }
+
+ /* Loop searching for ends of lines and storing the positions of the
+ start of the next line in lineStarts */
+ for ( line = startLine; line <= endLine; line++ ) {
+ find_line_end(startPos, true, &lineEnd, &nextLineStart);
+ startPos = nextLineStart;
+ if ( startPos >= bufLen ) {
+ /* If the buffer ends with a newline or line break, put
+ buf->length() in the next line start position (instead of
+ a -1 which is the normal marker for an empty line) to
+ indicate that the cursor may safely be displayed there */
+ if ( line == 0 || ( lineStarts[ line - 1 ] != bufLen &&
+ lineEnd != nextLineStart ) ) {
+ lineStarts[ line ] = bufLen;
+ line++;
+ }
+ break;
+ }
+ lineStarts[ line ] = startPos;
+ }
+
+ /* Set any entries beyond the end of the text to -1 */
+ for ( ; line <= endLine; line++ )
+ lineStarts[ line ] = -1;
+}
+
+/*
+** Given a Fl_Text_Display with a complete, up-to-date lineStarts array, update
+** the lastChar entry to point to the last buffer position displayed.
+*/
+void Fl_Text_Display_mod::calc_last_char() {
+ int i;
+ for (i = mNVisibleLines - 1; i >= 0 && mLineStarts[i] == -1; i--) ;
+ mLastChar = i < 0 ? 0 : line_end(mLineStarts[i], true);
+}
+
+void Fl_Text_Display_mod::scroll(int topLineNum, int horizOffset) {
+ mTopLineNumHint = topLineNum;
+ mHorizOffsetHint = horizOffset;
+ resize(x(), y(), w(), h());
+}
+
+void Fl_Text_Display_mod::scroll_(int topLineNum, int horizOffset) {
+ /* Limit the requested scroll position to allowable values */
+ if (topLineNum > mNBufferLines + 3 - mNVisibleLines)
+ topLineNum = mNBufferLines + 3 - mNVisibleLines;
+ if (topLineNum < 1) topLineNum = 1;
+
+ if (horizOffset > longest_vline() - text_area.w)
+ horizOffset = longest_vline() - text_area.w;
+ if (horizOffset < 0) horizOffset = 0;
+
+ /* Do nothing if scroll position hasn't actually changed or there's no
+ window to draw in yet */
+ if (mHorizOffset == horizOffset && mTopLineNum == topLineNum)
+ return;
+
+ /* If the vertical scroll position has changed, update the line
+ starts array and related counters in the text display */
+ offset_line_starts(topLineNum);
+
+ /* Just setting mHorizOffset is enough information for redisplay */
+ mHorizOffset = horizOffset;
+
+ // redraw all text
+ damage(FL_DAMAGE_EXPOSE);
+}
+
+/*
+** Update the minimum, maximum, slider size, page increment, and value
+** for vertical scroll bar.
+*/
+void Fl_Text_Display_mod::update_v_scrollbar() {
+ /* The Vert. scroll bar value and slider size directly represent the top
+ line number, and the number of visible lines respectively. The scroll
+ bar maximum value is chosen to generally represent the size of the whole
+ buffer, with minor adjustments to keep the scroll bar widget happy */
+#ifdef DEBUG
+ printf("Fl_Text_Display_mod::update_v_scrollbar():\n"
+ " mTopLineNum=%d, mNVisibleLines=%d, mNBufferLines=%d\n",
+ mTopLineNum, mNVisibleLines, mNBufferLines);
+#endif // DEBUG
+
+ mVScrollBar->value(mTopLineNum, mNVisibleLines, 1, mNBufferLines+2);
+ mVScrollBar->linesize(3);
+}
+
+/*
+** Update the minimum, maximum, slider size, page increment, and value
+** for the horizontal scroll bar.
+*/
+void Fl_Text_Display_mod::update_h_scrollbar() {
+ int sliderMax = max(longest_vline(), text_area.w + mHorizOffset);
+ mHScrollBar->value( mHorizOffset, text_area.w, 0, sliderMax );
+}
+
+/*
+** Callbacks for drag or valueChanged on scroll bars
+*/
+void Fl_Text_Display_mod::v_scrollbar_cb(Fl_Scrollbar* b, Fl_Text_Display_mod* textD) {
+ if (b->value() == textD->mTopLineNum) return;
+ textD->scroll(b->value(), textD->mHorizOffset);
+}
+
+void Fl_Text_Display_mod::h_scrollbar_cb(Fl_Scrollbar* b, Fl_Text_Display_mod* textD) {
+ if (b->value() == textD->mHorizOffset) return;
+ textD->scroll(textD->mTopLineNum, b->value());
+}
+
+/*
+** Refresh the line number area. If clearAll is False, writes only over
+** the character cell areas. Setting clearAll to True will clear out any
+** stray marks outside of the character cell area, which might have been
+** left from before a resize or font change.
+*/
+void Fl_Text_Display_mod::draw_line_numbers(bool /*clearAll*/) {
+#if 0
+ // FIXME: don't want this yet, so will leave for another time
+
+ int y, line, visLine, nCols, lineStart;
+ char lineNumString[12];
+ int lineHeight = mMaxsize ? mMaxsize : textsize_;
+ int charWidth = TMPFONTWIDTH; //mFontStruct->max_bounds.width;
+
+ /* Don't draw if mLineNumWidth == 0 (line numbers are hidden), or widget is
+ not yet realized */
+ if (mLineNumWidth == 0 || visible_r())
+ return;
+
+ /* GC is allocated on demand, since not everyone will use line numbering */
+ if (textD->lineNumGC == NULL) {
+ XGCValues values;
+ values.foreground = textD->lineNumFGPixel;
+ values.background = textD->bgPixel;
+ values.font = textD->fontStruct->fid;
+ textD->lineNumGC = XtGetGC(textD->w,
+ GCFont| GCForeground | GCBackground, &values);
+ }
+
+ /* Erase the previous contents of the line number area, if requested */
+ if (clearAll)
+ XClearArea(XtDisplay(textD->w), XtWindow(textD->w), textD->lineNumLeft,
+ textD->top, textD->lineNumWidth, textD->height, False);
+
+ /* Draw the line numbers, aligned to the text */
+ nCols = min(11, textD->lineNumWidth / charWidth);
+ y = textD->top;
+ line = getAbsTopLineNum(textD);
+ for (visLine=0; visLine < textD->nVisibleLines; visLine++) {
+ lineStart = textD->lineStarts[visLine];
+ if (lineStart != -1 && (lineStart==0 ||
+ BufGetCharacter(textD->buffer, lineStart-1)=='\n')) {
+ snprintf(lineNumString, sizeof(lineNumString), "%*d", nCols, line);
+ XDrawImageString(XtDisplay(textD->w), XtWindow(textD->w),
+ textD->lineNumGC, textD->lineNumLeft, y + textD->ascent,
+ lineNumString, strlen(lineNumString));
+ line++;
+ } else {
+ XClearArea(XtDisplay(textD->w), XtWindow(textD->w),
+ textD->lineNumLeft, y, textD->lineNumWidth,
+ textD->ascent + textD->descent, False);
+ if (visLine == 0)
+ line++;
+ }
+ y += lineHeight;
+ }
+#endif
+}
+
+static int max( int i1, int i2 ) {
+ return i1 >= i2 ? i1 : i2;
+}
+
+static int min( int i1, int i2 ) {
+ return i1 <= i2 ? i1 : i2;
+}
+
+/*
+** Count the number of newlines in a null-terminated text string;
+*/
+static int countlines( const char *string ) {
+ const char * c;
+ int lineCount = 0;
+
+ if (!string) return 0;
+
+ for ( c = string; *c != '\0'; c++ )
+ if ( *c == '\n' ) lineCount++;
+ return lineCount;
+}
+
+/*
+** Return the width in pixels of the displayed line pointed to by "visLineNum"
+*/
+int Fl_Text_Display_mod::measure_vline( int visLineNum ) {
+ int i, width = 0, len, style, lineLen = vline_length( visLineNum );
+ int charCount = 0, lineStartPos = mLineStarts[ visLineNum ];
+ char expandedChar[ FL_TEXT_MAX_EXP_CHAR_LEN ];
+
+ if (lineStartPos < 0 || lineLen == 0) return 0;
+ if ( mStyleBuffer == NULL ) {
+ for ( i = 0; i < lineLen; i++ ) {
+ len = mBuffer->expand_character( lineStartPos + i,
+ charCount, expandedChar );
+
+ fl_font( textfont(), textsize() );
+
+ width += ( int ) fl_width( expandedChar, len );
+
+ charCount += len;
+ }
+ } else {
+ for ( i = 0; i < lineLen; i++ ) {
+ len = mBuffer->expand_character( lineStartPos + i,
+ charCount, expandedChar );
+ style = ( unsigned char ) mStyleBuffer->character(
+ lineStartPos + i ) - 'A';
+
+ if (style < 0) style = 0;
+ else if (style >= mNStyles) style = mNStyles - 1;
+
+ fl_font( mStyleTable[ style ].font, mStyleTable[ style ].size );
+
+ width += ( int ) fl_width( expandedChar, len );
+
+ charCount += len;
+ }
+ }
+ return width;
+}
+
+/*
+** Return true if there are lines visible with no corresponding buffer text
+*/
+int Fl_Text_Display_mod::empty_vlines() {
+ return mNVisibleLines > 0 &&
+ mLineStarts[ mNVisibleLines - 1 ] == -1;
+}
+
+/*
+** Return the length of a line (number of displayable characters) by examining
+** entries in the line starts array rather than by scanning for newlines
+*/
+int Fl_Text_Display_mod::vline_length( int visLineNum ) {
+ int nextLineStart, lineStartPos;
+
+ if (visLineNum < 0 || visLineNum >= mNVisibleLines)
+ return (0);
+
+ lineStartPos = mLineStarts[ visLineNum ];
+
+ if ( lineStartPos == -1 )
+ return 0;
+ if ( visLineNum + 1 >= mNVisibleLines )
+ return mLastChar - lineStartPos;
+ nextLineStart = mLineStarts[ visLineNum + 1 ];
+ if ( nextLineStart == -1 )
+ return mLastChar - lineStartPos;
+ if (wrap_uses_character(nextLineStart-1))
+ return nextLineStart-1 - lineStartPos;
+ return nextLineStart - lineStartPos;
+}
+
+/*
+** When continuous wrap is on, and the user inserts or deletes characters,
+** wrapping can happen before and beyond the changed position. This routine
+** finds the extent of the changes, and counts the deleted and inserted lines
+** over that range. It also attempts to minimize the size of the range to
+** what has to be counted and re-displayed, so the results can be useful
+** both for delimiting where the line starts need to be recalculated, and
+** for deciding what part of the text to redisplay.
+*/
+void Fl_Text_Display_mod::find_wrap_range(const char *deletedText, int pos,
+ int nInserted, int nDeleted, int *modRangeStart, int *modRangeEnd,
+ int *linesInserted, int *linesDeleted) {
+ int length, retPos, retLines, retLineStart, retLineEnd;
+ Fl_Text_Buffer_mod*deletedTextBuf, *buf = buffer();
+ int nVisLines = mNVisibleLines;
+ int *lineStarts = mLineStarts;
+ int countFrom, countTo, lineStart, adjLineStart, i;
+ int visLineNum = 0, nLines = 0;
+
+ /*
+ ** Determine where to begin searching: either the previous newline, or
+ ** if possible, limit to the start of the (original) previous displayed
+ ** line, using information from the existing line starts array
+ */
+ if (pos >= mFirstChar && pos <= mLastChar) {
+ for (i=nVisLines-1; i>0; i--)
+ if (lineStarts[i] != -1 && pos >= lineStarts[i])
+ break;
+ if (i > 0) {
+ countFrom = lineStarts[i-1];
+ visLineNum = i-1;
+ } else
+ countFrom = buf->line_start(pos);
+ } else
+ countFrom = buf->line_start(pos);
+
+
+ /*
+ ** Move forward through the (new) text one line at a time, counting
+ ** displayed lines, and looking for either a real newline, or for the
+ ** line starts to re-sync with the original line starts array
+ */
+ lineStart = countFrom;
+ *modRangeStart = countFrom;
+ for (;;) {
+
+ /* advance to the next line. If the line ended in a real newline
+ or the end of the buffer, that's far enough */
+ wrapped_line_counter(buf, lineStart, buf->length(), 1, true, 0,
+ &retPos, &retLines, &retLineStart, &retLineEnd);
+ if (retPos >= buf->length()) {
+ countTo = buf->length();
+ *modRangeEnd = countTo;
+ if (retPos != retLineEnd)
+ nLines++;
+ break;
+ } else
+ lineStart = retPos;
+ nLines++;
+ if (lineStart > pos + nInserted &&
+ buf->character(lineStart-1) == '\n') {
+ countTo = lineStart;
+ *modRangeEnd = lineStart;
+ break;
+ }
+
+ /* Don't try to resync in continuous wrap mode with non-fixed font
+ sizes; it would result in a chicken-and-egg dependency between
+ the calculations for the inserted and the deleted lines.
+ If we're in that mode, the number of deleted lines is calculated in
+ advance, without resynchronization, so we shouldn't resynchronize
+ for the inserted lines either. */
+ if (mSuppressResync)
+ continue;
+
+ /* check for synchronization with the original line starts array
+ before pos, if so, the modified range can begin later */
+ if (lineStart <= pos) {
+ while (visLineNum<nVisLines && lineStarts[visLineNum] < lineStart)
+ visLineNum++;
+ if (visLineNum < nVisLines && lineStarts[visLineNum] == lineStart) {
+ countFrom = lineStart;
+ nLines = 0;
+ if (visLineNum+1 < nVisLines && lineStarts[visLineNum+1] != -1)
+ *modRangeStart = min(pos, lineStarts[visLineNum+1]-1);
+ else
+ *modRangeStart = countFrom;
+ } else
+ *modRangeStart = min(*modRangeStart, lineStart-1);
+ }
+
+ /* check for synchronization with the original line starts array
+ after pos, if so, the modified range can end early */
+ else if (lineStart > pos + nInserted) {
+ adjLineStart = lineStart - nInserted + nDeleted;
+ while (visLineNum<nVisLines && lineStarts[visLineNum]<adjLineStart)
+ visLineNum++;
+ if (visLineNum < nVisLines && lineStarts[visLineNum] != -1 &&
+ lineStarts[visLineNum] == adjLineStart) {
+ countTo = line_end(lineStart, true);
+ *modRangeEnd = lineStart;
+ break;
+ }
+ }
+ }
+ *linesInserted = nLines;
+
+
+ /* Count deleted lines between countFrom and countTo as the text existed
+ before the modification (that is, as if the text between pos and
+ pos+nInserted were replaced by "deletedText"). This extra context is
+ necessary because wrapping can occur outside of the modified region
+ as a result of adding or deleting text in the region. This is done by
+ creating a textBuffer containing the deleted text and the necessary
+ additional context, and calling the wrappedLineCounter on it.
+
+ NOTE: This must not be done in continuous wrap mode when the font
+ width is not fixed. In that case, the calculation would try
+ to access style information that is no longer available (deleted
+ text), or out of date (updated highlighting), possibly leading
+ to completely wrong calculations and/or even crashes eventually.
+ (This is not theoretical; it really happened.)
+
+ In that case, the calculation of the number of deleted lines
+ has happened before the buffer was modified (only in that case,
+ because resynchronization of the line starts is impossible
+ in that case, which makes the whole calculation less efficient).
+ */
+ if (mSuppressResync) {
+ *linesDeleted = mNLinesDeleted;
+ mSuppressResync = 0;
+ return;
+ }
+
+ length = (pos-countFrom) + nDeleted +(countTo-(pos+nInserted));
+ deletedTextBuf = new Fl_Text_Buffer_mod(length);
+ deletedTextBuf->copy(buffer(), countFrom, pos, 0);
+ if (nDeleted != 0)
+ deletedTextBuf->insert(pos-countFrom, deletedText);
+ deletedTextBuf->copy(buffer(),
+ pos+nInserted, countTo, pos-countFrom+nDeleted);
+ /* Note that we need to take into account an offset for the style buffer:
+ the deletedTextBuf can be out of sync with the style buffer. */
+ wrapped_line_counter(deletedTextBuf, 0, length, INT_MAX, true,
+ countFrom, &retPos, &retLines, &retLineStart, &retLineEnd, false);
+ delete deletedTextBuf;
+ *linesDeleted = retLines;
+ mSuppressResync = 0;
+}
+
+/*
+** This is a stripped-down version of the findWrapRange() function above,
+** intended to be used to calculate the number of "deleted" lines during
+** a buffer modification. It is called _before_ the modification takes place.
+**
+** This function should only be called in continuous wrap mode with a
+** non-fixed font width. In that case, it is impossible to calculate
+** the number of deleted lines, because the necessary style information
+** is no longer available _after_ the modification. In other cases, we
+** can still perform the calculation afterwards (possibly even more
+** efficiently).
+*/
+void Fl_Text_Display_mod::measure_deleted_lines(int pos, int nDeleted) {
+ int retPos, retLines, retLineStart, retLineEnd;
+ Fl_Text_Buffer_mod*buf = buffer();
+ int nVisLines = mNVisibleLines;
+ int *lineStarts = mLineStarts;
+ int countFrom, lineStart;
+ int nLines = 0, i;
+ /*
+ ** Determine where to begin searching: either the previous newline, or
+ ** if possible, limit to the start of the (original) previous displayed
+ ** line, using information from the existing line starts array
+ */
+ if (pos >= mFirstChar && pos <= mLastChar) {
+ for (i=nVisLines-1; i>0; i--)
+ if (lineStarts[i] != -1 && pos >= lineStarts[i])
+ break;
+ if (i > 0) countFrom = lineStarts[i-1];
+ else countFrom = buf->line_start(pos);
+ } else
+ countFrom = buf->line_start(pos);
+
+ /*
+ ** Move forward through the (new) text one line at a time, counting
+ ** displayed lines, and looking for either a real newline, or for the
+ ** line starts to re-sync with the original line starts array
+ */
+ lineStart = countFrom;
+ for (;;) {
+ /* advance to the next line. If the line ended in a real newline
+ or the end of the buffer, that's far enough */
+ wrapped_line_counter(buf, lineStart, buf->length(), 1, true, 0,
+ &retPos, &retLines, &retLineStart, &retLineEnd);
+ if (retPos >= buf->length()) {
+ if (retPos != retLineEnd)
+ nLines++;
+ break;
+ } else
+ lineStart = retPos;
+ nLines++;
+ if (lineStart > pos + nDeleted &&
+ buf->character(lineStart-1) == '\n') {
+ break;
+ }
+
+ /* Unlike in the findWrapRange() function above, we don't try to
+ resync with the line starts, because we don't know the length
+ of the inserted text yet, nor the updated style information.
+
+ Because of that, we also shouldn't resync with the line starts
+ after the modification either, because we must perform the
+ calculations for the deleted and inserted lines in the same way.
+
+ This can result in some unnecessary recalculation and redrawing
+ overhead, and therefore we should only use this two-phase mode
+ of calculation when it's really needed (continuous wrap + variable
+ font width). */
+ }
+ mNLinesDeleted = nLines;
+ mSuppressResync = 1;
+}
+
+/*
+** Count forward from startPos to either maxPos or maxLines (whichever is
+** reached first), and return all relevant positions and line count.
+** The provided textBuffer may differ from the actual text buffer of the
+** widget. In that case it must be a (partial) copy of the actual text buffer
+** and the styleBufOffset argument must indicate the starting position of the
+** copy, to take into account the correct style information.
+**
+** Returned values:
+**
+** retPos: Position where counting ended. When counting lines, the
+** position returned is the start of the line "maxLines"
+** lines beyond "startPos".
+** retLines: Number of line breaks counted
+** retLineStart: Start of the line where counting ended
+** retLineEnd: End position of the last line traversed
+*/
+void Fl_Text_Display_mod::wrapped_line_counter(Fl_Text_Buffer_mod*buf, int startPos,
+ int maxPos, int maxLines, bool startPosIsLineStart, int styleBufOffset,
+ int *retPos, int *retLines, int *retLineStart, int *retLineEnd,
+ bool countLastLineMissingNewLine) {
+ int lineStart, newLineStart = 0, b, p, colNum, wrapMargin;
+ int maxWidth, i, foundBreak, width;
+ bool countPixels;
+ int nLines = 0, tabDist = buffer()->tab_distance();
+ unsigned char c;
+ char nullSubsChar = buffer()->null_substitution_character();
+
+ /* If the font is fixed, or there's a wrap margin set, it's more efficient
+ to measure in columns, than to count pixels. Determine if we can count
+ in columns (countPixels == False) or must count pixels (countPixels ==
+ True), and set the wrap target for either pixels or columns */
+ if (mFixedFontWidth != -1 || mWrapMargin != 0) {
+ countPixels = false;
+ wrapMargin = mWrapMargin ? mWrapMargin : text_area.w / (mFixedFontWidth + 1);
+ maxWidth = INT_MAX;
+ } else {
+ countPixels = true;
+ wrapMargin = INT_MAX;
+ maxWidth = text_area.w;
+ }
+
+ /* Find the start of the line if the start pos is not marked as a
+ line start. */
+ if (startPosIsLineStart)
+ lineStart = startPos;
+ else
+ lineStart = line_start(startPos);
+
+ /*
+ ** Loop until position exceeds maxPos or line count exceeds maxLines.
+ ** (actually, contines beyond maxPos to end of line containing maxPos,
+ ** in case later characters cause a word wrap back before maxPos)
+ */
+ colNum = 0;
+ width = 0;
+ for (p=lineStart; p<buf->length(); p++) {
+ c = (unsigned char)buf->character(p);
+
+ /* If the character was a newline, count the line and start over,
+ otherwise, add it to the width and column counts */
+ if (c == '\n') {
+ if (p >= maxPos) {
+ *retPos = maxPos;
+ *retLines = nLines;
+ *retLineStart = lineStart;
+ *retLineEnd = maxPos;
+ return;
+ }
+ nLines++;
+ if (nLines >= maxLines) {
+ *retPos = p + 1;
+ *retLines = nLines;
+ *retLineStart = p + 1;
+ *retLineEnd = p;
+ return;
+ }
+ lineStart = p + 1;
+ colNum = 0;
+ width = 0;
+ } else {
+ colNum += Fl_Text_Buffer_mod::character_width(c, colNum, tabDist, nullSubsChar);
+ if (countPixels)
+ width += measure_proportional_character(c, colNum, p+styleBufOffset);
+ }
+
+ /* If character exceeded wrap margin, find the break point
+ and wrap there */
+ if (colNum > wrapMargin || width > maxWidth) {
+ foundBreak = false;
+ for (b=p; b>=lineStart; b--) {
+ c = (unsigned char)buf->character(b);
+ if (c == '\t' || c == ' ') {
+ newLineStart = b + 1;
+ if (countPixels) {
+ colNum = 0;
+ width = 0;
+ for (i=b+1; i<p+1; i++) {
+ width += measure_proportional_character(
+ buf->character(i), colNum,
+ i+styleBufOffset);
+ colNum++;
+ }
+ } else
+ colNum = buf->count_displayed_characters(b+1, p+1);
+ foundBreak = true;
+ break;
+ }
+ }
+ if (!foundBreak) { /* no whitespace, just break at margin */
+ newLineStart = max(p, lineStart+1);
+ colNum = Fl_Text_Buffer_mod::character_width(c, colNum, tabDist, nullSubsChar);
+ if (countPixels)
+ width = measure_proportional_character(c, colNum, p+styleBufOffset);
+ }
+ if (p >= maxPos) {
+ *retPos = maxPos;
+ *retLines = maxPos < newLineStart ? nLines : nLines + 1;
+ *retLineStart = maxPos < newLineStart ? lineStart :
+ newLineStart;
+ *retLineEnd = maxPos;
+ return;
+ }
+ nLines++;
+ if (nLines >= maxLines) {
+ *retPos = foundBreak ? b + 1 : max(p, lineStart+1);
+ *retLines = nLines;
+ *retLineStart = lineStart;
+ *retLineEnd = foundBreak ? b : p;
+ return;
+ }
+ lineStart = newLineStart;
+ }
+ }
+
+ /* reached end of buffer before reaching pos or line target */
+ *retPos = buf->length();
+ *retLines = nLines;
+ if (countLastLineMissingNewLine && colNum > 0)
+ ++(*retLines);
+ *retLineStart = lineStart;
+ *retLineEnd = buf->length();
+}
+
+/*
+** Measure the width in pixels of a character "c" at a particular column
+** "colNum" and buffer position "pos". This is for measuring characters in
+** proportional or mixed-width highlighting fonts.
+**
+** A note about proportional and mixed-width fonts: the mixed width and
+** proportional font code in nedit does not get much use in general editing,
+** because nedit doesn't allow per-language-mode fonts, and editing programs
+** in a proportional font is usually a bad idea, so very few users would
+** choose a proportional font as a default. There are still probably mixed-
+** width syntax highlighting cases where things don't redraw properly for
+** insertion/deletion, though static display and wrapping and resizing
+** should now be solid because they are now used for online help display.
+*/
+int Fl_Text_Display_mod::measure_proportional_character(char c, int colNum, int pos) {
+ int charLen, style;
+ char expChar[ FL_TEXT_MAX_EXP_CHAR_LEN ];
+ Fl_Text_Buffer_mod*styleBuf = mStyleBuffer;
+
+ charLen = Fl_Text_Buffer_mod::expand_character(c, colNum, expChar,
+ buffer()->tab_distance(), buffer()->null_substitution_character());
+ if (styleBuf == 0) {
+ style = 0;
+ } else {
+ style = (unsigned char)styleBuf->character(pos);
+ if (style == mUnfinishedStyle && mUnfinishedHighlightCB) {
+ /* encountered "unfinished" style, trigger parsing */
+ (mUnfinishedHighlightCB)(pos, mHighlightCBArg);
+ style = (unsigned char)styleBuf->character(pos);
+ }
+ }
+ return string_width(expChar, charLen, style);
+}
+
+/*
+** Finds both the end of the current line and the start of the next line. Why?
+** In continuous wrap mode, if you need to know both, figuring out one from the
+** other can be expensive or error prone. The problem comes when there's a
+** trailing space or tab just before the end of the buffer. To translate an
+** end of line value to or from the next lines start value, you need to know
+** whether the trailing space or tab is being used as a line break or just a
+** normal character, and to find that out would otherwise require counting all
+** the way back to the beginning of the line.
+*/
+void Fl_Text_Display_mod::find_line_end(int startPos, bool startPosIsLineStart,
+ int *lineEnd, int *nextLineStart) {
+ int retLines, retLineStart;
+
+ /* if we're not wrapping use more efficient BufEndOfLine */
+ if (!mContinuousWrap) {
+ *lineEnd = buffer()->line_end(startPos);
+ *nextLineStart = min(buffer()->length(), *lineEnd + 1);
+ return;
+ }
+
+ /* use the wrapped line counter routine to count forward one line */
+ wrapped_line_counter(buffer(), startPos, buffer()->length(),
+ 1, startPosIsLineStart, 0, nextLineStart, &retLines,
+ &retLineStart, lineEnd);
+ return;
+}
+
+/*
+** Line breaks in continuous wrap mode usually happen at newlines or
+** whitespace. This line-terminating character is not included in line
+** width measurements and has a special status as a non-visible character.
+** However, lines with no whitespace are wrapped without the benefit of a
+** line terminating character, and this distinction causes endless trouble
+** with all of the text display code which was originally written without
+** continuous wrap mode and always expects to wrap at a newline character.
+**
+** Given the position of the end of the line, as returned by TextDEndOfLine
+** or BufEndOfLine, this returns true if there is a line terminating
+** character, and false if there's not. On the last character in the
+** buffer, this function can't tell for certain whether a trailing space was
+** used as a wrap point, and just guesses that it wasn't. So if an exact
+** accounting is necessary, don't use this function.
+*/
+int Fl_Text_Display_mod::wrap_uses_character(int lineEndPos) {
+ char c;
+
+ if (!mContinuousWrap || lineEndPos == buffer()->length())
+ return 1;
+
+ c = buffer()->character(lineEndPos);
+ return c == '\n' || ((c == '\t' || c == ' ') &&
+ lineEndPos + 1 != buffer()->length());
+}
+
+/*
+** Return true if the selection "sel" is rectangular, and touches a
+** buffer position withing "rangeStart" to "rangeEnd"
+*/
+int Fl_Text_Display_mod::range_touches_selection(Fl_Text_Selection *sel,
+ int rangeStart, int rangeEnd) {
+ return sel->selected() && sel->rectangular() && sel->end() >= rangeStart &&
+ sel->start() <= rangeEnd;
+}
+
+/*
+** Extend the range of a redraw request (from *start to *end) with additional
+** redraw requests resulting from changes to the attached style buffer (which
+** contains auxiliary information for coloring or styling text).
+*/
+void Fl_Text_Display_mod::extend_range_for_styles( int *startpos, int *endpos ) {
+ Fl_Text_Selection * sel = mStyleBuffer->primary_selection();
+ int extended = 0;
+
+ /* The peculiar protocol used here is that modifications to the style
+ buffer are marked by selecting them with the buffer's primary Fl_Text_Selection.
+ The style buffer is usually modified in response to a modify callback on
+ the text buffer BEFORE Fl_Text_Display.c's modify callback, so that it can keep
+ the style buffer in step with the text buffer. The style-update
+ callback can't just call for a redraw, because Fl_Text_Display hasn't processed
+ the original text changes yet. Anyhow, to minimize redrawing and to
+ avoid the complexity of scheduling redraws later, this simple protocol
+ tells the text display's buffer modify callback to extend it's redraw
+ range to show the text color/and font changes as well. */
+ if ( sel->selected() ) {
+ if ( sel->start() < *startpos ) {
+ *startpos = sel->start();
+ extended = 1;
+ }
+ if ( sel->end() > *endpos ) {
+ *endpos = sel->end();
+ extended = 1;
+ }
+ }
+
+ /* If the Fl_Text_Selection was extended due to a style change, and some of the
+ fonts don't match in spacing, extend redraw area to end of line to
+ redraw characters exposed by possible font size changes */
+ if ( mFixedFontWidth == -1 && extended )
+ *endpos = mBuffer->line_end( *endpos ) + 1;
+}
+
+// The draw() method. It tries to minimize what is draw as much as possible.
+void Fl_Text_Display_mod::draw(void) {
+ // don't even try if there is no associated text buffer!
+ if (!buffer()) { draw_box(); return; }
+
+ fl_push_clip(x(),y(),w(),h()); // prevent drawing outside widget area
+
+ // draw the non-text, non-scrollbar areas.
+ if (damage() & FL_DAMAGE_ALL) {
+// printf("drawing all (box = %d)\n", box());
+ // draw the box()
+ int W = w(), H = h();
+ draw_box(box(), x(), y(), W, H, color());
+
+ if (mHScrollBar->visible())
+ W -= scrollbar_width();
+ if (mVScrollBar->visible())
+ H -= scrollbar_width();
+
+ // left margin
+ fl_rectf(text_area.x-LEFT_MARGIN, text_area.y-TOP_MARGIN,
+ LEFT_MARGIN, text_area.h+TOP_MARGIN+BOTTOM_MARGIN,
+ color());
+
+ // right margin
+ fl_rectf(text_area.x+text_area.w, text_area.y-TOP_MARGIN,
+ RIGHT_MARGIN, text_area.h+TOP_MARGIN+BOTTOM_MARGIN,
+ color());
+
+ // top margin
+ fl_rectf(text_area.x, text_area.y-TOP_MARGIN,
+ text_area.w, TOP_MARGIN, color());
+
+ // bottom margin
+ fl_rectf(text_area.x, text_area.y+text_area.h,
+ text_area.w, BOTTOM_MARGIN, color());
+
+ // draw that little box in the corner of the scrollbars
+ if (mVScrollBar->visible() && mHScrollBar->visible())
+ fl_rectf(mVScrollBar->x(), mHScrollBar->y(),
+ mVScrollBar->w(), mHScrollBar->h(),
+ FL_GRAY);
+
+ // blank the previous cursor protrusions
+ }
+ else if (damage() & (FL_DAMAGE_SCROLL | FL_DAMAGE_EXPOSE)) {
+// printf("blanking previous cursor extrusions at Y: %d\n", mCursorOldY);
+ // CET - FIXME - save old cursor position instead and just draw side needed?
+ fl_push_clip(text_area.x-LEFT_MARGIN,
+ text_area.y,
+ text_area.w+LEFT_MARGIN+RIGHT_MARGIN,
+ text_area.h);
+ fl_rectf(text_area.x-LEFT_MARGIN, mCursorOldY,
+ LEFT_MARGIN, mMaxsize, color());
+ fl_rectf(text_area.x+text_area.w, mCursorOldY,
+ RIGHT_MARGIN, mMaxsize, color());
+ fl_pop_clip();
+ }
+
+ // draw the scrollbars
+ if (damage() & (FL_DAMAGE_ALL | FL_DAMAGE_CHILD)) {
+ mVScrollBar->damage(FL_DAMAGE_ALL);
+ mHScrollBar->damage(FL_DAMAGE_ALL);
+ }
+ update_child(*mVScrollBar);
+ update_child(*mHScrollBar);
+
+ // draw all of the text
+ if (damage() & (FL_DAMAGE_ALL | FL_DAMAGE_EXPOSE)) {
+ //printf("drawing all text\n");
+ int X, Y, W, H;
+ if (fl_clip_box(text_area.x, text_area.y, text_area.w, text_area.h,
+ X, Y, W, H)) {
+ // Draw text using the intersected clipping box...
+ // (this sets the clipping internally)
+ draw_text(X, Y, W, H);
+ } else {
+ // Draw the whole area...
+ draw_text(text_area.x, text_area.y, text_area.w, text_area.h);
+ }
+ }
+ else if (damage() & FL_DAMAGE_SCROLL) {
+ // draw some lines of text
+ fl_push_clip(text_area.x, text_area.y,
+ text_area.w, text_area.h);
+ //printf("drawing text from %d to %d\n", damage_range1_start, damage_range1_end);
+ draw_range(damage_range1_start, damage_range1_end);
+ if (damage_range2_end != -1) {
+ //printf("drawing text from %d to %d\n", damage_range2_start, damage_range2_end);
+ draw_range(damage_range2_start, damage_range2_end);
+ }
+ damage_range1_start = damage_range1_end = -1;
+ damage_range2_start = damage_range2_end = -1;
+ fl_pop_clip();
+ }
+
+ // draw the text cursor
+ if (damage() & (FL_DAMAGE_ALL | FL_DAMAGE_SCROLL | FL_DAMAGE_EXPOSE)
+ && !buffer()->primary_selection()->selected() &&
+ mCursorOn && Fl::focus() == this ) {
+ fl_push_clip(text_area.x-LEFT_MARGIN,
+ text_area.y,
+ text_area.w+LEFT_MARGIN+RIGHT_MARGIN,
+ text_area.h);
+
+ int X, Y;
+ if (position_to_xy(mCursorPos, &X, &Y)) draw_cursor(X, Y);
+// else puts("position_to_xy() failed - unable to draw cursor!");
+ //printf("drew cursor at pos: %d (%d,%d)\n", mCursorPos, X, Y);
+ mCursorOldY = Y;
+ fl_pop_clip();
+ }
+ fl_pop_clip();
+}
+
+// this processes drag events due to mouse for Fl_Text_Display and
+// also drags due to cursor movement with shift held down for
+// Fl_Text_Editor
+void fl_text_drag_me(int pos, Fl_Text_Display_mod* d) {
+ if (d->dragType == Fl_Text_Display_mod::DRAG_CHAR) {
+ if (pos >= d->dragPos) {
+ d->buffer()->select(d->dragPos, pos);
+ } else {
+ d->buffer()->select(pos, d->dragPos);
+ }
+ d->insert_position(pos);
+ } else if (d->dragType == Fl_Text_Display_mod::DRAG_WORD) {
+ if (pos >= d->dragPos) {
+ d->insert_position(d->word_end(pos));
+ d->buffer()->select(d->word_start(d->dragPos), d->word_end(pos));
+ } else {
+ d->insert_position(d->word_start(pos));
+ d->buffer()->select(d->word_start(pos), d->word_end(d->dragPos));
+ }
+ } else if (d->dragType == Fl_Text_Display_mod::DRAG_LINE) {
+ if (pos >= d->dragPos) {
+ d->insert_position(d->buffer()->line_end(pos)+1);
+ d->buffer()->select(d->buffer()->line_start(d->dragPos),
+ d->buffer()->line_end(pos)+1);
+ } else {
+ d->insert_position(d->buffer()->line_start(pos));
+ d->buffer()->select(d->buffer()->line_start(pos),
+ d->buffer()->line_end(d->dragPos)+1);
+ }
+ }
+}
+
+// This timer event scrolls the text view proportionally to
+// how far the mouse pointer has left the text area. This
+// allows for smooth scrolling without "wiggeling" the mouse.
+void Fl_Text_Display_mod::scroll_timer_cb(void *user_data) {
+ Fl_Text_Display_mod *w = (Fl_Text_Display_mod*)user_data;
+ int pos;
+ switch (scroll_direction) {
+ case 1: // mouse is to the right, scroll left
+ w->scroll(w->mTopLineNum, w->mHorizOffset + scroll_amount);
+ pos = w->xy_to_position(w->text_area.x + w->text_area.w, scroll_y, CURSOR_POS);
+ break;
+ case 2: // mouse is to the left, scroll right
+ w->scroll(w->mTopLineNum, w->mHorizOffset + scroll_amount);
+ pos = w->xy_to_position(w->text_area.x, scroll_y, CURSOR_POS);
+ break;
+ case 3: // mouse is above, scroll down
+ w->scroll(w->mTopLineNum + scroll_amount, w->mHorizOffset);
+ pos = w->xy_to_position(scroll_x, w->text_area.y, CURSOR_POS);
+ break;
+ case 4: // mouse is below, scroll up
+ w->scroll(w->mTopLineNum + scroll_amount, w->mHorizOffset);
+ pos = w->xy_to_position(scroll_x, w->text_area.y + w->text_area.h, CURSOR_POS);
+ break;
+ default:
+ return;
+ }
+ fl_text_drag_me(pos, w);
+ Fl::repeat_timeout(.1, scroll_timer_cb, user_data);
+}
+
+
+int Fl_Text_Display_mod::handle(int event) {
+ if (!buffer()) return 0;
+ // This isn't very elegant!
+ if (!Fl::event_inside(text_area.x, text_area.y, text_area.w, text_area.h) &&
+ !dragging && event != FL_LEAVE && event != FL_ENTER &&
+ event != FL_MOVE && event != FL_FOCUS && event != FL_UNFOCUS &&
+ event != FL_KEYBOARD && event != FL_KEYUP) {
+ return Fl_Group::handle(event);
+ }
+
+ switch (event) {
+ case FL_ENTER:
+ case FL_MOVE:
+ if (active_r()) {
+ if (Fl::event_inside(text_area.x, text_area.y, text_area.w,
+ text_area.h)) window()->cursor(FL_CURSOR_INSERT);
+ else window()->cursor(FL_CURSOR_DEFAULT);
+ return 1;
+ } else {
+ return 0;
+ }
+
+ case FL_LEAVE:
+ case FL_HIDE:
+ if (active_r() && window()) {
+ window()->cursor(FL_CURSOR_DEFAULT);
+
+ return 1;
+ } else {
+ return 0;
+ }
+
+ case FL_PUSH: {
+ if (active_r() && window()) {
+ if (Fl::event_inside(text_area.x, text_area.y, text_area.w,
+ text_area.h)) window()->cursor(FL_CURSOR_INSERT);
+ else window()->cursor(FL_CURSOR_DEFAULT);
+ }
+
+ if (Fl::focus() != this) {
+ Fl::focus(this);
+ handle(FL_FOCUS);
+ }
+ if (Fl_Group::handle(event)) return 1;
+ if (Fl::event_state()&FL_SHIFT) return handle(FL_DRAG);
+ dragging = 1;
+ int pos = xy_to_position(Fl::event_x(), Fl::event_y(), CURSOR_POS);
+ dragType = Fl::event_clicks();
+ dragPos = pos;
+ if (dragType == DRAG_CHAR)
+ buffer()->unselect();
+ else if (dragType == DRAG_WORD)
+ buffer()->select(word_start(pos), word_end(pos));
+ else if (dragType == DRAG_LINE)
+ buffer()->select(buffer()->line_start(pos), buffer()->line_end(pos)+1);
+
+ if (buffer()->primary_selection()->selected())
+ insert_position(buffer()->primary_selection()->end());
+ else
+ insert_position(pos);
+ show_insert_position();
+ return 1;
+ }
+
+ case FL_DRAG: {
+ if (dragType < 0) return 1;
+ int X = Fl::event_x(), Y = Fl::event_y(), pos;
+ // if we leave the text_area, we start a timer event
+ // that will take care of scrolling and selecting
+ if (Y < text_area.y) {
+ scroll_x = X;
+ scroll_amount = (Y - text_area.y) / 5 - 1;
+ if (!scroll_direction) {
+ Fl::add_timeout(.01, scroll_timer_cb, this);
+ }
+ scroll_direction = 3;
+ } else if (Y >= text_area.y+text_area.h) {
+ scroll_x = X;
+ scroll_amount = (Y - text_area.y - text_area.h) / 5 + 1;
+ if (!scroll_direction) {
+ Fl::add_timeout(.01, scroll_timer_cb, this);
+ }
+ scroll_direction = 4;
+ } else if (X < text_area.x) {
+ scroll_y = Y;
+ scroll_amount = (X - text_area.x) / 2 - 1;
+ if (!scroll_direction) {
+ Fl::add_timeout(.01, scroll_timer_cb, this);
+ }
+ scroll_direction = 2;
+ } else if (X >= text_area.x+text_area.w) {
+ scroll_y = Y;
+ scroll_amount = (X - text_area.x - text_area.w) / 2 + 1;
+ if (!scroll_direction) {
+ Fl::add_timeout(.01, scroll_timer_cb, this);
+ }
+ scroll_direction = 1;
+ } else {
+ if (scroll_direction) {
+ Fl::remove_timeout(scroll_timer_cb, this);
+ scroll_direction = 0;
+ }
+ pos = xy_to_position(X, Y, CURSOR_POS);
+ fl_text_drag_me(pos, this);
+ }
+ return 1;
+ }
+
+ case FL_RELEASE: {
+ dragging = 0;
+ if (scroll_direction) {
+ Fl::remove_timeout(scroll_timer_cb, this);
+ scroll_direction = 0;
+ }
+
+ // convert from WORD or LINE selection to CHAR
+ if (insert_position() >= dragPos)
+ dragPos = buffer()->primary_selection()->start();
+ else
+ dragPos = buffer()->primary_selection()->end();
+ dragType = DRAG_CHAR;
+
+ const char* copy = buffer()->selection_text();
+ if (*copy) Fl::copy(copy, strlen(copy), 0);
+ free((void*)copy);
+ return 1;
+ }
+
+ case FL_MOUSEWHEEL:
+ if (Fl::event_dy()) return mVScrollBar->handle(event);
+ else return mHScrollBar->handle(event);
+
+ case FL_UNFOCUS:
+ if (active_r() && window()) window()->cursor(FL_CURSOR_DEFAULT);
+ case FL_FOCUS:
+ if (buffer()->selected()) redraw();
+
+ return 1;
+
+ case FL_KEYBOARD:
+ // Copy?
+ if ((Fl::event_state()&(FL_CTRL|FL_COMMAND)) && Fl::event_key()=='c') {
+ if (!buffer()->selected()) return 1;
+ const char *copy = buffer()->selection_text();
+ if (*copy) Fl::copy(copy, strlen(copy), 1);
+ free((void*)copy);
+ return 1;
+ }
+
+ // Select all ?
+ if ((Fl::event_state()&(FL_CTRL|FL_COMMAND)) && Fl::event_key()=='a') {
+ buffer()->select(0,buffer()->length());
+ return 1;
+ }
+
+ if (mVScrollBar->handle(event)) return 1;
+ if (mHScrollBar->handle(event)) return 1;
+
+ break;
+ }
+
+ return 0;
+}
+
+
+//
+// End of "$Id: Fl_Text_Display.cxx 5848 2007-05-20 16:18:31Z mike $".
+//
diff --git a/src/widgets/Fl_Text_Display_mod_1_3.cxx b/src/widgets/Fl_Text_Display_mod_1_3.cxx
new file mode 100644
index 0000000..bfddba3
--- /dev/null
+++ b/src/widgets/Fl_Text_Display_mod_1_3.cxx
@@ -0,0 +1,33 @@
+//
+// "$Id: Fl_Text_Display_mod.cxx 8808 2011-06-16 13:31:25Z manolo $"
+//
+// Copyright 2001-2010 by Bill Spitzak and others.
+// Original code Copyright Mark Edel. Permission to distribute under
+// the LGPL for the FLTK library granted by Mark Edel.
+//
+// This library 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 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+// http://www.fltk.org/str.php
+//
+
+// TODO: rendering of the "optional hyphen"
+// TODO: make line numbering work again
+
+//
+// End of "$Id: Fl_Text_Display_mod.cxx 8808 2011-06-16 13:31:25Z manolo $".
+//
diff --git a/src/widgets/Fl_Text_Editor_mod.cxx b/src/widgets/Fl_Text_Editor_mod.cxx
new file mode 100644
index 0000000..d8e9037
--- /dev/null
+++ b/src/widgets/Fl_Text_Editor_mod.cxx
@@ -0,0 +1,7 @@
+#include <config.h>
+
+#if FLWKEY_FLTK_API_MAJOR == 1 && FLWKEY_FLTK_API_MINOR < 3
+# include "Fl_Text_Editor_mod_1_1.cxx"
+#elif FLWKEY_FLTK_API_MAJOR == 1 && FLWKEY_FLTK_API_MINOR == 3
+# include "Fl_Text_Editor_mod_1_3.cxx"
+#endif
diff --git a/src/widgets/Fl_Text_Editor_mod_1_1.cxx b/src/widgets/Fl_Text_Editor_mod_1_1.cxx
new file mode 100644
index 0000000..d1e552b
--- /dev/null
+++ b/src/widgets/Fl_Text_Editor_mod_1_1.cxx
@@ -0,0 +1,494 @@
+//
+// "$Id: Fl_Text_Editor.cxx 5671 2007-02-08 07:58:47Z matt $"
+//
+// Copyright 2001-2006 by Bill Spitzak and others.
+// Original code Copyright Mark Edel. Permission to distribute under
+// the LGPL for the FLTK library granted by Mark Edel.
+//
+// This library 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 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+// http://www.fltk.org/str.php
+//
+
+#include <config.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <FL/Fl.H>
+#include <FL/Fl_Window.H>
+#include "Fl_Text_Editor_mod.H"
+#include <FL/fl_ask.H>
+
+
+Fl_Text_Editor_mod::Fl_Text_Editor_mod(int X, int Y, int W, int H, const char* l)
+ : Fl_Text_Display_mod(X, Y, W, H, l) {
+ mCursorOn = 1;
+ insert_mode_ = 1;
+ key_bindings = 0;
+
+ // handle the default key bindings
+ add_default_key_bindings(&key_bindings);
+
+ // handle everything else
+ default_key_function(kf_default);
+}
+
+Fl_Text_Editor_mod::Key_Binding* Fl_Text_Editor_mod::global_key_bindings = 0;
+
+// These are the default key bindings every widget should start with
+static struct {
+ int key;
+ int state;
+ Fl_Text_Editor_mod::Key_Func func;
+} default_key_bindings[] = {
+ { FL_Escape, FL_TEXT_EDITOR_ANY_STATE, Fl_Text_Editor_mod::kf_ignore },
+ { FL_Enter, FL_TEXT_EDITOR_ANY_STATE, Fl_Text_Editor_mod::kf_enter },
+ { FL_KP_Enter, FL_TEXT_EDITOR_ANY_STATE, Fl_Text_Editor_mod::kf_enter },
+ { FL_BackSpace, FL_TEXT_EDITOR_ANY_STATE, Fl_Text_Editor_mod::kf_backspace },
+ { FL_Insert, FL_TEXT_EDITOR_ANY_STATE, Fl_Text_Editor_mod::kf_insert },
+ { FL_Delete, FL_TEXT_EDITOR_ANY_STATE, Fl_Text_Editor_mod::kf_delete },
+ { FL_Home, 0, Fl_Text_Editor_mod::kf_move },
+ { FL_End, 0, Fl_Text_Editor_mod::kf_move },
+ { FL_Left, 0, Fl_Text_Editor_mod::kf_move },
+ { FL_Up, 0, Fl_Text_Editor_mod::kf_move },
+ { FL_Right, 0, Fl_Text_Editor_mod::kf_move },
+ { FL_Down, 0, Fl_Text_Editor_mod::kf_move },
+ { FL_Page_Up, 0, Fl_Text_Editor_mod::kf_move },
+ { FL_Page_Down, 0, Fl_Text_Editor_mod::kf_move },
+ { FL_Home, FL_SHIFT, Fl_Text_Editor_mod::kf_shift_move },
+ { FL_End, FL_SHIFT, Fl_Text_Editor_mod::kf_shift_move },
+ { FL_Left, FL_SHIFT, Fl_Text_Editor_mod::kf_shift_move },
+ { FL_Up, FL_SHIFT, Fl_Text_Editor_mod::kf_shift_move },
+ { FL_Right, FL_SHIFT, Fl_Text_Editor_mod::kf_shift_move },
+ { FL_Down, FL_SHIFT, Fl_Text_Editor_mod::kf_shift_move },
+ { FL_Page_Up, FL_SHIFT, Fl_Text_Editor_mod::kf_shift_move },
+ { FL_Page_Down, FL_SHIFT, Fl_Text_Editor_mod::kf_shift_move },
+ { FL_Home, FL_CTRL, Fl_Text_Editor_mod::kf_ctrl_move },
+ { FL_End, FL_CTRL, Fl_Text_Editor_mod::kf_ctrl_move },
+ { FL_Left, FL_CTRL, Fl_Text_Editor_mod::kf_ctrl_move },
+ { FL_Up, FL_CTRL, Fl_Text_Editor_mod::kf_ctrl_move },
+ { FL_Right, FL_CTRL, Fl_Text_Editor_mod::kf_ctrl_move },
+ { FL_Down, FL_CTRL, Fl_Text_Editor_mod::kf_ctrl_move },
+ { FL_Page_Up, FL_CTRL, Fl_Text_Editor_mod::kf_ctrl_move },
+ { FL_Page_Down, FL_CTRL, Fl_Text_Editor_mod::kf_ctrl_move },
+ { FL_Home, FL_CTRL|FL_SHIFT, Fl_Text_Editor_mod::kf_c_s_move },
+ { FL_End, FL_CTRL|FL_SHIFT, Fl_Text_Editor_mod::kf_c_s_move },
+ { FL_Left, FL_CTRL|FL_SHIFT, Fl_Text_Editor_mod::kf_c_s_move },
+ { FL_Up, FL_CTRL|FL_SHIFT, Fl_Text_Editor_mod::kf_c_s_move },
+ { FL_Right, FL_CTRL|FL_SHIFT, Fl_Text_Editor_mod::kf_c_s_move },
+ { FL_Down, FL_CTRL|FL_SHIFT, Fl_Text_Editor_mod::kf_c_s_move },
+ { FL_Page_Up, FL_CTRL|FL_SHIFT, Fl_Text_Editor_mod::kf_c_s_move },
+ { FL_Page_Down, FL_CTRL|FL_SHIFT, Fl_Text_Editor_mod::kf_c_s_move },
+//{ FL_Clear, 0, Fl_Text_Editor_mod::delete_to_eol },
+ { 'z', FL_CTRL, Fl_Text_Editor_mod::kf_undo },
+ { '/', FL_CTRL, Fl_Text_Editor_mod::kf_undo },
+ { 'x', FL_CTRL, Fl_Text_Editor_mod::kf_cut },
+ { FL_Delete, FL_SHIFT, Fl_Text_Editor_mod::kf_cut },
+ { 'c', FL_CTRL, Fl_Text_Editor_mod::kf_copy },
+ { FL_Insert, FL_CTRL, Fl_Text_Editor_mod::kf_copy },
+ { 'v', FL_CTRL, Fl_Text_Editor_mod::kf_paste },
+ { FL_Insert, FL_SHIFT, Fl_Text_Editor_mod::kf_paste },
+ { 'a', FL_CTRL, Fl_Text_Editor_mod::kf_select_all },
+
+#ifdef __APPLE__
+ // Define CMD+key accelerators...
+ { 'z', FL_COMMAND, Fl_Text_Editor_mod::kf_undo },
+ { 'x', FL_COMMAND, Fl_Text_Editor_mod::kf_cut },
+ { 'c', FL_COMMAND, Fl_Text_Editor_mod::kf_copy },
+ { 'v', FL_COMMAND, Fl_Text_Editor_mod::kf_paste },
+ { 'a', FL_COMMAND, Fl_Text_Editor_mod::kf_select_all },
+#endif // __APPLE__
+
+ { 0, 0, 0 }
+};
+
+void Fl_Text_Editor_mod::add_default_key_bindings(Key_Binding** list) {
+ for (int i = 0; default_key_bindings[i].key; i++) {
+ add_key_binding(default_key_bindings[i].key,
+ default_key_bindings[i].state,
+ default_key_bindings[i].func,
+ list);
+ }
+}
+
+Fl_Text_Editor_mod::Key_Func
+Fl_Text_Editor_mod::bound_key_function(int key, int state, Key_Binding* list) {
+ Key_Binding* cur;
+ for (cur = list; cur; cur = cur->next)
+ if (cur->key == key)
+ if (cur->state == FL_TEXT_EDITOR_ANY_STATE || cur->state == state)
+ break;
+ if (!cur) return 0;
+ return cur->function;
+}
+
+void
+Fl_Text_Editor_mod::remove_all_key_bindings(Key_Binding** list) {
+ Key_Binding *cur, *next;
+ for (cur = *list; cur; cur = next) {
+ next = cur->next;
+ delete cur;
+ }
+ *list = 0;
+}
+
+void
+Fl_Text_Editor_mod::remove_key_binding(int key, int state, Key_Binding** list) {
+ Key_Binding *cur, *last = 0;
+ for (cur = *list; cur; last = cur, cur = cur->next)
+ if (cur->key == key && cur->state == state) break;
+ if (!cur) return;
+ if (last) last->next = cur->next;
+ else *list = cur->next;
+ delete cur;
+}
+
+void
+Fl_Text_Editor_mod::add_key_binding(int key, int state, Key_Func function,
+ Key_Binding** list) {
+ Key_Binding* kb = new Key_Binding;
+ kb->key = key;
+ kb->state = state;
+ kb->function = function;
+ kb->next = *list;
+ *list = kb;
+}
+
+////////////////////////////////////////////////////////////////
+
+#define NORMAL_INPUT_MOVE 0
+
+static void kill_selection(Fl_Text_Editor_mod* e) {
+ if (e->buffer()->selected()) {
+ e->insert_position(e->buffer()->primary_selection()->start());
+ e->buffer()->remove_selection();
+ }
+}
+
+int Fl_Text_Editor_mod::kf_default(int c, Fl_Text_Editor_mod* e) {
+ if (!c || (!isprint(c) && c != '\t')) return 0;
+ char s[2] = "\0";
+ s[0] = (char)c;
+ kill_selection(e);
+ if (e->insert_mode()) e->insert(s);
+ else e->overstrike(s);
+ e->show_insert_position();
+ e->set_changed();
+ if (e->when()&FL_WHEN_CHANGED) e->do_callback();
+ return 1;
+}
+
+int Fl_Text_Editor_mod::kf_ignore(int, Fl_Text_Editor_mod*) {
+ return 0; // don't handle
+}
+
+int Fl_Text_Editor_mod::kf_backspace(int, Fl_Text_Editor_mod* e) {
+ if (!e->buffer()->selected() && e->move_left())
+ e->buffer()->select(e->insert_position(), e->insert_position()+1);
+ kill_selection(e);
+ e->show_insert_position();
+ e->set_changed();
+ if (e->when()&FL_WHEN_CHANGED) e->do_callback();
+ return 1;
+}
+
+int Fl_Text_Editor_mod::kf_enter(int, Fl_Text_Editor_mod* e) {
+ kill_selection(e);
+ e->insert("\n");
+ e->show_insert_position();
+ e->set_changed();
+ if (e->when()&FL_WHEN_CHANGED) e->do_callback();
+ return 1;
+}
+
+extern void fl_text_drag_me(int pos, Fl_Text_Display_mod* d);
+
+int Fl_Text_Editor_mod::kf_move(int c, Fl_Text_Editor_mod* e) {
+ int i;
+ int selected = e->buffer()->selected();
+ if (!selected)
+ e->dragPos = e->insert_position();
+ e->buffer()->unselect();
+ switch (c) {
+ case FL_Home:
+ e->insert_position(e->buffer()->line_start(e->insert_position()));
+ break;
+ case FL_End:
+ e->insert_position(e->buffer()->line_end(e->insert_position()));
+ break;
+ case FL_Left:
+ e->move_left();
+ break;
+ case FL_Right:
+ e->move_right();
+ break;
+ case FL_Up:
+ e->move_up();
+ break;
+ case FL_Down:
+ e->move_down();
+ break;
+ case FL_Page_Up:
+ for (i = 0; i < e->mNVisibleLines - 1; i++) e->move_up();
+ break;
+ case FL_Page_Down:
+ for (i = 0; i < e->mNVisibleLines - 1; i++) e->move_down();
+ break;
+ }
+ e->show_insert_position();
+ return 1;
+}
+
+int Fl_Text_Editor_mod::kf_shift_move(int c, Fl_Text_Editor_mod* e) {
+ kf_move(c, e);
+ fl_text_drag_me(e->insert_position(), e);
+ return 1;
+}
+
+int Fl_Text_Editor_mod::kf_ctrl_move(int c, Fl_Text_Editor_mod* e) {
+ if (!e->buffer()->selected())
+ e->dragPos = e->insert_position();
+ if (c != FL_Up && c != FL_Down) {
+ e->buffer()->unselect();
+ e->show_insert_position();
+ }
+ switch (c) {
+ case FL_Home:
+ e->insert_position(0);
+ e->scroll(0, 0);
+ break;
+ case FL_End:
+ e->insert_position(e->buffer()->length());
+ e->scroll(e->count_lines(0, e->buffer()->length(), 1), 0);
+ break;
+ case FL_Left:
+ e->previous_word();
+ break;
+ case FL_Right:
+ e->next_word();
+ break;
+ case FL_Up:
+ e->scroll(e->mTopLineNum-1, e->mHorizOffset);
+ break;
+ case FL_Down:
+ e->scroll(e->mTopLineNum+1, e->mHorizOffset);
+ break;
+ case FL_Page_Up:
+ e->insert_position(e->mLineStarts[0]);
+ break;
+ case FL_Page_Down:
+ e->insert_position(e->mLineStarts[e->mNVisibleLines-2]);
+ break;
+ }
+ return 1;
+}
+
+int Fl_Text_Editor_mod::kf_c_s_move(int c, Fl_Text_Editor_mod* e) {
+ kf_ctrl_move(c, e);
+ fl_text_drag_me(e->insert_position(), e);
+ return 1;
+}
+
+int Fl_Text_Editor_mod::kf_home(int, Fl_Text_Editor_mod* e) {
+ return kf_move(FL_Home, e);
+}
+
+int Fl_Text_Editor_mod::kf_end(int, Fl_Text_Editor_mod* e) {
+ return kf_move(FL_End, e);
+}
+
+int Fl_Text_Editor_mod::kf_left(int, Fl_Text_Editor_mod* e) {
+ return kf_move(FL_Left, e);
+}
+
+int Fl_Text_Editor_mod::kf_up(int, Fl_Text_Editor_mod* e) {
+ return kf_move(FL_Up, e);
+}
+
+int Fl_Text_Editor_mod::kf_right(int, Fl_Text_Editor_mod* e) {
+ return kf_move(FL_Right, e);
+}
+
+int Fl_Text_Editor_mod::kf_down(int, Fl_Text_Editor_mod* e) {
+ return kf_move(FL_Down, e);
+}
+
+int Fl_Text_Editor_mod::kf_page_up(int, Fl_Text_Editor_mod* e) {
+ return kf_move(FL_Page_Up, e);
+}
+
+int Fl_Text_Editor_mod::kf_page_down(int, Fl_Text_Editor_mod* e) {
+ return kf_move(FL_Page_Down, e);
+}
+
+
+int Fl_Text_Editor_mod::kf_insert(int, Fl_Text_Editor_mod* e) {
+ e->insert_mode(e->insert_mode() ? 0 : 1);
+ return 1;
+}
+
+int Fl_Text_Editor_mod::kf_delete(int, Fl_Text_Editor_mod* e) {
+ if (!e->buffer()->selected())
+ e->buffer()->select(e->insert_position(), e->insert_position()+1);
+ kill_selection(e);
+ e->show_insert_position();
+ e->set_changed();
+ if (e->when()&FL_WHEN_CHANGED) e->do_callback();
+ return 1;
+}
+
+int Fl_Text_Editor_mod::kf_copy(int, Fl_Text_Editor_mod* e) {
+ if (!e->buffer()->selected()) return 1;
+ const char *copy = e->buffer()->selection_text();
+ if (*copy) Fl::copy(copy, strlen(copy), 1);
+ free((void*)copy);
+ e->show_insert_position();
+ return 1;
+}
+
+int Fl_Text_Editor_mod::kf_cut(int c, Fl_Text_Editor_mod* e) {
+ kf_copy(c, e);
+ kill_selection(e);
+ e->set_changed();
+ if (e->when()&FL_WHEN_CHANGED) e->do_callback();
+ return 1;
+}
+
+int Fl_Text_Editor_mod::kf_paste(int, Fl_Text_Editor_mod* e) {
+ kill_selection(e);
+ Fl::paste(*e, 1);
+ e->show_insert_position();
+ e->set_changed();
+ if (e->when()&FL_WHEN_CHANGED) e->do_callback();
+ return 1;
+}
+
+int Fl_Text_Editor_mod::kf_select_all(int, Fl_Text_Editor_mod* e) {
+ e->buffer()->select(0, e->buffer()->length());
+ return 1;
+}
+
+int Fl_Text_Editor_mod::kf_undo(int , Fl_Text_Editor_mod* e) {
+ e->buffer()->unselect();
+ int crsr;
+ int ret = e->buffer()->undo(&crsr);
+ e->insert_position(crsr);
+ e->show_insert_position();
+ e->set_changed();
+ if (e->when()&FL_WHEN_CHANGED) e->do_callback();
+ return ret;
+}
+
+int Fl_Text_Editor_mod::handle_key() {
+ // Call FLTK's rules to try to turn this into a printing character.
+ // This uses the right-hand ctrl key as a "compose prefix" and returns
+ // the changes that should be made to the text, as a number of
+ // bytes to delete and a string to insert:
+ int del;
+ if (Fl::compose(del)) {
+ if (del) buffer()->select(insert_position()-del, insert_position());
+ kill_selection(this);
+ if (Fl::event_length()) {
+ if (insert_mode()) insert(Fl::event_text());
+ else overstrike(Fl::event_text());
+ }
+ show_insert_position();
+ set_changed();
+ if (when()&FL_WHEN_CHANGED) do_callback();
+ return 1;
+ }
+
+ int key = Fl::event_key(), state = Fl::event_state(), c = Fl::event_text()[0];
+ state &= FL_SHIFT|FL_CTRL|FL_ALT|FL_META; // only care about these states
+ Key_Func f;
+ f = bound_key_function(key, state, global_key_bindings);
+ if (!f) f = bound_key_function(key, state, key_bindings);
+ if (f) return f(key, this);
+ if (default_key_function_ && !state) return default_key_function_(c, this);
+ return 0;
+}
+
+void Fl_Text_Editor_mod::maybe_do_callback() {
+// printf("Fl_Text_Editor_mod::maybe_do_callback()\n");
+// printf("changed()=%d, when()=%x\n", changed(), when());
+ if (changed() || (when()&FL_WHEN_NOT_CHANGED)) do_callback();
+}
+
+int Fl_Text_Editor_mod::handle(int event) {
+ if (!buffer()) return 0;
+
+ switch (event) {
+ case FL_FOCUS:
+ show_cursor(mCursorOn); // redraws the cursor
+ if (buffer()->selected()) redraw(); // Redraw selections...
+ Fl::focus(this);
+ return 1;
+
+ case FL_UNFOCUS:
+ show_cursor(mCursorOn); // redraws the cursor
+ if (buffer()->selected()) redraw(); // Redraw selections...
+ case FL_HIDE:
+ if (when() & FL_WHEN_RELEASE) maybe_do_callback();
+ return 1;
+
+ case FL_KEYBOARD:
+ if (active_r() && window() && this == Fl::belowmouse())
+ window()->cursor(FL_CURSOR_NONE);
+ return handle_key();
+
+ case FL_PASTE:
+ if (!Fl::event_text()) {
+ fl_beep();
+ return 1;
+ }
+ buffer()->remove_selection();
+ if (insert_mode()) insert(Fl::event_text());
+ else overstrike(Fl::event_text());
+ show_insert_position();
+ set_changed();
+ if (when()&FL_WHEN_CHANGED) do_callback();
+ return 1;
+
+ case FL_ENTER:
+// MRS: WIN32 only? Need to test!
+// case FL_MOVE:
+ show_cursor(mCursorOn);
+ return 1;
+
+ case FL_PUSH:
+ if (Fl::event_button() == 2) {
+ // don't let the text_display see this event
+ if (Fl_Group::handle(event)) return 1;
+ dragType = -1;
+ Fl::paste(*this, 0);
+ Fl::focus(this);
+ set_changed();
+ if (when()&FL_WHEN_CHANGED) do_callback();
+ return 1;
+ }
+ break;
+ }
+
+ return Fl_Text_Display_mod::handle(event);
+}
+
+//
+// End of "$Id: Fl_Text_Editor.cxx 5671 2007-02-08 07:58:47Z matt $".
+//
diff --git a/src/widgets/Fl_Text_Editor_mod_1_3.cxx b/src/widgets/Fl_Text_Editor_mod_1_3.cxx
new file mode 100644
index 0000000..fbcded8
--- /dev/null
+++ b/src/widgets/Fl_Text_Editor_mod_1_3.cxx
@@ -0,0 +1,31 @@
+//
+// "$Id: Fl_Text_Editor_mod.cxx 8034 2010-12-15 12:21:55Z AlbrechtS $"
+//
+// Copyright 2001-2010 by Bill Spitzak and others.
+// Original code Copyright Mark Edel. Permission to distribute under
+// the LGPL for the FLTK library granted by Mark Edel.
+//
+// This library 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 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+// http://www.fltk.org/str.php
+//
+
+
+//
+// End of "$Id: Fl_Text_Editor_mod.cxx 8034 2010-12-15 12:21:55Z AlbrechtS $".
+//
diff --git a/src/widgets/ValueSlider.cxx b/src/widgets/ValueSlider.cxx
new file mode 100644
index 0000000..87bb489
--- /dev/null
+++ b/src/widgets/ValueSlider.cxx
@@ -0,0 +1,33 @@
+//======================================================================
+// class wheel_slider - based on Fl_Slider
+// class wheel_value_slider - based on Fl_Value_Slider
+//======================================================================
+
+#include <FL/Fl.H>
+#include "ValueSlider.h"
+
+int Fl_Wheel_Slider::handle(int event)
+{
+ if (event != FL_MOUSEWHEEL || !Fl::event_inside(this))
+ return Fl_Slider::handle(event);
+ int d;
+ if ( !((d = Fl::event_dy()) || (d = Fl::event_dx())) )
+ return Fl_Slider::handle(event);
+ if (reverse_) d = -d;
+ value(clamp(increment(value(), d)));
+ do_callback();
+ return 1;
+}
+
+int Fl_Wheel_Value_Slider::handle(int event)
+{
+ if (event != FL_MOUSEWHEEL || !Fl::event_inside(this))
+ return Fl_Value_Slider::handle(event);
+ int d;
+ if ( !((d = Fl::event_dy()) || (d = Fl::event_dx())) )
+ return Fl_Value_Slider::handle(event);
+ if (reverse_) d = -d;
+ value(clamp(increment(value(), d)));
+ do_callback();
+ return 1;
+}
diff --git a/src/widgets/combo.cxx b/src/widgets/combo.cxx
new file mode 100644
index 0000000..16c3256
--- /dev/null
+++ b/src/widgets/combo.cxx
@@ -0,0 +1,355 @@
+#include <cstring>
+#include <cstdlib>
+#include <FL/Fl.H>
+#include <FL/fl_draw.H>
+
+#include "combo.h"
+
+void popbrwsr_cb (Fl_Widget *v, long d);
+
+Fl_PopBrowser::Fl_PopBrowser (int X, int Y, int W, int H, retvals R)
+ : Fl_Window (X, Y, W, H, "")
+{
+ Rvals = R;
+ hRow = H;
+ wRow = W;
+ clear_border();
+ box(FL_BORDER_BOX);
+ popbrwsr = new Fl_Select_Browser(0,0,wRow,hRow,0);
+ popbrwsr->callback ( (Fl_Callback*)popbrwsr_cb);
+ parent = 0;
+ end();
+ set_modal();
+}
+
+Fl_PopBrowser::~Fl_PopBrowser ()
+{
+}
+
+int Fl_PopBrowser::handle(int event)
+{
+ if (!Fl::event_inside( child(0) ) && event == FL_PUSH) {
+ pophide();
+ return 1;
+ }
+ return Fl_Group::handle(event);
+}
+
+void Fl_PopBrowser::add(char *s, void *d)
+{
+ popbrwsr->add(s,d);
+}
+
+void Fl_PopBrowser::clear()
+{
+ popbrwsr->clear();
+}
+
+void Fl_PopBrowser::sort()
+{
+ return;
+}
+
+void Fl_PopBrowser::popshow (int x, int y)
+{
+ int nRows = parent->numrows();
+ int fh = fl_height();
+ int height = nRows * fh + 4;
+
+ if (popbrwsr->size() == 0) return;
+ if (nRows > parent->lsize()) nRows = parent->lsize();
+
+// locate first occurance of Output string value in the list
+// and display that if found
+ int i = parent->index();
+ if (!(i >= 0 && i < parent->listsize)) {
+ for (i = 0; i < parent->listsize; i++)
+ if (!strcmp(parent->Output->value(), parent->datalist[i]->s))
+ break;
+ if (i == parent->listsize)
+ i = 0;
+ }
+
+// resize and reposition the popup to insure that it is within the bounds
+// of the uppermost parent widget
+// preferred position is just below and at the same x position as the
+// parent widget
+
+ Fl_Widget *gparent = parent;
+ int xp = gparent->x(),
+ yp = gparent->y(),
+ hp = gparent->h();
+ while ((gparent = gparent->parent())) {
+ xp = gparent->x();
+ yp = gparent->y();
+ hp = gparent->h();
+ }
+
+ int nu = nRows, nl = nRows;
+ int hu = nu * fh + 4, hl = nl * fh + 4;
+ int yu = parent->y() - hu;
+ int yl = y;
+
+ while (nl > 1 && (yl + hl > hp)) { nl--; hl -= fh; }
+ while (nu > 1 && yu < 0) { nu--; yu += fh; hu -= fh; }
+
+ if (nl >= nu) { y = yl; height = hl; }
+ else { y = yu; height = hu; }
+
+ x += xp;
+ y += yp;
+
+ popbrwsr->size (wRow, height);
+ resize (x, y, wRow, height);
+
+ popbrwsr->topline (i);
+ show();
+
+ Fl::grab(this);
+}
+
+void Fl_PopBrowser::pophide ()
+{
+ hide ();
+ Fl::release();
+}
+
+void Fl_PopBrowser::popbrwsr_cb_i (Fl_Widget *v, long d)
+{
+ Fl_PopBrowser *me = (Fl_PopBrowser *)(v->parent());
+ Fl_Input *tgt = me->Rvals.Inp;
+// update the return values
+ int row = (me->popbrwsr)->value();
+ if (row == 0) return;
+ me->popbrwsr->deselect();
+
+ if (tgt) {
+ tgt->value ((me->popbrwsr)->text (row));
+ me->Rvals.retval = (me->popbrwsr)->data (row);
+ *(me->Rvals.idx) = row - 1;
+ }
+ me->pophide();
+// user selected an item from the browser list, so execute the
+// callback if one is registered.
+ if (me->parent)
+ (me->parent)->do_callback();
+ return;
+}
+
+void popbrwsr_cb (Fl_Widget *v, long d)
+{
+ ((Fl_PopBrowser *)(v))->popbrwsr_cb_i (v, d);
+ return;
+}
+
+
+void Fl_ComboBox::fl_popbrwsr(Fl_Widget *p)
+{
+ int xpos = p->x(), ypos = p->h() + p->y();
+ if (Brwsr == 0) {
+ Brwsr = new Fl_PopBrowser(xpos, ypos, width, height, R);
+ }
+// pass the calling widget to the popup browser so that the
+// correct callback function can be called when the user selects an item
+// from the browser list
+ Brwsr->parent = (Fl_ComboBox *) p;
+ Brwsr->popshow(xpos, ypos);
+ return;
+}
+
+void btnComboBox_cb (Fl_Widget *v, void *d)
+{
+ Fl_Widget *p = v->parent();
+ ((Fl_ComboBox *)p)->fl_popbrwsr (p);
+ return;
+}
+
+
+Fl_ComboBox::Fl_ComboBox (int X,int Y,int W,int H, const char *L)
+ : Fl_Group (X, Y, W, H, L)
+{
+ width = W; height = H - 4;
+ Btn = new Fl_Button (X + W - 18, Y + 1, 18, H - 2, "@#-32>");
+ Btn->callback ((Fl_Callback *)btnComboBox_cb, 0);
+ Output = new Fl_Input (X, Y, W-18, H);
+
+ Brwsr = 0;
+ datalist = new datambr *[FL_COMBO_LIST_INCR];
+ maxsize = FL_COMBO_LIST_INCR;
+ for (int i = 0; i < FL_COMBO_LIST_INCR; i++) datalist[i] = 0;
+ listsize = 0;
+ listtype = 0;
+ end();
+ R.Inp = Output;
+ R.retval = retdata;
+ R.idx = &idx;
+ numrows_ = 8;
+}
+
+Fl_ComboBox::~Fl_ComboBox()
+{
+ if (Brwsr) delete Brwsr;
+ for (int i = 0; i < listsize; i++) {
+ if (datalist[i]) {
+ if (datalist[i]->s) delete [] datalist[i]->s;
+ delete datalist[i];
+ }
+ }
+ delete [] datalist;
+}
+
+void Fl_ComboBox::type (int t)
+{
+ listtype = t;
+}
+
+void Fl_ComboBox::readonly()
+{
+ Output->type(FL_NORMAL_OUTPUT);
+}
+
+// ComboBox value is contained in the Output widget
+
+void Fl_ComboBox::value( const char *s )
+{
+ int i;
+ if ((listtype & FL_COMBO_UNIQUE_NOCASE) == FL_COMBO_UNIQUE_NOCASE) {
+ for (i = 0; i < listsize; i++) {
+ if (strcasecmp (s, datalist[i]->s) == 0)
+ break;
+ }
+ } else {
+ for (i = 0; i < listsize; i++) {
+ if (strcmp (s, datalist[i]->s) == 0)
+ break;
+ }
+ }
+ if ( i < listsize)
+ Output->value(datalist[i]->s);
+}
+
+void Fl_ComboBox::put_value(const char *s)
+{
+ value(s);
+}
+
+void Fl_ComboBox::index(int i)
+{
+ if (i >= 0 && i < listsize)
+ Output->value( datalist[idx = i]->s);
+}
+
+
+const char *Fl_ComboBox::value()
+{
+ return (Output->value ());
+}
+
+int Fl_ComboBox::index() {
+ return idx;
+}
+
+void * Fl_ComboBox::data() {
+ return retdata;
+}
+
+void Fl_ComboBox::add( const char *s, void * d)
+{
+ if (Brwsr == 0) {
+ Brwsr = new Fl_PopBrowser(0, 0, width, height, R);
+ }
+// test for uniqueness of entry if required
+ if ((listtype & FL_COMBO_UNIQUE) == FL_COMBO_UNIQUE) {
+ if ((listtype & FL_COMBO_UNIQUE_NOCASE) == FL_COMBO_UNIQUE_NOCASE) {
+ for (int i = 0; i < listsize; i++) {
+ if (strcasecmp (s, datalist[i]->s) == 0)
+ return;
+ }
+ } else {
+ for (int i = 0; i < listsize; i++) {
+ if (strcmp (s, datalist[i]->s) == 0)
+ return;
+ }
+ }
+ }
+// not unique or not in list, so add this entry
+ datalist[listsize] = new datambr;
+ datalist[listsize]->s = new char [strlen(s) + 1];
+ datalist[listsize]->s[0] = 0;
+ strcpy (datalist[listsize]->s, s);
+ datalist[listsize]->d = d;
+ Brwsr->add(datalist[listsize]->s,d);
+ listsize++;
+ if (listsize == maxsize) {
+ int nusize = maxsize + FL_COMBO_LIST_INCR;
+ datambr **temparray = new datambr *[nusize];
+ for (int i = 0; i < listsize; i++) temparray[i] = datalist[i];
+ delete [] datalist;
+ datalist = temparray;
+ maxsize = nusize;
+ }
+}
+
+void Fl_ComboBox::clear()
+{
+ if (Brwsr == 0)
+ Brwsr = new Fl_PopBrowser(0, 0, width, height, R);
+ else
+ Brwsr->clear();
+
+ if (listsize == 0) return;
+ for (int i = 0; i < listsize; i++) {
+ delete [] datalist[i]->s;
+ delete datalist[i];
+ }
+ listsize = 0;
+}
+
+int DataCompare( const void *x1, const void *x2 )
+{
+ int cmp;
+ datambr *X1, *X2;
+ X1 = *(datambr **)(x1);
+ X2 = *(datambr **)(x2);
+ cmp = strcasecmp (X1->s, X2->s);
+ if (cmp < 0)
+ return -1;
+ if (cmp > 0)
+ return 1;
+ return 0;
+}
+
+void Fl_ComboBox::sort() {
+ Brwsr->clear ();
+ qsort (&datalist[0],
+ listsize,
+ sizeof (datambr *),
+ DataCompare);
+ for (int i = 0; i < listsize; i++)
+ Brwsr->add (datalist[i]->s, datalist[i]->d);
+}
+
+void Fl_ComboBox::textfont (int fnt)
+{
+ Output->textfont (fnt);
+}
+
+void Fl_ComboBox::textsize (uchar n)
+{
+ Output->textsize (n);
+}
+
+void Fl_ComboBox::textcolor( Fl_Color c)
+{
+ Output->textcolor (c);
+}
+
+void Fl_ComboBox::color(Fl_Color c)
+{
+ _color = c;
+ Output->color(c);
+ if (Brwsr) Brwsr->color(c);
+}
+
+
+
diff --git a/src/widgets/fileselect.cxx b/src/widgets/fileselect.cxx
new file mode 100644
index 0000000..f2d8297
--- /dev/null
+++ b/src/widgets/fileselect.cxx
@@ -0,0 +1,222 @@
+// ----------------------------------------------------------------------------
+//
+// fileselect.cxx -- file selector front end
+//
+// Copyright (C) 2008-2009
+// Stelios Bounanos, M0GLD
+//
+// This file is part of fldigi.
+//
+// Fldigi is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Fldigi 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 fldigi. If not, see <http://www.gnu.org/licenses/>.
+// ----------------------------------------------------------------------------
+
+#include <config.h>
+
+#include <string>
+#include <cstdlib>
+#include <libgen.h>
+
+#include "fileselect.h"
+#include "icons.h"
+#include "debug.h"
+
+#include <FL/fl_ask.H>
+#include <FL/Fl_Native_File_Chooser.H>
+
+/**
+ \class Fl_Native_File_Chooser
+
+ This class lets an FLTK application easily and consistently access
+ the operating system's native file chooser. Some operating systems
+ have very complex and specific file choosers that many users want
+ access to specifically, instead of FLTK's default file chooser(s).
+
+ In cases where there is no native file browser, FLTK's own file browser
+ is used instead.
+
+ To use this widget correctly, use the following include in your code:
+ \code
+ #include <FL/Fl_Native_File_Chooser.H>
+ \endcode
+ Do not include the other Fl_Native_File_Choser_XXX.H files in your code;
+ those are platform specific files that will be included automatically
+ depending on your build platform.
+
+ The following example shows how to pick a single file:
+ \code
+ // Create and post the local native file chooser
+ #include <FL/Fl_Native_File_Chooser.H>
+ [..]
+ Fl_Native_File_Chooser fnfc;
+ fnfc.title("Pick a file");
+ fnfc.type(Fl_Native_File_Chooser::BROWSE_FILE);
+ fnfc.filter("Text\t*.txt\n"
+ "C Files\t*.{cxx,h,c}");
+ fnfc.directory("/var/tmp"); // default directory to use
+ // Show native chooser
+ switch ( fnfc.show() ) {
+ case -1: printf("ERROR: %s\n", fnfc.errmsg()); break; // ERROR
+ case 1: printf("CANCEL\n"); break; // CANCEL
+ default: printf("PICKED: %s\n", fnfc.filename()); break; // FILE CHOSEN
+ }
+ \endcode
+
+ <B>Platform Specific Caveats</B>
+
+ - Under X windows, it's best if you call Fl_File_Icon::load_system_icons()
+ at the start of main(), to enable the nicer looking file browser widgets.
+ Use the static public attributes of class Fl_File_Chooser to localize
+ the browser.
+ - Some operating systems support certain OS specific options; see
+ Fl_Native_File_Chooser::options() for a list.
+
+ \image html Fl_Native_File_Chooser.png "The Fl_Native_File_Chooser on different platforms."
+ \image latex Fl_Native_File_Chooser.png "The Fl_Native_File_Chooser on different platforms" width=14cm
+
+ enum Type {
+ BROWSE_FILE = 0, ///< browse files (lets user choose one file)
+ BROWSE_DIRECTORY, ///< browse directories (lets user choose one directory)
+ BROWSE_MULTI_FILE, ///< browse files (lets user choose multiple files)
+ BROWSE_MULTI_DIRECTORY, ///< browse directories (lets user choose multiple directories)
+ BROWSE_SAVE_FILE, ///< browse to save a file
+ BROWSE_SAVE_DIRECTORY ///< browse to save a directory
+ };
+ enum Option {
+ NO_OPTIONS = 0x0000, ///< no options enabled
+ SAVEAS_CONFIRM = 0x0001, ///< Show native 'Save As' overwrite confirm dialog (if supported)
+ NEW_FOLDER = 0x0002, ///< Show 'New Folder' icon (if supported)
+ PREVIEW = 0x0004 ///< enable preview mode
+ };
+
+IMPORTANT NOTICE:
+
+The filter type must be terminated with a '\n' on OS X or the application crashes with a Bus timeout
+
+*/
+
+using namespace std;
+
+namespace FSEL {
+
+string filename;
+
+void create(void) {};
+void destroy(void) {};
+
+string stitle, sfilter, sdef;
+
+const char* select(const char* title, const char* filter, const char* def)
+{
+ Fl_Native_File_Chooser native;
+
+ stitle.clear();
+ sfilter.clear();
+ sdef.clear();
+ if (title) stitle.assign(title);
+ if (filter) sfilter.assign(filter);
+ if (def) sdef.assign(def);
+ if (!sfilter.empty() && sfilter[sfilter.length()-1] != '\n') sfilter += '\n';
+
+ if (!stitle.empty()) native.title(stitle.c_str());
+ native.type(Fl_Native_File_Chooser::BROWSE_FILE);
+ if (!sfilter.empty()) native.filter(sfilter.c_str());
+ native.options(Fl_Native_File_Chooser::PREVIEW);
+ if (!sdef.empty()) native.preset_file(sdef.c_str());
+
+ filename.clear();
+ switch ( native.show() ) {
+ case -1: fprintf(stderr, "ERROR: %s\n", native.errmsg()); break; // ERROR
+ case 1: break;
+ default:
+ if ( native.filename() ) {
+ filename = native.filename();
+ } else {
+ filename = "";
+ }
+ break;
+ }
+
+ return filename.c_str();
+}
+
+const char* saveas(const char* title, const char* filter, const char* def)
+{
+ Fl_Native_File_Chooser native;
+
+ stitle.clear();
+ sfilter.clear();
+ sdef.clear();
+ if (title) stitle.assign(title);
+ if (filter) sfilter.assign(filter);
+ if (def) sdef.assign(def);
+ if (!sfilter.empty() && sfilter[sfilter.length()-1] != '\n') sfilter += '\n';
+
+ if (!stitle.empty()) native.title(stitle.c_str());
+ native.type(Fl_Native_File_Chooser::BROWSE_SAVE_FILE);
+ if (!sfilter.empty()) native.filter(sfilter.c_str());
+ native.options(Fl_Native_File_Chooser::NEW_FOLDER || Fl_Native_File_Chooser::SAVEAS_CONFIRM);
+ if (!sdef.empty()) native.preset_file(sdef.c_str());
+
+ filename.clear();
+ switch ( native.show() ) {
+ case -1: fprintf(stderr, "ERROR: %s\n", native.errmsg()); break; // ERROR
+ case 1: break; // CANCEL
+ default:
+ if ( native.filename() ) {
+ filename = native.filename();
+ } else {
+ filename = "";
+ }
+ break;
+ }
+
+ return filename.c_str();
+
+}
+
+const char* dir_select(const char* title, const char* filter, const char* def)
+{
+ Fl_Native_File_Chooser native;
+
+ stitle.clear();
+ sfilter.clear();
+ sdef.clear();
+ if (title) stitle.assign(title);
+ if (filter) sfilter.assign(filter);
+ if (def) sdef.assign(def);
+ if (!sfilter.empty() && sfilter[sfilter.length()-1] != '\n') sfilter += '\n';
+
+ if (!stitle.empty()) native.title(stitle.c_str());
+ native.type(Fl_Native_File_Chooser::BROWSE_DIRECTORY);
+ if (!sfilter.empty()) native.filter(sfilter.c_str());
+ native.options(Fl_Native_File_Chooser::NO_OPTIONS);
+ if (!sdef.empty()) native.directory(sdef.c_str());
+
+ filename.clear();
+ switch ( native.show() ) {
+ case -1: fprintf(stderr, "ERROR: %s\n", native.errmsg()); break; // ERROR
+ case 1: break; // CANCEL
+ default:
+ if ( native.filename() ) {
+ filename = native.filename();
+ } else {
+ filename = "";
+ }
+ break;
+ }
+
+ return filename.c_str();
+}
+
+} // FSEL
diff --git a/src/widgets/flinput2.cxx b/src/widgets/flinput2.cxx
new file mode 100644
index 0000000..8aad3e7
--- /dev/null
+++ b/src/widgets/flinput2.cxx
@@ -0,0 +1,180 @@
+// =====================================================================
+//
+// flinput2.cxx
+//
+// Author: Stelios Buononos, M0GLD
+// Copyright: 2010
+//
+// This software 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. It is
+// copyright under the GNU General Public License.
+//
+// You should have received a copy of the GNU General Public License
+// along with the program; if not, write to the Free Software
+// Foundation, Inc.
+// 59 Temple Place, Suite 330
+// Boston, MA 02111-1307 USA
+//
+// =====================================================================
+
+#include "config.h"
+
+#include <cctype>
+
+#include <FL/Fl.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Widget.H>
+#include <FL/Fl_Input.H>
+#include <FL/Fl_Menu_Item.H>
+#include <FL/Fl_Tooltip.H>
+
+#include "icons.h"
+#include "flinput2.h"
+#include "gettext.h"
+#include "util.h"
+
+enum { OP_UNDO, OP_CUT, OP_COPY, OP_PASTE, OP_DELETE, OP_CLEAR, OP_SELECT_ALL };
+
+static Fl_Menu_Item cmenu[] = {
+ { make_icon_label(_("Undo"), edit_undo_icon), 0, 0, 0, FL_MENU_DIVIDER, _FL_MULTI_LABEL },
+ { make_icon_label(_("Cut"), edit_cut_icon), 0, 0, 0, 0, _FL_MULTI_LABEL },
+ { make_icon_label(_("Copy"), edit_copy_icon), 0, 0, 0, 0, _FL_MULTI_LABEL },
+ { make_icon_label(_("Paste"), edit_paste_icon), 0, 0, 0, 0, _FL_MULTI_LABEL },
+ { make_icon_label(_("Delete"), trash_icon), 0, 0, 0, 0, _FL_MULTI_LABEL },
+ { make_icon_label(_("Clear"), edit_clear_icon), 0, 0, 0, FL_MENU_DIVIDER, _FL_MULTI_LABEL },
+ { make_icon_label(_("Select All"), edit_select_all_icon), 0, 0, 0, 0, _FL_MULTI_LABEL },
+ { 0 }
+};
+static bool cmenu_init = false;
+
+
+Fl_Input2::Fl_Input2(int x, int y, int w, int h, const char* l)
+ : Fl_Input(x, y, w, h, l)
+{
+ if (!cmenu_init) {
+ for (size_t i = 0; i < sizeof(cmenu)/sizeof(*cmenu) - 1; i++)
+ if (cmenu[i].labeltype() == _FL_MULTI_LABEL)
+ set_icon_label(&cmenu[i]);
+ cmenu_init = true;
+ }
+}
+
+int Fl_Input2::handle(int event)
+{
+ switch (event) {
+ case FL_KEYBOARD: {
+ int b = Fl::event_key();
+ int p = position();
+ // stop the move-to-next-field madness, we have Tab for that!
+ if (unlikely((b == FL_Left && p == 0) || (b == FL_Right && p == size()) ||
+ (b == FL_Up && line_start(p) == 0) ||
+ (b == FL_Down && line_end(p) == size())))
+ return 1;
+ else if (unlikely(Fl::event_state() & (FL_ALT | FL_META))) {
+ switch (b) {
+ case 'c': { // capitalise
+ if (readonly() || p == size())
+ return 1;
+
+ while (p < size() && isspace(*(value() + p)))
+ p++;
+ if (p == size())
+ return 1;
+ char c = toupper(*(value() + p));
+ replace(p, p + 1, &c, 1);
+ position(word_end(p));
+ }
+ return 1;
+ case 'u': case 'l': { // upper/lower case
+ if (readonly() || p == size())
+ return 1;
+ while (p < size() && isspace(*(value() + p)))
+ p++;
+ int n = word_end(p) - p;
+ if (n == 0)
+ return 1;
+
+ char* s = new char[n];
+ memcpy(s, value() + p, n);
+ if (b == 'u')
+ for (int i = 0; i < n; i++)
+ s[i] = toupper(s[i]);
+ else
+ for (int i = 0; i < n; i++)
+ s[i] = tolower(s[i]);
+ replace(p, p + n, s, n);
+ position(p + n);
+ delete [] s;
+ return 1;
+ }
+ default:
+ break;
+ }
+ }
+ }
+ return Fl_Input::handle(event);
+ case FL_MOUSEWHEEL: {
+ if (!((type() & (FL_MULTILINE_INPUT | FL_MULTILINE_OUTPUT)) && Fl::event_inside(this)))
+ return Fl_Input::handle(event);
+ int d;
+ if (!((d = Fl::event_dy()) || (d = Fl::event_dx())))
+ return Fl_Input::handle(event);
+ if (Fl::focus() != this)
+ take_focus();
+ up_down_position(d + (d > 0 ? line_end(position()) : line_start(position())));
+ return 1;
+ }
+ case FL_PUSH:
+ if (Fl::event_button() == FL_RIGHT_MOUSE)
+ break;
+ // fall through
+ default:
+ return Fl_Input::handle(event);
+ }
+
+ bool sel = position() != mark(), ro = readonly();
+ set_active(&cmenu[OP_UNDO], !ro);
+ set_active(&cmenu[OP_CUT], !ro && sel);
+ set_active(&cmenu[OP_COPY], sel);
+ set_active(&cmenu[OP_PASTE], !ro);
+ set_active(&cmenu[OP_DELETE], !ro && sel);
+ set_active(&cmenu[OP_CLEAR], !ro && size());
+ set_active(&cmenu[OP_SELECT_ALL], size());
+
+ take_focus();
+ window()->cursor(FL_CURSOR_DEFAULT);
+ int t = Fl_Tooltip::enabled();
+ Fl_Tooltip::disable();
+ const Fl_Menu_Item* m = cmenu->popup(Fl::event_x(), Fl::event_y());
+ Fl_Tooltip::enable(t);
+
+ if (!m)
+ return 1;
+ switch (m - cmenu) {
+ case OP_UNDO:
+ undo();
+ break;
+ case OP_CUT:
+ cut();
+ copy_cuts();
+ break;
+ case OP_COPY:
+ copy(1);
+ break;
+ case OP_PASTE:
+ Fl::paste(*this, 1);
+ break;
+ case OP_DELETE:
+ cut();
+ break;
+ case OP_CLEAR:
+ cut(0, size());
+ break;
+ case OP_SELECT_ALL:
+ position(0, size());
+ break;
+ }
+
+ return 1;
+}
diff --git a/src/widgets/flnfc_common.cxx b/src/widgets/flnfc_common.cxx
new file mode 100644
index 0000000..32411ef
--- /dev/null
+++ b/src/widgets/flnfc_common.cxx
@@ -0,0 +1,80 @@
+//
+// flnfc_common.cxx -- common string subs for Fl_Native_File_Chooser
+//
+// Copyright 2004 by Greg Ercolano.
+//
+// This library 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 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please keep code 80 column compliant.
+//
+// 10 20 30 40 50 60 70
+// | | | | | | |
+// 4567890123456789012345678901234567890123456789012345678901234567890123456789
+//
+
+#include <string.h>
+
+// COPY A STRING WITH 'new'
+// Value can be NULL
+//
+static char *strnew(const char *val) {
+ if ( val == NULL ) return(NULL);
+ char *s = new char[strlen(val)+1];
+ strcpy(s, val);
+ return(s);
+}
+
+// FREE STRING CREATED WITH strnew(), NULLS OUT STRING
+// Value can be NULL
+//
+static char *strfree(char *val) {
+ if ( val ) delete [] val;
+ return(NULL);
+}
+
+#ifndef __WOE32__
+// 'DYNAMICALLY' APPEND ONE STRING TO ANOTHER
+// Returns newly allocated string, or NULL
+// if s && val == NULL.
+// 's' can be NULL; returns a strnew(val).
+// 'val' can be NULL; s is returned unmodified.
+//
+// Usage:
+// char *s = strnew("foo"); // s = "foo"
+// s = strapp(s, "bar"); // s = "foobar"
+//
+static char *strapp(char *s, const char *val) {
+ if ( ! val ) {
+ return(s); // Nothing to append? return s
+ }
+ if ( ! s ) {
+ return(strnew(val)); // New string? return copy of val
+ }
+ char *news = new char[strlen(s)+strlen(val)+1];
+ strcpy(news, s);
+ strcat(news, val);
+ delete [] s; // delete old string
+ return(news); // return new copy
+}
+#endif
+
+// APPEND A CHARACTER TO A STRING
+// This does NOT allocate space for the new character.
+//
+static void chrcat(char *s, char c) {
+ char tmp[2] = { c, '\0' };
+ strcat(s, tmp);
+}
diff --git a/src/widgets/flslider2.cxx b/src/widgets/flslider2.cxx
new file mode 100644
index 0000000..943c2b0
--- /dev/null
+++ b/src/widgets/flslider2.cxx
@@ -0,0 +1,82 @@
+// ----------------------------------------------------------------------------
+// flslider2.cxx
+//
+// Copyright (C) 2010
+// Stelios Bounanos, M0GLD
+//
+// This file is part of fldigi.
+//
+// Fldigi is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Fldigi 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 fldigi. If not, see <http://www.gnu.org/licenses/>.
+// ----------------------------------------------------------------------------
+
+#include <FL/Fl.H>
+#include "flslider2.h"
+#include "util.h"
+
+inline static int handle_scroll(Fl_Valuator* w, int event)
+{
+ if (!(event == FL_MOUSEWHEEL && Fl::event_inside(w)))
+ return 0;
+ double d;
+ if ((d = Fl::event_dy()) || (d = Fl::event_dx())) {
+ if (Fl::event_state() & FL_SHIFT)
+ d *= 10.0;
+ if (!dynamic_cast<Fl_Value_Input*>(w) && !dynamic_cast<Fl_Counter*>(w) &&
+ !(w->type() & FL_HOR_SLIDER))
+ d = -d;
+ w->value(w->clamp(w->increment(w->value(), static_cast<int>(-d))));
+ w->do_callback();
+ }
+ return 1;
+}
+
+int Fl_Slider2::handle(int event)
+{
+ return handle_scroll(this, event) ? 1 : Fl_Slider::handle(event);
+}
+
+int Fl_Value_Slider2::handle(int event)
+{
+ return handle_scroll(this, event) ? 1 : Fl_Value_Slider::handle(event);
+}
+
+int Fl_Counter2::handle(int event)
+{
+ return handle_scroll(this, event) ? 1 : Fl_Counter::handle(event);
+}
+
+int Fl_Value_Input2::handle(int event)
+{
+ return handle_scroll(this, event) ? 1 : Fl_Value_Input::handle(event);
+}
+
+inline static int handle_scroll(Fl_Spinner* w, int event)
+{
+ if (!(event == FL_MOUSEWHEEL && Fl::event_inside(w)))
+ return 0;
+ double d;
+ if ((d = Fl::event_dy()) || (d = Fl::event_dx())) {
+ if (Fl::event_state() & FL_SHIFT)
+ d *= 10.0;
+ d = w->value() - d * w->step();
+ w->value(WCLAMP(d, w->minimum(), w->maximum()));
+ w->do_callback();
+ }
+ return 1;
+}
+
+int Fl_Spinner2::handle(int event)
+{
+ return handle_scroll(this, event) ? 1 : Fl_Spinner::handle(event);
+}
diff --git a/src/wkey_dialogs.cxx b/src/wkey_dialogs.cxx
new file mode 100644
index 0000000..d3d294b
--- /dev/null
+++ b/src/wkey_dialogs.cxx
@@ -0,0 +1,1466 @@
+// generated by Fast Light User Interface Designer (fluid) version 1.0302
+
+#include "gettext.h"
+#include "wkey_dialogs.h"
+#include "support.h"
+
+Fl_ComboBox *selectCommPort=(Fl_ComboBox *)0;
+
+Fl_Input *inpXmlAddress=(Fl_Input *)0;
+
+static void cb_inpXmlAddress(Fl_Input* o, void*) {
+ progStatus.log_address = o->value();
+}
+
+Fl_Input *inpXmlPort=(Fl_Input *)0;
+
+static void cb_inpXmlPort(Fl_Input* o, void*) {
+ progStatus.log_port = o->value();
+}
+
+Fl_Return_Button *btn_ser_port_ok=(Fl_Return_Button *)0;
+
+static void cb_btn_ser_port_ok(Fl_Return_Button*, void*) {
+ cbOkSetupDialog();
+}
+
+Fl_Button *btn_serial_port_cancel=(Fl_Button *)0;
+
+static void cb_btn_serial_port_cancel(Fl_Button*, void*) {
+ cbCancelSetupDialog();
+}
+
+Fl_Double_Window* SetupDialog() {
+ Fl_Double_Window* w;
+ { Fl_Double_Window* o = new Fl_Double_Window(270, 145, _("Select Ports"));
+ w = o;
+ { selectCommPort = new Fl_ComboBox(75, 13, 190, 23, _("Ser. Port"));
+ selectCommPort->tooltip(_("Xcvr serial port"));
+ selectCommPort->box(FL_DOWN_BOX);
+ selectCommPort->color((Fl_Color)53);
+ selectCommPort->selection_color(FL_BACKGROUND_COLOR);
+ selectCommPort->labeltype(FL_NORMAL_LABEL);
+ selectCommPort->labelfont(0);
+ selectCommPort->labelsize(14);
+ selectCommPort->labelcolor(FL_FOREGROUND_COLOR);
+ selectCommPort->align(Fl_Align(FL_ALIGN_LEFT));
+ selectCommPort->when(FL_WHEN_RELEASE);
+ selectCommPort->end();
+ } // Fl_ComboBox* selectCommPort
+ { Fl_Input* o = inpXmlAddress = new Fl_Input(75, 45, 190, 23, _("Xml Addr"));
+ inpXmlAddress->tooltip(_("External logbook net address"));
+ inpXmlAddress->callback((Fl_Callback*)cb_inpXmlAddress);
+ o->value(progStatus.log_address.c_str());
+ } // Fl_Input* inpXmlAddress
+ { Fl_Input* o = inpXmlPort = new Fl_Input(75, 77, 190, 23, _("Xml Port"));
+ inpXmlPort->tooltip(_("External logbook net port"));
+ inpXmlPort->callback((Fl_Callback*)cb_inpXmlPort);
+ o->value(progStatus.log_port.c_str());
+ } // Fl_Input* inpXmlPort
+ { btn_ser_port_ok = new Fl_Return_Button(193, 114, 67, 20, _("OK"));
+ btn_ser_port_ok->callback((Fl_Callback*)cb_btn_ser_port_ok);
+ } // Fl_Return_Button* btn_ser_port_ok
+ { btn_serial_port_cancel = new Fl_Button(115, 114, 70, 20, _("Cancel"));
+ btn_serial_port_cancel->callback((Fl_Callback*)cb_btn_serial_port_cancel);
+ } // Fl_Button* btn_serial_port_cancel
+ o->end();
+ } // Fl_Double_Window* o
+ return w;
+}
+
+static void cb_mnu_exit(Fl_Menu_*, void*) {
+ cbExit();
+}
+
+static void cb_mnu_sel_port(Fl_Menu_*, void*) {
+ config_comm_port();
+}
+
+static void cb_mnu_parameters(Fl_Menu_*, void*) {
+ config_parameters();
+}
+
+static void cb_mnu_messages(Fl_Menu_*, void*) {
+ config_messages();
+}
+
+static void cb_mnu_operator(Fl_Menu_*, void*) {
+ open_operator_dialog();
+}
+
+static void cb_mnu_display_log(Fl_Menu_*, void*) {
+ cb_mnuShowLogbook();
+}
+
+static void cb_mnu_new_log(Fl_Menu_*, void*) {
+ cb_mnuNewLogbook();
+}
+
+static void cb_mnu_open_logbook(Fl_Menu_*, void*) {
+ cb_mnuOpenLogbook();
+}
+
+static void cb_mnu_save_logbook(Fl_Menu_*, void*) {
+ cb_mnuSaveLogbook();
+}
+
+static void cb_mnu_merge_logbook(Fl_Menu_*, void*) {
+ cb_mnuMergeADIF_log();
+}
+
+static void cb_mnu_export_adif(Fl_Menu_*, void*) {
+ cb_mnuExportADIF_log();
+}
+
+static void cb_mnu_export_logbook_text(Fl_Menu_*, void*) {
+ cb_mnuExportTEXT_log();
+}
+
+static void cb_mnu_export_logbook_csv(Fl_Menu_*, void*) {
+ cb_mnuExportCSV_log();
+}
+
+static void cb_mnu_export_cabrillo(Fl_Menu_*, void*) {
+ cb_Export_Cabrillo();
+}
+
+static void cb_mnu_log_client(Fl_Menu_*, void*) {
+ connect_to_server();
+}
+
+static void cb_mnu_contest(Fl_Menu_*, void*) {
+ cb_contest();
+}
+
+static void cb_mnu_events(Fl_Menu_*, void*) {
+ cb_events();
+}
+
+static void cb_mnu_about(Fl_Menu_*, void*) {
+ about();
+}
+
+static void cb_mnu_on_line_help(Fl_Menu_*, void*) {
+ on_line_help();
+}
+
+unsigned char menu__i18n_done = 0;
+Fl_Menu_Item menu_[] = {
+ {"&File", 0, 0, 0, 64, FL_NORMAL_LABEL, 0, 14, 0},
+ {"E&xit", 0, (Fl_Callback*)cb_mnu_exit, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
+ {0,0,0,0,0,0,0,0,0},
+ {"Configure", 0, 0, 0, 64, FL_NORMAL_LABEL, 0, 14, 0},
+ {"Ports", 0, (Fl_Callback*)cb_mnu_sel_port, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
+ {"Parameters", 0, (Fl_Callback*)cb_mnu_parameters, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
+ {"Messages", 0, (Fl_Callback*)cb_mnu_messages, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
+ {"Operator", 0, (Fl_Callback*)cb_mnu_operator, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
+ {0,0,0,0,0,0,0,0,0},
+ {"Logbook", 0, 0, 0, 64, FL_NORMAL_LABEL, 0, 14, 0},
+ {"Display Log", 0, (Fl_Callback*)cb_mnu_display_log, 0, 128, FL_NORMAL_LABEL, 0, 14, 0},
+ {"New", 0, (Fl_Callback*)cb_mnu_new_log, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
+ {"Open", 0, (Fl_Callback*)cb_mnu_open_logbook, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
+ {"Save", 0, (Fl_Callback*)cb_mnu_save_logbook, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
+ {"Merge Log", 0, (Fl_Callback*)cb_mnu_merge_logbook, 0, 128, FL_NORMAL_LABEL, 0, 14, 0},
+ {"Export Log", 0, (Fl_Callback*)cb_mnu_export_adif, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
+ {"Export text", 0, (Fl_Callback*)cb_mnu_export_logbook_text, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
+ {"Export CSV", 0, (Fl_Callback*)cb_mnu_export_logbook_csv, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
+ {"Cabrillo Report", 0, (Fl_Callback*)cb_mnu_export_cabrillo, 0, 128, FL_NORMAL_LABEL, 0, 14, 0},
+ {"Connect to Server", 0, (Fl_Callback*)cb_mnu_log_client, 0, 130, FL_NORMAL_LABEL, 0, 14, 0},
+ {0,0,0,0,0,0,0,0,0},
+ {"Contest", 0, (Fl_Callback*)cb_mnu_contest, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
+ {"Events", 0, (Fl_Callback*)cb_mnu_events, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
+ {"Help", 0, 0, 0, 64, FL_NORMAL_LABEL, 0, 14, 0},
+ {"About", 0, (Fl_Callback*)cb_mnu_about, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
+ {"On line help", 0, (Fl_Callback*)cb_mnu_on_line_help, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
+ {0,0,0,0,0,0,0,0,0},
+ {0,0,0,0,0,0,0,0,0}
+};
+
+FTextView *txt_sent=(FTextView *)0;
+
+FTextTX *txt_to_send=(FTextTX *)0;
+
+Fl_Light_Button *btn_send=(Fl_Light_Button *)0;
+
+static void cb_btn_send(Fl_Light_Button*, void*) {
+ cb_send_button();
+}
+
+Fl_Light_Button *btn_tune=(Fl_Light_Button *)0;
+
+static void cb_btn_tune(Fl_Light_Button*, void*) {
+ cb_tune();
+}
+
+Fl_Button *btn_cancel=(Fl_Button *)0;
+
+static void cb_btn_cancel(Fl_Button*, void*) {
+ cb_cancel_transmit();
+}
+
+Fl_Box *box_busy=(Fl_Box *)0;
+
+Fl_Box *box_keydown=(Fl_Box *)0;
+
+Fl_Box *box_break_in=(Fl_Box *)0;
+
+Fl_Box *box_xoff=(Fl_Box *)0;
+
+Fl_Box *box_wait=(Fl_Box *)0;
+
+Fl_Output *txt_wpm=(Fl_Output *)0;
+
+Fl_Counter *cntr_wpm=(Fl_Counter *)0;
+
+static void cb_cntr_wpm(Fl_Counter*, void*) {
+ set_wpm();
+}
+
+Fl_Check_Button *btn_use_pot=(Fl_Check_Button *)0;
+
+static void cb_btn_use_pot(Fl_Check_Button*, void*) {
+ use_pot_changed();
+}
+
+Fl_Button *btn_msg1=(Fl_Button *)0;
+
+static void cb_btn_msg1(Fl_Button*, void*) {
+ exec_msg1();
+}
+
+Fl_Button *btn_msg2=(Fl_Button *)0;
+
+static void cb_btn_msg2(Fl_Button*, void*) {
+ exec_msg2();
+}
+
+Fl_Button *btn_msg3=(Fl_Button *)0;
+
+static void cb_btn_msg3(Fl_Button*, void*) {
+ exec_msg3();
+}
+
+Fl_Button *btn_msg4=(Fl_Button *)0;
+
+static void cb_btn_msg4(Fl_Button*, void*) {
+ exec_msg4();
+}
+
+Fl_Button *btn_msg5=(Fl_Button *)0;
+
+static void cb_btn_msg5(Fl_Button*, void*) {
+ exec_msg5();
+}
+
+Fl_Button *btn_msg6=(Fl_Button *)0;
+
+static void cb_btn_msg6(Fl_Button*, void*) {
+ exec_msg6();
+}
+
+Fl_Button *btn_msg7=(Fl_Button *)0;
+
+static void cb_btn_msg7(Fl_Button*, void*) {
+ exec_msg7();
+}
+
+Fl_Button *btn_msg8=(Fl_Button *)0;
+
+static void cb_btn_msg8(Fl_Button*, void*) {
+ exec_msg8();
+}
+
+Fl_Button *btn_msg9=(Fl_Button *)0;
+
+static void cb_btn_msg9(Fl_Button*, void*) {
+ exec_msg9();
+}
+
+Fl_Button *btn_msg10=(Fl_Button *)0;
+
+static void cb_btn_msg10(Fl_Button*, void*) {
+ exec_msg10();
+}
+
+Fl_Button *btn_msg11=(Fl_Button *)0;
+
+static void cb_btn_msg11(Fl_Button*, void*) {
+ exec_msg11();
+}
+
+Fl_Button *btn_msg12=(Fl_Button *)0;
+
+static void cb_btn_msg12(Fl_Button*, void*) {
+ exec_msg12();
+}
+
+Fl_Input2 *txt_sta=(Fl_Input2 *)0;
+
+static void cb_txt_sta(Fl_Input2*, void*) {
+ check_call();
+}
+
+Fl_Input2 *txt_name=(Fl_Input2 *)0;
+
+Fl_Input2 *txt_xchg=(Fl_Input2 *)0;
+
+Fl_Button *btn_log_it=(Fl_Button *)0;
+
+static void cb_btn_log_it(Fl_Button*, void*) {
+ if (mnu_log_client->value())
+ xml_add_record();
+else
+ AddRecord();
+txt_sta->take_focus();
+}
+
+Fl_Button *btn_clear=(Fl_Button *)0;
+
+static void cb_btn_clear(Fl_Button*, void*) {
+ txt_sta->value("");
+txt_name->value("");
+txt_xchg->value("");
+txt_sta->color(FL_BACKGROUND2_COLOR);
+txt_sta->take_focus();
+}
+
+Fl_Input *txt_freq=(Fl_Input *)0;
+
+static void cb_txt_freq(Fl_Input*, void*) {
+ check_call();
+}
+
+Fl_Double_Window* WKey_window() {
+ Fl_Double_Window* w;
+ { Fl_Double_Window* o = new Fl_Double_Window(670, 275, _("Fl_WinKey"));
+ w = o;
+ { Fl_Menu_Bar* o = new Fl_Menu_Bar(0, 0, 670, 20);
+ if (!menu__i18n_done) {
+ int i=0;
+ for ( ; i<26; i++)
+ if (menu_[i].label())
+ menu_[i].label(_(menu_[i].label()));
+ menu__i18n_done = 1;
+ }
+ o->menu(menu_);
+ } // Fl_Menu_Bar* o
+ { txt_sent = new FTextView(5, 23, 660, 96);
+ txt_sent->type(12);
+ txt_sent->box(FL_DOWN_BOX);
+ txt_sent->color(FL_BACKGROUND2_COLOR);
+ txt_sent->selection_color(FL_SELECTION_COLOR);
+ txt_sent->labeltype(FL_NORMAL_LABEL);
+ txt_sent->labelfont(0);
+ txt_sent->labelsize(14);
+ txt_sent->labelcolor(FL_FOREGROUND_COLOR);
+ txt_sent->align(Fl_Align(FL_ALIGN_LEFT));
+ txt_sent->when(FL_WHEN_RELEASE);
+ Fl_Group::current()->resizable(txt_sent);
+ } // FTextView* txt_sent
+ { txt_to_send = new FTextTX(5, 121, 660, 68, _("input:"));
+ txt_to_send->type(4);
+ txt_to_send->box(FL_DOWN_BOX);
+ txt_to_send->color(FL_BACKGROUND2_COLOR);
+ txt_to_send->selection_color(FL_SELECTION_COLOR);
+ txt_to_send->labeltype(FL_NORMAL_LABEL);
+ txt_to_send->labelfont(0);
+ txt_to_send->labelsize(14);
+ txt_to_send->labelcolor(FL_FOREGROUND_COLOR);
+ txt_to_send->align(Fl_Align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE));
+ txt_to_send->when(FL_WHEN_CHANGED);
+ } // FTextTX* txt_to_send
+ { btn_send = new Fl_Light_Button(607, 221, 60, 25, _("Send"));
+ btn_send->callback((Fl_Callback*)cb_btn_send);
+ } // Fl_Light_Button* btn_send
+ { btn_tune = new Fl_Light_Button(607, 250, 60, 25, _("Tune"));
+ btn_tune->selection_color((Fl_Color)5);
+ btn_tune->callback((Fl_Callback*)cb_btn_tune);
+ } // Fl_Light_Button* btn_tune
+ { btn_cancel = new Fl_Button(544, 221, 60, 25, _("Cancel"));
+ btn_cancel->callback((Fl_Callback*)cb_btn_cancel);
+ } // Fl_Button* btn_cancel
+ { box_busy = new Fl_Box(7, 241, 16, 16, _("Busy"));
+ box_busy->box(FL_DIAMOND_DOWN_BOX);
+ box_busy->align(Fl_Align(FL_ALIGN_RIGHT));
+ } // Fl_Box* box_busy
+ { box_keydown = new Fl_Box(7, 260, 16, 16, _("Key"));
+ box_keydown->box(FL_DIAMOND_DOWN_BOX);
+ box_keydown->align(Fl_Align(FL_ALIGN_RIGHT));
+ } // Fl_Box* box_keydown
+ { box_break_in = new Fl_Box(64, 222, 16, 16, _("Bk"));
+ box_break_in->box(FL_DIAMOND_DOWN_BOX);
+ box_break_in->align(Fl_Align(FL_ALIGN_RIGHT));
+ } // Fl_Box* box_break_in
+ { box_xoff = new Fl_Box(64, 241, 16, 16, _("Bfr"));
+ box_xoff->box(FL_DIAMOND_DOWN_BOX);
+ box_xoff->align(Fl_Align(FL_ALIGN_RIGHT));
+ } // Fl_Box* box_xoff
+ { box_wait = new Fl_Box(7, 222, 16, 16, _("Wait"));
+ box_wait->box(FL_DIAMOND_DOWN_BOX);
+ box_wait->align(Fl_Align(FL_ALIGN_RIGHT));
+ } // Fl_Box* box_wait
+ { txt_wpm = new Fl_Output(160, 251, 38, 22);
+ } // Fl_Output* txt_wpm
+ { cntr_wpm = new Fl_Counter(146, 222, 64, 22, _("WPM"));
+ cntr_wpm->tooltip(_("flwkey WPM"));
+ cntr_wpm->type(1);
+ cntr_wpm->minimum(10);
+ cntr_wpm->maximum(35);
+ cntr_wpm->step(1);
+ cntr_wpm->value(20);
+ cntr_wpm->callback((Fl_Callback*)cb_cntr_wpm);
+ cntr_wpm->align(Fl_Align(FL_ALIGN_LEFT));
+ } // Fl_Counter* cntr_wpm
+ { btn_use_pot = new Fl_Check_Button(140, 255, 20, 15, _("Pot"));
+ btn_use_pot->tooltip(_("Winkeyer pot controls WPM"));
+ btn_use_pot->down_box(FL_DOWN_BOX);
+ btn_use_pot->callback((Fl_Callback*)cb_btn_use_pot);
+ btn_use_pot->align(Fl_Align(FL_ALIGN_LEFT));
+ btn_use_pot->when(FL_WHEN_CHANGED);
+ } // Fl_Check_Button* btn_use_pot
+ { btn_msg1 = new Fl_Button(4, 197, 50, 20, _("m 1"));
+ btn_msg1->tooltip(_("Action - Fkey/Left click\nEdit - Right click"));
+ btn_msg1->callback((Fl_Callback*)cb_btn_msg1);
+ } // Fl_Button* btn_msg1
+ { btn_msg2 = new Fl_Button(59, 197, 50, 20, _("m 2"));
+ btn_msg2->tooltip(_("Action - Fkey/Left click\nEdit - Right click"));
+ btn_msg2->callback((Fl_Callback*)cb_btn_msg2);
+ } // Fl_Button* btn_msg2
+ { btn_msg3 = new Fl_Button(115, 197, 50, 20, _("m 3"));
+ btn_msg3->tooltip(_("Action - Fkey/Left click\nEdit - Right click"));
+ btn_msg3->callback((Fl_Callback*)cb_btn_msg3);
+ } // Fl_Button* btn_msg3
+ { btn_msg4 = new Fl_Button(170, 197, 50, 20, _("m 4"));
+ btn_msg4->tooltip(_("Action - Fkey/Left click\nEdit - Right click"));
+ btn_msg4->callback((Fl_Callback*)cb_btn_msg4);
+ } // Fl_Button* btn_msg4
+ { btn_msg5 = new Fl_Button(226, 197, 50, 20, _("m 5"));
+ btn_msg5->tooltip(_("Action - Fkey/Left click\nEdit - Right click"));
+ btn_msg5->callback((Fl_Callback*)cb_btn_msg5);
+ } // Fl_Button* btn_msg5
+ { btn_msg6 = new Fl_Button(282, 197, 50, 20, _("m 6"));
+ btn_msg6->tooltip(_("Action - Fkey/Left click\nEdit - Right click"));
+ btn_msg6->callback((Fl_Callback*)cb_btn_msg6);
+ } // Fl_Button* btn_msg6
+ { btn_msg7 = new Fl_Button(337, 197, 50, 20, _("m 7"));
+ btn_msg7->tooltip(_("Action - Fkey/Left click\nEdit - Right click"));
+ btn_msg7->callback((Fl_Callback*)cb_btn_msg7);
+ } // Fl_Button* btn_msg7
+ { btn_msg8 = new Fl_Button(393, 197, 50, 20, _("m 8"));
+ btn_msg8->tooltip(_("Action - Fkey/Left click\nEdit - Right click"));
+ btn_msg8->callback((Fl_Callback*)cb_btn_msg8);
+ } // Fl_Button* btn_msg8
+ { btn_msg9 = new Fl_Button(449, 197, 50, 20, _("m 9"));
+ btn_msg9->tooltip(_("Action - Fkey/Left click\nEdit - Right click"));
+ btn_msg9->callback((Fl_Callback*)cb_btn_msg9);
+ } // Fl_Button* btn_msg9
+ { btn_msg10 = new Fl_Button(504, 197, 50, 20, _("m 10"));
+ btn_msg10->tooltip(_("Action - Fkey/Left click\nEdit - Right click"));
+ btn_msg10->callback((Fl_Callback*)cb_btn_msg10);
+ } // Fl_Button* btn_msg10
+ { btn_msg11 = new Fl_Button(560, 197, 50, 20, _("m 11"));
+ btn_msg11->tooltip(_("Action - Fkey/Left click\nEdit - Right click"));
+ btn_msg11->callback((Fl_Callback*)cb_btn_msg11);
+ } // Fl_Button* btn_msg11
+ { btn_msg12 = new Fl_Button(616, 197, 50, 20, _("m 12"));
+ btn_msg12->tooltip(_("Action - Fkey/Left click\nEdit - Right click"));
+ btn_msg12->callback((Fl_Callback*)cb_btn_msg12);
+ } // Fl_Button* btn_msg12
+ { txt_sta = new Fl_Input2(246, 222, 100, 22, _("STA"));
+ txt_sta->tooltip(_("Other station"));
+ txt_sta->box(FL_DOWN_BOX);
+ txt_sta->color(FL_BACKGROUND2_COLOR);
+ txt_sta->selection_color(FL_SELECTION_COLOR);
+ txt_sta->labeltype(FL_NORMAL_LABEL);
+ txt_sta->labelfont(0);
+ txt_sta->labelsize(14);
+ txt_sta->labelcolor(FL_FOREGROUND_COLOR);
+ txt_sta->callback((Fl_Callback*)cb_txt_sta);
+ txt_sta->align(Fl_Align(FL_ALIGN_LEFT));
+ txt_sta->when(FL_WHEN_CHANGED);
+ } // Fl_Input2* txt_sta
+ { txt_name = new Fl_Input2(383, 222, 100, 22, _("NAM"));
+ txt_name->tooltip(_("Other operator"));
+ txt_name->box(FL_DOWN_BOX);
+ txt_name->color(FL_BACKGROUND2_COLOR);
+ txt_name->selection_color(FL_SELECTION_COLOR);
+ txt_name->labeltype(FL_NORMAL_LABEL);
+ txt_name->labelfont(0);
+ txt_name->labelsize(14);
+ txt_name->labelcolor(FL_FOREGROUND_COLOR);
+ txt_name->align(Fl_Align(FL_ALIGN_LEFT));
+ txt_name->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* txt_name
+ { txt_xchg = new Fl_Input2(381, 251, 100, 22, _("X_in"));
+ txt_xchg->tooltip(_("Rcvd Contest Exchange"));
+ txt_xchg->box(FL_DOWN_BOX);
+ txt_xchg->color(FL_BACKGROUND2_COLOR);
+ txt_xchg->selection_color(FL_SELECTION_COLOR);
+ txt_xchg->labeltype(FL_NORMAL_LABEL);
+ txt_xchg->labelfont(0);
+ txt_xchg->labelsize(14);
+ txt_xchg->labelcolor(FL_FOREGROUND_COLOR);
+ txt_xchg->align(Fl_Align(FL_ALIGN_LEFT));
+ txt_xchg->when(FL_WHEN_CHANGED);
+ } // Fl_Input2* txt_xchg
+ { btn_log_it = new Fl_Button(487, 250, 52, 25, _("Log"));
+ btn_log_it->callback((Fl_Callback*)cb_btn_log_it);
+ } // Fl_Button* btn_log_it
+ { btn_clear = new Fl_Button(487, 221, 52, 25, _("Clear"));
+ btn_clear->callback((Fl_Callback*)cb_btn_clear);
+ } // Fl_Button* btn_clear
+ { txt_freq = new Fl_Input(246, 251, 100, 22, _("Freq:"));
+ txt_freq->tooltip(_("Frequency (MHz preferred)"));
+ txt_freq->callback((Fl_Callback*)cb_txt_freq);
+ txt_freq->when(FL_WHEN_CHANGED);
+ } // Fl_Input* txt_freq
+ o->end();
+ } // Fl_Double_Window* o
+ return w;
+}
+
+Fl_Check_Button *btn_swap=(Fl_Check_Button *)0;
+
+static void cb_btn_swap(Fl_Check_Button*, void*) {
+ change_btn_swap();
+}
+
+Fl_Check_Button *btn_auto_space=(Fl_Check_Button *)0;
+
+static void cb_btn_auto_space(Fl_Check_Button*, void*) {
+ change_btn_auto_space();
+}
+
+Fl_Check_Button *btn_ct_space=(Fl_Check_Button *)0;
+
+static void cb_btn_ct_space(Fl_Check_Button*, void*) {
+ change_btn_ct_space();
+}
+
+Fl_Check_Button *btn_paddledog=(Fl_Check_Button *)0;
+
+static void cb_btn_paddledog(Fl_Check_Button*, void*) {
+ change_btn_paddledog();
+}
+
+Fl_Check_Button *btn_cut_zeronine=(Fl_Check_Button *)0;
+
+static void cb_btn_cut_zeronine(Fl_Check_Button*, void*) {
+ change_btn_cut_zeronine();
+}
+
+Fl_Check_Button *btn_paddle_echo=(Fl_Check_Button *)0;
+
+static void cb_btn_paddle_echo(Fl_Check_Button*, void*) {
+ change_btn_paddle_echo();
+}
+
+Fl_Check_Button *btn_serial_echo=(Fl_Check_Button *)0;
+
+static void cb_btn_serial_echo(Fl_Check_Button*, void*) {
+ change_btn_serial_echo();
+}
+
+Fl_Check_Button *btn_sidetone_on=(Fl_Check_Button *)0;
+
+static void cb_btn_sidetone_on(Fl_Check_Button*, void*) {
+ change_btn_sidetone_on();
+}
+
+Fl_Check_Button *btn_tone_on=(Fl_Check_Button *)0;
+
+static void cb_btn_tone_on(Fl_Check_Button*, void*) {
+ change_btn_tone_on();
+}
+
+Fl_Check_Button *btn_ptt_on=(Fl_Check_Button *)0;
+
+static void cb_btn_ptt_on(Fl_Check_Button*, void*) {
+ change_btn_ptt_on();
+}
+
+Fl_Counter *cntr_min_wpm=(Fl_Counter *)0;
+
+static void cb_cntr_min_wpm(Fl_Counter*, void*) {
+ change_cntr_min_wpm();
+}
+
+Fl_Counter *cntr_rng_wpm=(Fl_Counter *)0;
+
+static void cb_cntr_rng_wpm(Fl_Counter*, void*) {
+ change_cntr_rng_wpm();
+}
+
+Fl_Counter *cntr_farnsworth=(Fl_Counter *)0;
+
+static void cb_cntr_farnsworth(Fl_Counter*, void*) {
+ change_cntr_farnsworth();
+}
+
+Fl_Counter *cntr_cmd_wpm=(Fl_Counter *)0;
+
+static void cb_cntr_cmd_wpm(Fl_Counter*, void*) {
+ change_cntr_cmd_wpm();
+}
+
+Fl_Counter *cntr_ratio=(Fl_Counter *)0;
+
+static void cb_cntr_ratio(Fl_Counter*, void*) {
+ change_cntr_ratio();
+}
+
+Fl_Counter *cntr_comp=(Fl_Counter *)0;
+
+static void cb_cntr_comp(Fl_Counter*, void*) {
+ change_cntr_comp();
+}
+
+Fl_Counter *cntr_first_ext=(Fl_Counter *)0;
+
+static void cb_cntr_first_ext(Fl_Counter*, void*) {
+ change_cntr_first_ext();
+}
+
+Fl_Counter *cntr_sample=(Fl_Counter *)0;
+
+static void cb_cntr_sample(Fl_Counter*, void*) {
+ change_cntr_sample();
+}
+
+Fl_Counter *cntr_weight=(Fl_Counter *)0;
+
+static void cb_cntr_weight(Fl_Counter*, void*) {
+ change_cntr_weight();
+}
+
+Fl_Counter *cntr_leadin=(Fl_Counter *)0;
+
+static void cb_cntr_leadin(Fl_Counter*, void*) {
+ change_cntr_leadin();
+}
+
+Fl_Counter *cntr_tail=(Fl_Counter *)0;
+
+static void cb_cntr_tail(Fl_Counter*, void*) {
+ change_cntr_tail();
+}
+
+Fl_ComboBox *choice_keyer_mode=(Fl_ComboBox *)0;
+
+static void cb_choice_keyer_mode(Fl_ComboBox*, void*) {
+ change_choice_keyer_mode();
+}
+
+Fl_ComboBox *choice_hang=(Fl_ComboBox *)0;
+
+static void cb_choice_hang(Fl_ComboBox*, void*) {
+ change_choice_hang();
+}
+
+Fl_ComboBox *choice_sidetone=(Fl_ComboBox *)0;
+
+static void cb_choice_sidetone(Fl_ComboBox*, void*) {
+ change_choice_sidetone();
+}
+
+Fl_ComboBox *choice_output_pins=(Fl_ComboBox *)0;
+
+static void cb_choice_output_pins(Fl_ComboBox*, void*) {
+ change_choice_output_pins();
+}
+
+Fl_Button *btn_done_parameters=(Fl_Button *)0;
+
+static void cb_btn_done_parameters(Fl_Button*, void*) {
+ done_parameters();
+}
+
+Fl_Double_Window* make_parameters_dialog() {
+ Fl_Double_Window* w;
+ { Fl_Double_Window* o = new Fl_Double_Window(515, 232, _("WKeyer Parameters"));
+ w = o;
+ { Fl_Group* o = new Fl_Group(5, 23, 115, 114, _("ModeReg"));
+ o->box(FL_ENGRAVED_FRAME);
+ { btn_swap = new Fl_Check_Button(15, 31, 70, 15, _("Swap"));
+ btn_swap->down_box(FL_DOWN_BOX);
+ btn_swap->callback((Fl_Callback*)cb_btn_swap);
+ } // Fl_Check_Button* btn_swap
+ { btn_auto_space = new Fl_Check_Button(15, 51, 70, 15, _("Auto Space"));
+ btn_auto_space->down_box(FL_DOWN_BOX);
+ btn_auto_space->callback((Fl_Callback*)cb_btn_auto_space);
+ } // Fl_Check_Button* btn_auto_space
+ { btn_ct_space = new Fl_Check_Button(15, 72, 70, 15, _("CT space"));
+ btn_ct_space->down_box(FL_DOWN_BOX);
+ btn_ct_space->callback((Fl_Callback*)cb_btn_ct_space);
+ } // Fl_Check_Button* btn_ct_space
+ { btn_paddledog = new Fl_Check_Button(15, 92, 70, 15, _("Paddle Dog"));
+ btn_paddledog->down_box(FL_DOWN_BOX);
+ btn_paddledog->callback((Fl_Callback*)cb_btn_paddledog);
+ } // Fl_Check_Button* btn_paddledog
+ { btn_cut_zeronine = new Fl_Check_Button(15, 113, 70, 15, _("Cut 0/9"));
+ btn_cut_zeronine->down_box(FL_DOWN_BOX);
+ btn_cut_zeronine->callback((Fl_Callback*)cb_btn_cut_zeronine);
+ } // Fl_Check_Button* btn_cut_zeronine
+ o->end();
+ } // Fl_Group* o
+ { Fl_Group* o = new Fl_Group(122, 23, 115, 114, _("ModeReg"));
+ o->box(FL_ENGRAVED_FRAME);
+ { btn_paddle_echo = new Fl_Check_Button(128, 31, 70, 15, _("Paddle echo"));
+ btn_paddle_echo->down_box(FL_DOWN_BOX);
+ btn_paddle_echo->callback((Fl_Callback*)cb_btn_paddle_echo);
+ } // Fl_Check_Button* btn_paddle_echo
+ { btn_serial_echo = new Fl_Check_Button(128, 51, 70, 15, _("Serial echo"));
+ btn_serial_echo->down_box(FL_DOWN_BOX);
+ btn_serial_echo->callback((Fl_Callback*)cb_btn_serial_echo);
+ } // Fl_Check_Button* btn_serial_echo
+ { btn_sidetone_on = new Fl_Check_Button(128, 71, 103, 15, _("Tone Keyer"));
+ btn_sidetone_on->down_box(FL_DOWN_BOX);
+ btn_sidetone_on->callback((Fl_Callback*)cb_btn_sidetone_on);
+ } // Fl_Check_Button* btn_sidetone_on
+ { btn_tone_on = new Fl_Check_Button(128, 92, 87, 15, _("Tone ON"));
+ btn_tone_on->down_box(FL_DOWN_BOX);
+ btn_tone_on->callback((Fl_Callback*)cb_btn_tone_on);
+ } // Fl_Check_Button* btn_tone_on
+ { btn_ptt_on = new Fl_Check_Button(128, 113, 87, 15, _("PTT ON"));
+ btn_ptt_on->down_box(FL_DOWN_BOX);
+ btn_ptt_on->callback((Fl_Callback*)cb_btn_ptt_on);
+ } // Fl_Check_Button* btn_ptt_on
+ o->end();
+ } // Fl_Group* o
+ { Fl_Group* o = new Fl_Group(240, 23, 112, 165, _("WPM Settings"));
+ o->box(FL_ENGRAVED_FRAME);
+ { cntr_min_wpm = new Fl_Counter(261, 31, 64, 20, _("Min WPM"));
+ cntr_min_wpm->type(1);
+ cntr_min_wpm->callback((Fl_Callback*)cb_cntr_min_wpm);
+ } // Fl_Counter* cntr_min_wpm
+ { cntr_rng_wpm = new Fl_Counter(261, 68, 64, 20, _("Rng WPM"));
+ cntr_rng_wpm->type(1);
+ cntr_rng_wpm->callback((Fl_Callback*)cb_cntr_rng_wpm);
+ } // Fl_Counter* cntr_rng_wpm
+ { cntr_farnsworth = new Fl_Counter(261, 105, 64, 20, _("Farsnworth"));
+ cntr_farnsworth->type(1);
+ cntr_farnsworth->callback((Fl_Callback*)cb_cntr_farnsworth);
+ } // Fl_Counter* cntr_farnsworth
+ { cntr_cmd_wpm = new Fl_Counter(261, 143, 64, 20, _("Cmd WPM"));
+ cntr_cmd_wpm->type(1);
+ cntr_cmd_wpm->callback((Fl_Callback*)cb_cntr_cmd_wpm);
+ } // Fl_Counter* cntr_cmd_wpm
+ o->end();
+ } // Fl_Group* o
+ { Fl_Group* o = new Fl_Group(353, 23, 159, 165, _("Timing/Settings"));
+ o->box(FL_ENGRAVED_FRAME);
+ { cntr_ratio = new Fl_Counter(365, 31, 64, 20, _("Ratio"));
+ cntr_ratio->type(1);
+ cntr_ratio->callback((Fl_Callback*)cb_cntr_ratio);
+ } // Fl_Counter* cntr_ratio
+ { cntr_comp = new Fl_Counter(365, 68, 64, 20, _("Comp"));
+ cntr_comp->type(1);
+ cntr_comp->callback((Fl_Callback*)cb_cntr_comp);
+ } // Fl_Counter* cntr_comp
+ { cntr_first_ext = new Fl_Counter(365, 105, 64, 20, _("1st Ext"));
+ cntr_first_ext->type(1);
+ cntr_first_ext->callback((Fl_Callback*)cb_cntr_first_ext);
+ } // Fl_Counter* cntr_first_ext
+ { cntr_sample = new Fl_Counter(365, 143, 64, 20, _("Sample"));
+ cntr_sample->type(1);
+ cntr_sample->callback((Fl_Callback*)cb_cntr_sample);
+ } // Fl_Counter* cntr_sample
+ { cntr_weight = new Fl_Counter(436, 31, 64, 20, _("Weight"));
+ cntr_weight->type(1);
+ cntr_weight->callback((Fl_Callback*)cb_cntr_weight);
+ } // Fl_Counter* cntr_weight
+ { cntr_leadin = new Fl_Counter(436, 68, 64, 20, _("Leadin"));
+ cntr_leadin->type(1);
+ cntr_leadin->callback((Fl_Callback*)cb_cntr_leadin);
+ } // Fl_Counter* cntr_leadin
+ { cntr_tail = new Fl_Counter(436, 105, 64, 20, _("Tail"));
+ cntr_tail->type(1);
+ cntr_tail->callback((Fl_Callback*)cb_cntr_tail);
+ } // Fl_Counter* cntr_tail
+ o->end();
+ } // Fl_Group* o
+ { Fl_Group* o = new Fl_Group(5, 138, 232, 90);
+ o->box(FL_ENGRAVED_FRAME);
+ { choice_keyer_mode = new Fl_ComboBox(20, 143, 90, 22, _("Keyer Mode"));
+ choice_keyer_mode->box(FL_BORDER_BOX);
+ choice_keyer_mode->color(FL_BACKGROUND_COLOR);
+ choice_keyer_mode->selection_color(FL_BACKGROUND_COLOR);
+ choice_keyer_mode->labeltype(FL_NORMAL_LABEL);
+ choice_keyer_mode->labelfont(0);
+ choice_keyer_mode->labelsize(14);
+ choice_keyer_mode->labelcolor(FL_FOREGROUND_COLOR);
+ choice_keyer_mode->callback((Fl_Callback*)cb_choice_keyer_mode);
+ choice_keyer_mode->align(Fl_Align(FL_ALIGN_BOTTOM));
+ choice_keyer_mode->when(FL_WHEN_RELEASE);
+ choice_keyer_mode->end();
+ } // Fl_ComboBox* choice_keyer_mode
+ { choice_hang = new Fl_ComboBox(130, 143, 90, 22, _("Hang"));
+ choice_hang->box(FL_BORDER_BOX);
+ choice_hang->color(FL_BACKGROUND_COLOR);
+ choice_hang->selection_color(FL_BACKGROUND_COLOR);
+ choice_hang->labeltype(FL_NORMAL_LABEL);
+ choice_hang->labelfont(0);
+ choice_hang->labelsize(14);
+ choice_hang->labelcolor(FL_FOREGROUND_COLOR);
+ choice_hang->callback((Fl_Callback*)cb_choice_hang);
+ choice_hang->align(Fl_Align(FL_ALIGN_BOTTOM));
+ choice_hang->when(FL_WHEN_RELEASE);
+ choice_hang->end();
+ } // Fl_ComboBox* choice_hang
+ { choice_sidetone = new Fl_ComboBox(20, 185, 90, 22, _("Sidetone"));
+ choice_sidetone->box(FL_BORDER_BOX);
+ choice_sidetone->color(FL_BACKGROUND_COLOR);
+ choice_sidetone->selection_color(FL_BACKGROUND_COLOR);
+ choice_sidetone->labeltype(FL_NORMAL_LABEL);
+ choice_sidetone->labelfont(0);
+ choice_sidetone->labelsize(14);
+ choice_sidetone->labelcolor(FL_FOREGROUND_COLOR);
+ choice_sidetone->callback((Fl_Callback*)cb_choice_sidetone);
+ choice_sidetone->align(Fl_Align(FL_ALIGN_BOTTOM));
+ choice_sidetone->when(FL_WHEN_RELEASE);
+ choice_sidetone->end();
+ } // Fl_ComboBox* choice_sidetone
+ { choice_output_pins = new Fl_ComboBox(130, 185, 90, 22, _("Output PIns"));
+ choice_output_pins->box(FL_BORDER_BOX);
+ choice_output_pins->color(FL_BACKGROUND_COLOR);
+ choice_output_pins->selection_color(FL_BACKGROUND_COLOR);
+ choice_output_pins->labeltype(FL_NORMAL_LABEL);
+ choice_output_pins->labelfont(0);
+ choice_output_pins->labelsize(14);
+ choice_output_pins->labelcolor(FL_FOREGROUND_COLOR);
+ choice_output_pins->callback((Fl_Callback*)cb_choice_output_pins);
+ choice_output_pins->align(Fl_Align(FL_ALIGN_BOTTOM));
+ choice_output_pins->when(FL_WHEN_RELEASE);
+ choice_output_pins->end();
+ } // Fl_ComboBox* choice_output_pins
+ o->end();
+ } // Fl_Group* o
+ { btn_done_parameters = new Fl_Button(411, 194, 75, 27, _("Done"));
+ btn_done_parameters->callback((Fl_Callback*)cb_btn_done_parameters);
+ } // Fl_Button* btn_done_parameters
+ o->end();
+ } // Fl_Double_Window* o
+ return w;
+}
+
+Fl_Input2 *label_1=(Fl_Input2 *)0;
+
+Fl_Input2 *edit_msg1=(Fl_Input2 *)0;
+
+Fl_Input2 *label_2=(Fl_Input2 *)0;
+
+Fl_Input2 *edit_msg2=(Fl_Input2 *)0;
+
+Fl_Input2 *label_3=(Fl_Input2 *)0;
+
+Fl_Input2 *edit_msg3=(Fl_Input2 *)0;
+
+Fl_Input2 *label_4=(Fl_Input2 *)0;
+
+Fl_Input2 *edit_msg4=(Fl_Input2 *)0;
+
+Fl_Input2 *label_5=(Fl_Input2 *)0;
+
+Fl_Input2 *edit_msg5=(Fl_Input2 *)0;
+
+Fl_Input2 *label_6=(Fl_Input2 *)0;
+
+Fl_Input2 *edit_msg6=(Fl_Input2 *)0;
+
+Fl_Input2 *label_7=(Fl_Input2 *)0;
+
+Fl_Input2 *edit_msg7=(Fl_Input2 *)0;
+
+Fl_Input2 *label_8=(Fl_Input2 *)0;
+
+Fl_Input2 *edit_msg8=(Fl_Input2 *)0;
+
+Fl_Input2 *label_9=(Fl_Input2 *)0;
+
+Fl_Input2 *edit_msg9=(Fl_Input2 *)0;
+
+Fl_Input2 *label_10=(Fl_Input2 *)0;
+
+Fl_Input2 *edit_msg10=(Fl_Input2 *)0;
+
+Fl_Button *btn_done_edit=(Fl_Button *)0;
+
+static void cb_btn_done_edit(Fl_Button*, void*) {
+ done_edit();
+}
+
+Fl_Button *btn_cancel_edit=(Fl_Button *)0;
+
+static void cb_btn_cancel_edit(Fl_Button*, void*) {
+ cancel_edit();
+}
+
+Fl_Button *btn_apply_edit=(Fl_Button *)0;
+
+static void cb_btn_apply_edit(Fl_Button*, void*) {
+ apply_edit();
+}
+
+Fl_Input2 *label_11=(Fl_Input2 *)0;
+
+Fl_Input2 *edit_msg11=(Fl_Input2 *)0;
+
+Fl_Input2 *label_12=(Fl_Input2 *)0;
+
+Fl_Input2 *edit_msg12=(Fl_Input2 *)0;
+
+Fl_Double_Window* make_message_editor() {
+ Fl_Double_Window* w;
+ { Fl_Double_Window* o = new Fl_Double_Window(600, 350, _("Message Editor"));
+ w = o;
+ { label_1 = new Fl_Input2(30, 31, 50, 22, _("1:"));
+ label_1->box(FL_DOWN_BOX);
+ label_1->color(FL_BACKGROUND2_COLOR);
+ label_1->selection_color(FL_SELECTION_COLOR);
+ label_1->labeltype(FL_NORMAL_LABEL);
+ label_1->labelfont(0);
+ label_1->labelsize(14);
+ label_1->labelcolor(FL_FOREGROUND_COLOR);
+ label_1->align(Fl_Align(FL_ALIGN_LEFT));
+ label_1->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* label_1
+ { edit_msg1 = new Fl_Input2(85, 31, 375, 22);
+ edit_msg1->box(FL_DOWN_BOX);
+ edit_msg1->color(FL_BACKGROUND2_COLOR);
+ edit_msg1->selection_color(FL_SELECTION_COLOR);
+ edit_msg1->labeltype(FL_NORMAL_LABEL);
+ edit_msg1->labelfont(0);
+ edit_msg1->labelsize(14);
+ edit_msg1->labelcolor(FL_FOREGROUND_COLOR);
+ edit_msg1->align(Fl_Align(FL_ALIGN_LEFT));
+ edit_msg1->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* edit_msg1
+ { label_2 = new Fl_Input2(30, 57, 50, 22, _("2:"));
+ label_2->box(FL_DOWN_BOX);
+ label_2->color(FL_BACKGROUND2_COLOR);
+ label_2->selection_color(FL_SELECTION_COLOR);
+ label_2->labeltype(FL_NORMAL_LABEL);
+ label_2->labelfont(0);
+ label_2->labelsize(14);
+ label_2->labelcolor(FL_FOREGROUND_COLOR);
+ label_2->align(Fl_Align(FL_ALIGN_LEFT));
+ label_2->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* label_2
+ { edit_msg2 = new Fl_Input2(85, 57, 375, 22);
+ edit_msg2->box(FL_DOWN_BOX);
+ edit_msg2->color(FL_BACKGROUND2_COLOR);
+ edit_msg2->selection_color(FL_SELECTION_COLOR);
+ edit_msg2->labeltype(FL_NORMAL_LABEL);
+ edit_msg2->labelfont(0);
+ edit_msg2->labelsize(14);
+ edit_msg2->labelcolor(FL_FOREGROUND_COLOR);
+ edit_msg2->align(Fl_Align(FL_ALIGN_LEFT));
+ edit_msg2->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* edit_msg2
+ { label_3 = new Fl_Input2(30, 83, 50, 22, _("3:"));
+ label_3->box(FL_DOWN_BOX);
+ label_3->color(FL_BACKGROUND2_COLOR);
+ label_3->selection_color(FL_SELECTION_COLOR);
+ label_3->labeltype(FL_NORMAL_LABEL);
+ label_3->labelfont(0);
+ label_3->labelsize(14);
+ label_3->labelcolor(FL_FOREGROUND_COLOR);
+ label_3->align(Fl_Align(FL_ALIGN_LEFT));
+ label_3->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* label_3
+ { edit_msg3 = new Fl_Input2(85, 83, 375, 22);
+ edit_msg3->box(FL_DOWN_BOX);
+ edit_msg3->color(FL_BACKGROUND2_COLOR);
+ edit_msg3->selection_color(FL_SELECTION_COLOR);
+ edit_msg3->labeltype(FL_NORMAL_LABEL);
+ edit_msg3->labelfont(0);
+ edit_msg3->labelsize(14);
+ edit_msg3->labelcolor(FL_FOREGROUND_COLOR);
+ edit_msg3->align(Fl_Align(FL_ALIGN_LEFT));
+ edit_msg3->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* edit_msg3
+ { label_4 = new Fl_Input2(30, 110, 50, 22, _("4:"));
+ label_4->box(FL_DOWN_BOX);
+ label_4->color(FL_BACKGROUND2_COLOR);
+ label_4->selection_color(FL_SELECTION_COLOR);
+ label_4->labeltype(FL_NORMAL_LABEL);
+ label_4->labelfont(0);
+ label_4->labelsize(14);
+ label_4->labelcolor(FL_FOREGROUND_COLOR);
+ label_4->align(Fl_Align(FL_ALIGN_LEFT));
+ label_4->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* label_4
+ { edit_msg4 = new Fl_Input2(85, 110, 375, 22);
+ edit_msg4->box(FL_DOWN_BOX);
+ edit_msg4->color(FL_BACKGROUND2_COLOR);
+ edit_msg4->selection_color(FL_SELECTION_COLOR);
+ edit_msg4->labeltype(FL_NORMAL_LABEL);
+ edit_msg4->labelfont(0);
+ edit_msg4->labelsize(14);
+ edit_msg4->labelcolor(FL_FOREGROUND_COLOR);
+ edit_msg4->align(Fl_Align(FL_ALIGN_LEFT));
+ edit_msg4->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* edit_msg4
+ { label_5 = new Fl_Input2(30, 136, 50, 22, _("5:"));
+ label_5->box(FL_DOWN_BOX);
+ label_5->color(FL_BACKGROUND2_COLOR);
+ label_5->selection_color(FL_SELECTION_COLOR);
+ label_5->labeltype(FL_NORMAL_LABEL);
+ label_5->labelfont(0);
+ label_5->labelsize(14);
+ label_5->labelcolor(FL_FOREGROUND_COLOR);
+ label_5->align(Fl_Align(FL_ALIGN_LEFT));
+ label_5->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* label_5
+ { edit_msg5 = new Fl_Input2(85, 136, 375, 22);
+ edit_msg5->box(FL_DOWN_BOX);
+ edit_msg5->color(FL_BACKGROUND2_COLOR);
+ edit_msg5->selection_color(FL_SELECTION_COLOR);
+ edit_msg5->labeltype(FL_NORMAL_LABEL);
+ edit_msg5->labelfont(0);
+ edit_msg5->labelsize(14);
+ edit_msg5->labelcolor(FL_FOREGROUND_COLOR);
+ edit_msg5->align(Fl_Align(FL_ALIGN_LEFT));
+ edit_msg5->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* edit_msg5
+ { label_6 = new Fl_Input2(30, 162, 50, 22, _("6:"));
+ label_6->box(FL_DOWN_BOX);
+ label_6->color(FL_BACKGROUND2_COLOR);
+ label_6->selection_color(FL_SELECTION_COLOR);
+ label_6->labeltype(FL_NORMAL_LABEL);
+ label_6->labelfont(0);
+ label_6->labelsize(14);
+ label_6->labelcolor(FL_FOREGROUND_COLOR);
+ label_6->align(Fl_Align(FL_ALIGN_LEFT));
+ label_6->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* label_6
+ { edit_msg6 = new Fl_Input2(85, 162, 375, 22);
+ edit_msg6->box(FL_DOWN_BOX);
+ edit_msg6->color(FL_BACKGROUND2_COLOR);
+ edit_msg6->selection_color(FL_SELECTION_COLOR);
+ edit_msg6->labeltype(FL_NORMAL_LABEL);
+ edit_msg6->labelfont(0);
+ edit_msg6->labelsize(14);
+ edit_msg6->labelcolor(FL_FOREGROUND_COLOR);
+ edit_msg6->align(Fl_Align(FL_ALIGN_LEFT));
+ edit_msg6->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* edit_msg6
+ { label_7 = new Fl_Input2(30, 189, 50, 22, _("7:"));
+ label_7->box(FL_DOWN_BOX);
+ label_7->color(FL_BACKGROUND2_COLOR);
+ label_7->selection_color(FL_SELECTION_COLOR);
+ label_7->labeltype(FL_NORMAL_LABEL);
+ label_7->labelfont(0);
+ label_7->labelsize(14);
+ label_7->labelcolor(FL_FOREGROUND_COLOR);
+ label_7->align(Fl_Align(FL_ALIGN_LEFT));
+ label_7->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* label_7
+ { edit_msg7 = new Fl_Input2(85, 189, 375, 22);
+ edit_msg7->box(FL_DOWN_BOX);
+ edit_msg7->color(FL_BACKGROUND2_COLOR);
+ edit_msg7->selection_color(FL_SELECTION_COLOR);
+ edit_msg7->labeltype(FL_NORMAL_LABEL);
+ edit_msg7->labelfont(0);
+ edit_msg7->labelsize(14);
+ edit_msg7->labelcolor(FL_FOREGROUND_COLOR);
+ edit_msg7->align(Fl_Align(FL_ALIGN_LEFT));
+ edit_msg7->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* edit_msg7
+ { label_8 = new Fl_Input2(30, 215, 50, 22, _("8:"));
+ label_8->box(FL_DOWN_BOX);
+ label_8->color(FL_BACKGROUND2_COLOR);
+ label_8->selection_color(FL_SELECTION_COLOR);
+ label_8->labeltype(FL_NORMAL_LABEL);
+ label_8->labelfont(0);
+ label_8->labelsize(14);
+ label_8->labelcolor(FL_FOREGROUND_COLOR);
+ label_8->align(Fl_Align(FL_ALIGN_LEFT));
+ label_8->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* label_8
+ { edit_msg8 = new Fl_Input2(85, 215, 375, 22);
+ edit_msg8->box(FL_DOWN_BOX);
+ edit_msg8->color(FL_BACKGROUND2_COLOR);
+ edit_msg8->selection_color(FL_SELECTION_COLOR);
+ edit_msg8->labeltype(FL_NORMAL_LABEL);
+ edit_msg8->labelfont(0);
+ edit_msg8->labelsize(14);
+ edit_msg8->labelcolor(FL_FOREGROUND_COLOR);
+ edit_msg8->align(Fl_Align(FL_ALIGN_LEFT));
+ edit_msg8->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* edit_msg8
+ { label_9 = new Fl_Input2(30, 241, 50, 22, _("9:"));
+ label_9->box(FL_DOWN_BOX);
+ label_9->color(FL_BACKGROUND2_COLOR);
+ label_9->selection_color(FL_SELECTION_COLOR);
+ label_9->labeltype(FL_NORMAL_LABEL);
+ label_9->labelfont(0);
+ label_9->labelsize(14);
+ label_9->labelcolor(FL_FOREGROUND_COLOR);
+ label_9->align(Fl_Align(FL_ALIGN_LEFT));
+ label_9->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* label_9
+ { edit_msg9 = new Fl_Input2(85, 241, 375, 22);
+ edit_msg9->box(FL_DOWN_BOX);
+ edit_msg9->color(FL_BACKGROUND2_COLOR);
+ edit_msg9->selection_color(FL_SELECTION_COLOR);
+ edit_msg9->labeltype(FL_NORMAL_LABEL);
+ edit_msg9->labelfont(0);
+ edit_msg9->labelsize(14);
+ edit_msg9->labelcolor(FL_FOREGROUND_COLOR);
+ edit_msg9->align(Fl_Align(FL_ALIGN_LEFT));
+ edit_msg9->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* edit_msg9
+ { label_10 = new Fl_Input2(30, 268, 50, 22, _("10:"));
+ label_10->box(FL_DOWN_BOX);
+ label_10->color(FL_BACKGROUND2_COLOR);
+ label_10->selection_color(FL_SELECTION_COLOR);
+ label_10->labeltype(FL_NORMAL_LABEL);
+ label_10->labelfont(0);
+ label_10->labelsize(14);
+ label_10->labelcolor(FL_FOREGROUND_COLOR);
+ label_10->align(Fl_Align(FL_ALIGN_LEFT));
+ label_10->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* label_10
+ { edit_msg10 = new Fl_Input2(85, 268, 375, 22);
+ edit_msg10->box(FL_DOWN_BOX);
+ edit_msg10->color(FL_BACKGROUND2_COLOR);
+ edit_msg10->selection_color(FL_SELECTION_COLOR);
+ edit_msg10->labeltype(FL_NORMAL_LABEL);
+ edit_msg10->labelfont(0);
+ edit_msg10->labelsize(14);
+ edit_msg10->labelcolor(FL_FOREGROUND_COLOR);
+ edit_msg10->align(Fl_Align(FL_ALIGN_LEFT));
+ edit_msg10->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* edit_msg10
+ { btn_done_edit = new Fl_Button(535, 305, 56, 26, _("Done"));
+ btn_done_edit->callback((Fl_Callback*)cb_btn_done_edit);
+ } // Fl_Button* btn_done_edit
+ { btn_cancel_edit = new Fl_Button(465, 276, 65, 26, _("Cancel"));
+ btn_cancel_edit->callback((Fl_Callback*)cb_btn_cancel_edit);
+ } // Fl_Button* btn_cancel_edit
+ { btn_apply_edit = new Fl_Button(465, 305, 65, 26, _("Apply"));
+ btn_apply_edit->callback((Fl_Callback*)cb_btn_apply_edit);
+ } // Fl_Button* btn_apply_edit
+ { new Fl_Box(201, 9, 223, 19, _("Message Text"));
+ } // Fl_Box* o
+ { new Fl_Box(12, 8, 84, 23, _("Msg Label"));
+ } // Fl_Box* o
+ { Fl_Group* o = new Fl_Group(464, 4, 65, 252);
+ o->box(FL_ENGRAVED_FRAME);
+ { new Fl_Box(469, 7, 54, 20, _("Tags"));
+ } // Fl_Box* o
+ { Fl_Box* o = new Fl_Box(469, 36, 55, 20, _("<CLL>"));
+ o->tooltip(_("Your call"));
+ } // Fl_Box* o
+ { Fl_Box* o = new Fl_Box(469, 56, 55, 20, _("<QTH>"));
+ o->tooltip(_("Your qth"));
+ } // Fl_Box* o
+ { Fl_Box* o = new Fl_Box(469, 76, 55, 20, _("<LOC>"));
+ o->tooltip(_("Your location"));
+ } // Fl_Box* o
+ { Fl_Box* o = new Fl_Box(469, 96, 55, 20, _("<OPR>"));
+ o->tooltip(_("Your name"));
+ } // Fl_Box* o
+ { Fl_Box* o = new Fl_Box(469, 115, 55, 20, _("<STA>"));
+ o->tooltip(_("Other stations callsign"));
+ } // Fl_Box* o
+ { Fl_Box* o = new Fl_Box(469, 134, 55, 20, _("<NAM>"));
+ o->tooltip(_("Other stations name"));
+ } // Fl_Box* o
+ { Fl_Box* o = new Fl_Box(469, 151, 55, 20, _("<#>"));
+ o->tooltip(_("Serial OUT"));
+ } // Fl_Box* o
+ { Fl_Box* o = new Fl_Box(469, 170, 55, 20, _("<+>"));
+ o->tooltip(_("Increment serial #"));
+ } // Fl_Box* o
+ { Fl_Box* o = new Fl_Box(469, 189, 55, 20, _("<->"));
+ o->tooltip(_("Decrement serial #"));
+ } // Fl_Box* o
+ { Fl_Box* o = new Fl_Box(469, 208, 55, 20, _("<LOG>"));
+ o->tooltip(_("Append entry to logbook"));
+ } // Fl_Box* o
+ { Fl_Box* o = new Fl_Box(469, 229, 55, 20, _("<X>"));
+ o->tooltip(_("Xout text"));
+ } // Fl_Box* o
+ o->end();
+ } // Fl_Group* o
+ { Fl_Group* o = new Fl_Group(529, 4, 65, 252);
+ o->box(FL_ENGRAVED_FRAME);
+ { new Fl_Box(532, 7, 59, 20, _("ProSign"));
+ } // Fl_Box* o
+ { Fl_Box* o = new Fl_Box(531, 36, 60, 20, _("\" RR"));
+ o->tooltip(_(".-..-."));
+ } // Fl_Box* o
+ { Fl_Box* o = new Fl_Box(531, 56, 60, 20, _("$ SX"));
+ o->tooltip(_("...-..-"));
+ } // Fl_Box* o
+ { Fl_Box* o = new Fl_Box(531, 75, 60, 20, _("\' WG"));
+ o->tooltip(_(".----."));
+ } // Fl_Box* o
+ { Fl_Box* o = new Fl_Box(531, 94, 60, 20, _("( KN"));
+ o->tooltip(_("-.--."));
+ } // Fl_Box* o
+ { Fl_Box* o = new Fl_Box(531, 113, 60, 20, _(") KK"));
+ o->tooltip(_("-.--.-"));
+ } // Fl_Box* o
+ { Fl_Box* o = new Fl_Box(531, 132, 60, 20, _("+ AR"));
+ o->tooltip(_(".-.-."));
+ } // Fl_Box* o
+ { Fl_Box* o = new Fl_Box(531, 151, 60, 20, _("< AR"));
+ o->tooltip(_(".-.-."));
+ } // Fl_Box* o
+ { Fl_Box* o = new Fl_Box(531, 170, 60, 20, _("> SK"));
+ o->tooltip(_("...-.-"));
+ } // Fl_Box* o
+ { Fl_Box* o = new Fl_Box(531, 189, 60, 20, _("= BT"));
+ o->tooltip(_("-...-"));
+ } // Fl_Box* o
+ { Fl_Box* o = new Fl_Box(531, 208, 60, 20, _("- DU"));
+ o->tooltip(_("-....-"));
+ } // Fl_Box* o
+ { Fl_Box* o = new Fl_Box(531, 229, 60, 20, _("@@ AC"));
+ o->tooltip(_(".--.-."));
+ } // Fl_Box* o
+ o->end();
+ } // Fl_Group* o
+ { label_11 = new Fl_Input2(29, 294, 50, 22, _("11:"));
+ label_11->box(FL_DOWN_BOX);
+ label_11->color(FL_BACKGROUND2_COLOR);
+ label_11->selection_color(FL_SELECTION_COLOR);
+ label_11->labeltype(FL_NORMAL_LABEL);
+ label_11->labelfont(0);
+ label_11->labelsize(14);
+ label_11->labelcolor(FL_FOREGROUND_COLOR);
+ label_11->align(Fl_Align(FL_ALIGN_LEFT));
+ label_11->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* label_11
+ { edit_msg11 = new Fl_Input2(84, 294, 375, 22);
+ edit_msg11->box(FL_DOWN_BOX);
+ edit_msg11->color(FL_BACKGROUND2_COLOR);
+ edit_msg11->selection_color(FL_SELECTION_COLOR);
+ edit_msg11->labeltype(FL_NORMAL_LABEL);
+ edit_msg11->labelfont(0);
+ edit_msg11->labelsize(14);
+ edit_msg11->labelcolor(FL_FOREGROUND_COLOR);
+ edit_msg11->align(Fl_Align(FL_ALIGN_LEFT));
+ edit_msg11->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* edit_msg11
+ { label_12 = new Fl_Input2(30, 321, 50, 22, _("12:"));
+ label_12->box(FL_DOWN_BOX);
+ label_12->color(FL_BACKGROUND2_COLOR);
+ label_12->selection_color(FL_SELECTION_COLOR);
+ label_12->labeltype(FL_NORMAL_LABEL);
+ label_12->labelfont(0);
+ label_12->labelsize(14);
+ label_12->labelcolor(FL_FOREGROUND_COLOR);
+ label_12->align(Fl_Align(FL_ALIGN_LEFT));
+ label_12->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* label_12
+ { edit_msg12 = new Fl_Input2(85, 321, 375, 22);
+ edit_msg12->box(FL_DOWN_BOX);
+ edit_msg12->color(FL_BACKGROUND2_COLOR);
+ edit_msg12->selection_color(FL_SELECTION_COLOR);
+ edit_msg12->labeltype(FL_NORMAL_LABEL);
+ edit_msg12->labelfont(0);
+ edit_msg12->labelsize(14);
+ edit_msg12->labelcolor(FL_FOREGROUND_COLOR);
+ edit_msg12->align(Fl_Align(FL_ALIGN_LEFT));
+ edit_msg12->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* edit_msg12
+ o->end();
+ } // Fl_Double_Window* o
+ return w;
+}
+
+Fl_Input2 *txt_cll=(Fl_Input2 *)0;
+
+static void cb_txt_cll(Fl_Input2*, void*) {
+ change_txt_cll();
+}
+
+Fl_Input2 *txt_opr=(Fl_Input2 *)0;
+
+static void cb_txt_opr(Fl_Input2*, void*) {
+ change_txt_opr();
+}
+
+Fl_Input2 *txt_qth=(Fl_Input2 *)0;
+
+static void cb_txt_qth(Fl_Input2*, void*) {
+ change_txt_qth();
+}
+
+Fl_Input2 *txt_loc=(Fl_Input2 *)0;
+
+static void cb_txt_loc(Fl_Input2*, void*) {
+ change_txt_loc();
+}
+
+Fl_Button *btn_done_op_dialog=(Fl_Button *)0;
+
+static void cb_btn_done_op_dialog(Fl_Button*, void*) {
+ cb_done_op_dialog();
+}
+
+Fl_Double_Window* make_operator_dialog() {
+ Fl_Double_Window* w;
+ { Fl_Double_Window* o = new Fl_Double_Window(296, 162, _("Operator Setup"));
+ w = o;
+ { txt_cll = new Fl_Input2(63, 10, 224, 23, _("<CLL>"));
+ txt_cll->tooltip(_("Your callsign"));
+ txt_cll->box(FL_DOWN_BOX);
+ txt_cll->color(FL_BACKGROUND2_COLOR);
+ txt_cll->selection_color(FL_SELECTION_COLOR);
+ txt_cll->labeltype(FL_NORMAL_LABEL);
+ txt_cll->labelfont(0);
+ txt_cll->labelsize(14);
+ txt_cll->labelcolor(FL_FOREGROUND_COLOR);
+ txt_cll->callback((Fl_Callback*)cb_txt_cll);
+ txt_cll->align(Fl_Align(FL_ALIGN_LEFT));
+ txt_cll->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* txt_cll
+ { txt_opr = new Fl_Input2(63, 41, 224, 23, _("<OPR>"));
+ txt_opr->box(FL_DOWN_BOX);
+ txt_opr->color(FL_BACKGROUND2_COLOR);
+ txt_opr->selection_color(FL_SELECTION_COLOR);
+ txt_opr->labeltype(FL_NORMAL_LABEL);
+ txt_opr->labelfont(0);
+ txt_opr->labelsize(14);
+ txt_opr->labelcolor(FL_FOREGROUND_COLOR);
+ txt_opr->callback((Fl_Callback*)cb_txt_opr);
+ txt_opr->align(Fl_Align(FL_ALIGN_LEFT));
+ txt_opr->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* txt_opr
+ { txt_qth = new Fl_Input2(63, 72, 224, 23, _("<QTH>"));
+ txt_qth->tooltip(_("Your QTH"));
+ txt_qth->box(FL_DOWN_BOX);
+ txt_qth->color(FL_BACKGROUND2_COLOR);
+ txt_qth->selection_color(FL_SELECTION_COLOR);
+ txt_qth->labeltype(FL_NORMAL_LABEL);
+ txt_qth->labelfont(0);
+ txt_qth->labelsize(14);
+ txt_qth->labelcolor(FL_FOREGROUND_COLOR);
+ txt_qth->callback((Fl_Callback*)cb_txt_qth);
+ txt_qth->align(Fl_Align(FL_ALIGN_LEFT));
+ txt_qth->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* txt_qth
+ { txt_loc = new Fl_Input2(63, 103, 224, 23, _("<LOC>"));
+ txt_loc->tooltip(_("Your locator"));
+ txt_loc->box(FL_DOWN_BOX);
+ txt_loc->color(FL_BACKGROUND2_COLOR);
+ txt_loc->selection_color(FL_SELECTION_COLOR);
+ txt_loc->labeltype(FL_NORMAL_LABEL);
+ txt_loc->labelfont(0);
+ txt_loc->labelsize(14);
+ txt_loc->labelcolor(FL_FOREGROUND_COLOR);
+ txt_loc->callback((Fl_Callback*)cb_txt_loc);
+ txt_loc->align(Fl_Align(FL_ALIGN_LEFT));
+ txt_loc->when(FL_WHEN_RELEASE);
+ } // Fl_Input2* txt_loc
+ { btn_done_op_dialog = new Fl_Button(204, 133, 70, 20, _("Done"));
+ btn_done_op_dialog->callback((Fl_Callback*)cb_btn_done_op_dialog);
+ } // Fl_Button* btn_done_op_dialog
+ o->end();
+ } // Fl_Double_Window* o
+ return w;
+}
+
+Fl_Int_Input *txt_serial_nbr=(Fl_Int_Input *)0;
+
+static void cb_txt_serial_nbr(Fl_Int_Input*, void*) {
+ serial_nbr();
+}
+
+Fl_Int_Input *txt_time_span=(Fl_Int_Input *)0;
+
+static void cb_txt_time_span(Fl_Int_Input*, void*) {
+ time_span();
+}
+
+Fl_Check_Button *btn_zeros=(Fl_Check_Button *)0;
+
+static void cb_btn_zeros(Fl_Check_Button*, void*) {
+ zeros();
+}
+
+Fl_Check_Button *btn_ck_band=(Fl_Check_Button *)0;
+
+static void cb_btn_ck_band(Fl_Check_Button*, void*) {
+ ck_band();
+}
+
+Fl_Check_Button *btn_ck_time_span=(Fl_Check_Button *)0;
+
+static void cb_btn_ck_time_span(Fl_Check_Button*, void*) {
+ time_span();
+}
+
+Fl_Check_Button *btn_dups=(Fl_Check_Button *)0;
+
+static void cb_btn_dups(Fl_Check_Button*, void*) {
+ dups();
+}
+
+Fl_Button *btn_close_contest=(Fl_Button *)0;
+
+static void cb_btn_close_contest(Fl_Button*, void*) {
+ close_contest();
+}
+
+Fl_Input *txt_xout=(Fl_Input *)0;
+
+static void cb_txt_xout(Fl_Input* o, void*) {
+ progStatus.xout=o->value();
+}
+
+Fl_Double_Window* make_contest_dialog() {
+ Fl_Double_Window* w;
+ { Fl_Double_Window* o = new Fl_Double_Window(455, 65, _("Contest"));
+ w = o;
+ { txt_serial_nbr = new Fl_Int_Input(59, 4, 60, 24, _("Next #"));
+ txt_serial_nbr->tooltip(_("Next serial number to be sent"));
+ txt_serial_nbr->type(2);
+ txt_serial_nbr->callback((Fl_Callback*)cb_txt_serial_nbr);
+ } // Fl_Int_Input* txt_serial_nbr
+ { txt_time_span = new Fl_Int_Input(205, 4, 60, 24, _("Time Span"));
+ txt_time_span->tooltip(_("Min\'s allowed between dups"));
+ txt_time_span->type(2);
+ txt_time_span->callback((Fl_Callback*)cb_txt_time_span);
+ } // Fl_Int_Input* txt_time_span
+ { Fl_Check_Button* o = btn_zeros = new Fl_Check_Button(8, 37, 20, 15, _("Zeros ?"));
+ btn_zeros->tooltip(_("Send nbr as 0nn if < 100"));
+ btn_zeros->down_box(FL_DOWN_BOX);
+ btn_zeros->callback((Fl_Callback*)cb_btn_zeros);
+ o->value(progStatus.zeros);
+ } // Fl_Check_Button* btn_zeros
+ { Fl_Check_Button* o = btn_ck_band = new Fl_Check_Button(93, 37, 20, 15, _("Ck Band"));
+ btn_ck_band->tooltip(_("Include band for dup check"));
+ btn_ck_band->down_box(FL_DOWN_BOX);
+ btn_ck_band->callback((Fl_Callback*)cb_btn_ck_band);
+ o->value(progStatus.band);
+ } // Fl_Check_Button* btn_ck_band
+ { Fl_Check_Button* o = btn_ck_time_span = new Fl_Check_Button(178, 37, 20, 15, _("Ck span"));
+ btn_ck_time_span->tooltip(_("Include time span for dup check"));
+ btn_ck_time_span->down_box(FL_DOWN_BOX);
+ btn_ck_time_span->callback((Fl_Callback*)cb_btn_ck_time_span);
+ o->value(progStatus.time_span);
+ } // Fl_Check_Button* btn_ck_time_span
+ { Fl_Check_Button* o = btn_dups = new Fl_Check_Button(263, 37, 20, 15, _("Ck Dups"));
+ btn_dups->tooltip(_("Check for duplicates"));
+ btn_dups->down_box(FL_DOWN_BOX);
+ btn_dups->callback((Fl_Callback*)cb_btn_dups);
+ o->value(progStatus.dups);
+ } // Fl_Check_Button* btn_dups
+ { btn_close_contest = new Fl_Button(374, 34, 70, 20, _("Close"));
+ btn_close_contest->callback((Fl_Callback*)cb_btn_close_contest);
+ } // Fl_Button* btn_close_contest
+ { Fl_Input* o = txt_xout = new Fl_Input(308, 4, 140, 24, _("Xout"));
+ txt_xout->tooltip(_("Exchange out (not serial #)"));
+ txt_xout->callback((Fl_Callback*)cb_txt_xout);
+ o->value(progStatus.xout.c_str());
+ } // Fl_Input* txt_xout
+ o->end();
+ } // Fl_Double_Window* o
+ return w;
+}
diff --git a/src/wkey_dialogs.fl b/src/wkey_dialogs.fl
new file mode 100644
index 0000000..f1ac00b
--- /dev/null
+++ b/src/wkey_dialogs.fl
@@ -0,0 +1,845 @@
+# data file for the Fltk User Interface Designer (fluid)
+version 1.0302
+i18n_type 1
+i18n_include "gettext.h"
+i18n_function _
+header_name {.h}
+code_name {.cxx}
+decl {\#include "support.h"} {private local
+}
+
+Function {SetupDialog()} {open
+} {
+ Fl_Window {} {
+ label {Select Ports} open selected
+ xywh {578 389 270 145} type Double visible
+ } {
+ Fl_Group selectCommPort {
+ label {Ser. Port} open
+ tooltip {Xcvr serial port} xywh {75 13 190 23} box DOWN_BOX color 53 align 4
+ code0 {\#include "combo.h"}
+ class Fl_ComboBox
+ } {}
+ Fl_Input inpXmlAddress {
+ label {Xml Addr}
+ callback {progStatus.log_address = o->value();}
+ tooltip {External logbook net address} xywh {75 45 190 23}
+ code0 {o->value(progStatus.log_address.c_str());}
+ }
+ Fl_Input inpXmlPort {
+ label {Xml Port}
+ callback {progStatus.log_port = o->value();}
+ tooltip {External logbook net port} xywh {75 77 190 23}
+ code0 {o->value(progStatus.log_port.c_str());}
+ }
+ Fl_Return_Button btn_ser_port_ok {
+ label OK
+ callback {cbOkSetupDialog();}
+ xywh {193 114 67 20}
+ }
+ Fl_Button btn_serial_port_cancel {
+ label Cancel
+ callback {cbCancelSetupDialog();}
+ xywh {115 114 70 20}
+ }
+ }
+}
+
+Function {WKey_window()} {} {
+ Fl_Window {} {
+ label Fl_WinKey open
+ xywh {578 64 670 275} type Double resizable visible
+ } {
+ Fl_Menu_Bar {} {open
+ xywh {0 0 670 20}
+ } {
+ Submenu {} {
+ label {&File} open
+ xywh {0 0 70 21}
+ } {
+ MenuItem mnu_exit {
+ label {E&xit}
+ callback {cbExit();}
+ xywh {0 0 36 21}
+ }
+ }
+ Submenu {} {
+ label Configure open
+ xywh {0 0 70 21}
+ } {
+ MenuItem mnu_sel_port {
+ label Ports
+ callback {config_comm_port();}
+ xywh {0 0 36 21}
+ }
+ MenuItem mnu_parameters {
+ label Parameters
+ callback {config_parameters();}
+ xywh {0 0 36 21}
+ }
+ MenuItem mnu_messages {
+ label Messages
+ callback {config_messages();}
+ xywh {0 0 36 21}
+ }
+ MenuItem mnu_operator {
+ label Operator
+ callback {open_operator_dialog();}
+ xywh {0 0 36 21}
+ }
+ }
+ Submenu mnu_Logbook {
+ label Logbook open
+ xywh {0 0 70 21}
+ } {
+ MenuItem mnu_display_log {
+ label {Display Log}
+ callback {cb_mnuShowLogbook();}
+ xywh {0 0 36 21} divider
+ }
+ MenuItem mnu_new_log {
+ label New
+ callback {cb_mnuNewLogbook();}
+ xywh {0 0 36 21}
+ }
+ MenuItem mnu_open_logbook {
+ label Open
+ callback {cb_mnuOpenLogbook();}
+ xywh {0 0 36 21}
+ }
+ MenuItem mnu_save_logbook {
+ label Save
+ callback {cb_mnuSaveLogbook();}
+ xywh {0 0 36 21}
+ }
+ MenuItem mnu_merge_logbook {
+ label {Merge Log}
+ callback {cb_mnuMergeADIF_log();}
+ xywh {0 0 36 21} divider
+ }
+ MenuItem mnu_export_adif {
+ label {Export Log}
+ callback {cb_mnuExportADIF_log();}
+ xywh {0 0 36 21}
+ }
+ MenuItem mnu_export_logbook_text {
+ label {Export text}
+ callback {cb_mnuExportTEXT_log();}
+ xywh {0 0 36 21}
+ }
+ MenuItem mnu_export_logbook_csv {
+ label {Export CSV}
+ callback {cb_mnuExportCSV_log();}
+ xywh {0 0 36 21}
+ }
+ MenuItem mnu_export_cabrillo {
+ label {Cabrillo Report}
+ callback {cb_Export_Cabrillo();}
+ xywh {0 0 36 21} divider
+ }
+ MenuItem mnu_log_client {
+ label {Connect to Server}
+ callback {connect_to_server();}
+ xywh {0 0 36 21} type Toggle divider
+ }
+ }
+ MenuItem mnu_contest {
+ label Contest
+ callback {cb_contest();}
+ xywh {0 0 36 21}
+ }
+ MenuItem mnu_events {
+ label Events
+ callback {cb_events();}
+ xywh {0 0 36 21}
+ }
+ Submenu {} {
+ label Help open
+ xywh {0 0 70 21}
+ } {
+ MenuItem mnu_about {
+ label About
+ callback {about();}
+ xywh {0 0 36 21}
+ }
+ MenuItem mnu_on_line_help {
+ label {On line help}
+ callback {on_line_help();}
+ xywh {0 0 36 21}
+ }
+ }
+ }
+ Fl_Output txt_sent {
+ xywh {5 23 660 96} type Multiline resizable
+ code0 {\#include "FTextView.h"}
+ class FTextView
+ }
+ Fl_Input txt_to_send {
+ label {input:}
+ xywh {5 121 660 68} type Multiline align 16 when 1
+ code0 {\#include "FTextRXTX.h"}
+ class FTextTX
+ }
+ Fl_Light_Button btn_send {
+ label Send
+ callback {cb_send_button();}
+ xywh {607 221 60 25}
+ }
+ Fl_Light_Button btn_tune {
+ label Tune
+ callback {cb_tune();}
+ xywh {607 250 60 25} selection_color 5
+ }
+ Fl_Button btn_cancel {
+ label Cancel
+ callback {cb_cancel_transmit();}
+ xywh {544 221 60 25}
+ }
+ Fl_Box box_busy {
+ label Busy
+ xywh {7 241 16 16} box DIAMOND_DOWN_BOX align 8
+ }
+ Fl_Box box_keydown {
+ label Key
+ xywh {7 260 16 16} box DIAMOND_DOWN_BOX align 8
+ }
+ Fl_Box box_break_in {
+ label Bk
+ xywh {64 222 16 16} box DIAMOND_DOWN_BOX align 8
+ }
+ Fl_Box box_xoff {
+ label Bfr
+ xywh {64 241 16 16} box DIAMOND_DOWN_BOX align 8
+ }
+ Fl_Box box_wait {
+ label Wait
+ xywh {7 222 16 16} box DIAMOND_DOWN_BOX align 8
+ }
+ Fl_Output txt_wpm {
+ xywh {160 251 38 22}
+ }
+ Fl_Counter cntr_wpm {
+ label WPM
+ callback {set_wpm();}
+ tooltip {flwkey WPM} xywh {146 222 64 22} type Simple align 4 minimum 10 maximum 35 step 1 value 20
+ }
+ Fl_Check_Button btn_use_pot {
+ label Pot
+ callback {use_pot_changed();}
+ tooltip {Winkeyer pot controls WPM} xywh {140 255 20 15} down_box DOWN_BOX align 4 when 1
+ }
+ Fl_Button btn_msg1 {
+ label {m 1}
+ callback {exec_msg1();}
+ tooltip {Action - Fkey/Left click
+Edit - Right click} xywh {4 197 50 20}
+ }
+ Fl_Button btn_msg2 {
+ label {m 2}
+ callback {exec_msg2();}
+ tooltip {Action - Fkey/Left click
+Edit - Right click} xywh {59 197 50 20}
+ }
+ Fl_Button btn_msg3 {
+ label {m 3}
+ callback {exec_msg3();}
+ tooltip {Action - Fkey/Left click
+Edit - Right click} xywh {115 197 50 20}
+ }
+ Fl_Button btn_msg4 {
+ label {m 4}
+ callback {exec_msg4();}
+ tooltip {Action - Fkey/Left click
+Edit - Right click} xywh {170 197 50 20}
+ }
+ Fl_Button btn_msg5 {
+ label {m 5}
+ callback {exec_msg5();}
+ tooltip {Action - Fkey/Left click
+Edit - Right click} xywh {226 197 50 20}
+ }
+ Fl_Button btn_msg6 {
+ label {m 6}
+ callback {exec_msg6();}
+ tooltip {Action - Fkey/Left click
+Edit - Right click} xywh {282 197 50 20}
+ }
+ Fl_Button btn_msg7 {
+ label {m 7}
+ callback {exec_msg7();}
+ tooltip {Action - Fkey/Left click
+Edit - Right click} xywh {337 197 50 20}
+ }
+ Fl_Button btn_msg8 {
+ label {m 8}
+ callback {exec_msg8();}
+ tooltip {Action - Fkey/Left click
+Edit - Right click} xywh {393 197 50 20}
+ }
+ Fl_Button btn_msg9 {
+ label {m 9}
+ callback {exec_msg9();}
+ tooltip {Action - Fkey/Left click
+Edit - Right click} xywh {449 197 50 20}
+ }
+ Fl_Button btn_msg10 {
+ label {m 10}
+ callback {exec_msg10();}
+ tooltip {Action - Fkey/Left click
+Edit - Right click} xywh {504 197 50 20}
+ }
+ Fl_Button btn_msg11 {
+ label {m 11}
+ callback {exec_msg11();}
+ tooltip {Action - Fkey/Left click
+Edit - Right click} xywh {560 197 50 20}
+ }
+ Fl_Button btn_msg12 {
+ label {m 12}
+ callback {exec_msg12();}
+ tooltip {Action - Fkey/Left click
+Edit - Right click} xywh {616 197 50 20}
+ }
+ Fl_Input txt_sta {
+ label STA
+ callback {check_call();}
+ tooltip {Other station} xywh {246 222 100 22} when 1
+ code0 {\#include "flinput2.h"}
+ class Fl_Input2
+ }
+ Fl_Input txt_name {
+ label NAM
+ tooltip {Other operator} xywh {383 222 100 22}
+ class Fl_Input2
+ }
+ Fl_Input txt_xchg {
+ label X_in
+ tooltip {Rcvd Contest Exchange} xywh {381 251 100 22} when 1
+ class Fl_Input2
+ }
+ Fl_Button btn_log_it {
+ label Log
+ callback {if (mnu_log_client->value())
+ xml_add_record();
+else
+ AddRecord();
+txt_sta->take_focus();}
+ xywh {487 250 52 25}
+ }
+ Fl_Button btn_clear {
+ label Clear
+ callback {txt_sta->value("");
+txt_name->value("");
+txt_xchg->value("");
+txt_sta->color(FL_BACKGROUND2_COLOR);
+txt_sta->take_focus();}
+ xywh {487 221 52 25}
+ }
+ Fl_Input txt_freq {
+ label {Freq:}
+ callback {check_call();}
+ tooltip {Frequency (MHz preferred)} xywh {246 251 100 22} when 1
+ }
+ }
+}
+
+Function {make_parameters_dialog()} {} {
+ Fl_Window {} {
+ label {WKeyer Parameters}
+ xywh {588 491 515 232} type Double hide
+ } {
+ Fl_Group {} {
+ label ModeReg open
+ xywh {5 23 115 114} box ENGRAVED_FRAME
+ } {
+ Fl_Check_Button btn_swap {
+ label Swap
+ callback {change_btn_swap();}
+ xywh {15 31 70 15} down_box DOWN_BOX
+ }
+ Fl_Check_Button btn_auto_space {
+ label {Auto Space}
+ callback {change_btn_auto_space();}
+ xywh {15 51 70 15} down_box DOWN_BOX
+ }
+ Fl_Check_Button btn_ct_space {
+ label {CT space}
+ callback {change_btn_ct_space();}
+ xywh {15 72 70 15} down_box DOWN_BOX
+ }
+ Fl_Check_Button btn_paddledog {
+ label {Paddle Dog}
+ callback {change_btn_paddledog();}
+ xywh {15 92 70 15} down_box DOWN_BOX
+ }
+ Fl_Check_Button btn_cut_zeronine {
+ label {Cut 0/9}
+ callback {change_btn_cut_zeronine();}
+ xywh {15 113 70 15} down_box DOWN_BOX
+ }
+ }
+ Fl_Group {} {
+ label ModeReg open
+ xywh {122 23 115 114} box ENGRAVED_FRAME
+ } {
+ Fl_Check_Button btn_paddle_echo {
+ label {Paddle echo}
+ callback {change_btn_paddle_echo();}
+ xywh {128 31 70 15} down_box DOWN_BOX
+ }
+ Fl_Check_Button btn_serial_echo {
+ label {Serial echo}
+ callback {change_btn_serial_echo();}
+ xywh {128 51 70 15} down_box DOWN_BOX
+ }
+ Fl_Check_Button btn_sidetone_on {
+ label {Tone Keyer}
+ callback {change_btn_sidetone_on();}
+ xywh {128 71 103 15} down_box DOWN_BOX
+ }
+ Fl_Check_Button btn_tone_on {
+ label {Tone ON}
+ callback {change_btn_tone_on();}
+ xywh {128 92 87 15} down_box DOWN_BOX
+ }
+ Fl_Check_Button btn_ptt_on {
+ label {PTT ON}
+ callback {change_btn_ptt_on();}
+ xywh {128 113 87 15} down_box DOWN_BOX
+ }
+ }
+ Fl_Group {} {
+ label {WPM Settings} open
+ xywh {240 23 112 165} box ENGRAVED_FRAME
+ } {
+ Fl_Counter cntr_min_wpm {
+ label {Min WPM}
+ callback {change_cntr_min_wpm();}
+ xywh {261 31 64 20} type Simple
+ }
+ Fl_Counter cntr_rng_wpm {
+ label {Rng WPM}
+ callback {change_cntr_rng_wpm();}
+ xywh {261 68 64 20} type Simple
+ }
+ Fl_Counter cntr_farnsworth {
+ label Farsnworth
+ callback {change_cntr_farnsworth();}
+ xywh {261 105 64 20} type Simple
+ }
+ Fl_Counter cntr_cmd_wpm {
+ label {Cmd WPM}
+ callback {change_cntr_cmd_wpm();}
+ xywh {261 143 64 20} type Simple
+ }
+ }
+ Fl_Group {} {
+ label {Timing/Settings} open
+ xywh {353 23 159 165} box ENGRAVED_FRAME
+ } {
+ Fl_Counter cntr_ratio {
+ label Ratio
+ callback {change_cntr_ratio();}
+ xywh {365 31 64 20} type Simple
+ }
+ Fl_Counter cntr_comp {
+ label Comp
+ callback {change_cntr_comp();}
+ xywh {365 68 64 20} type Simple
+ }
+ Fl_Counter cntr_first_ext {
+ label {1st Ext}
+ callback {change_cntr_first_ext();}
+ xywh {365 105 64 20} type Simple
+ }
+ Fl_Counter cntr_sample {
+ label Sample
+ callback {change_cntr_sample();}
+ xywh {365 143 64 20} type Simple
+ }
+ Fl_Counter cntr_weight {
+ label Weight
+ callback {change_cntr_weight();}
+ xywh {436 31 64 20} type Simple
+ }
+ Fl_Counter cntr_leadin {
+ label Leadin
+ callback {change_cntr_leadin();}
+ xywh {436 68 64 20} type Simple
+ }
+ Fl_Counter cntr_tail {
+ label Tail
+ callback {change_cntr_tail();}
+ xywh {436 105 64 20} type Simple
+ }
+ }
+ Fl_Group {} {open
+ xywh {5 138 232 90} box ENGRAVED_FRAME
+ } {
+ Fl_Group choice_keyer_mode {
+ label {Keyer Mode}
+ callback {change_choice_keyer_mode();} open
+ xywh {20 143 90 22} box BORDER_BOX align 2
+ code0 {\#include "combo.h"}
+ class Fl_ComboBox
+ } {}
+ Fl_Group choice_hang {
+ label Hang
+ callback {change_choice_hang();} open
+ xywh {130 143 90 22} box BORDER_BOX align 2
+ class Fl_ComboBox
+ } {}
+ Fl_Group choice_sidetone {
+ label Sidetone
+ callback {change_choice_sidetone();} open
+ xywh {20 185 90 22} box BORDER_BOX align 2
+ class Fl_ComboBox
+ } {}
+ Fl_Group choice_output_pins {
+ label {Output PIns}
+ callback {change_choice_output_pins();} open
+ xywh {130 185 90 22} box BORDER_BOX align 2
+ class Fl_ComboBox
+ } {}
+ }
+ Fl_Button btn_done_parameters {
+ label Done
+ callback {done_parameters();}
+ xywh {411 194 75 27}
+ }
+ }
+}
+
+Function {make_message_editor()} {} {
+ Fl_Window {} {
+ label {Message Editor} open
+ xywh {571 437 600 350} type Double hide
+ } {
+ Fl_Input label_1 {
+ label {1:}
+ xywh {30 31 50 22}
+ code0 {\#include "flinput2.h"}
+ class Fl_Input2
+ }
+ Fl_Input edit_msg1 {
+ xywh {85 31 375 22}
+ class Fl_Input2
+ }
+ Fl_Input label_2 {
+ label {2:}
+ xywh {30 57 50 22}
+ class Fl_Input2
+ }
+ Fl_Input edit_msg2 {
+ xywh {85 57 375 22}
+ class Fl_Input2
+ }
+ Fl_Input label_3 {
+ label {3:}
+ xywh {30 83 50 22}
+ class Fl_Input2
+ }
+ Fl_Input edit_msg3 {
+ xywh {85 83 375 22}
+ class Fl_Input2
+ }
+ Fl_Input label_4 {
+ label {4:}
+ xywh {30 110 50 22}
+ class Fl_Input2
+ }
+ Fl_Input edit_msg4 {
+ xywh {85 110 375 22}
+ class Fl_Input2
+ }
+ Fl_Input label_5 {
+ label {5:}
+ xywh {30 136 50 22}
+ class Fl_Input2
+ }
+ Fl_Input edit_msg5 {
+ xywh {85 136 375 22}
+ class Fl_Input2
+ }
+ Fl_Input label_6 {
+ label {6:}
+ xywh {30 162 50 22}
+ class Fl_Input2
+ }
+ Fl_Input edit_msg6 {
+ xywh {85 162 375 22}
+ class Fl_Input2
+ }
+ Fl_Input label_7 {
+ label {7:}
+ xywh {30 189 50 22}
+ class Fl_Input2
+ }
+ Fl_Input edit_msg7 {
+ xywh {85 189 375 22}
+ class Fl_Input2
+ }
+ Fl_Input label_8 {
+ label {8:}
+ xywh {30 215 50 22}
+ class Fl_Input2
+ }
+ Fl_Input edit_msg8 {
+ xywh {85 215 375 22}
+ class Fl_Input2
+ }
+ Fl_Input label_9 {
+ label {9:}
+ xywh {30 241 50 22}
+ class Fl_Input2
+ }
+ Fl_Input edit_msg9 {
+ xywh {85 241 375 22}
+ class Fl_Input2
+ }
+ Fl_Input label_10 {
+ label {10:}
+ xywh {30 268 50 22}
+ class Fl_Input2
+ }
+ Fl_Input edit_msg10 {
+ xywh {85 268 375 22}
+ class Fl_Input2
+ }
+ Fl_Button btn_done_edit {
+ label Done
+ callback {done_edit();}
+ xywh {535 305 56 26}
+ }
+ Fl_Button btn_cancel_edit {
+ label Cancel
+ callback {cancel_edit();}
+ xywh {465 276 65 26}
+ }
+ Fl_Button btn_apply_edit {
+ label Apply
+ callback {apply_edit();}
+ xywh {465 305 65 26}
+ }
+ Fl_Box {} {
+ label {Message Text}
+ xywh {201 9 223 19}
+ }
+ Fl_Box {} {
+ label {Msg Label}
+ xywh {12 8 84 23}
+ }
+ Fl_Group {} {open
+ xywh {464 4 65 252} box ENGRAVED_FRAME
+ } {
+ Fl_Box {} {
+ label Tags
+ xywh {469 7 54 20}
+ }
+ Fl_Box {} {
+ label {<CLL>}
+ tooltip {Your call} xywh {469 36 55 20}
+ }
+ Fl_Box {} {
+ label {<QTH>}
+ tooltip {Your qth} xywh {469 56 55 20}
+ }
+ Fl_Box {} {
+ label {<LOC>}
+ tooltip {Your location} xywh {469 76 55 20}
+ }
+ Fl_Box {} {
+ label {<OPR>}
+ tooltip {Your name} xywh {469 96 55 20}
+ }
+ Fl_Box {} {
+ label {<STA>}
+ tooltip {Other stations callsign} xywh {469 115 55 20}
+ }
+ Fl_Box {} {
+ label {<NAM>}
+ tooltip {Other stations name} xywh {469 134 55 20}
+ }
+ Fl_Box {} {
+ label {<\#>}
+ tooltip {Serial OUT} xywh {469 151 55 20}
+ }
+ Fl_Box {} {
+ label {<+>}
+ tooltip {Increment serial \#} xywh {469 170 55 20}
+ }
+ Fl_Box {} {
+ label {<->}
+ tooltip {Decrement serial \#} xywh {469 189 55 20}
+ }
+ Fl_Box {} {
+ label {<LOG>}
+ tooltip {Append entry to logbook} xywh {469 208 55 20}
+ }
+ Fl_Box {} {
+ label {<X>}
+ tooltip {Xout text} xywh {469 229 55 20}
+ }
+ }
+ Fl_Group {} {
+ xywh {529 4 65 252} box ENGRAVED_FRAME
+ } {
+ Fl_Box {} {
+ label ProSign
+ xywh {532 7 59 20}
+ }
+ Fl_Box {} {
+ label {" RR}
+ tooltip {.-..-.} xywh {531 36 60 20}
+ }
+ Fl_Box {} {
+ label {$ SX}
+ tooltip {...-..-} xywh {531 56 60 20}
+ }
+ Fl_Box {} {
+ label {' WG}
+ tooltip {.----.} xywh {531 75 60 20}
+ }
+ Fl_Box {} {
+ label {( KN}
+ tooltip {-.--.} xywh {531 94 60 20}
+ }
+ Fl_Box {} {
+ label {) KK}
+ tooltip {-.--.-} xywh {531 113 60 20}
+ }
+ Fl_Box {} {
+ label {+ AR}
+ tooltip {.-.-.} xywh {531 132 60 20}
+ }
+ Fl_Box {} {
+ label {< AR}
+ tooltip {.-.-.} xywh {531 151 60 20}
+ }
+ Fl_Box {} {
+ label {> SK}
+ tooltip {...-.-} xywh {531 170 60 20}
+ }
+ Fl_Box {} {
+ label {= BT}
+ tooltip {-...-} xywh {531 189 60 20}
+ }
+ Fl_Box {} {
+ label {- DU}
+ tooltip {-....-} xywh {531 208 60 20}
+ }
+ Fl_Box {} {
+ label {@@ AC}
+ tooltip {.--.-.} xywh {531 229 60 20}
+ }
+ }
+ Fl_Input label_11 {
+ label {11:}
+ xywh {29 294 50 22}
+ class Fl_Input2
+ }
+ Fl_Input edit_msg11 {
+ xywh {84 294 375 22}
+ class Fl_Input2
+ }
+ Fl_Input label_12 {
+ label {12:}
+ xywh {30 321 50 22}
+ class Fl_Input2
+ }
+ Fl_Input edit_msg12 {
+ xywh {85 321 375 22}
+ class Fl_Input2
+ }
+ }
+}
+
+Function {make_operator_dialog()} {} {
+ Fl_Window {} {
+ label {Operator Setup}
+ xywh {559 373 296 162} type Double hide
+ } {
+ Fl_Input txt_cll {
+ label {<CLL>}
+ callback {change_txt_cll();}
+ tooltip {Your callsign} xywh {63 10 224 23}
+ class Fl_Input2
+ }
+ Fl_Input txt_opr {
+ label {<OPR>}
+ callback {change_txt_opr();}
+ xywh {63 41 224 23}
+ class Fl_Input2
+ }
+ Fl_Input txt_qth {
+ label {<QTH>}
+ callback {change_txt_qth();}
+ tooltip {Your QTH} xywh {63 72 224 23}
+ class Fl_Input2
+ }
+ Fl_Input txt_loc {
+ label {<LOC>}
+ callback {change_txt_loc();}
+ tooltip {Your locator} xywh {63 103 224 23}
+ class Fl_Input2
+ }
+ Fl_Button btn_done_op_dialog {
+ label Done
+ callback {cb_done_op_dialog();}
+ xywh {204 133 70 20}
+ }
+ }
+}
+
+Function {make_contest_dialog()} {} {
+ Fl_Window {} {
+ label Contest open
+ xywh {553 749 455 65} type Double hide
+ } {
+ Fl_Input txt_serial_nbr {
+ label {Next \#}
+ callback {serial_nbr();}
+ tooltip {Next serial number to be sent} xywh {59 4 60 24} type Int
+ }
+ Fl_Input txt_time_span {
+ label {Time Span}
+ callback {time_span();}
+ tooltip {Min's allowed between dups} xywh {205 4 60 24} type Int
+ }
+ Fl_Check_Button btn_zeros {
+ label {Zeros ?}
+ callback {zeros();}
+ tooltip {Send nbr as 0nn if < 100} xywh {8 37 20 15} down_box DOWN_BOX
+ code0 {o->value(progStatus.zeros);}
+ }
+ Fl_Check_Button btn_ck_band {
+ label {Ck Band}
+ callback {ck_band();}
+ tooltip {Include band for dup check} xywh {93 37 20 15} down_box DOWN_BOX
+ code0 {o->value(progStatus.band);}
+ }
+ Fl_Check_Button btn_ck_time_span {
+ label {Ck span}
+ callback {time_span();}
+ tooltip {Include time span for dup check} xywh {178 37 20 15} down_box DOWN_BOX
+ code0 {o->value(progStatus.time_span);}
+ }
+ Fl_Check_Button btn_dups {
+ label {Ck Dups}
+ callback {dups();}
+ tooltip {Check for duplicates} xywh {263 37 20 15} down_box DOWN_BOX
+ code0 {o->value(progStatus.dups);}
+ }
+ Fl_Button btn_close_contest {
+ label Close
+ callback {close_contest();}
+ xywh {374 34 70 20}
+ }
+ Fl_Input txt_xout {
+ label Xout
+ callback {progStatus.xout=o->value();}
+ tooltip {Exchange out (not serial \#)} xywh {308 4 140 24}
+ code0 {o->value(progStatus.xout.c_str());}
+ }
+ }
+}
diff --git a/src/wkey_io.cxx b/src/wkey_io.cxx
new file mode 100644
index 0000000..daec155
--- /dev/null
+++ b/src/wkey_io.cxx
@@ -0,0 +1,117 @@
+#include <math.h>
+#include <string>
+
+#include <FL/Fl.H>
+
+#include "flwkey.h"
+#include "support.h"
+#include "util.h"
+#include "debug.h"
+#include "status.h"
+#include "wkey_io.h"
+
+using namespace std;
+
+extern bool test;
+
+const char *nuline = "\n";
+
+static int iBaudRates[] = { 300, 600, 1200, 2400, 4800, 9600,
+ 19200, 38400, 57600, 115200, 230400, 460800 };
+const char *szBaudRates[] = { "300", "600", "1200", "2400", "4800", "9600",
+ "19200", "38400", "57600", "115200", "230400", "460800", NULL };
+
+int BaudRate(int n)
+{
+ if (n > (int)sizeof(iBaudRates)) return 1200;
+ return (iBaudRates[n]);
+}
+
+bool start_wkey_serial()
+{
+// bypass_serial_thread_loop = true;
+// setup commands for serial port
+
+ WKEY_serial.ClosePort();
+
+ if (progStatus.serial_port_name == "NONE") return false;
+
+ WKEY_serial.Device(progStatus.serial_port_name);
+ WKEY_serial.Baud(1200);
+ WKEY_serial.Stopbits(2);
+ WKEY_serial.Retries(1);
+ WKEY_serial.Timeout(1);//50);
+ WKEY_serial.RTSptt(false);
+ WKEY_serial.DTRptt(false);
+ WKEY_serial.RTSCTS(false);
+ WKEY_serial.RTS(false);
+ WKEY_serial.DTR(true);
+
+ if (!WKEY_serial.OpenPort()) {
+ LOG_ERROR("Cannot access %s", progStatus.serial_port_name.c_str());
+ return false;
+ } else if (debug::level == debug::DEBUG_LEVEL) {
+ LOG_DEBUG("\n\
+Serial port:\n\
+ Port : %s\n\
+ Baud : %d\n\
+ Stopbits : %d\n\
+ Timeout : %d\n\
+ DTR : %s\n\
+ RTS/CTS : %s",
+ progStatus.serial_port_name.c_str(),
+ WKEY_serial.Baud(),
+ WKEY_serial.Stopbits(),
+ WKEY_serial.Timeout(),
+ WKEY_serial.DTR() ? "true" : "false",
+ WKEY_serial.RTSCTS() ? "true" : "false");
+ }
+
+ MilliSleep(400); // to allow WK1 to wake up
+ WKEY_serial.FlushBuffer();
+
+ return true;
+}
+
+#define RXBUFFSIZE 512
+char replybuff[RXBUFFSIZE+1];
+string replystr;
+
+bool readByte(unsigned char &byte)
+{
+ return WKEY_serial.ReadByte(byte);
+}
+
+int readString()
+{
+ int numread = 0;
+ size_t n;
+ memset(replybuff, 0, RXBUFFSIZE + 1);
+ while (numread < RXBUFFSIZE) {
+ if ((n = WKEY_serial.ReadBuffer(&replybuff[numread], RXBUFFSIZE - numread)) == 0) break;
+ numread += n;
+ }
+ replystr.append(replybuff);
+ return numread;
+}
+
+int sendString (string &s, bool b)
+{
+ if (WKEY_serial.IsOpen() == false) {
+ LOG_DEBUG("command: %s", b ? str2hex(s.data(), s.length()) : s.c_str());
+ return 0;
+ }
+ int numwrite = (int)s.length();
+ if (WKEY_DEBUG)
+ LOG_WARN("%s", b ? str2hex(s.data(), numwrite) : s.c_str());
+
+ WKEY_serial.WriteBuffer(s.c_str(), numwrite);
+ return numwrite;
+}
+
+void clearSerialPort()
+{
+ if (WKEY_serial.IsOpen() == false) return;
+ WKEY_serial.FlushBuffer();
+}
+
diff --git a/src/xmlrpccpp/XmlRpcClient.cpp b/src/xmlrpccpp/XmlRpcClient.cpp
new file mode 100644
index 0000000..760e9f5
--- /dev/null
+++ b/src/xmlrpccpp/XmlRpcClient.cpp
@@ -0,0 +1,529 @@
+//
+// XmlRpc++ Copyright (c) 2002-2008 by Chris Morley
+//
+
+#include "XmlRpcClient.h"
+
+#include "XmlRpcSocket.h"
+#include "XmlRpc.h"
+
+#include "base64.h" // For HTTP authentication encoding
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <string>
+
+using namespace XmlRpc;
+using namespace std;
+
+// Static data
+const char REQUEST_BEGIN[] =
+ "<?xml version=\"1.0\"?>\r\n"
+ "<methodCall><methodName>";
+const char REQUEST_END_METHODNAME[] = "</methodName>\r\n";
+const char PARAMS_TAG[] = "<params>";
+const char PARAMS_ETAG[] = "</params>";
+const char PARAM_TAG[] = "<param>";
+const char PARAM_ETAG[] = "</param>";
+const char REQUEST_END[] = "</methodCall>\r\n";
+
+
+
+
+XmlRpcClient::XmlRpcClient(const char* host, int port, const char* uri/*=0*/)
+{
+ XmlRpcUtil::log(1, "XmlRpcClient new client: host %s, port %d.", host, port);
+
+ _host = host;
+ _port = port;
+ if (uri && *uri)
+ _uri = uri;
+ else
+ _uri = "/RPC2";
+ _connectionState = NO_CONNECTION;
+ _executing = false;
+ _eof = false;
+
+ // Default to keeping the connection open until an explicit close is done
+ setKeepOpen();
+}
+
+
+XmlRpcClient::XmlRpcClient(const char* host, int port,
+ const char* login, const char* password, const char* uri/*=0*/)
+{
+ XmlRpcUtil::log(1, "XmlRpcClient new client: host %s, port %d, login %s.", host, port, login);
+
+ _host = host;
+ _port = port;
+
+ _login = login ? login : "";
+ _password = password ? password : "";
+
+ _uri = uri ? uri : "/RPC2";
+
+ _connectionState = NO_CONNECTION;
+ _executing = false;
+ _eof = false;
+
+ // Default to keeping the connection open until an explicit close is done
+ setKeepOpen();
+}
+
+
+
+XmlRpcClient::~XmlRpcClient()
+{
+ XmlRpcUtil::log(1, "XmlRpcClient dtor client: host %s, port %d.", _host.c_str(), _port);
+ if (_connectionState != NO_CONNECTION) close();
+}
+
+
+// Close the owned fd
+void
+XmlRpcClient::close()
+{
+ XmlRpcUtil::log(4, "XmlRpcClient::close: fd %d.", getfd());
+ _connectionState = NO_CONNECTION;
+ _disp.exit();
+ _disp.removeSource(this);
+
+ XmlRpcSource::close();
+}
+
+
+// Clear the referenced flag even if exceptions or errors occur.
+struct ClearFlagOnExit {
+ ClearFlagOnExit(bool& flag) : _flag(flag) {}
+ ~ClearFlagOnExit() { _flag = false; }
+ bool& _flag;
+};
+
+// Execute the named procedure on the remote server.
+// Params should be an array of the arguments for the method.
+// Returns true if the request was sent and a result received (although the result
+// might be a fault).
+bool
+XmlRpcClient::execute(const char* method, XmlRpcValue const& params, XmlRpcValue& result, double timeoutSeconds)
+{
+ XmlRpcUtil::log(1, "XmlRpcClient::execute: method %s (_connectionState %d).", method, _connectionState);
+
+ // This is not a thread-safe operation, if you want to do multithreading, use separate
+ // clients for each thread. If you want to protect yourself from multiple threads
+ // accessing the same client, replace this code with a real mutex.
+ if (_executing)
+ return false;
+
+ _executing = true;
+ ClearFlagOnExit cf(_executing);
+
+ _sendAttempts = 0;
+ _isFault = false;
+
+ if ( ! setupConnection())
+ return false;
+
+ if ( ! generateRequest(method, params))
+ return false;
+
+ result.clear();
+
+ // Process until either a response is received or the timeout period passes
+ _disp.work(timeoutSeconds);
+
+ if (_connectionState != IDLE || ! parseResponse(result))
+ return false;
+
+ XmlRpcUtil::log(1, "XmlRpcClient::execute: method %s completed.", method);
+ _response.clear();
+ return true;
+}
+
+// XmlRpcSource interface implementation
+// Handle server responses. Called by the event dispatcher during execute.
+unsigned
+XmlRpcClient::handleEvent(unsigned eventType)
+{
+ if (eventType == XmlRpcDispatch::Exception)
+ {
+ //if (XmlRpcSocket::nonFatalError())
+ // return (_connectionState == WRITE_REQUEST)
+ // ? XmlRpcDispatch::WritableEvent : XmlRpcDispatch::ReadableEvent;
+
+ if (_connectionState == WRITE_REQUEST && _bytesWritten == 0)
+ XmlRpcUtil::error("Error in XmlRpcClient::handleEvent: could not connect to server (%s).",
+ XmlRpcSocket::getErrorMsg().c_str());
+ else
+ XmlRpcUtil::error("Error in XmlRpcClient::handleEvent (state %d): %s.",
+ _connectionState, XmlRpcSocket::getErrorMsg().c_str());
+ return 0;
+ }
+
+ if (_connectionState == WRITE_REQUEST)
+ if ( ! writeRequest()) return 0;
+
+ if (_connectionState == READ_HEADER)
+ if ( ! readHeader()) return 0;
+
+ if (_connectionState == READ_RESPONSE)
+ if ( ! readResponse()) return 0;
+
+ // This should probably always ask for Exception events too
+ return (_connectionState == WRITE_REQUEST)
+ ? XmlRpcDispatch::WritableEvent : XmlRpcDispatch::ReadableEvent;
+}
+
+
+// Create the socket connection to the server if necessary
+bool
+XmlRpcClient::setupConnection()
+{
+ // If an error occurred last time through, or if the server closed the connection, close our end
+ if ((_connectionState != NO_CONNECTION && _connectionState != IDLE) || _eof)
+ close();
+
+ _eof = false;
+ if (_connectionState == NO_CONNECTION)
+ if (! doConnect())
+ return false;
+
+ // Prepare to write the request
+ _connectionState = WRITE_REQUEST;
+ _bytesWritten = 0;
+
+ // Notify the dispatcher to listen on this source (calls handleEvent when the socket is writable)
+ _disp.removeSource(this); // Make sure nothing is left over
+ _disp.addSource(this, XmlRpcDispatch::WritableEvent | XmlRpcDispatch::Exception);
+
+ return true;
+}
+
+
+// Connect to the xmlrpc server
+bool
+XmlRpcClient::doConnect()
+{
+ XmlRpcSocket::Socket fd = XmlRpcSocket::socket();
+ if (fd == XmlRpcSocket::Invalid)
+ {
+ XmlRpcUtil::error("Error in XmlRpcClient::doConnect: Could not create socket (%s).", XmlRpcSocket::getErrorMsg().c_str());
+ return false;
+ }
+
+ XmlRpcUtil::log(3, "XmlRpcClient::doConnect: fd %d.", fd);
+ this->setfd(fd);
+
+ // Don't block on connect/reads/writes
+ if ( ! XmlRpcSocket::setNonBlocking(fd))
+ {
+ this->close();
+ XmlRpcUtil::error("Error in XmlRpcClient::doConnect: Could not set socket to non-blocking IO mode (%s).", XmlRpcSocket::getErrorMsg().c_str());
+ return false;
+ }
+
+ if ( ! XmlRpcSocket::connect(fd, _host, _port))
+ {
+ this->close();
+ XmlRpcUtil::error("Error in XmlRpcClient::doConnect: Could not connect to server (%s).", XmlRpcSocket::getErrorMsg().c_str());
+ return false;
+ }
+
+ return XmlRpcSource::doConnect();
+}
+
+// Encode the request to call the specified method with the specified parameters into xml
+bool
+XmlRpcClient::generateRequest(const char* methodName, XmlRpcValue const& params)
+{
+ std::string body = REQUEST_BEGIN;
+ body += methodName;
+ body += REQUEST_END_METHODNAME;
+
+ // If params is an array, each element is a separate parameter
+ if (params.valid()) {
+ body += PARAMS_TAG;
+ if (params.getType() == XmlRpcValue::TypeArray)
+ {
+ for (int i=0; i<params.size(); ++i) {
+ body += PARAM_TAG;
+ body += params[i].toXml();
+ body += PARAM_ETAG;
+ }
+ }
+ else
+ {
+ body += PARAM_TAG;
+ body += params.toXml();
+ body += PARAM_ETAG;
+ }
+
+ body += PARAMS_ETAG;
+ }
+ body += REQUEST_END;
+
+ std::string header = generateHeader(body);
+ XmlRpcUtil::log(4, "XmlRpcClient::generateRequest: header is %d bytes, content-length is %d.",
+ header.length(), body.length());
+
+ _request = header + body;
+ return true;
+}
+
+// Prepend http headers
+std::string
+XmlRpcClient::generateHeader(std::string const& body)
+{
+ std::string header =
+ "POST " + _uri + " HTTP/1.1\r\n"
+ "User-Agent: ";
+ header += XMLRPC_VERSION;
+ header += "\r\nHost: ";
+ header += _host;
+
+ char buff[40];
+ sprintf(buff,":%d\r\n", _port);
+
+ header += buff;
+
+ if (_login.length() != 0)
+ {
+ // convert to base64
+ std::vector<char> base64data;
+ int iostatus = 0;
+ base64<char> encoder;
+ std::back_insert_iterator<std::vector<char> > ins =
+ std::back_inserter(base64data);
+
+ std::string authBuf = _login + ":" + _password;
+
+ encoder.put(authBuf.begin(), authBuf.end(), ins, iostatus,
+ base64<>::crlf());
+
+ header += "Authorization: Basic ";
+ std::string authEnc(base64data.begin(), base64data.end());
+ // handle pesky linefeed characters
+ string::size_type lf;
+ while ( (lf = authEnc.find("\r")) != string::npos ) {
+ authEnc.erase(lf, 1);
+ }
+ while ( (lf = authEnc.find("\n")) != string::npos ) {
+ authEnc.erase(lf, 1);
+ }
+ header += authEnc;
+ header += "\r\n";
+ }
+
+ header += "Content-Type: text/xml\r\nContent-length: ";
+
+ sprintf(buff,"%d\r\n\r\n", body.size());
+
+ return header + buff;
+}
+
+bool
+XmlRpcClient::writeRequest()
+{
+ if (_bytesWritten == 0)
+ XmlRpcUtil::log(5, "XmlRpcClient::writeRequest (attempt %d):\n%s\n", _sendAttempts+1, _request.c_str());
+
+ // Try to write the request
+ if ( ! nbWrite(_request, &_bytesWritten))
+ {
+ XmlRpcUtil::error("Error in XmlRpcClient::writeRequest: write error (%s).",XmlRpcSocket::getErrorMsg().c_str());
+ return false;
+ }
+
+ XmlRpcUtil::log(3, "XmlRpcClient::writeRequest: wrote %d of %d bytes.", _bytesWritten, _request.length());
+
+ // Wait for the result
+ if (_bytesWritten == int(_request.length()))
+ {
+ _header = "";
+ _response = "";
+ _connectionState = READ_HEADER;
+ }
+ return true;
+}
+
+
+// Read the header from the response
+bool
+XmlRpcClient::readHeader()
+{
+ // Read available data
+ if ( ! nbRead(_header, &_eof) || (_eof && _header.length() == 0))
+ {
+ // If we haven't read any data yet and this is a keep-alive connection, the server may
+ // have timed out, so we try one more time.
+ if (getKeepOpen() && _header.length() == 0 && _sendAttempts++ == 0)
+ {
+ XmlRpcUtil::log(4, "XmlRpcClient::readHeader: re-trying connection");
+ XmlRpcSource::close();
+
+ _connectionState = NO_CONNECTION;
+ _eof = false;
+ return setupConnection();
+ }
+
+ XmlRpcUtil::error("Error in XmlRpcClient::readHeader: error while reading header (%s) on fd %d.",
+ XmlRpcSocket::getErrorMsg().c_str(), getfd());
+ return false;
+ }
+
+ XmlRpcUtil::log(4, "XmlRpcClient::readHeader: client has read %d bytes", _header.length());
+
+ return parseHeader();
+}
+
+bool
+XmlRpcClient::parseHeader()
+{
+ char const *hp = _header.c_str(); // Start of header
+ char const *ep = hp + _header.length(); // End of string
+ char const *bp = 0; // Start of body
+ char const *lp = 0; // Start of content-length value
+
+ std::string const CONTINUE100("100 Continue");
+ int nc100 = int(CONTINUE100.length());
+ for (char const *cp = hp; (bp == 0) && (cp < ep); ++cp)
+ {
+ if ((ep - cp > 16) && (strncasecmp(cp, "Content-length: ", 16) == 0))
+ {
+ lp = cp + 16;
+ }
+ else if ((ep - cp > 4) && (strncmp(cp, "\r\n\r\n", 4) == 0))
+ {
+ if (cp - hp > nc100 && strncmp(cp-CONTINUE100.length(), CONTINUE100.c_str(), CONTINUE100.length()) == 0)
+ cp += 3;
+ else
+ bp = cp + 4;
+ }
+ else if ((ep - cp > 2) && (strncmp(cp, "\n\n", 2) == 0))
+ {
+ if (cp - hp > nc100 && strncmp(cp-CONTINUE100.length(), CONTINUE100.c_str(), CONTINUE100.length()) == 0)
+ ++ cp;
+ else
+ bp = cp + 2;
+ }
+ }
+
+ // If we haven't gotten the entire header yet, return (keep reading)
+ if (bp == 0)
+ {
+ if (_eof) // EOF in the middle of a response is an error
+ {
+ XmlRpcUtil::error("Error in XmlRpcClient::readHeader: EOF while reading header");
+ return false; // Close the connection
+ }
+
+ return true; // Keep reading
+ }
+
+ // Decode content length
+ if (lp == 0)
+ {
+ XmlRpcUtil::error("Error XmlRpcClient::readHeader: No Content-length specified");
+ return false; // We could try to figure it out by parsing as we read, but for now...
+ }
+
+ _contentLength = atoi(lp);
+ if (_contentLength <= 0)
+ {
+ XmlRpcUtil::error("Error in XmlRpcClient::readHeader: Invalid Content-length specified (%d).", _contentLength);
+ return false;
+ }
+
+ XmlRpcUtil::log(4, "client read content length: %d", _contentLength);
+
+ // Otherwise copy non-header data to response buffer and set state to read response.
+ _response = bp;
+ _header = ""; // should parse out any interesting bits from the header (connection, etc)...
+ _connectionState = READ_RESPONSE;
+ return true; // Continue monitoring this source
+}
+
+
+bool
+XmlRpcClient::readResponse()
+{
+ // If we dont have the entire response yet, read available data
+ if (int(_response.length()) < _contentLength)
+ {
+ if ( ! nbRead(_response, &_eof))
+ {
+ XmlRpcUtil::error("Error in XmlRpcClient::readResponse: read error (%s).",XmlRpcSocket::getErrorMsg().c_str());
+ return false;
+ }
+
+ // If we haven't gotten the entire _response yet, return (keep reading)
+ if (int(_response.length()) < _contentLength)
+ {
+ if (_eof)
+ {
+ XmlRpcUtil::error("Error in XmlRpcClient::readResponse: EOF while reading response");
+ return false;
+ }
+ return true;
+ }
+ }
+
+ // Otherwise, parse and return the result
+ XmlRpcUtil::log(3, "XmlRpcClient::readResponse (read %d bytes)", _response.length());
+ XmlRpcUtil::log(5, "response:\n%s", _response.c_str());
+
+ _connectionState = IDLE;
+
+ return false; // Stop monitoring this source (causes return from work)
+}
+
+
+// Convert the response xml into a result value
+bool
+XmlRpcClient::parseResponse(XmlRpcValue& result)
+{
+ std::string r;
+ _response.swap(r);
+
+ // Parse response xml into result
+ bool emptyParam;
+ int offset = 0;
+ if ( ! XmlRpcUtil::findTag("methodResponse",r,&offset,&emptyParam) || emptyParam)
+ {
+ XmlRpcUtil::error("Error in XmlRpcClient::parseResponse: Invalid response - no methodResponse. Response:\n%s", r.c_str());
+ return false;
+ }
+
+ // Expect either <params><param>... or <fault>...
+ if (XmlRpcUtil::nextTagIs("params",r,&offset,&emptyParam) &&
+ XmlRpcUtil::nextTagIs("param",r,&offset,&emptyParam))
+ {
+ if (emptyParam)
+ {
+ result = 0; // No result?
+ }
+ else if ( ! result.fromXml(r, &offset))
+ {
+ XmlRpcUtil::error("Error in XmlRpcClient::parseResponse: Invalid response value. Response:\n%s", r.c_str());
+ return false;
+ }
+ }
+ else if (XmlRpcUtil::nextTagIs("fault",r,&offset,&emptyParam))
+ {
+ _isFault = true;
+
+ if (emptyParam || ! result.fromXml(r, &offset))
+ {
+ result = 0; // No result?
+ return false;
+ }
+ }
+ else
+ {
+ XmlRpcUtil::error("Error in XmlRpcClient::parseResponse: Invalid response - no param or fault tag. Response:\n%s", r.c_str());
+ return false;
+ }
+
+ return result.valid();
+}
+
diff --git a/src/xmlrpccpp/XmlRpcDispatch.cpp b/src/xmlrpccpp/XmlRpcDispatch.cpp
new file mode 100644
index 0000000..95321c7
--- /dev/null
+++ b/src/xmlrpccpp/XmlRpcDispatch.cpp
@@ -0,0 +1,270 @@
+//
+// XmlRpc++ Copyright (c) 2002-2008 by Chris Morley
+//
+
+#include "XmlRpcDispatch.h"
+#include "XmlRpcSource.h"
+#include "XmlRpcUtil.h"
+
+#include <errno.h>
+#include <math.h>
+#include <sys/timeb.h>
+
+#if defined(_WINDOWS)
+# include <winsock2.h>
+
+# define USE_FTIME
+# if defined(_MSC_VER)
+# define timeb _timeb
+# define ftime _ftime
+# endif
+#else
+# include <sys/time.h>
+#endif // _WINDOWS
+
+
+using namespace XmlRpc;
+
+
+XmlRpcDispatch::XmlRpcDispatch()
+{
+ _endTime = -1.0;
+ _doClear = false;
+ _inWork = false;
+}
+
+
+XmlRpcDispatch::~XmlRpcDispatch()
+{
+}
+
+// Monitor this source for the specified events and call its event handler
+// when the event occurs
+void
+XmlRpcDispatch::addSource(XmlRpcSource* source, unsigned mask)
+{
+ _sources.push_back(MonitoredSource(source, mask));
+}
+
+// Stop monitoring this source. Does not close the source.
+void
+XmlRpcDispatch::removeSource(XmlRpcSource* source)
+{
+ for (SourceList::iterator it=_sources.begin(); it!=_sources.end(); ++it)
+ if (it->getSource() == source)
+ {
+ _sources.erase(it);
+ break;
+ }
+}
+
+
+// Modify the types of events to watch for on this source
+void
+XmlRpcDispatch::setSourceEvents(XmlRpcSource* source, unsigned eventMask)
+{
+ for (SourceList::iterator it=_sources.begin(); it!=_sources.end(); ++it)
+ if (it->getSource() == source)
+ {
+ it->getMask() = eventMask;
+ break;
+ }
+}
+
+
+
+// Watch current set of sources and process events
+void
+XmlRpcDispatch::work(double timeoutSeconds)
+{
+ // Compute end time
+ double timeNow = getTime();
+ _endTime = (timeoutSeconds < 0.0) ? -1.0 : (timeNow + timeoutSeconds);
+ _doClear = false;
+ _inWork = true;
+
+ // Only work while there is something to monitor
+ while (_sources.size() > 0) {
+
+ // Wait for and dispatch events
+ if ( ! waitForAndProcessEvents(timeoutSeconds))
+ {
+ _inWork = false;
+ return;
+ }
+
+
+ // Check whether to clear all sources
+ if (_doClear)
+ {
+ SourceList sourcesToClose;
+ _sources.swap(sourcesToClose);
+ for (SourceList::iterator it=sourcesToClose.begin(); it!=sourcesToClose.end(); ++it)
+ {
+ XmlRpcSource *src = it->getSource();
+ src->close();
+ }
+
+ _doClear = false;
+ }
+
+ // Check whether end time has passed or exit has been called
+ if (_endTime == 0.0) // Exit
+ {
+ break;
+ }
+ else if (_endTime > 0.0) // Check for timeout
+ {
+ double t = getTime();
+ if (t > _endTime)
+ break;
+
+ // Decrement timeout by elapsed time
+ timeoutSeconds -= (t - timeNow);
+ if (timeoutSeconds < 0.0)
+ timeoutSeconds = 0.0; // Shouldn't happen but its fp math...
+ timeNow = t;
+ }
+ }
+
+ _inWork = false;
+}
+
+
+
+// Exit from work routine. Presumably this will be called from
+// one of the source event handlers.
+void
+XmlRpcDispatch::exit()
+{
+ _endTime = 0.0; // Return from work asap
+}
+
+
+// Clear all sources from the monitored sources list
+void
+XmlRpcDispatch::clear()
+{
+ if (_inWork)
+ {
+ _doClear = true; // Finish reporting current events before clearing
+ }
+ else
+ {
+ SourceList sourcesToClose;
+ _sources.swap(sourcesToClose);
+ for (SourceList::iterator it=sourcesToClose.begin(); it!=sourcesToClose.end(); ++it)
+ it->getSource()->close();
+ }
+}
+
+
+// Time utility- return time in seconds
+double
+XmlRpcDispatch::getTime()
+{
+#ifdef USE_FTIME
+ struct timeb tbuff;
+
+ ftime(&tbuff);
+ return ((double) tbuff.time + ((double)tbuff.millitm / 1000.0) +
+ ((double) tbuff.timezone * 60));
+#else
+ struct timeval tv;
+ struct timezone tz;
+
+ gettimeofday(&tv, &tz);
+ return (tv.tv_sec + tv.tv_usec / 1000000.0);
+#endif /* USE_FTIME */
+}
+
+
+// Wait for I/O on any source, timeout, or interrupt signal.
+bool
+XmlRpcDispatch::waitForAndProcessEvents(double timeoutSeconds)
+{
+ // Construct the sets of descriptors we are interested in
+ fd_set inFd, outFd, excFd;
+ FD_ZERO(&inFd);
+ FD_ZERO(&outFd);
+ FD_ZERO(&excFd);
+
+ XmlRpcSocket::Socket maxFd = 0;
+ for (SourceList::iterator it=_sources.begin(); it!=_sources.end(); ++it)
+ {
+ XmlRpcSocket::Socket fd = it->getSource()->getfd();
+ if (it->getMask() & ReadableEvent) FD_SET(fd, &inFd);
+ if (it->getMask() & WritableEvent) FD_SET(fd, &outFd);
+ if (it->getMask() & Exception) FD_SET(fd, &excFd);
+ if (it->getMask() && fd > maxFd) maxFd = fd;
+ }
+
+ // Check for events
+ int nEvents;
+ if (_endTime < 0.0)
+ {
+ nEvents = select(int(maxFd+1), &inFd, &outFd, &excFd, NULL);
+ }
+ else
+ {
+ struct timeval tv;
+ tv.tv_sec = (int)floor(timeoutSeconds);
+ tv.tv_usec = ((int)floor(1000000.0 * (timeoutSeconds-floor(timeoutSeconds)))) % 1000000;
+ nEvents = select(int(maxFd+1), &inFd, &outFd, &excFd, &tv);
+ }
+
+ if (nEvents < 0 && errno != EINTR)
+ {
+ XmlRpcUtil::error("Error in XmlRpcDispatch::work: error in select (%d).", nEvents);
+ return false;
+ }
+
+ // Process events. Copy source list to avoid invalidating iterator by removing sources.
+ SourceList s(_sources);
+ for (SourceList::iterator it=s.begin(); it != s.end(); ++it)
+ {
+ XmlRpcSource* src = it->getSource();
+ XmlRpcSocket::Socket fd = src->getfd();
+
+ if (fd <= maxFd)
+ {
+ // handleEvent is called once per event type signalled
+ unsigned newMask = 0;
+ int nset = 0;
+ if (FD_ISSET(fd, &inFd))
+ {
+ newMask |= src->handleEvent(ReadableEvent);
+ ++nset;
+ }
+ if (FD_ISSET(fd, &outFd))
+ {
+ newMask |= src->handleEvent(WritableEvent);
+ ++nset;
+ }
+ if (FD_ISSET(fd, &excFd))
+ {
+ newMask |= src->handleEvent(Exception);
+ ++nset;
+ }
+
+ // Some event occurred
+ if (nset)
+ {
+ // This bit is not terribly efficient if many connections are active...
+ if (newMask)
+ {
+ setSourceEvents(src, newMask);
+ }
+ else // Stop monitoring this one
+ {
+ removeSource(src);
+
+ if ( ! src->getKeepOpen())
+ src->close();
+ }
+ }
+ }
+ }
+
+ return true;
+}
diff --git a/src/xmlrpccpp/XmlRpcMutex.cpp b/src/xmlrpccpp/XmlRpcMutex.cpp
new file mode 100644
index 0000000..b29455d
--- /dev/null
+++ b/src/xmlrpccpp/XmlRpcMutex.cpp
@@ -0,0 +1,60 @@
+#if defined(XMLRPC_THREADS)
+
+#include "XmlRpcMutex.h"
+
+#if defined(_WINDOWS)
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+#else
+# include <pthread.h>
+#endif
+
+using namespace XmlRpc;
+
+
+//! Destructor.
+XmlRpcMutex::~XmlRpcMutex()
+{
+ if (_pMutex)
+ {
+#if defined(_WINDOWS)
+ ::CloseHandle((HANDLE)_pMutex);
+#else
+ ::pthread_mutex_destroy((pthread_mutex_t*)_pMutex);
+ delete _pMutex;
+#endif
+ _pMutex = 0;
+ }
+}
+
+//! Wait for the mutex to be available and then acquire the lock.
+void XmlRpcMutex::acquire()
+{
+#if defined(_WINDOWS)
+ if ( ! _pMutex)
+ _pMutex = ::CreateMutex(0, TRUE, 0);
+ else
+ ::WaitForSingleObject(_pMutex, INFINITE);
+#else
+ if ( ! _pMutex)
+ {
+ _pMutex = new pthread_mutex_t;
+ ::pthread_mutex_init((pthread_mutex_t*)_pMutex, 0);
+ }
+ ::pthread_mutex_lock((pthread_mutex_t*)_pMutex);
+#endif
+}
+
+//! Release the mutex.
+void XmlRpcMutex::release()
+{
+ if (_pMutex)
+#if defined(_WINDOWS)
+ ::ReleaseMutex(_pMutex);
+#else
+ ::pthread_mutex_unlock((pthread_mutex_t*)_pMutex);
+#endif
+}
+
+#endif // XMLRPC_THREADS
+
diff --git a/src/xmlrpccpp/XmlRpcServer.cpp b/src/xmlrpccpp/XmlRpcServer.cpp
new file mode 100644
index 0000000..25cd975
--- /dev/null
+++ b/src/xmlrpccpp/XmlRpcServer.cpp
@@ -0,0 +1,506 @@
+//
+// XmlRpc++ Copyright (c) 2002-2008 by Chris Morley
+//
+
+
+#include "XmlRpcServer.h"
+#include "XmlRpcServerConnection.h"
+#include "XmlRpcServerMethod.h"
+#include "XmlRpcSocket.h"
+#include "XmlRpcUtil.h"
+#include "XmlRpcException.h"
+#include "XmlRpc.h"
+
+#include <stdio.h>
+
+using namespace XmlRpc;
+
+
+// Static data
+const char XmlRpcServer::METHODNAME_TAG[] = "methodName";
+const char XmlRpcServer::PARAMS_TAG[] = "params";
+const char XmlRpcServer::PARAM_TAG[] = "param";
+
+const std::string XmlRpcServer::METHODNAME = "methodName";
+const std::string XmlRpcServer::PARAMS = "params";
+
+const std::string XmlRpcServer::FAULTCODE = "faultCode";
+const std::string XmlRpcServer::FAULTSTRING = "faultString";
+
+
+
+XmlRpcServer::XmlRpcServer()
+{
+ _introspectionEnabled = false;
+ _listMethods = 0;
+ _methodHelp = 0;
+}
+
+
+XmlRpcServer::~XmlRpcServer()
+{
+ this->shutdown();
+ _methods.clear();
+ delete _listMethods;
+ delete _methodHelp;
+}
+
+
+// Add a command to the RPC server
+void
+XmlRpcServer::addMethod(XmlRpcServerMethod* method)
+{
+ _methods[method->name()] = method;
+}
+
+// Remove a command from the RPC server
+void
+XmlRpcServer::removeMethod(XmlRpcServerMethod* method)
+{
+ MethodMap::iterator i = _methods.find(method->name());
+ if (i != _methods.end())
+ _methods.erase(i);
+}
+
+// Remove a command from the RPC server by name
+void
+XmlRpcServer::removeMethod(const std::string& methodName)
+{
+ MethodMap::iterator i = _methods.find(methodName);
+ if (i != _methods.end())
+ _methods.erase(i);
+}
+
+
+// Look up a method by name
+XmlRpcServerMethod*
+XmlRpcServer::findMethod(const std::string& name) const
+{
+ MethodMap::const_iterator i = _methods.find(name);
+ if (i == _methods.end())
+ return 0;
+ return i->second;
+}
+
+
+// Create a socket, bind to the specified port, and
+// set it in listen mode to make it available for clients.
+bool
+XmlRpcServer::bindAndListen(int port, int backlog /*= 5*/)
+{
+ XmlRpcSocket::Socket fd = XmlRpcSocket::socket();
+ if (XmlRpcSocket::Invalid == fd)
+ {
+ XmlRpcUtil::error("XmlRpcServer::bindAndListen: Could not create socket (%s).", XmlRpcSocket::getErrorMsg().c_str());
+ return false;
+ }
+
+ this->setfd(fd);
+
+ // Don't block on reads/writes
+ if ( ! XmlRpcSocket::setNonBlocking(fd))
+ {
+ this->close();
+ XmlRpcUtil::error("XmlRpcServer::bindAndListen: Could not set socket to non-blocking input mode (%s).", XmlRpcSocket::getErrorMsg().c_str());
+ return false;
+ }
+
+ // Allow this port to be re-bound immediately so server re-starts are not delayed
+ if ( ! XmlRpcSocket::setReuseAddr(fd))
+ {
+ this->close();
+ XmlRpcUtil::error("XmlRpcServer::bindAndListen: Could not set SO_REUSEADDR socket option (%s).", XmlRpcSocket::getErrorMsg().c_str());
+ return false;
+ }
+
+ // Bind to the specified port on the default interface
+ if ( ! XmlRpcSocket::bind(fd, port))
+ {
+ this->close();
+ XmlRpcUtil::error("XmlRpcServer::bindAndListen: Could not bind to specified port (%s).", XmlRpcSocket::getErrorMsg().c_str());
+ return false;
+ }
+
+ // Set in listening mode
+ if ( ! XmlRpcSocket::listen(fd, backlog))
+ {
+ this->close();
+ XmlRpcUtil::error("XmlRpcServer::bindAndListen: Could not set socket in listening mode (%s).", XmlRpcSocket::getErrorMsg().c_str());
+ return false;
+ }
+
+ XmlRpcUtil::log(2, "XmlRpcServer::bindAndListen: server listening on port %d fd %d", port, fd);
+
+ // Notify the dispatcher to listen on this source when we are in work()
+ _disp.addSource(this, XmlRpcDispatch::ReadableEvent);
+
+ return true;
+}
+
+
+// Get port number that this server is listening on
+int
+XmlRpcServer::getPort(void) const
+{
+ return XmlRpcSocket::getPort(getfd());
+}
+
+
+
+// Process client requests for the specified time (in seconds)
+void
+XmlRpcServer::work(double timeSeconds)
+{
+ XmlRpcUtil::log(2, "XmlRpcServer::work: waiting for a connection");
+ _disp.work(timeSeconds);
+}
+
+
+
+// Handle input on the server socket by accepting the connection
+// and reading the rpc request.
+unsigned
+XmlRpcServer::handleEvent(unsigned mask)
+{
+ acceptConnection();
+ return XmlRpcDispatch::ReadableEvent; // Continue to monitor this fd
+}
+
+
+// Accept a client connection request and create a connection to
+// handle method calls from the client.
+void
+XmlRpcServer::acceptConnection()
+{
+ XmlRpcSocket::Socket s = XmlRpcSocket::accept(this->getfd());
+ XmlRpcUtil::log(2, "XmlRpcServer::acceptConnection: socket %d", s);
+ if (XmlRpcSocket::Invalid == s)
+ {
+ //this->close();
+ XmlRpcUtil::error("XmlRpcServer::acceptConnection: Could not accept connection (%s).", XmlRpcSocket::getErrorMsg().c_str());
+ }
+ else if ( ! XmlRpcSocket::setNonBlocking(s))
+ {
+ XmlRpcSocket::close(s);
+ XmlRpcUtil::error("XmlRpcServer::acceptConnection: Could not set socket to non-blocking input mode (%s).", XmlRpcSocket::getErrorMsg().c_str());
+ }
+ else // Notify the dispatcher to listen for input on this source when we are in work()
+ {
+ XmlRpcUtil::log(2, "XmlRpcServer::acceptConnection: creating a connection");
+ XmlRpcServerConnection* c = this->createConnection(s);
+ if (c) this->dispatchConnection(c);
+ }
+}
+
+
+// Create a new connection object for processing requests from a specific client.
+XmlRpcServerConnection*
+XmlRpcServer::createConnection(XmlRpcSocket::Socket s)
+{
+ // Specify that the connection object be deleted when it is closed
+ return new XmlRpcServerConnection(s, this, true);
+}
+
+
+// Hand off a new connection to a dispatcher
+void
+XmlRpcServer::dispatchConnection(XmlRpcServerConnection* sc)
+{
+ _disp.addSource(sc, XmlRpcDispatch::ReadableEvent);
+}
+
+
+// Remove a connection. Called by the connection when it closes down.
+void
+XmlRpcServer::removeConnection(XmlRpcServerConnection* sc)
+{
+ _disp.removeSource(sc);
+}
+
+
+// Stop processing client requests
+void
+XmlRpcServer::exit()
+{
+ _disp.exit();
+}
+
+
+// Close the server socket file descriptor and stop monitoring connections
+void
+XmlRpcServer::shutdown()
+{
+ // This closes and destroys all connections as well as closing this socket
+ _disp.clear();
+}
+
+
+// Introspection support
+static const std::string LIST_METHODS("system.listMethods");
+static const std::string METHOD_HELP("system.methodHelp");
+static const std::string MULTICALL("system.multicall");
+
+
+// List all methods available on a server
+class ListMethods : public XmlRpcServerMethod
+{
+public:
+ ListMethods(XmlRpcServer* s) : XmlRpcServerMethod(LIST_METHODS, s) {}
+
+ void execute(XmlRpcValue& params, XmlRpcValue& result)
+ {
+ _server->listMethods(result);
+ }
+
+ std::string help() { return std::string("List all methods available on a server as an array of strings"); }
+};
+
+
+// Retrieve the help string for a named method
+class MethodHelp : public XmlRpcServerMethod
+{
+public:
+ MethodHelp(XmlRpcServer* s) : XmlRpcServerMethod(METHOD_HELP, s) {}
+
+ void execute(XmlRpcValue& params, XmlRpcValue& result)
+ {
+ if (params[0].getType() != XmlRpcValue::TypeString)
+ throw XmlRpcException(METHOD_HELP + ": Invalid argument type");
+
+ XmlRpcServerMethod* m = _server->findMethod(params[0]);
+ if ( ! m)
+ throw XmlRpcException(METHOD_HELP + ": Unknown method name");
+
+ result = m->help();
+ }
+
+ std::string help() { return std::string("Retrieve the help string for a named method"); }
+};
+
+
+// Specify whether introspection is enabled or not. Default is enabled.
+void
+XmlRpcServer::enableIntrospection(bool enabled)
+{
+ if (_introspectionEnabled == enabled)
+ return;
+
+ _introspectionEnabled = enabled;
+
+ if (enabled)
+ {
+ if ( ! _listMethods)
+ {
+ _listMethods = new ListMethods(this);
+ _methodHelp = new MethodHelp(this);
+ } else {
+ addMethod(_listMethods);
+ addMethod(_methodHelp);
+ }
+ }
+ else
+ {
+ removeMethod(LIST_METHODS);
+ removeMethod(METHOD_HELP);
+ }
+}
+
+
+void
+XmlRpcServer::listMethods(XmlRpcValue& result)
+{
+ int i = 0;
+ result.setSize(int(_methods.size())+1);
+ for (MethodMap::iterator it=_methods.begin(); it != _methods.end(); ++it)
+ result[i++] = it->first;
+
+ // Multicall support is built into XmlRpcServer::executeRequest
+ result[i] = MULTICALL;
+}
+
+
+
+// Parse the request, run the method, generate a response string.
+std::string
+XmlRpcServer::executeRequest(std::string const& request)
+{
+ XmlRpcValue params, resultValue;
+ std::string methodName = parseRequest(request, params);
+ XmlRpcUtil::log(2, "XmlRpcServer::executeRequest: server calling method '%s'",
+ methodName.c_str());
+
+ std::string response;
+ try {
+
+ if ( ! executeMethod(methodName, params, resultValue) &&
+ ! executeMulticall(methodName, params, resultValue))
+ response = generateFaultResponse(methodName + ": unknown method name");
+ else
+ response = generateResponse(resultValue.toXml());
+
+ } catch (const XmlRpcException& fault) {
+ XmlRpcUtil::log(2, "XmlRpcServer::executeRequest: fault %s.",
+ fault.getMessage().c_str());
+ response = generateFaultResponse(fault.getMessage(), fault.getCode());
+ }
+
+ return response;
+}
+
+// Parse the method name and the argument values from the request.
+std::string
+XmlRpcServer::parseRequest(std::string const& request, XmlRpcValue& params)
+{
+ std::string methodName;
+ int offset = 0; // Number of chars parsed from the request
+ bool emptyTag;
+
+ if (XmlRpcUtil::parseTag(METHODNAME_TAG, request, &offset, methodName) &&
+ XmlRpcUtil::findTag(PARAMS_TAG, request, &offset, &emptyTag) &&
+ ! emptyTag)
+ {
+ int nArgs = 0;
+ while (XmlRpcUtil::nextTagIs(PARAM_TAG, request, &offset, &emptyTag))
+ {
+ if (emptyTag)
+ {
+ params[nArgs++] = XmlRpcValue("");
+ }
+ else
+ {
+ params[nArgs++] = XmlRpcValue(request, &offset);
+ (void) XmlRpcUtil::nextTagIsEnd(PARAM_TAG, request, &offset);
+ }
+ }
+
+ (void) XmlRpcUtil::nextTagIsEnd(PARAMS_TAG, request, &offset);
+ }
+
+ return methodName;
+}
+
+// Execute a named method with the specified params.
+bool
+XmlRpcServer::executeMethod(const std::string& methodName,
+ XmlRpcValue& params,
+ XmlRpcValue& result)
+{
+ XmlRpcServerMethod* method = findMethod(methodName);
+
+ if ( ! method) return false;
+
+ method->execute(params, result);
+
+ // Ensure a valid result value
+ if ( ! result.valid())
+ result = std::string();
+
+ return true;
+}
+
+// Execute multiple calls and return the results in an array.
+bool
+XmlRpcServer::executeMulticall(const std::string& methodName,
+ XmlRpcValue& params,
+ XmlRpcValue& result)
+{
+ if (methodName != MULTICALL) return false;
+
+ // There ought to be 1 parameter, an array of structs
+ if (params.size() != 1 || params[0].getType() != XmlRpcValue::TypeArray)
+ throw XmlRpcException(MULTICALL + ": Invalid argument (expected an array)");
+
+ int nc = params[0].size();
+ result.setSize(nc);
+
+ for (int i=0; i<nc; ++i) {
+
+ if ( ! params[0][i].hasMember(METHODNAME) ||
+ ! params[0][i].hasMember(PARAMS)) {
+ result[i][FAULTCODE] = -1;
+ result[i][FAULTSTRING] = MULTICALL +
+ ": Invalid argument (expected a struct with members methodName and params)";
+ continue;
+ }
+
+ const std::string& methodName = params[0][i][METHODNAME];
+ XmlRpcValue& methodParams = params[0][i][PARAMS];
+
+ XmlRpcValue resultValue;
+ resultValue.setSize(1);
+ try {
+ if ( ! executeMethod(methodName, methodParams, resultValue[0]) &&
+ ! executeMulticall(methodName, params, resultValue[0]))
+ {
+ result[i][FAULTCODE] = -1;
+ result[i][FAULTSTRING] = methodName + ": unknown method name";
+ }
+ else
+ result[i] = resultValue;
+
+ } catch (const XmlRpcException& fault) {
+ result[i][FAULTCODE] = fault.getCode();
+ result[i][FAULTSTRING] = fault.getMessage();
+ }
+ }
+
+ return true;
+}
+
+
+// Create a response from results xml
+std::string
+XmlRpcServer::generateResponse(std::string const& resultXml)
+{
+ const char RESPONSE_1[] =
+ "<?xml version=\"1.0\"?>\r\n"
+ "<methodResponse><params><param>\r\n\t";
+ const char RESPONSE_2[] =
+ "\r\n</param></params></methodResponse>\r\n";
+
+ std::string body = RESPONSE_1 + resultXml + RESPONSE_2;
+ std::string header = generateHeader(body);
+ std::string response = header + body;
+
+ XmlRpcUtil::log(5, "XmlRpcServer::generateResponse:\n%s\n", response.c_str());
+ return response;
+}
+
+
+// Prepend http headers
+std::string
+XmlRpcServer::generateHeader(std::string const& body)
+{
+ std::string header =
+ "HTTP/1.1 200 OK\r\n"
+ "Server: ";
+ header += XMLRPC_VERSION;
+ header += "\r\n"
+ "Content-Type: text/xml\r\n"
+ "Content-length: ";
+
+ char buffLen[40];
+ sprintf(buffLen,"%d\r\n\r\n", body.size());
+
+ return header + buffLen;
+}
+
+
+std::string
+XmlRpcServer::generateFaultResponse(std::string const& errorMsg, int errorCode)
+{
+ const char RESPONSE_1[] =
+ "<?xml version=\"1.0\"?>\r\n"
+ "<methodResponse><fault>\r\n\t";
+ const char RESPONSE_2[] =
+ "\r\n</fault></methodResponse>\r\n";
+
+ XmlRpcValue faultStruct;
+ faultStruct[FAULTCODE] = errorCode;
+ faultStruct[FAULTSTRING] = errorMsg;
+ std::string body = RESPONSE_1 + faultStruct.toXml() + RESPONSE_2;
+ std::string header = generateHeader(body);
+
+ return header + body;
+}
+
diff --git a/src/xmlrpccpp/XmlRpcServerConnection.cpp b/src/xmlrpccpp/XmlRpcServerConnection.cpp
new file mode 100644
index 0000000..f0fcc7e
--- /dev/null
+++ b/src/xmlrpccpp/XmlRpcServerConnection.cpp
@@ -0,0 +1,216 @@
+//
+// XmlRpc++ Copyright (c) 2002-2008 by Chris Morley
+//
+
+#include "XmlRpcServerConnection.h"
+
+#include "XmlRpcDispatch.h"
+#include "XmlRpcServer.h"
+#include "XmlRpcSocket.h"
+#include "XmlRpcUtil.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+using namespace XmlRpc;
+
+
+
+// The server delegates handling client requests to a serverConnection object.
+XmlRpcServerConnection::XmlRpcServerConnection(XmlRpcSocket::Socket fd,
+ XmlRpcServer* server,
+ bool deleteOnClose /*= false*/) :
+ XmlRpcSource(fd, deleteOnClose)
+{
+ XmlRpcUtil::log(2,"XmlRpcServerConnection: new socket %d.", fd);
+ _server = server;
+ _connectionState = READ_HEADER;
+ _keepAlive = true;
+}
+
+
+XmlRpcServerConnection::~XmlRpcServerConnection()
+{
+ XmlRpcUtil::log(4,"XmlRpcServerConnection dtor.");
+ _server->removeConnection(this);
+}
+
+
+// Handle input on the server socket by accepting the connection
+// and reading the rpc request. Return true to continue to monitor
+// the socket for events, false to remove it from the dispatcher.
+unsigned
+XmlRpcServerConnection::handleEvent(unsigned /*eventType*/)
+{
+ if (_connectionState == READ_HEADER)
+ if ( ! readHeader()) return 0;
+
+ if (_connectionState == READ_REQUEST)
+ if ( ! readRequest()) return 0;
+
+ if (_connectionState == WRITE_RESPONSE)
+ if ( ! writeResponse()) return 0;
+
+ return (_connectionState == WRITE_RESPONSE)
+ ? XmlRpcDispatch::WritableEvent : XmlRpcDispatch::ReadableEvent;
+}
+
+
+bool
+XmlRpcServerConnection::readHeader()
+{
+ // Read available data
+ bool eof;
+ if ( ! nbRead(_header, &eof))
+ {
+ // Its only an error if we already have read some data
+ if (_header.length() > 0)
+ XmlRpcUtil::error("XmlRpcServerConnection::readHeader: error while reading header (%s).",XmlRpcSocket::getErrorMsg().c_str());
+ return false;
+ }
+
+ XmlRpcUtil::log(4, "XmlRpcServerConnection::readHeader: read %d bytes.", _header.length());
+ char *hp = (char*)_header.c_str(); // Start of header
+ char *ep = hp + _header.length(); // End of string
+ char *bp = 0; // Start of body
+ char *lp = 0; // Start of content-length value
+ char *kp = 0; // Start of connection value
+
+ for (char *cp = hp; (bp == 0) && (cp < ep); ++cp) {
+ if ((ep - cp > 16) && (strncasecmp(cp, "Content-length: ", 16) == 0))
+ lp = cp + 16;
+ else if ((ep - cp > 12) && (strncasecmp(cp, "Connection: ", 12) == 0))
+ kp = cp + 12;
+ else if ((ep - cp > 4) && (strncmp(cp, "\r\n\r\n", 4) == 0))
+ bp = cp + 4;
+ else if ((ep - cp > 2) && (strncmp(cp, "\n\n", 2) == 0))
+ bp = cp + 2;
+ }
+
+ // If we haven't gotten the entire header yet, return (keep reading)
+ if (bp == 0) {
+ // EOF in the middle of a request is an error, otherwise its ok
+ if (eof) {
+ XmlRpcUtil::log(4, "XmlRpcServerConnection::readHeader: EOF");
+ if (_header.length() > 0)
+ XmlRpcUtil::error("XmlRpcServerConnection::readHeader: EOF while reading header");
+ return false; // Either way we close the connection
+ }
+
+ return true; // Keep reading
+ }
+
+ // Decode content length
+ if (lp == 0) {
+ XmlRpcUtil::error("XmlRpcServerConnection::readHeader: No Content-length specified");
+ return false; // We could try to figure it out by parsing as we read, but for now...
+ }
+
+ _contentLength = atoi(lp);
+ if (_contentLength <= 0) {
+ XmlRpcUtil::error("XmlRpcServerConnection::readHeader: Invalid Content-length specified (%d).", _contentLength);
+ return false;
+ }
+
+ XmlRpcUtil::log(3, "XmlRpcServerConnection::readHeader: specified content length is %d.", _contentLength);
+
+ // Otherwise copy non-header data to request buffer and set state to read request.
+ _request = bp;
+
+ // Parse out any interesting bits from the header (HTTP version, connection)
+ _keepAlive = true;
+ if (_header.find("HTTP/1.0") != std::string::npos) {
+ if (kp == 0 || strncasecmp(kp, "keep-alive", 10) != 0)
+ _keepAlive = false; // Default for HTTP 1.0 is to close the connection
+ } else {
+ if (kp != 0 && strncasecmp(kp, "close", 5) == 0)
+ _keepAlive = false;
+ }
+ XmlRpcUtil::log(3, "KeepAlive: %d", _keepAlive);
+
+
+ _header = "";
+ _connectionState = READ_REQUEST;
+ return true; // Continue monitoring this source
+}
+
+
+
+bool
+XmlRpcServerConnection::readRequest()
+{
+ // If we dont have the entire request yet, read available data
+ if (int(_request.length()) < _contentLength)
+ {
+ bool eof;
+ if ( ! nbRead(_request, &eof))
+ {
+ XmlRpcUtil::error("XmlRpcServerConnection::readRequest: read error (%s).",XmlRpcSocket::getErrorMsg().c_str());
+ return false;
+ }
+
+ // If we haven't gotten the entire request yet, return (keep reading)
+ if (int(_request.length()) < _contentLength)
+ {
+ if (eof)
+ {
+ XmlRpcUtil::error("XmlRpcServerConnection::readRequest: EOF while reading request");
+ return false; // Either way we close the connection
+ }
+ return true;
+ }
+ }
+
+ // Otherwise, parse and dispatch the request
+ XmlRpcUtil::log(3, "XmlRpcServerConnection::readRequest read %d bytes.", _request.length());
+ //XmlRpcUtil::log(5, "XmlRpcServerConnection::readRequest:\n%s\n", _request.c_str());
+
+ _connectionState = WRITE_RESPONSE;
+
+ return true; // Continue monitoring this source
+}
+
+
+
+bool
+XmlRpcServerConnection::writeResponse()
+{
+ if (_response.length() == 0)
+ {
+ executeRequest();
+ _bytesWritten = 0;
+ if (_response.length() == 0)
+ {
+ XmlRpcUtil::error("XmlRpcServerConnection::writeResponse: empty response.");
+ return false;
+ }
+ }
+
+ // Try to write the response
+ if ( ! nbWrite(_response, &_bytesWritten))
+ {
+ XmlRpcUtil::error("XmlRpcServerConnection::writeResponse: write error (%s).",XmlRpcSocket::getErrorMsg().c_str());
+ return false;
+ }
+ XmlRpcUtil::log(3, "XmlRpcServerConnection::writeResponse: wrote %d of %d bytes.", _bytesWritten, _response.length());
+
+ // Prepare to read the next request
+ if (_bytesWritten == int(_response.length()))
+ {
+ _header = "";
+ _request = "";
+ _response = "";
+ _connectionState = READ_HEADER;
+ }
+
+ return _keepAlive; // Continue monitoring this source if true
+}
+
+
+//! Helper method to execute the client request
+void XmlRpcServerConnection::executeRequest()
+{
+ _response = _server->executeRequest(_request);
+}
+
diff --git a/src/xmlrpccpp/XmlRpcServerMethod.cpp b/src/xmlrpccpp/XmlRpcServerMethod.cpp
new file mode 100644
index 0000000..b35db4c
--- /dev/null
+++ b/src/xmlrpccpp/XmlRpcServerMethod.cpp
@@ -0,0 +1,24 @@
+//
+// XmlRpc++ Copyright (c) 2002-2008 by Chris Morley
+//
+
+#include "XmlRpcServerMethod.h"
+#include "XmlRpcServer.h"
+
+namespace XmlRpc {
+
+
+ XmlRpcServerMethod::XmlRpcServerMethod(std::string const& name, XmlRpcServer* server)
+ {
+ _name = name;
+ _server = server;
+ if (_server) _server->addMethod(this);
+ }
+
+ XmlRpcServerMethod::~XmlRpcServerMethod()
+ {
+ if (_server) _server->removeMethod(this);
+ }
+
+
+} // namespace XmlRpc
diff --git a/src/xmlrpccpp/XmlRpcSocket.cpp b/src/xmlrpccpp/XmlRpcSocket.cpp
new file mode 100644
index 0000000..fd2b30e
--- /dev/null
+++ b/src/xmlrpccpp/XmlRpcSocket.cpp
@@ -0,0 +1,224 @@
+//
+// XmlRpc++ Copyright (c) 2002-2008 by Chris Morley
+//
+
+#include "XmlRpcSocket.h"
+#include "XmlRpcUtil.h"
+
+
+#if defined(_WINDOWS)
+# include <stdio.h>
+# include <winsock2.h>
+//# pragma lib(WS2_32.lib)
+
+# define EINPROGRESS WSAEINPROGRESS
+# define EWOULDBLOCK WSAEWOULDBLOCK
+# define ETIMEDOUT WSAETIMEDOUT
+
+typedef int socklen_t;
+
+#else
+extern "C" {
+# include <unistd.h>
+# include <stdio.h>
+# include <string.h>
+# include <sys/types.h>
+# include <sys/socket.h>
+# include <netinet/in.h>
+# include <netdb.h>
+# include <errno.h>
+# include <fcntl.h>
+# include <signal.h>
+}
+#endif // _WINDOWS
+
+
+using namespace XmlRpc;
+
+
+// One-time initializations
+static bool initialized = false;
+
+
+static void initialize()
+{
+ initialized = true;
+
+#if defined(_WINDOWS)
+ {
+ WORD wVersionRequested = MAKEWORD( 2, 0 );
+ WSADATA wsaData;
+ WSAStartup(wVersionRequested, &wsaData);
+ }
+#else
+ {
+ // Ignore SIGPIPE
+ (void) signal(SIGPIPE, SIG_IGN);
+ }
+#endif // _WINDOWS
+}
+
+
+
+// These errors are not considered fatal for an IO operation; the operation will be re-tried.
+bool
+XmlRpcSocket::nonFatalError()
+{
+ int err = XmlRpcSocket::getError();
+ return (err == EINPROGRESS ||
+#if defined(EAGAIN)
+ err == EAGAIN ||
+#endif
+#if defined(EINTR)
+ err == EINTR ||
+#endif
+ err == EWOULDBLOCK);
+}
+
+
+XmlRpcSocket::Socket
+XmlRpcSocket::socket()
+{
+ if ( ! initialized) initialize();
+ return ::socket(AF_INET, SOCK_STREAM, 0);
+}
+
+
+void
+XmlRpcSocket::close(XmlRpcSocket::Socket fd)
+{
+ XmlRpcUtil::log(4, "XmlRpcSocket::close: fd %d.", fd);
+#if defined(_WINDOWS)
+ closesocket(fd);
+#else
+ ::close(fd);
+#endif // _WINDOWS
+}
+
+
+
+
+bool
+XmlRpcSocket::setNonBlocking(XmlRpcSocket::Socket fd)
+{
+#if defined(_WINDOWS)
+ unsigned long flag = 1;
+ return (ioctlsocket(fd, FIONBIO, &flag) == 0);
+#else
+ return (fcntl(fd, F_SETFL, O_NONBLOCK) == 0);
+#endif // _WINDOWS
+}
+
+
+bool
+XmlRpcSocket::setReuseAddr(XmlRpcSocket::Socket fd)
+{
+ // Allow this port to be re-bound immediately so server re-starts are not delayed
+ int sflag = 1;
+ return (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (const char *)&sflag, sizeof(sflag)) == 0);
+}
+
+
+// Bind to a specified port
+bool
+XmlRpcSocket::bind(XmlRpcSocket::Socket fd, int port)
+{
+ struct sockaddr_in saddr;
+ memset(&saddr, 0, sizeof(saddr));
+ saddr.sin_family = AF_INET;
+ saddr.sin_addr.s_addr = htonl(INADDR_ANY);
+ saddr.sin_port = htons((u_short) port);
+ return (::bind(fd, (struct sockaddr *)&saddr, sizeof(saddr)) == 0);
+}
+
+
+// Set socket in listen mode
+bool
+XmlRpcSocket::listen(XmlRpcSocket::Socket fd, int backlog)
+{
+ return (::listen(fd, backlog) == 0);
+}
+
+
+XmlRpcSocket::Socket
+XmlRpcSocket::accept(XmlRpcSocket::Socket fd)
+{
+ struct sockaddr_in addr;
+ socklen_t addrlen = sizeof(addr);
+
+ return ::accept(fd, (struct sockaddr*)&addr, &addrlen);
+}
+
+
+
+// Connect a socket to a server (from a client)
+bool
+XmlRpcSocket::connect(XmlRpcSocket::Socket fd, std::string& host, int port)
+{
+ struct sockaddr_in saddr;
+ memset(&saddr, 0, sizeof(saddr));
+ saddr.sin_family = AF_INET;
+
+ struct hostent *hp = gethostbyname(host.c_str());
+ if (hp == 0) return false;
+
+ saddr.sin_family = hp->h_addrtype;
+ memcpy(&saddr.sin_addr, hp->h_addr, hp->h_length);
+ saddr.sin_port = htons((u_short) port);
+
+ // For asynch operation, this will return EWOULDBLOCK (windows) or
+ // EINPROGRESS (linux) and we just need to wait for the socket to be writable...
+ int result = ::connect(fd, (struct sockaddr *)&saddr, sizeof(saddr));
+ return result == 0 || nonFatalError();
+}
+
+
+
+// Get the port of a bound socket
+int
+XmlRpcSocket::getPort(XmlRpcSocket::Socket socket)
+{
+ struct sockaddr_in saddr;
+ socklen_t saddr_len = sizeof(saddr);
+ int port;
+
+ int result = ::getsockname(socket, (sockaddr*) &saddr, &saddr_len);
+
+ if (result != 0) {
+ port = -1;
+ } else {
+ port = ntohs(saddr.sin_port);
+ }
+ return port;
+}
+
+
+// Returns last errno
+int
+XmlRpcSocket::getError()
+{
+#if defined(_WINDOWS)
+ return WSAGetLastError();
+#else
+ return errno;
+#endif
+}
+
+
+// Returns message corresponding to last errno
+std::string
+XmlRpcSocket::getErrorMsg()
+{
+ return getErrorMsg(getError());
+}
+
+// Returns message corresponding to errno... well, it should anyway
+std::string
+XmlRpcSocket::getErrorMsg(int error)
+{
+ char err[60];
+ snprintf(err,sizeof(err),"error %d", error);
+ return std::string(err);
+}
+
+
diff --git a/src/xmlrpccpp/XmlRpcSource.cpp b/src/xmlrpccpp/XmlRpcSource.cpp
new file mode 100644
index 0000000..7f5bc0a
--- /dev/null
+++ b/src/xmlrpccpp/XmlRpcSource.cpp
@@ -0,0 +1,204 @@
+//
+// XmlRpc++ Copyright (c) 2002-2008 by Chris Morley
+//
+
+#include "XmlRpcSource.h"
+#include "XmlRpcUtil.h"
+
+#if defined(_WINDOWS)
+# include <stdio.h>
+# include <winsock2.h>
+#else
+extern "C" {
+# include <unistd.h>
+# include <stdio.h>
+}
+#endif
+
+#if USE_OPENSSL
+# include <openssl/crypto.h>
+# include <openssl/x509.h>
+# include <openssl/pem.h>
+# include <openssl/ssl.h>
+# include <openssl/err.h>
+#endif
+
+namespace XmlRpc {
+
+ struct SslProxy
+ {
+#if USE_OPENSSL
+ SSL_CTX* _ssl_ctx;
+ SSL_METHOD* _ssl_meth;
+ SSL* _ssl_ssl;
+#endif
+ };
+
+
+ XmlRpcSource::XmlRpcSource(XmlRpcSocket::Socket fd /*= -1*/, bool deleteOnClose /*= false*/)
+ : _fd(fd)
+ , _deleteOnClose(deleteOnClose)
+ , _keepOpen(false)
+ , _sslEnabled(false)
+ , _ssl(0)
+ {
+ }
+
+ XmlRpcSource::~XmlRpcSource()
+ {
+ delete _ssl;
+ }
+
+
+ void
+ XmlRpcSource::setSslEnabled(bool b /*=true*/)
+ {
+#if USE_OPENSSL
+ _sslEnabled = b;
+#endif
+ }
+
+
+ bool
+ XmlRpcSource::doConnect()
+ {
+#if USE_OPENSSL
+ // Perform SSL if needed
+ if (_sslEnabled)
+ {
+ _ssl = new SslProxy;
+
+ SSLeay_add_ssl_algorithms();
+ _ssl->_ssl_meth = SSLv23_client_method();
+ SSL_load_error_strings();
+ _ssl->_ssl_ctx = SSL_CTX_new(_ssl->_ssl_meth);
+ _ssl->_ssl_ssl = SSL_new(_ssl->_ssl_ctx);
+ SSL_set_fd(_ssl->_ssl_ssl, _fd);
+
+ return SSL_connect(_ssl->_ssl_ssl) == 1;
+ }
+#endif
+ return true;
+ }
+
+ // Read available text from the specified socket. Returns false on error.
+ bool
+ XmlRpcSource::nbRead(std::string& s, bool *eof)
+ {
+ const int READ_SIZE = 4096; // Number of bytes to attempt to read at a time
+ char readBuf[READ_SIZE];
+
+ bool wouldBlock = false;
+ *eof = false;
+
+ while ( ! wouldBlock && ! *eof)
+ {
+ int n;
+
+#if USE_OPENSSL
+ // Perform SSL if needed
+ if (_ssl && _ssl->_ssl_ssl)
+ {
+ n = SSL_read(_ssl->_ssl_ssl, readBuf, READ_SIZE-1);
+ }
+ else
+#endif
+#if defined(_WINDOWS)
+ n = recv(_fd, readBuf, READ_SIZE-1, 0);
+#else
+ n = read(_fd, readBuf, READ_SIZE-1);
+#endif
+ XmlRpcUtil::log(5, "XmlRpcSocket::nbRead: read/recv returned %d.", n);
+
+ if (n > 0) {
+ readBuf[n] = 0;
+ s.append(readBuf, n);
+ } else if (n == 0) {
+ *eof = true;
+ } else if (XmlRpcSocket::nonFatalError()) {
+ wouldBlock = true;
+ } else {
+ return false; // Error
+ }
+ }
+ return true;
+ }
+
+
+ // Write text to the socket. Returns false on error.
+ bool
+ XmlRpcSource::nbWrite(std::string const& s, int *bytesSoFar)
+ {
+ int nToWrite = int(s.length()) - *bytesSoFar;
+ const char *sp = s.c_str() + *bytesSoFar;
+ bool wouldBlock = false;
+
+ while ( nToWrite > 0 && ! wouldBlock )
+ {
+ int n;
+#if USE_OPENSSL
+ // Perform SSL if needed
+ if (_ssl && _ssl->_ssl_ssl)
+ {
+ n = SSL_write(_ssl->_ssl_ssl, sp, nToWrite);
+ }
+ else
+#endif
+#if defined(_WINDOWS)
+ n = send(_fd, sp, nToWrite, 0);
+#else
+ n = write(_fd, sp, nToWrite);
+#endif
+
+ XmlRpcUtil::log(5, "XmlRpcSocket::nbWrite: send/write returned %d.", n);
+
+ if (n > 0)
+ {
+ sp += n;
+ *bytesSoFar += n;
+ nToWrite -= n;
+ }
+ else if (XmlRpcSocket::nonFatalError())
+ {
+ wouldBlock = true;
+ }
+ else
+ {
+ return false; // Error
+ }
+ }
+ return true;
+ }
+
+ void
+ XmlRpcSource::close()
+ {
+#if USE_OPENSSL
+ if (_ssl && _ssl->_ssl_ssl)
+ {
+ SSL_shutdown(_ssl->_ssl_ssl);
+
+ // Should close be called here ? ...
+
+ SSL_free(_ssl->_ssl_ssl);
+ SSL_CTX_free(_ssl->_ssl_ctx);
+
+ delete _ssl;
+ _ssl = 0;
+ }
+#endif
+ if (_fd != -1)
+ {
+ XmlRpcUtil::log(2,"XmlRpcSource::close: closing socket %d.", _fd);
+ XmlRpcSocket::close(_fd);
+ _fd = -1;
+ }
+ if (_deleteOnClose)
+ {
+ XmlRpcUtil::log(2,"XmlRpcSource::close: deleting this");
+ _deleteOnClose = false;
+ delete this;
+ }
+ }
+
+} // namespace XmlRpc
diff --git a/src/xmlrpccpp/XmlRpcThread.cpp b/src/xmlrpccpp/XmlRpcThread.cpp
new file mode 100644
index 0000000..8a91d87
--- /dev/null
+++ b/src/xmlrpccpp/XmlRpcThread.cpp
@@ -0,0 +1,74 @@
+#if defined(XMLRPC_THREADS)
+
+#include "XmlRpcThread.h"
+
+#if defined(_WINDOWS)
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+# include <process.h>
+#else
+# include <pthread.h>
+#endif
+
+
+using namespace XmlRpc;
+
+
+//! Destructor. Does not perform a join() (ie, the thread may continue to run).
+XmlRpcThread::~XmlRpcThread()
+{
+ if (_pThread)
+ {
+#if defined(_WINDOWS)
+ ::CloseHandle((HANDLE)_pThread);
+#else
+ ::pthread_detach((pthread_t)_pThread);
+#endif
+ _pThread = 0;
+ }
+}
+
+//! Execute the run method of the runnable object in a separate thread.
+//! Returns immediately in the calling thread.
+void
+XmlRpcThread::start()
+{
+ if ( ! _pThread)
+ {
+#if defined(_WINDOWS)
+ unsigned threadID;
+ _pThread = (HANDLE)_beginthreadex(NULL, 0, &runInThread, this, 0, &threadID);
+#else
+ ::pthread_create((pthread_t*) &_pThread, NULL, &runInThread, this);
+#endif
+ }
+}
+
+//! Waits until the thread exits.
+void
+XmlRpcThread::join()
+{
+ if (_pThread)
+ {
+#if defined(_WINDOWS)
+ ::WaitForSingleObject(_pThread, INFINITE);
+ ::CloseHandle(_pThread);
+#else
+ ::pthread_join((pthread_t)_pThread, 0);
+#endif
+ _pThread = 0;
+ }
+}
+
+//! Start the runnable going in a thread
+unsigned int
+XmlRpcThread::runInThread(void* pThread)
+{
+ XmlRpcThread* t = (XmlRpcThread*)pThread;
+ t->getRunnable()->run();
+ return 0;
+}
+
+#endif // XMLRPC_THREADS
+
+
diff --git a/src/xmlrpccpp/XmlRpcUtil.cpp b/src/xmlrpccpp/XmlRpcUtil.cpp
new file mode 100644
index 0000000..eccd41f
--- /dev/null
+++ b/src/xmlrpccpp/XmlRpcUtil.cpp
@@ -0,0 +1,317 @@
+//
+// XmlRpc++ Copyright (c) 2002-2008 by Chris Morley
+//
+
+#include "XmlRpcUtil.h"
+
+#include <ctype.h>
+#include <iostream>
+#include <stdarg.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "XmlRpc.h"
+
+using namespace XmlRpc;
+
+
+//#define USE_WINDOWS_DEBUG // To make the error and log messages go to VC++ debug output
+#ifdef USE_WINDOWS_DEBUG
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#endif
+
+// Version id
+const char XmlRpc::XMLRPC_VERSION[] = "XMLRPC++ 0.8";
+
+// Default log verbosity: 0 for no messages through 5 (writes everything)
+int XmlRpcLogHandler::_verbosity = 0;
+
+// Default log handler
+static class DefaultLogHandler : public XmlRpcLogHandler {
+public:
+
+ void log(int level, const char* msg) {
+#ifdef USE_WINDOWS_DEBUG
+ if (level <= _verbosity) { OutputDebugString(msg); OutputDebugString("\n"); }
+#else
+ if (level <= _verbosity) std::cout << msg << std::endl;
+#endif
+ }
+
+} defaultLogHandler;
+
+// Message log singleton
+XmlRpcLogHandler* XmlRpcLogHandler::_logHandler = &defaultLogHandler;
+
+
+// Default error handler
+static class DefaultErrorHandler : public XmlRpcErrorHandler {
+public:
+
+ void error(const char* msg) {
+#ifdef USE_WINDOWS_DEBUG
+// OutputDebugString(msg); OutputDebugString("\n");
+#else
+// std::cerr << msg << std::endl;
+#endif
+ }
+} defaultErrorHandler;
+
+
+// Error handler singleton
+XmlRpcErrorHandler* XmlRpcErrorHandler::_errorHandler = &defaultErrorHandler;
+
+
+// Easy API for log verbosity
+int XmlRpc::getVerbosity() { return XmlRpcLogHandler::getVerbosity(); }
+void XmlRpc::setVerbosity(int level) { XmlRpcLogHandler::setVerbosity(level); }
+
+
+
+void XmlRpcUtil::log(int level, const char* fmt, ...)
+{
+ if (level <= XmlRpcLogHandler::getVerbosity())
+ {
+ va_list va;
+ char buf[1024];
+ va_start( va, fmt);
+ vsnprintf(buf,sizeof(buf)-1,fmt,va);
+ buf[sizeof(buf)-1] = 0;
+ XmlRpcLogHandler::getLogHandler()->log(level, buf);
+ }
+}
+
+
+void XmlRpcUtil::error(const char* fmt, ...)
+{
+ va_list va;
+ va_start(va, fmt);
+ char buf[1024];
+ vsnprintf(buf,sizeof(buf)-1,fmt,va);
+ buf[sizeof(buf)-1] = 0;
+ XmlRpcErrorHandler::getErrorHandler()->error(buf);
+}
+
+// Returns true if the tag is parsed. No attributes are parsed.
+// Sets val to the contents between <tag> and </tag>, or an empty string if <tag/> is found.
+// Updates offset to char after </tag>
+bool
+XmlRpcUtil::parseTag(const char* tag, std::string const& xml, int* offset, std::string &val)
+{
+ size_t nxml = xml.length();
+ if (*offset >= int(nxml)) return false;
+
+ // Find <tag (skips over anything preceeding...)
+ std::string stag = "<";
+ stag += tag;
+ size_t istart = xml.find(stag, *offset);
+ if (istart == std::string::npos) return false;
+
+ istart += stag.length();
+
+ // Advance istart past > or />
+ bool lastSlash = false;
+ while (istart < nxml && xml[istart] != '>')
+ {
+ lastSlash = (xml[istart] == '/');
+ ++ istart;
+ }
+
+ if (istart == nxml) return false;
+
+ val.clear();
+ if (lastSlash) // <tag/>
+ {
+ *offset = int(istart+1); // 1 after >
+ }
+ else // Find </tag>
+ {
+ std::string etag = "</";
+ etag += tag;
+ etag += ">";
+ size_t iend = xml.find(etag, istart);
+
+ if (iend == std::string::npos) return false;
+
+ *offset = int(iend + etag.length());
+ ++ istart;
+ val = xml.substr(istart, iend-istart);
+ }
+
+ return true;
+}
+
+
+// Returns true if the tag is found and updates offset to the char after the tag
+bool
+XmlRpcUtil::findTag(const char* tag, std::string const& xml, int* offset, bool* emptyTag)
+{
+ size_t nxml = xml.length();
+ if (*offset >= int(nxml)) return false;
+ std::string stag = "<";
+ stag += tag;
+ size_t istart = xml.find(stag, *offset);
+ if (istart == std::string::npos)
+ return false;
+
+ istart += stag.length();
+
+ // Advance istart past > or />, skips attribs
+ bool lastSlash = false;
+ while (istart < nxml && xml[istart] != '>')
+ {
+ lastSlash = (xml[istart] == '/');
+ ++ istart;
+ }
+
+ if (istart == nxml)
+ return false;
+
+ *emptyTag = lastSlash;
+ *offset = int(istart+1); // char after >
+ return true;
+}
+
+
+// Returns true if the <tag> or <tag/> is found at the specified offset (modulo any whitespace)
+// and updates offset to the char after the tag. *emptyTag is set to true if <tag/> is found, false otherwise
+bool
+XmlRpcUtil::nextTagIs(const char* tag, std::string const& xml, int* offset, bool *emptyTag)
+{
+ if (*offset >= int(xml.length()))
+ return false;
+
+ const char* cp = xml.c_str() + *offset;
+ int nc = 0;
+ while (*cp && isspace(*cp))
+ {
+ ++cp;
+ ++nc;
+ }
+
+ int len = int(strlen(tag));
+ if (*cp == '<' && (strncmp(cp+1, tag, len) == 0))
+ {
+ cp += len + 1;
+ if (*cp == '>') // <tag>
+ {
+ *offset += nc + len + 2;
+ *emptyTag = false;
+ return true;
+ }
+
+ while (*cp && isspace(*cp)) { ++cp; ++nc; }
+
+ if (*cp == '/' && *(cp + 1) == '>') // <tag />
+ {
+ *offset += nc + len + 3;
+ *emptyTag = true;
+ return true;
+ }
+ }
+ return false;
+}
+
+
+// Returns true if the next tag found at the specified offset is </tag>
+// and updates offset to the char after the tag.
+bool
+XmlRpcUtil::nextTagIsEnd(const char* tag, std::string const& xml, int* offset)
+{
+ if (*offset >= int(xml.length()))
+ return false;
+
+ const char* cp = xml.c_str() + *offset;
+ int nc = 0;
+ while (*cp && *cp != '<')
+ {
+ ++cp;
+ ++nc;
+ }
+
+ int len = int(strlen(tag));
+ if (*cp == '<' && *(cp+1) == '/' && (strncmp(cp+2, tag, len) == 0) && *(cp + len + 2) == '>')
+ {
+ *offset += nc + len + 3;
+ return true;
+ }
+
+ return false;
+}
+
+
+// xml encodings (xml-encoded entities are preceded with '&')
+static const char AMP = '&';
+static const char rawEntity[] = { '<', '>', '&', '\'', '\"', 0 };
+static const char* xmlEntity[] = { "lt;", "gt;", "amp;", "apos;", "quot;", 0 };
+static const int xmlEntLen[] = { 3, 3, 4, 5, 5 };
+
+
+// Replace xml-encoded entities with the raw text equivalents.
+
+std::string
+XmlRpcUtil::xmlDecode(const std::string& encoded)
+{
+ std::string::size_type iAmp = encoded.find(AMP);
+ if (iAmp == std::string::npos)
+ return encoded;
+
+ std::string decoded(encoded, 0, iAmp);
+ std::string::size_type iSize = encoded.size();
+ decoded.reserve(iSize);
+
+ const char* ens = encoded.c_str();
+ while (iAmp != iSize) {
+ if (encoded[iAmp] == AMP && iAmp+1 < iSize) {
+ int iEntity;
+ for (iEntity=0; xmlEntity[iEntity] != 0; ++iEntity)
+ //if (encoded.compare(iAmp+1, xmlEntLen[iEntity], xmlEntity[iEntity]) == 0)
+ if (strncmp(ens+iAmp+1, xmlEntity[iEntity], xmlEntLen[iEntity]) == 0)
+ {
+ decoded += rawEntity[iEntity];
+ iAmp += xmlEntLen[iEntity]+1;
+ break;
+ }
+ if (xmlEntity[iEntity] == 0) // unrecognized sequence
+ decoded += encoded[iAmp++];
+
+ } else {
+ decoded += encoded[iAmp++];
+ }
+ }
+
+ return decoded;
+}
+
+
+// Replace raw text with xml-encoded entities.
+
+std::string
+XmlRpcUtil::xmlEncode(const std::string& raw)
+{
+ std::string::size_type iRep = raw.find_first_of(rawEntity);
+ if (iRep == std::string::npos)
+ return raw;
+
+ std::string encoded(raw, 0, iRep);
+ std::string::size_type iSize = raw.size();
+
+ while (iRep != iSize) {
+ int iEntity;
+ for (iEntity=0; rawEntity[iEntity] != 0; ++iEntity)
+ if (raw[iRep] == rawEntity[iEntity])
+ {
+ encoded += AMP;
+ encoded += xmlEntity[iEntity];
+ break;
+ }
+ if (rawEntity[iEntity] == 0)
+ encoded += raw[iRep];
+ ++iRep;
+ }
+ return encoded;
+}
+
+
+
diff --git a/src/xmlrpccpp/XmlRpcValue.cpp b/src/xmlrpccpp/XmlRpcValue.cpp
new file mode 100644
index 0000000..dc3d1f2
--- /dev/null
+++ b/src/xmlrpccpp/XmlRpcValue.cpp
@@ -0,0 +1,673 @@
+//
+// XmlRpc++ Copyright (c) 2002-2008 by Chris Morley
+//
+
+#include "XmlRpcValue.h"
+#include "XmlRpcException.h"
+#include "XmlRpcUtil.h"
+#include "base64.h"
+
+#include <iostream>
+#include <ostream>
+#include <stdlib.h>
+#include <stdio.h>
+
+
+namespace XmlRpc {
+
+
+ static const char VALUE_TAG[] = "value";
+ static const char NIL_TAG[] = "nil";
+ static const char BOOLEAN_TAG[] = "boolean";
+ static const char DOUBLE_TAG[] = "double";
+ static const char INT_TAG[] = "int";
+ static const char I4_TAG[] = "i4";
+ static const char STRING_TAG[] = "string";
+ static const char DATETIME_TAG[] = "dateTime.iso8601";
+ static const char BASE64_TAG[] = "base64";
+
+ static const char ARRAY_TAG[] = "array";
+ static const char DATA_TAG[] = "data";
+
+ static const char STRUCT_TAG[] = "struct";
+ static const char MEMBER_TAG[] = "member";
+ static const char NAME_TAG[] = "name";
+
+
+ // Format strings
+ std::string XmlRpcValue::_doubleFormat("%f");
+
+
+
+ // Clean up
+ void XmlRpcValue::invalidate()
+ {
+ switch (_type) {
+ case TypeString: delete _value.asString; break;
+ case TypeDateTime: delete _value.asTime; break;
+ case TypeBase64: delete _value.asBinary; break;
+ case TypeArray: delete _value.asArray; break;
+ case TypeStruct: delete _value.asStruct; break;
+ default: break;
+ }
+ _type = TypeInvalid;
+ _value.asBinary = 0;
+ }
+
+
+ // Type checking
+ void XmlRpcValue::assertType(Type t) const
+ {
+ if (_type != t)
+ {
+ throw XmlRpcException("type error");
+ }
+ }
+
+ void XmlRpcValue::assertType(Type t)
+ {
+ if (_type == TypeInvalid)
+ {
+ _type = t;
+ switch (_type) { // Ensure there is a valid value for the type
+ case TypeString: _value.asString = new std::string(); break;
+ case TypeDateTime: _value.asTime = new struct tm(); break;
+ case TypeBase64: _value.asBinary = new BinaryData(); break;
+ case TypeArray: _value.asArray = new ValueArray(); break;
+ case TypeStruct: _value.asStruct = new ValueStruct(); break;
+ default: _value.asBinary = 0; break;
+ }
+ }
+ else if (_type != t)
+ {
+ throw XmlRpcException("type error");
+ }
+ }
+
+ void XmlRpcValue::assertArray(int size) const
+ {
+ if (_type != TypeArray)
+ throw XmlRpcException("type error: expected an array");
+ else if (int(_value.asArray->size()) < size)
+ throw XmlRpcException("range error: array index too large");
+ }
+
+
+ void XmlRpcValue::assertArray(int size)
+ {
+ if (_type == TypeInvalid) {
+ _type = TypeArray;
+ _value.asArray = new ValueArray(size);
+ } else if (_type == TypeArray) {
+ if (int(_value.asArray->size()) < size)
+ _value.asArray->resize(size);
+ } else
+ throw XmlRpcException("type error: expected an array");
+ }
+
+ void XmlRpcValue::assertStruct()
+ {
+ if (_type == TypeInvalid) {
+ _type = TypeStruct;
+ _value.asStruct = new ValueStruct();
+ } else if (_type != TypeStruct)
+ throw XmlRpcException("type error: expected a struct");
+ }
+
+
+ // Operators
+ XmlRpcValue& XmlRpcValue::operator=(XmlRpcValue const& rhs)
+ {
+ if (this != &rhs)
+ {
+ invalidate();
+ _type = rhs._type;
+ switch (_type) {
+ case TypeBoolean: _value.asBool = rhs._value.asBool; break;
+ case TypeInt: _value.asInt = rhs._value.asInt; break;
+ case TypeDouble: _value.asDouble = rhs._value.asDouble; break;
+ case TypeDateTime: _value.asTime = new struct tm(*rhs._value.asTime); break;
+ case TypeString: _value.asString = new std::string(*rhs._value.asString); break;
+ case TypeBase64: _value.asBinary = new BinaryData(*rhs._value.asBinary); break;
+ case TypeArray: _value.asArray = new ValueArray(*rhs._value.asArray); break;
+ case TypeStruct: _value.asStruct = new ValueStruct(*rhs._value.asStruct); break;
+ default: _value.asBinary = 0; break;
+ }
+ }
+ return *this;
+ }
+
+
+ // Predicate for tm equality
+ static bool tmEq(struct tm const& t1, struct tm const& t2) {
+ return t1.tm_sec == t2.tm_sec && t1.tm_min == t2.tm_min &&
+ t1.tm_hour == t2.tm_hour && t1.tm_mday == t1.tm_mday &&
+ t1.tm_mon == t2.tm_mon && t1.tm_year == t2.tm_year;
+ }
+
+ bool XmlRpcValue::operator==(XmlRpcValue const& other) const
+ {
+ if (_type != other._type)
+ return false;
+
+ switch (_type) {
+ case TypeBoolean: return ( !_value.asBool && !other._value.asBool) ||
+ ( _value.asBool && other._value.asBool);
+ case TypeInt: return _value.asInt == other._value.asInt;
+ case TypeDouble: return _value.asDouble == other._value.asDouble;
+ case TypeDateTime: return tmEq(*_value.asTime, *other._value.asTime);
+ case TypeString: return *_value.asString == *other._value.asString;
+ case TypeBase64: return *_value.asBinary == *other._value.asBinary;
+ case TypeArray: return *_value.asArray == *other._value.asArray;
+
+ // The map<>::operator== requires the definition of value< for kcc
+ case TypeStruct: //return *_value.asStruct == *other._value.asStruct;
+ {
+ if (_value.asStruct->size() != other._value.asStruct->size())
+ return false;
+
+ ValueStruct::const_iterator it1=_value.asStruct->begin();
+ ValueStruct::const_iterator it2=other._value.asStruct->begin();
+ while (it1 != _value.asStruct->end()) {
+ const XmlRpcValue& v1 = it1->second;
+ const XmlRpcValue& v2 = it2->second;
+ if ( ! (v1 == v2))
+ return false;
+ it1++;
+ it2++;
+ }
+ return true;
+ }
+ default: break;
+ }
+ return true; // Both invalid values ...
+ }
+
+ bool XmlRpcValue::operator!=(XmlRpcValue const& other) const
+ {
+ return !(*this == other);
+ }
+
+
+ // Works for strings, binary data, arrays, and structs.
+ int XmlRpcValue::size() const
+ {
+ switch (_type) {
+ case TypeString: return int(_value.asString->size());
+ case TypeBase64: return int(_value.asBinary->size());
+ case TypeArray: return int(_value.asArray->size());
+ case TypeStruct: return int(_value.asStruct->size());
+ default: break;
+ }
+
+ throw XmlRpcException("type error");
+ }
+
+ // Checks for existence of struct member
+ bool XmlRpcValue::hasMember(const std::string& name) const
+ {
+ return _type == TypeStruct && _value.asStruct->find(name) != _value.asStruct->end();
+ }
+
+
+ // Set the value from xml. The chars at *offset into valueXml
+ // should be the start of a <value> tag. Destroys any existing value.
+ bool XmlRpcValue::fromXml(std::string const& valueXml, int* offset)
+ {
+ int savedOffset = *offset;
+
+ invalidate();
+ bool emptyTag;
+ if ( ! XmlRpcUtil::nextTagIs(VALUE_TAG, valueXml, offset, &emptyTag))
+ return false; // Not a value, offset not updated
+
+ // No value? Pretend its an empty string...
+ if (emptyTag)
+ {
+ *this = "";
+ return true;
+ }
+
+ // No type tag? Assume string
+ bool result = true;
+ int valueOffset = *offset;
+ if (XmlRpcUtil::nextTagIsEnd(VALUE_TAG, valueXml, offset))
+ {
+ return stringFromXml(valueXml, &valueOffset);
+ }
+ else if (XmlRpcUtil::nextTagIs(NIL_TAG, valueXml, offset, &emptyTag))
+ {
+ _type = TypeNil;
+ result = true;
+ }
+ else if (XmlRpcUtil::nextTagIs(BOOLEAN_TAG, valueXml, offset, &emptyTag))
+ {
+ if (emptyTag)
+ *this = false;
+ else
+ result = boolFromXml(valueXml, offset) &&
+ XmlRpcUtil::nextTagIsEnd(BOOLEAN_TAG, valueXml, offset);
+ }
+ else if (XmlRpcUtil::nextTagIs(I4_TAG, valueXml, offset, &emptyTag))
+ {
+ if (emptyTag)
+ *this = 0;
+ else
+ result = intFromXml(valueXml, offset) &&
+ XmlRpcUtil::nextTagIsEnd(I4_TAG, valueXml, offset);
+ }
+ else if (XmlRpcUtil::nextTagIs(INT_TAG, valueXml, offset, &emptyTag))
+ {
+ if (emptyTag)
+ *this = 0;
+ else
+ result = intFromXml(valueXml, offset) &&
+ XmlRpcUtil::nextTagIsEnd(INT_TAG, valueXml, offset);
+ }
+ else if (XmlRpcUtil::nextTagIs(DOUBLE_TAG, valueXml, offset, &emptyTag))
+ {
+ if (emptyTag)
+ *this = 0.0;
+ else
+ result = doubleFromXml(valueXml, offset) &&
+ XmlRpcUtil::nextTagIsEnd(DOUBLE_TAG, valueXml, offset);
+ }
+ else if (XmlRpcUtil::nextTagIs(STRING_TAG, valueXml, offset, &emptyTag))
+ {
+ if (emptyTag)
+ *this = "";
+ else
+ result = stringFromXml(valueXml, offset) &&
+ XmlRpcUtil::nextTagIsEnd(STRING_TAG, valueXml, offset);
+ }
+ else if (XmlRpcUtil::nextTagIs(DATETIME_TAG, valueXml, offset, &emptyTag))
+ {
+ if (emptyTag)
+ result = false;
+ else
+ result = timeFromXml(valueXml, offset) &&
+ XmlRpcUtil::nextTagIsEnd(DATETIME_TAG, valueXml, offset);
+ }
+ else if (XmlRpcUtil::nextTagIs(BASE64_TAG, valueXml, offset, &emptyTag))
+ {
+ if (emptyTag)
+ result = binaryFromXml("", 0);
+ else
+ result = binaryFromXml(valueXml, offset) &&
+ XmlRpcUtil::nextTagIsEnd(BASE64_TAG, valueXml, offset);
+ }
+ else if (XmlRpcUtil::nextTagIs(ARRAY_TAG, valueXml, offset, &emptyTag))
+ {
+ if (emptyTag)
+ result = false;
+ else
+ result = arrayFromXml(valueXml, offset) &&
+ XmlRpcUtil::nextTagIsEnd(ARRAY_TAG, valueXml, offset);
+ }
+ else if (XmlRpcUtil::nextTagIs(STRUCT_TAG, valueXml, offset, &emptyTag))
+ {
+ if (emptyTag)
+ result = false;
+ else
+ result = structFromXml(valueXml, offset) &&
+ XmlRpcUtil::nextTagIsEnd(STRUCT_TAG, valueXml, offset);
+ }
+
+ // Unrecognized tag after <value> or no </value>
+ if ( ! result || ! XmlRpcUtil::nextTagIsEnd(VALUE_TAG, valueXml, offset))
+ {
+ *offset = savedOffset;
+ return false;
+ }
+
+ return true;
+ }
+
+ // Encode the Value in xml
+ std::string XmlRpcValue::toXml() const
+ {
+ switch (_type) {
+ case TypeNil: return nilToXml();
+ case TypeBoolean: return boolToXml();
+ case TypeInt: return intToXml();
+ case TypeDouble: return doubleToXml();
+ case TypeString: return stringToXml();
+ case TypeDateTime: return timeToXml();
+ case TypeBase64: return binaryToXml();
+ case TypeArray: return arrayToXml();
+ case TypeStruct: return structToXml();
+ default: break;
+ }
+ return std::string(); // Invalid value
+ }
+
+
+ // Boolean
+ bool XmlRpcValue::boolFromXml(std::string const& valueXml, int* offset)
+ {
+ const char* valueStart = valueXml.c_str() + *offset;
+ char* valueEnd;
+ long ivalue = strtol(valueStart, &valueEnd, 10);
+ if (valueEnd == valueStart || (ivalue != 0 && ivalue != 1))
+ return false;
+
+ _type = TypeBoolean;
+ _value.asBool = (ivalue == 1);
+ *offset += int(valueEnd - valueStart);
+ return true;
+ }
+
+ std::string XmlRpcValue::nilToXml() const
+ {
+ return "<value><nil/></value>";
+ }
+
+ std::string XmlRpcValue::boolToXml() const
+ {
+ static std::string booleanTrueXml("<value><boolean>1</boolean></value>");
+ static std::string booleanFalseXml("<value><boolean>0</boolean></value>");
+ return _value.asBool ? booleanTrueXml : booleanFalseXml;
+ }
+
+ // Int
+ bool XmlRpcValue::intFromXml(std::string const& valueXml, int* offset)
+ {
+ const char* valueStart = valueXml.c_str() + *offset;
+ char* valueEnd;
+ long ivalue = strtol(valueStart, &valueEnd, 10);
+ if (valueEnd == valueStart)
+ return false;
+
+ _type = TypeInt;
+ _value.asInt = int(ivalue);
+ *offset += int(valueEnd - valueStart);
+ return true;
+ }
+
+ std::string XmlRpcValue::intToXml() const
+ {
+ char buf[256];
+ snprintf(buf, sizeof(buf)-1, "<value><i4>%d</i4></value>", _value.asInt);
+ buf[sizeof(buf)-1] = 0;
+
+ return std::string(buf);
+ }
+
+ // Double
+ bool XmlRpcValue::doubleFromXml(std::string const& valueXml, int* offset)
+ {
+ const char* valueStart = valueXml.c_str() + *offset;
+ char* valueEnd;
+ double dvalue = strtod(valueStart, &valueEnd);
+ if (valueEnd == valueStart)
+ return false;
+
+ _type = TypeDouble;
+ _value.asDouble = dvalue;
+ *offset += int(valueEnd - valueStart);
+ return true;
+ }
+
+ std::string XmlRpcValue::doubleToXml() const
+ {
+ char fmtbuf[256], buf[256];
+ snprintf(fmtbuf, sizeof(fmtbuf)-1, "<value><double>%s</double></value>", getDoubleFormat().c_str());
+ fmtbuf[sizeof(fmtbuf)-1] = 0;
+ snprintf(buf, sizeof(buf)-1, fmtbuf, _value.asDouble);
+ buf[sizeof(buf)-1] = 0;
+
+ return std::string(buf);
+ }
+
+ // String
+ bool XmlRpcValue::stringFromXml(std::string const& valueXml, int* offset)
+ {
+ size_t valueEnd = valueXml.find('<', *offset);
+ if (valueEnd == std::string::npos)
+ return false; // No end tag;
+
+ _type = TypeString;
+ _value.asString = new std::string(XmlRpcUtil::xmlDecode(valueXml.substr(*offset, valueEnd-*offset)));
+ *offset += int(_value.asString->length());
+ return true;
+ }
+
+ std::string XmlRpcValue::stringToXml() const
+ {
+ return std::string("<value>") + XmlRpcUtil::xmlEncode(*_value.asString) + std::string("</value>");
+ }
+
+ // DateTime (stored as a struct tm)
+ bool XmlRpcValue::timeFromXml(std::string const& valueXml, int* offset)
+ {
+ size_t valueEnd = valueXml.find('<', *offset);
+ if (valueEnd == std::string::npos)
+ return false; // No end tag;
+
+ std::string stime = valueXml.substr(*offset, valueEnd-*offset);
+
+ struct tm t;
+ if (sscanf(stime.c_str(),"%4d%2d%2dT%2d:%2d:%2d",&t.tm_year,&t.tm_mon,&t.tm_mday,&t.tm_hour,&t.tm_min,&t.tm_sec) != 6)
+ return false;
+
+ t.tm_year -= 1900; // years since 1900
+ t.tm_mon -= 1; // months 0..11
+ t.tm_isdst = -1;
+ _type = TypeDateTime;
+ _value.asTime = new struct tm(t);
+ *offset += int(stime.length());
+ return true;
+ }
+
+ std::string XmlRpcValue::timeToXml() const
+ {
+ struct tm* t = _value.asTime;
+ char buf[20];
+ snprintf(buf, sizeof(buf)-1, "%04d%02d%02dT%02d:%02d:%02d",
+ 1900+t->tm_year,1+t->tm_mon,t->tm_mday,t->tm_hour,t->tm_min,t->tm_sec);
+ buf[sizeof(buf)-1] = 0;
+
+ return std::string("<value><dateTime.iso8601>") + buf + std::string("</dateTime.iso8601></value>");
+ }
+
+
+ // Base64
+ bool XmlRpcValue::binaryFromXml(std::string const& valueXml, int* offset)
+ {
+ size_t valueEnd = valueXml.find('<', *offset);
+ if (valueEnd == std::string::npos)
+ return false; // No end tag;
+
+ _type = TypeBase64;
+ std::string asString = valueXml.substr(*offset, valueEnd-*offset);
+ _value.asBinary = new BinaryData();
+ // check whether base64 encodings can contain chars xml encodes...
+
+ // convert from base64 to binary
+ int iostatus = 0;
+ base64<char> decoder;
+ std::back_insert_iterator<BinaryData> ins = std::back_inserter(*(_value.asBinary));
+ decoder.get(asString.begin(), asString.end(), ins, iostatus);
+
+ *offset += int(asString.length());
+ return true;
+ }
+
+
+ std::string XmlRpcValue::binaryToXml() const
+ {
+ // convert to base64
+ std::vector<char> base64data;
+ int iostatus = 0;
+ base64<char> encoder;
+ std::back_insert_iterator<std::vector<char> > ins = std::back_inserter(base64data);
+ encoder.put(_value.asBinary->begin(), _value.asBinary->end(), ins, iostatus, base64<>::crlf());
+
+ // Wrap with xml
+ std::string xml = "<value><base64>";
+ xml.append(base64data.begin(), base64data.end());
+ xml += "</base64></value>";
+ return xml;
+ }
+
+
+ // Array
+ bool XmlRpcValue::arrayFromXml(std::string const& valueXml, int* offset)
+ {
+ bool emptyTag;
+ if ( ! XmlRpcUtil::nextTagIs(DATA_TAG, valueXml, offset, &emptyTag))
+ return false;
+
+ _type = TypeArray;
+ _value.asArray = new ValueArray;
+
+ if ( ! emptyTag)
+ {
+ XmlRpcValue v;
+ while (v.fromXml(valueXml, offset))
+ _value.asArray->push_back(v); // copy...
+
+ // Skip the trailing </data>
+ (void) XmlRpcUtil::nextTagIsEnd(DATA_TAG, valueXml, offset);
+ }
+ return true;
+ }
+
+
+ // In general, its preferable to generate the xml of each element of the
+ // array as it is needed rather than glomming up one big string.
+ std::string XmlRpcValue::arrayToXml() const
+ {
+ std::string xml = "<value><array><data>";
+
+ int s = int(_value.asArray->size());
+ for (int i=0; i<s; ++i)
+ xml += _value.asArray->at(i).toXml();
+
+ xml += "</data></array></value>";
+ return xml;
+ }
+
+
+ // Struct
+ bool XmlRpcValue::structFromXml(std::string const& valueXml, int* offset)
+ {
+ _type = TypeStruct;
+ _value.asStruct = new ValueStruct;
+
+ std::string name;
+ bool emptyTag;
+ while (XmlRpcUtil::nextTagIs(MEMBER_TAG, valueXml, offset, &emptyTag))
+ {
+ if ( ! emptyTag)
+ {
+ if (XmlRpcUtil::parseTag(NAME_TAG, valueXml, offset, name))
+ {
+ // value
+ XmlRpcValue val(valueXml, offset);
+ if ( ! val.valid()) {
+ invalidate();
+ return false;
+ }
+ const std::pair<const std::string, XmlRpcValue> p(name, val);
+ _value.asStruct->insert(p);
+
+ (void) XmlRpcUtil::nextTagIsEnd(MEMBER_TAG, valueXml, offset);
+ }
+ }
+ }
+
+ return true;
+ }
+
+
+ // In general, its preferable to generate the xml of each element
+ // as it is needed rather than glomming up one big string.
+ std::string XmlRpcValue::structToXml() const
+ {
+ std::string xml = "<value><struct>";
+
+ ValueStruct::const_iterator it;
+ for (it=_value.asStruct->begin(); it!=_value.asStruct->end(); ++it)
+ {
+ xml += "<member><name>";
+ xml += XmlRpcUtil::xmlEncode(it->first);
+ xml += "</name>";
+ xml += it->second.toXml();
+ xml += "</member>";
+ }
+
+ xml += "</struct></value>";
+ return xml;
+ }
+
+
+
+ // Write the value without xml encoding it
+ std::ostream& XmlRpcValue::write(std::ostream& os) const {
+ switch (_type) {
+ default: break;
+ case TypeBoolean: os << _value.asBool; break;
+ case TypeInt: os << _value.asInt; break;
+ case TypeDouble: os << _value.asDouble; break;
+ case TypeString: os << *_value.asString; break;
+ case TypeDateTime:
+ {
+ struct tm* t = _value.asTime;
+ char buf[20];
+ snprintf(buf, sizeof(buf)-1, "%4d%02d%02dT%02d:%02d:%02d",
+ t->tm_year,t->tm_mon,t->tm_mday,t->tm_hour,t->tm_min,t->tm_sec);
+ buf[sizeof(buf)-1] = 0;
+ os << buf;
+ break;
+ }
+ case TypeBase64:
+ {
+ int iostatus = 0;
+ std::ostreambuf_iterator<char> out(os);
+ base64<char> encoder;
+ encoder.put(_value.asBinary->begin(), _value.asBinary->end(), out, iostatus, base64<>::crlf());
+ break;
+ }
+ case TypeArray:
+ {
+ int s = int(_value.asArray->size());
+ os << '{';
+ for (int i=0; i<s; ++i)
+ {
+ if (i > 0) os << ',';
+ _value.asArray->at(i).write(os);
+ }
+ os << '}';
+ break;
+ }
+ case TypeStruct:
+ {
+ os << '[';
+ ValueStruct::const_iterator it;
+ for (it=_value.asStruct->begin(); it!=_value.asStruct->end(); ++it)
+ {
+ if (it!=_value.asStruct->begin()) os << ',';
+ os << it->first << ':';
+ it->second.write(os);
+ }
+ os << ']';
+ break;
+ }
+
+ }
+
+ return os;
+ }
+
+} // namespace XmlRpc
+
+
+// ostream
+std::ostream& operator<<(std::ostream& os, XmlRpc::XmlRpcValue& v)
+{
+ // If you want to output in xml format:
+ //return os << v.toXml();
+ return v.write(os);
+}
+
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-hamradio/flwkey.git
More information about the pkg-hamradio-commits
mailing list