This commit is contained in:
Christian Grothoff
2006-08-18 21:41:52 +00:00
commit b82c480226
91 changed files with 24439 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
Luis Figueiredo (stdio@netc.pt)
Main Programmer, designer
Christian Grothoff (christian@grothoff.org)
Adaptation for GNUnet (work in progress)
People who contributed:
João Luis Marques (lamego@ptlink.net)
minor bug reported (redirectors, stdout)
'oddsock' (oddsock@oddsock.org)
Licensing tip, and minor bug reported (segv in querystring)
Rocco Carbone (rocco@tecsiel.it)
Return code for web_server_run tip
Johannes E. Schindelin (Johannes.Schindelin@gmx.de)
Spell checking, Makefile portability, and security 'How do I create my own certificate?'
bugfixes, examples hello world!
Richard Offer (offer@sgi.com)
checkboxes, (multiple variables) tip
Sven Anders (anders@anduras.de)
new web_client_setcookie()
Hilobok Andrew (han@km.if.ua)
FreeBSD portability
#linuxhelp @ ptnet.org
Rui - to let me know the existence of strftime (yeah i didn't knew)
João Luis Marques Pinto - a problem with redirection (stdout & exit());
+506
View File
@@ -0,0 +1,506 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
+7
View File
@@ -0,0 +1,7 @@
Copyright 2002, 2003 Luis Figueiredo. All rights reserved
See the LICENSE file
The origin of this software must not be misrepresented, either by
explicit claim or by omission. Since few users ever read sources,
credits must appear in the documentation.
+245
View File
@@ -0,0 +1,245 @@
Fri Aug 18 15:21:30 PDT 2006
Starting to adopt the code to the GNUnet build system.
Applied patch to allow for shutdown.
0.5.3
Wen Apr 28 14:52:43 GMT 2004
Luis Figueiredo -- Long time no see, i've decided to check one mail dated from released version 0.5.2, was about cookies
it seems that was no problem to me, but i made a minor changes anyway
void web_client_setcookie(char *name, char *value, char *timeoutf, char *path, char *domain, int secure)
path and domain, can be called as "" for disable, instead of previous only, NULL that disables the domain and path
Tue Jan 13 18:43:11 GMT 2004
Luis Figueiredo -- I've put a prefix in each internal function "__ILWS_"
Wen Oct 22 18:38:52 GMT 2003
Luis Figueiredo -- Applied some changes reported by (freebsd port): Hilobok Andrew (han@km.if.ua), added Last-Modified on lws_list(); improved file handling
Thu Sep 25 13:11:21 GMT 2003
Luis Figueiredo -- Minor change the ClientInfo->request also gives the '/' (for lws_list)
Wen Sep 24 23:02:51 GMT 2003
Luis Figueiredo -- Corrected some code (for portability) reported by Hilobok Andrew (han@km.if.ua)
0.5.2
Thu Sep 18 21:33:05 GMT 2003
Luis Figueiredo -- Changed function set_EGApalette to web_client_gifsetpalette("filename.act oe "EGA");, and web_client_outputgif to web_client_gifoutput
(sorry for usual users of web_client_gif* :P)
Sun Sep 14 22:29:02 GMT 2003
Luis Figueiredo -- new functions added (web_server_aliasdir, web_server_useMIMEfile, web_client_contenttype);
0.5.1
Wen Sep 10 17:56:14 GMT 2003
Luis Figueiredo -- Code clean up, new error system!
Sex Sep 05 19:12:14 GMT 2003
Luis Figueiredo -- improved the function tmpfname, added documentation to section security
Sex Sep 05 06:16:01 GMT 2003
Luis Figueiredo -- i have lie down late, lately :o), well add_oustream prototipe changed to handle flock (filelock)
to avoid race condition on temorary files, added the util funtion for winnt flock
-- changed way to log "stetic?"
-- calculate and outputs Content-rage and Content-length if the get handler has the WS_USELEN turned on
Wen Sep 03 05:57:11 GMT 2003
Luis Figueiredo -- one day after (almost literaly), corrected something in ClientInfo->Cookie(),
And an new feature to web_client_setcookie, this function can now be called after end of headers.
Tue Sep 02 05:28:11 GMT 2003
Luis Figueiredo -- oh my!, nice hour for coding, finished 206 (partial content) resuming (Content-range:)
Mon Sep 01 19:35:32 GMT 2003
Luis Figueiredo -- now output header : "Content-length:"
Mon Sep 01 06:22:21 GMT 2003
Luis Figueiredo -- read_client optimized for speed (select removed, non_block sockets only)
Sex Aug 29 16:07:15 GMT 2003
Luis Figueiredo -- Corrected a bug on output_client() (writetemp) if the lib doesn't output (EAGAIN) the function
was returning, and retry using local variable writetemp (reading new data), now fseeks to last data written
Fri Aug 22 15:20:31 GMT 2003
Luis Figueiredo -- removed engine.h from help server (read the source if you want to know how it works), some changes in web_server_getconf!
Thu Aug 15 16:59:04 GMT 2003
Luis Figueiredo -- New functions and flag, flag is WS_DYNVAR (handler), to use dynamic variables on data ouput
web_client_setvar, web_client_delvar , web_client_getvar, exchanges "$variable;" into 'variable' value
previous defined with web_client_setvar("variable","something");
0.5.0
Wen Jul 30 03:45:28 GMT 2003
Luis Figueiredo -- IE 5.0 was confusing me with no \r\n\r\n after post data, i solved the problem using content-length value
changed errno (on output_client) to WSAGetLastError() on windows (#ifdef WIN32)
Fri Jul 25 06:10:03 GMT 2003
Luis Figueiredo -- Work around outgif.c, to support transparency
Wen Jul 21 20:13:12 GMT 2003
Luis Figueiredo -- Added set_gifEGApalette(), and global var GLOBALGIFPAL for web_client_outputgif();
Tue Jul 15 15:31:10 GMT 2003
Luis Figueiredo -- Start develop the config file, added some new elements to struct server, Added a ClientInfo->Conf( to get entries from config file )
Thu Apr 10 14:11:31 GMT 2003
Luis Figueiredo -- Some changes on web_client_setcookie() made by Sven Anders <anders@anduras.de> applied
Thu Apr 10 14:11:34 GMT 2003
Luis Figueiredo -- Some bugfixes reported by (http://www.stanford.edu/~engler) Ken Ashcraft <kash@stanford.edu>
0.4.1
Thu Mar 20 14:35:23 GMT 2003
Luis Figueiredo -- Fuck war! :o), minor Changes in help server
Wen Mar 19 21:46:32 GMT 2003
Luis Figueiredo -- new features for checkbox (or multiple variables) ClientInfo->Query("#xpto") returns the number of references to xpto
ClientInfo->Query("xpto") gives one value and fetches to another; if "#xpto" is bigger than one, "xpto" called twice will be diferent
Fri Mar 07 11:29:12 GMT 2003
Luis Figueiredo -- Added the extern "C" {} to web_server.h
0.4.0 // new features and fixes (new version)
Wen Feb 12 16:23:13 GMT 2003
Luis Figueiredo -- Added Cookie example, and Johannes E. Schindelin entered on project (officialy)
Mon Feb 09 17:24:45 GMT 2003
Luis Figueiredo -- web_client_setcookie(); done, Changed ClientInfo->Header(),Post(),Query(); when is called with
NULL argument, this function returns whole client header;
Added ClientInfo->Cookie();
Wen Feb 05 22:12:03 GMT 2003
Luis Figueiredo -- Start to develop web_client_setcookie();
Fri Jan 31 05:24:31 GMT 2003
Johannes E. Schindelin (patch) -- More spell checking (even in the code, heh!) client.h, client.c, examples.html functions.html info.html security.html
He also added an example (hello_world)
bugfix on clientinfo.c: post data and query data!
Sun Jan 26 21:22:34 GMT 2003
Luis Figueiredo -- Change the order of ChangeLog (this file) (was last version on Bottom)
Thu Jan 23 17:10:11 GMT 2003
Luis Figueiredo -- Patch from Johannes E. Schindelin, spell checking and make file portabilitie
0.3.5
Mon Jan 20 01:43:45 GMT 2003
Luis Figueiredo -- Changed the return codes from web_server_run() (Rocco Carbone [rocco@tecsiel.it] ideia), and some minor fix's on socket.c
Sat Jan 18 18:31:23 GMT 2003
Luis Figueiredo -- Corrected a querystring parser error(thanks 'oddsock')
0.3.4
Fri Dec 27 20:01:04 GMT 2002
Luis Figueiredo -- using closesocket (when deleting client) on WIN32, when client lost the connection the stat is (5) (5 delete client)
Thu Dec 26 23:16:21 GMT 2002
Luis Figueiredo -- (outstream.[ch]) Added an argument to add_outstream (char *fname); since the lib have a problem with atributing to stdout (*stdout=*nfile),
changed the tmpfile(), to 'tmpnam' (tmpfname) and use freopen; (unlinking fname when deleting outstreams)
0.3.3
Wen Nov 27 18:16:34 GMT 2002
Luis Figueiredo -- Produces output files to projectroot/bin
Wen Nov 27 00:24:31 GMT 2002
Luis Figueiredo -- Built strncasecmp function (Win32 doesn't have) for using in strcasestr (MultiPart in clientinfo)
Mon Nov 25 16:16:23 GMT 2002
Luis Figueiredo -- Help html's converted into header files, help server, doesn't need external files now, help.html directory moved to project root
Fri Nov 22 17:45:34 GMT 2002
Luis Figueiredo -- Win32 project files and help server updated
Sat Nov 16 21:22:13 GMT 2002
Luis Figueiredo -- Example SoundRecorder w/ new features
Fri Nov 15 20:38:48 GMT 2002
Luis Figueiredo -- Mem checker added (case of low mem)
0.3.2
Fri Nov 15 11:11:50 GMT 2002
Luis Figueiredo -- Added a new example (SoundRecorder)
Fri Nov 15 00:37:44 GMT 2002
Luis Figueiredo -- Created make install
Thu Nov 14 19:45:47 GMT 2002
Luis Figueiredo -- Changed client.c (now outputs 400 invalid request)
Wed Nov 13 23:39:46 GMT 2002
Luis Figueiredo -- added a feature, (web_client_outputgif) using xvgifwr.c (from xv 3.10a)
module is callod outgif.c
Wed Nov 13 04:27:12 GMT 2002
Luis Figueiredo -- Added a debug program (.pl) http butcher
Wed Nov 13 04:06:48 GMT 2002
Luis Figueiredo -- Fixed up a minor bug on client read data, make rule dist (to create package on makefile), removed Hdrdate to new mydate (using strftime)
discard hextoi to using strtol(str,NULL,16)
0.3.1
Sun Nov 10 21:05:40 GMT 2002
Luis Figueiredo -- Code cleanup, removed useless functions, developing documentation
Sun Nov 10 12:08:02 GMT 2002
Luis Figueiredo -- Changed regex to fnmatch once again (regex was giving problems w/ portability, and fnmatch is easier to use for
newbies)
Thu Nov 7 20:05:48 GMT 2002
Luis Figueiredo -- create module (utils.c) for base64decode, hextoi, strcasestr, Add documentation to example
Wed Nov 6 16:12:22 GMT 2002
Luis Figueiredo -- Changed again way of determine that the client sent all data, it checks about 5 times if doesn't have new data,
then marks all data readed, ClientInfo upload files (MultiPart) done, wow, new logo,
supports (enctype='Multipart/form-data') (tested in lynx and netscape and IE)
Thu Oct 31 18:11:28 GMT 2002
Luis Figueiredo -- Optimized functions Post,Header,Query // now holds the already queryied into a list, when it requests again
lib doesn't process request gives the saved data: ex:
if(ClientInfo->Query("queryval")) { // query val doesn't exists in list add
blah=atoi(ClientInfo->Query("queryval")); // return previous saved val that's on the list
};
better for memory and speed optimizations
0.3.0 and previous
Wed Oct 30 22:54:37 GMT 2002
Luis Figueiredo -- Changed way of determine that the client sent all data
before:
if there is no more data then search \r\n\r\n in the hole data readed // wrong, multipart/form-data was not doing right now
now:
if there is no more data then if the last two bytes is \r\n then mark all readed and process // i think that need improvments
Mon Oct 14 20:20:05 GMT 2002
Luis Figueiredo -- An example of a cgi handler was made, added the Date: header to server header
Mon Oct 7 16:56:15 GMT 2002
Luis Figueiredo -- Repaired some safe bugs, Added vars to stats proposes, inserted an liblogo, added debug instructions
Wed Apr 10 20:02:55 GMT 2002
Luis Figueiredo -- Make use of autoconf , removed open_memstream (doesn't work well w/ stdout structure on netbsd portability)
linux slack 7.1 uses "extern FILE *stdout", netbsd uses "extern FILE __sF[]" so i cannot make use of pointers
Mon Apr 8 15:04:31 GMT 2002
Luis Figueiredo -- Oh my.. kurt cobain is dead :o), restructured the code, separated into various files
Wed Mar 27 18:59:10 GMT 2002
Luis Figueiredo -- using regex instead of fnmatch(fnmatch only appears becouse of apache, i didn't knew it)
Mon Mar 25 14:46:13 GMT 2002
Luis Figueiredo -- wow, one month later..., discard web_server_addstr, and now process the stdout to server
using a tmpfile for streaming (not so good, but :o))
Mon Feb 25 06:27:58 GMT 2002
Luis Figueiredo -- Many corrections and new functions were added, until today
Fri Dec 28 12:51:11 GMT 2001
Luis Figueiredo -- I Corrected the input to handle only data when \n\r(twice) is arrived
+229
View File
@@ -0,0 +1,229 @@
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software
Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
Basic Installation
==================
These are generic installation instructions.
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 only 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. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. 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=c89 CFLAGS=-O2 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 must use a version of `make' that
supports the `VPATH' variable, such as 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 `..'.
If you have to use a `make' that does not support the `VPATH'
variable, you have 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' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' 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 `--target=TYPE' option 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
will cause the specified gcc to be used as the C compiler (unless it is
overridden in the site shell script).
`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.
+3
View File
@@ -0,0 +1,3 @@
SUBDIRS = include src
+1
View File
@@ -0,0 +1 @@
See ChangeLog.
+7
View File
@@ -0,0 +1,7 @@
This is an adaptation of libwebserver for GNUnet.
Non-essential code from old libwebserver library
was moved to contrib/, documentation was moved
to doc/.
The build system was changed to use automake.
+51
View File
@@ -0,0 +1,51 @@
try to make just makefile for win instead of project file
check for integer overflow
do a webserver stresser
CORRECT: netbsd dont free's the memory (linux's free) // i don't know why!
DONE: WS_USECONF is completed just make test and turn it better
DONE: WS_DYNVAR ( for using web_client_setvar("color","#FFFFFF")), printf("<BODY bgcolor='$color;>"); ) usefull for web_client_addfile();) <- DONE
DONE: there is some mem buffer that is not freeing on logfile example something related to web_client_addfile (corrected)
DONE: upload is missing somethind debug ok, but release is crashing (was related to writetemp[WRITEMAX+1])
DONE: faster way to upload and download! remove newdata ( is delaying operation)
DONE: content-range header (for resuming)
DONE: logging (put it on process_client)
DONE: Find a better way to manage "tmpfname" (using flocks)
DONE: make web_client_setcookie works called in whatever where in the handle function, (keep on an database maybe as varlist);
DONE: remove wrotesize and varsize from client to outstream
DONE: The war beguns, and i'm coding :o), reduce error mensaging to one file (reduce static mem space);
DONE: similar: maybe make the web_server_MIMEfile(server,"const char *");, to next do the web_server_adddir(server,"/home/users/www",WS_LISTING);
MAYBE DONE: Well something wrong about downloading several imgs, sometimes apears the 'X' image! figure why (requires intensive tests)
DONE: lib isn't close files well, probably is that becouse the Ximage
DONE: do the freebsd port by Hilobok Andrew (han@km.if.ua)
DONE: URGENT: Change names of internal functions, we don't want conflits with other ppl functions (such as already defined symbols)
TODO: The flag WS_USECGI, act as a cgi using env instead ClientInfo
TODO: better to do is web_server_addcgi("* /*",execfile.exe,0);
TODO: make the web_client_addurl function (web_client_addurl("http://127.0.0.1"); as web_client_addfile("path/to/file");)
TODO: WS_USEMOD (modulated system to use) /(maybe need WS_USECONF, for describe modules)
IMPROVE: Find a way to manage dll (stdout,stdin,etc)
IMPROVE: WS_DYNVAR
Vendored Executable
+1500
View File
@@ -0,0 +1,1500 @@
#! /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 Free Software Foundation,
# Inc.
timestamp='2006-07-02'
# 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, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
# 02110-1301, 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.
# Originally written by Per Bothner <per@bothner.com>.
# Please send patches to <config-patches@gnu.org>. Submit a context
# diff and a properly formatted 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.
#
# The plan is that this can be called by configure scripts if you
# don't specify an explicit build system type.
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@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
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@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 tupples: *-*-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 ;;
*) 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 __ELF__ >/dev/null
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'`
exit ;;
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@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 ;;
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:SunOS:5.*:*)
echo i386-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:*:[45])
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 __LP64__ >/dev/null
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:*:*)
case ${UNAME_MACHINE} in
pc98)
echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
amd64)
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
*)
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
esac
exit ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit ;;
i*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
i*:windows32*:*)
# uname -m includes "-pc" on this system.
echo ${UNAME_MACHINE}-mingw32
exit ;;
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit ;;
x86:Interix*:[3456]*)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
EM64T:Interix*:[3456]*)
echo x86_64-unknown-interix${UNAME_RELEASE}
exit ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-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 ;;
arm*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
avr32*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
cris:Linux:*:*)
echo cris-axis-linux-gnu
exit ;;
crisv32:Linux:*:*)
echo crisv32-axis-linux-gnu
exit ;;
frv:Linux:*:*)
echo frv-unknown-linux-gnu
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:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#undef CPU
#undef mips
#undef mipsel
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
CPU=mipsel
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
CPU=mips
#else
CPU=
#endif
#endif
EOF
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
/^CPU/{
s: ::g
p
}'`"
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
mips64:Linux:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#undef CPU
#undef mips64
#undef mips64el
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
CPU=mips64el
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
CPU=mips64
#else
CPU=
#endif
#endif
EOF
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
/^CPU/{
s: ::g
p
}'`"
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
or32:Linux:*:*)
echo or32-unknown-linux-gnu
exit ;;
ppc:Linux:*:*)
echo powerpc-unknown-linux-gnu
exit ;;
ppc64:Linux:*:*)
echo powerpc64-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 ld.so.1 >/dev/null
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
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 ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
echo hppa64-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 ;;
vax:Linux:*:*)
echo ${UNAME_MACHINE}-dec-linux-gnu
exit ;;
x86_64:Linux:*:*)
echo x86_64-unknown-linux-gnu
exit ;;
i*86:Linux:*:*)
# The BFD linker knows what the default object file format is, so
# first see if it will tell us. cd to the root directory to prevent
# problems with other programs or directories called `ld' in the path.
# Set LC_ALL=C to ensure ld outputs messages in English.
ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
| sed -ne '/supported targets:/!d
s/[ ][ ]*/ /g
s/.*supported targets: *//
s/ .*//
p'`
case "$ld_supported_targets" in
elf32-i386)
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
;;
a.out-i386-linux)
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
exit ;;
coff-i386)
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
exit ;;
"")
# Either a pre-BFD a.out linker (linux-gnuoldld) or
# one that does not give us useful --help.
echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
exit ;;
esac
# Determine whether the default compiler is a.out or elf
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include <features.h>
#ifdef __ELF__
# ifdef __GLIBC__
# if __GLIBC__ >= 2
LIBC=gnu
# else
LIBC=gnulibc1
# endif
# else
LIBC=gnulibc1
# endif
#else
#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
LIBC=gnu
#else
LIBC=gnuaout
#endif
#endif
#ifdef __dietlibc__
LIBC=dietlibc
#endif
EOF
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
/^LIBC/{
s: ::g
p
}'`"
test x"${LIBC}" != x && {
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
exit
}
test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; 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.0*:*)
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 i386.
echo i386-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; } ;;
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.0*:*)
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@ccMail.Census.GOV>
echo i586-unisys-sysv4
exit ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes <hewes@openmarket.com>.
# How about differentiating between stratus architectures? -djm
echo hppa1.1-stratus-sysv4
exit ;;
*:*:*:FTX*)
# From seanf@swdc.stratus.com.
echo i860-stratus-sysv4
exit ;;
i*86:VOS:*:*)
# From Paul.Green@stratus.com.
echo ${UNAME_MACHINE}-stratus-vos
exit ;;
*:VOS:*:*)
# From Paul.Green@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 ;;
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 ;;
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
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 ;;
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 ;;
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://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
and
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
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@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:
Vendored Executable
+1608
View File
@@ -0,0 +1,1608 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
# Inc.
timestamp='2006-07-02'
# 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, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
# 02110-1301, 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.
# Please send patches to <config-patches@gnu.org>. Submit a context
# diff and a properly formatted 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.
# 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@gnu.org>."
version="\
GNU config.sub ($timestamp)
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
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-dietlibc | linux-newlib* | linux-uclibc* | \
uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
*)
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)
os=
basic_machine=$1
;;
-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 \
| 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 \
| bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
| fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
| maxq | mb | microblaze | mcore \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
| mips64vr | mips64vrel \
| mips64orion | mips64orionel \
| mips64vr4100 | mips64vr4100el \
| mips64vr4300 | mips64vr4300el \
| mips64vr5000 | mips64vr5000el \
| mips64vr5900 | mips64vr5900el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
| mipsisa64 | mipsisa64el \
| mipsisa64r2 | mipsisa64r2el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
| mt \
| msp430 \
| nios | nios2 \
| ns16k | ns32k \
| or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \
| sh | sh[1234] | sh[24]a | 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 | strongarm \
| tahoe | thumb | tic4x | tic80 | tron \
| v850 | v850e \
| we32k \
| x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
| z8k)
basic_machine=$basic_machine-unknown
;;
m6811 | m68hc11 | m6812 | m68hc12)
# Motorola 68HC11/12.
basic_machine=$basic_machine-unknown
os=-none
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
;;
ms1)
basic_machine=mt-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-* \
| 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-* \
| bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
| clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | maxq-* | mcore-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
| mips64vr-* | mips64vrel-* \
| mips64orion-* | mips64orionel-* \
| 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-* \
| nios-* | nios2-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \
| romp-* | rs6000-* \
| sh-* | sh[1234]-* | sh[24]a-* | 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-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tron-* \
| v850-* | v850e-* | vax-* \
| we32k-* \
| x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
| xstormy16-* | xtensa-* \
| ymp-* \
| z8k-*)
;;
# 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
;;
aux)
basic_machine=m68k-apple
os=-aux
;;
balance)
basic_machine=ns32k-sequent
os=-dynix
;;
c90)
basic_machine=c90-cray
os=-unicos
;;
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
;;
cr16c)
basic_machine=cr16c-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
;;
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'm not sure what "Sysv32" means. Should this be sysv3.2?
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
;;
m88k-omron*)
basic_machine=m88k-omron
;;
magnum | m3230)
basic_machine=mips-mips
os=-sysv
;;
merlin)
basic_machine=ns32k-utek
os=-sysv
;;
mingw32)
basic_machine=i386-pc
os=-mingw32
;;
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-/'`
;;
mvs)
basic_machine=i370-ibm
os=-mvs
;;
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
;;
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
;;
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) basic_machine=powerpc-unknown
;;
ppc-*) 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
;;
sei)
basic_machine=mips-sei
os=-seiux
;;
sequent)
basic_machine=i386-sequent
;;
sh)
basic_machine=sh-hitachi
os=-hms
;;
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
;;
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
;;
tic54x | c54x*)
basic_machine=tic54x-unknown
os=-coff
;;
tic55x | c55x*)
basic_machine=tic55x-unknown
os=-coff
;;
tic6x | c6x*)
basic_machine=tic6x-unknown
os=-coff
;;
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
;;
ymp)
basic_machine=ymp-cray
os=-unicos
;;
z8k-*-coff)
basic_machine=z8k-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[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.
-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* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* \
| -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* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -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*)
# 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
;;
-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
spu-*)
os=-elf
;;
*-acorn)
os=-riscix1.2
;;
arm*-rebel)
os=-linux
;;
arm*-semi)
os=-aout
;;
c4x-* | tic4x-*)
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
# This also exists in the configure program, but was not the
# default.
# os=-sunos4
;;
m68*-cisco)
os=-aout
;;
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
;;
-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:
+36
View File
@@ -0,0 +1,36 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT([libwebserver],[0.5.3-GNUnet],[bug-gnunet@gnu.org])
AM_INIT_AUTOMAKE([libwebserver], [0.5.3-GNUnet])
AC_CONFIG_HEADER([config.h])
AC_PROG_CC
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netinet/in.h stddef.h stdlib.h string.h sys/socket.h sys/time.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
# Checks for library functions.
AC_FUNC_MEMCMP
AC_TYPE_SIGNAL
AC_FUNC_STRFTIME
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([inet_ntoa memset select socket strchr strerror strncasecmp strstr strtol])
AC_SUBST(INCLUDE)
AC_SUBST(LIBDIR)
AC_SUBST(LIBS)
AC_CONFIG_FILES([Makefile
src/Makefile
include/Makefile
])
AC_OUTPUT
+277
View File
@@ -0,0 +1,277 @@
/*
dir.c for MS-DOS by Samuel Lam <skl@van-bc.UUCP>, June/87
*/
/* #ifdef WIN32 */
/*
* @(#)dir.c 1.4 87/11/06 Public Domain.
*
* A public domain implementation of BSD directory routines for
* MS-DOS. Written by Michael Rendell ({uunet,utai}michael@garfield),
* August 1897
* Ported to OS/2 by Kai Uwe Rommel
* December 1989, February 1990
* Ported to Windows NT 22 May 91
* other mods Summer '92 brianmo@microsoft.com
* opendirx() was horribly written, very inefficient, and did not take care
* of all cases. It is still not too clean, but it is far more efficient.
* Changes made by Gordon Chaffee (chaffee@bugs-bunny.cs.berkeley.edu)
*/
/*Includes:
* crt
*/
#include <windows.h>
#include <stdlib.h>
#include <string.h>
#include <sys\types.h>
#include <sys\stat.h>
#include "dirent.h"
#define stat _stat
/*
* NT specific
*/
#include <stdio.h>
/*
* random typedefs
*/
#define HDIR HANDLE
#define HFILE HANDLE
#define PHFILE PHANDLE
/*
* local functions
*/
static char *getdirent(char *);
static void free_dircontents(struct _dircontents *);
static HDIR FindHandle;
static WIN32_FIND_DATA FileFindData;
static struct dirent dp;
DIR *opendirx(char *name, char *pattern)
{
struct stat statb;
DIR *dirp;
char c;
char *s;
struct _dircontents *dp;
int len;
int unc;
char path[OFS_MAXPATHNAME];
register char *ip, *op;
for (ip = name, op = path;; op++, ip++) {
*op = *ip;
if (*ip == '\0') {
break;
}
}
len = ip - name;
if (len > 0) {
unc = ((path[0] == '\\' || path[0] == '/') &&
(path[1] == '\\' || path[1] == '/'));
c = path[len - 1];
if (unc) {
if (c != '\\' && c != '/') {
path[len] = '/';
len++;
path[len] = '\0';
}
} else {
if ((c == '\\' || c == '/') && (len > 1)) {
len--;
path[len] = '\0';
if (path[len - 1] == ':') {
path[len] = '/';
len++;
path[len] = '.';
len++;
path[len] = '\0';
}
} else if (c == ':') {
path[len] = '.';
len++;
path[len] = '\0';
}
}
} else {
unc = 0;
path[0] = '.';
path[1] = '\0';
len = 1;
}
if (stat(path, &statb) < 0 || (statb.st_mode & S_IFMT) != S_IFDIR) {
return NULL;
}
dirp = malloc(sizeof(DIR));
if (dirp == NULL) {
return dirp;
}
c = path[len - 1];
if (c == '.') {
if (len == 1) {
len--;
} else {
c = path[len - 2];
if (c == '\\' || c == ':') {
len--;
} else {
path[len] = '/';
len++;
}
}
} else if (!unc && ((len != 1) || (c != '\\' && c != '/'))) {
path[len] = '/';
len++;
}
strcpy(path + len, pattern);
dirp->dd_loc = 0;
dirp->dd_contents = dirp->dd_cp = NULL;
if ((s = getdirent(path)) == NULL) {
return dirp;
}
do {
if (((dp = malloc(sizeof(struct _dircontents))) == NULL) ||
((dp->_d_entry = malloc(strlen(s) + 1)) == NULL)) {
if (dp)
free(dp);
free_dircontents(dirp->dd_contents);
return NULL;
}
if (dirp->dd_contents)
dirp->dd_cp = dirp->dd_cp->_d_next = dp;
else
dirp->dd_contents = dirp->dd_cp = dp;
strcpy(dp->_d_entry, s);
dp->_d_next = NULL;
}
while ((s = getdirent(NULL)) != NULL);
dirp->dd_cp = dirp->dd_contents;
return dirp;
}
DIR *opendir(char *name)
{
return opendirx(name, "*");
}
void closedir(DIR * dirp)
{
free_dircontents(dirp->dd_contents);
free(dirp);
}
struct dirent *readdir(DIR * dirp)
{
/* static struct dirent dp; */
if (dirp->dd_cp == NULL)
return NULL;
/*strcpy(dp.d_name,dirp->dd_cp->_d_entry); */
dp.d_name = dirp->dd_cp->_d_entry;
dp.d_namlen = dp.d_reclen =
strlen(dp.d_name);
dp.d_ino = dirp->dd_loc + 1; /* fake the inode */
dirp->dd_cp = dirp->dd_cp->_d_next;
dirp->dd_loc++;
return &dp;
}
void seekdir(DIR * dirp, long off)
{
long i = off;
struct _dircontents *dp;
if (off >= 0) {
for (dp = dirp->dd_contents; --i >= 0 && dp; dp = dp->_d_next);
dirp->dd_loc = off - (i + 1);
dirp->dd_cp = dp;
}
}
long telldir(DIR * dirp)
{
return dirp->dd_loc;
}
static void free_dircontents(struct _dircontents *dp)
{
struct _dircontents *odp;
while (dp) {
if (dp->_d_entry)
free(dp->_d_entry);
dp = (odp = dp)->_d_next;
free(odp);
}
}
/* end of "free_dircontents" */
static char *getdirent(char *dir)
{
int got_dirent;
if (dir != NULL) { /* get first entry */
if ((FindHandle = FindFirstFile(dir, &FileFindData))
== (HDIR) 0xffffffff) {
return NULL;
}
got_dirent = 1;
} else /* get next entry */
got_dirent = FindNextFile(FindHandle, &FileFindData);
if (got_dirent)
return FileFindData.cFileName;
else {
FindClose(FindHandle);
return NULL;
}
}
/* end of getdirent() */
struct passwd *_cdecl
getpwnam(char *name)
{
return NULL;
}
struct passwd *_cdecl
getpwuid(int uid)
{
return NULL;
}
int getuid()
{
return 0;
}
void _cdecl
endpwent(void)
{
}
/* #endif */
+56
View File
@@ -0,0 +1,56 @@
/*
* @(#) dirent.h 2.0 17 Jun 91 Public Domain.
*
* A public domain implementation of BSD directory routines for
* MS-DOS. Written by Michael Rendell ({uunet,utai}michael@garfield),
* August 1987
*
* Enhanced and ported to OS/2 by Kai Uwe Rommel; added scandir() prototype
* December 1989, February 1990
* Change of MAXPATHLEN for HPFS, October 1990
*
* Unenhanced and ported to Windows NT by Bill Gallagher
* 17 Jun 91
* changed d_name to char * instead of array, removed non-std extensions
*
* Cleanup, other hackery, Summer '92, Brian Moran , brianmo@microsoft.com
*/
#ifndef _DIRENT
#define _DIRENT
#include <direct.h>
struct dirent
{
ino_t d_ino; /* a bit of a farce */
short d_reclen; /* more farce */
short d_namlen; /* length of d_name */
char *d_name;
};
struct _dircontents
{
char *_d_entry;
struct _dircontents *_d_next;
};
typedef struct _dirdesc
{
int dd_id; /* uniquely identify each open directory*/
long dd_loc; /* where we are in directory entry */
struct _dircontents *dd_contents; /* pointer to contents of dir */
struct _dircontents *dd_cp; /* pointer to current position */
}
DIR;
extern DIR *opendir(char *);
extern struct dirent *readdir(DIR *);
extern void seekdir(DIR *, long);
extern long telldir(DIR *);
extern void closedir(DIR *);
#define rewinddir(dirp) seekdir(dirp, 0L)
#endif /* _DIRENT */
/* end of dirent.h */
+57
View File
@@ -0,0 +1,57 @@
/* Copyrights 2002 Luis Figueiredo (stdio@netc.pt) All rights reserved.
*
* See the LICENSE file
*
* The origin of this software must not be misrepresented, either by
* explicit claim or by omission. Since few users ever read sources,
* credits must appear in the documentation.
*
* date: 19:49,07-49-2002
*
* -- description: File lock for winnt
*
/*********************************************************************************************************/
/*
* simulate a file lock, using locking region on WINNT
*/
#include "flock.h"
#define LK_ERR(f,i) ((f) ? (i = 0) : (i=-1))
#define LK_LEN 0xffff0000
int flock(int fd, int oper) {
OVERLAPPED o;
int i = -1;
HANDLE fh;
fh = (HANDLE)_get_osfhandle(fd);
memset(&o, 0, sizeof(o));
switch(oper) {
case LOCK_SH: /* shared lock */
LK_ERR(LockFileEx(fh, 0, 0, LK_LEN, 0, &o),i);
break;
case LOCK_EX: /* exclusive lock */
LK_ERR(LockFileEx(fh, LOCKFILE_EXCLUSIVE_LOCK, 0, LK_LEN, 0, &o),i);
break;
case LOCK_SH|LOCK_NB: /* non-blocking shared lock */
LK_ERR(LockFileEx(fh, LOCKFILE_FAIL_IMMEDIATELY, 0, LK_LEN, 0, &o),i);
break;
case LOCK_EX|LOCK_NB: /* non-blocking exclusive lock */
LK_ERR(LockFileEx(fh,LOCKFILE_EXCLUSIVE_LOCK|LOCKFILE_FAIL_IMMEDIATELY,0, LK_LEN, 0, &o),i);
break;
case LOCK_UN: /* unlock lock */
LK_ERR(UnlockFileEx(fh, 0, LK_LEN, 0, &o),i);
break;
default: /* unknown */
//errno = EINVAL; // i heard that on some versions errno is a function (win32 MT lib?)
break;
}
return i;
}
#undef LK_ERR
#undef LK_LEN
+31
View File
@@ -0,0 +1,31 @@
/* Copyrights 2002 Luis Figueiredo (stdio@netc.pt) All rights reserved.
*
* See the LICENSE file
*
* The origin of this software must not be misrepresented, either by
* explicit claim or by omission. Since few users ever read sources,
* credits must appear in the documentation.
*
* file: utils.h
*
* description: Header
*
* date: 19:50,07-50-2002
*/
#ifndef _FLOCK_H_
#define _FLOCK_H_
#include <windows.h>
#include <io.h> // this?
#include <errno.h>
#define LOCK_SH 1
#define LOCK_EX 2
#define LOCK_NB 4
#define LOCK_UN 8
int flock (int,int);
#endif
+13
View File
@@ -0,0 +1,13 @@
[LIBWEBSERVER]
LOG=help.log
PORT=81
USESSL=0
LOCAL=0
DYNVAR=0
[PERSONAL_CONF]
PORT=Portability
MOST=general key guard
IP=127.0.0.1
+157
View File
@@ -0,0 +1,157 @@
# Microsoft Developer Studio Project File - Name="help" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=help - Win32 Release
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "help.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "help.mak" CFG="help - Win32 Release"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "help - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "help - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "help - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /Zm200 /c
# ADD BASE RSC /l 0x816 /d "NDEBUG"
# ADD RSC /l 0x816 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 libwebserver.lib wsock32.lib user32.lib /nologo /subsystem:console /machine:I386 /out:"../../bin/help.exe" /libpath:"../../bin"
# SUBTRACT LINK32 /pdb:none /nodefaultlib
!ELSEIF "$(CFG)" == "help - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /Gm /GX /ZI /Od /I "../../include" /D "_CONSOLE" /D "WIN32" /D "DEBUG" /D "_MBCS" /FA /FR /YX /FD /Zm200 /GZ /c
# ADD BASE RSC /l 0x816 /d "_DEBUG"
# ADD RSC /l 0x816 /d "DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 libwebserver.lib wsock32.lib user32.lib /nologo /subsystem:console /debug /machine:I386 /out:"../../bin/help.exe" /pdbtype:sept /libpath:"../../bin"
# SUBTRACT LINK32 /pdb:none
!ENDIF
# Begin Target
# Name "help - Win32 Release"
# Name "help - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\help\help.c
!IF "$(CFG)" == "help - Win32 Release"
# ADD CPP /I "../../include ./"
# SUBTRACT CPP /I "../../include"
!ELSEIF "$(CFG)" == "help - Win32 Debug"
# ADD CPP /I "../../include help/"
# SUBTRACT CPP /I "../../include"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\help.rc
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\help\examples.h
# End Source File
# Begin Source File
SOURCE=..\..\help\functions.h
# End Source File
# Begin Source File
SOURCE=..\..\help\info.h
# End Source File
# Begin Source File
SOURCE=..\..\help\security.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# Begin Source File
SOURCE=.\help.ico
# End Source File
# End Group
# Begin Source File
SOURCE=..\..\help.html\examples.html
# End Source File
# Begin Source File
SOURCE=..\..\help.html\functions.html
# End Source File
# Begin Source File
SOURCE=..\..\help.html\info.html
# End Source File
# Begin Source File
SOURCE=..\..\help.html\security.html
# End Source File
# End Target
# End Project
Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

+72
View File
@@ -0,0 +1,72 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// Portuguese (Portugal) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_PTG)
#ifdef _WIN32
LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON1 ICON DISCARDABLE "help.ico"
#endif // Portuguese (Portugal) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
+469
View File
@@ -0,0 +1,469 @@
# This is a comment. I love comments.
# This file controls what Internet media types are sent to the client for
# given file extension(s). Sending the correct media type to the client
# is important so they know how to handle the content of the file.
# Extra types can either be added here or by using an AddType directive
# in your config files. For more information about Internet media types,
# please read RFC 2045, 2046, 2047, 2048, and 2077. The Internet media type
# registry is at <ftp://ftp.iana.org/in-notes/iana/assignments/media-types/>.
# MIME type Extension
application/EDI-Consent
application/EDI-X12
application/EDIFACT
application/activemessage
application/andrew-inset ez
application/applefile
application/atomicmail
application/batch-SMTP
application/beep+xml
application/cals-1840
application/commonground
application/cybercash
application/dca-rft
application/dec-dx
application/dvcs
application/eshop
application/http
application/hyperstudio
application/iges
application/index
application/index.cmd
application/index.obj
application/index.response
application/index.vnd
application/iotp
application/ipp
application/isup
application/font-tdpfr
application/mac-binhex40 hqx
application/mac-compactpro cpt
application/macwriteii
application/marc
application/mathematica
application/mathematica-old
application/msword doc
application/news-message-id
application/news-transmission
application/ocsp-request
application/ocsp-response
application/octet-stream bin dms lha lzh exe class so dll
application/oda oda
application/parityfec
application/pdf pdf
application/pgp-encrypted
application/pgp-keys
application/pgp-signature
application/pkcs10
application/pkcs7-mime
application/pkcs7-signature
application/pkix-cert
application/pkix-crl
application/pkixcmp
application/postscript ai eps ps
application/prs.alvestrand.titrax-sheet
application/prs.cww
application/prs.nprend
application/qsig
application/remote-printing
application/riscos
application/rtf
application/sdp
application/set-payment
application/set-payment-initiation
application/set-registration
application/set-registration-initiation
application/sgml
application/sgml-open-catalog
application/sieve
application/slate
application/smil smi smil
application/timestamp-query
application/timestamp-reply
application/vemmi
application/vnd.3M.Post-it-Notes
application/vnd.FloGraphIt
application/vnd.accpac.simply.aso
application/vnd.accpac.simply.imp
application/vnd.acucobol
application/vnd.aether.imp
application/vnd.anser-web-certificate-issue-initiation
application/vnd.anser-web-funds-transfer-initiation
application/vnd.audiograph
application/vnd.businessobjects
application/vnd.bmi
application/vnd.canon-cpdl
application/vnd.canon-lips
application/vnd.claymore
application/vnd.commerce-battelle
application/vnd.commonspace
application/vnd.comsocaller
application/vnd.contact.cmsg
application/vnd.cosmocaller
application/vnd.cups-postscript
application/vnd.cups-raster
application/vnd.cups-raw
application/vnd.ctc-posml
application/vnd.cybank
application/vnd.dna
application/vnd.dpgraph
application/vnd.dxr
application/vnd.ecdis-update
application/vnd.ecowin.chart
application/vnd.ecowin.filerequest
application/vnd.ecowin.fileupdate
application/vnd.ecowin.series
application/vnd.ecowin.seriesrequest
application/vnd.ecowin.seriesupdate
application/vnd.enliven
application/vnd.epson.esf
application/vnd.epson.msf
application/vnd.epson.quickanime
application/vnd.epson.salt
application/vnd.epson.ssf
application/vnd.ericsson.quickcall
application/vnd.eudora.data
application/vnd.fdf
application/vnd.ffsns
application/vnd.framemaker
application/vnd.fsc.weblaunch
application/vnd.fujitsu.oasys
application/vnd.fujitsu.oasys2
application/vnd.fujitsu.oasys3
application/vnd.fujitsu.oasysgp
application/vnd.fujitsu.oasysprs
application/vnd.fujixerox.ddd
application/vnd.fujixerox.docuworks
application/vnd.fujixerox.docuworks.binder
application/vnd.fut-misnet
application/vnd.grafeq
application/vnd.groove-account
application/vnd.groove-identity-message
application/vnd.groove-injector
application/vnd.groove-tool-message
application/vnd.groove-tool-template
application/vnd.groove-vcard
application/vnd.hhe.lesson-player
application/vnd.hp-HPGL
application/vnd.hp-PCL
application/vnd.hp-PCLXL
application/vnd.hp-hpid
application/vnd.hp-hps
application/vnd.httphone
application/vnd.hzn-3d-crossword
application/vnd.ibm.afplinedata
application/vnd.ibm.MiniPay
application/vnd.ibm.modcap
application/vnd.informix-visionary
application/vnd.intercon.formnet
application/vnd.intertrust.digibox
application/vnd.intertrust.nncp
application/vnd.intu.qbo
application/vnd.intu.qfx
application/vnd.irepository.package+xml
application/vnd.is-xpr
application/vnd.japannet-directory-service
application/vnd.japannet-jpnstore-wakeup
application/vnd.japannet-payment-wakeup
application/vnd.japannet-registration
application/vnd.japannet-registration-wakeup
application/vnd.japannet-setstore-wakeup
application/vnd.japannet-verification
application/vnd.japannet-verification-wakeup
application/vnd.koan
application/vnd.lotus-1-2-3
application/vnd.lotus-approach
application/vnd.lotus-freelance
application/vnd.lotus-notes
application/vnd.lotus-organizer
application/vnd.lotus-screencam
application/vnd.lotus-wordpro
application/vnd.mcd
application/vnd.mediastation.cdkey
application/vnd.meridian-slingshot
application/vnd.mif mif
application/vnd.minisoft-hp3000-save
application/vnd.mitsubishi.misty-guard.trustweb
application/vnd.mobius.daf
application/vnd.mobius.dis
application/vnd.mobius.msl
application/vnd.mobius.plc
application/vnd.mobius.txf
application/vnd.motorola.flexsuite
application/vnd.motorola.flexsuite.adsi
application/vnd.motorola.flexsuite.fis
application/vnd.motorola.flexsuite.gotap
application/vnd.motorola.flexsuite.kmr
application/vnd.motorola.flexsuite.ttc
application/vnd.motorola.flexsuite.wem
application/vnd.mozilla.xul+xml
application/vnd.ms-artgalry
application/vnd.ms-asf
application/vnd.ms-excel xls
application/vnd.ms-lrm
application/vnd.ms-powerpoint ppt
application/vnd.ms-project
application/vnd.ms-tnef
application/vnd.ms-works
application/vnd.mseq
application/vnd.msign
application/vnd.music-niff
application/vnd.musician
application/vnd.netfpx
application/vnd.noblenet-directory
application/vnd.noblenet-sealer
application/vnd.noblenet-web
application/vnd.novadigm.EDM
application/vnd.novadigm.EDX
application/vnd.novadigm.EXT
application/vnd.osa.netdeploy
application/vnd.palm
application/vnd.pg.format
application/vnd.pg.osasli
application/vnd.powerbuilder6
application/vnd.powerbuilder6-s
application/vnd.powerbuilder7
application/vnd.powerbuilder7-s
application/vnd.powerbuilder75
application/vnd.powerbuilder75-s
application/vnd.previewsystems.box
application/vnd.publishare-delta-tree
application/vnd.pvi.ptid1
application/vnd.pwg-xhtml-print+xml
application/vnd.rapid
application/vnd.s3sms
application/vnd.seemail
application/vnd.shana.informed.formdata
application/vnd.shana.informed.formtemplate
application/vnd.shana.informed.interchange
application/vnd.shana.informed.package
application/vnd.sss-cod
application/vnd.sss-dtf
application/vnd.sss-ntf
application/vnd.street-stream
application/vnd.svd
application/vnd.swiftview-ics
application/vnd.triscape.mxs
application/vnd.trueapp
application/vnd.truedoc
application/vnd.tve-trigger
application/vnd.ufdl
application/vnd.uplanet.alert
application/vnd.uplanet.alert-wbxml
application/vnd.uplanet.bearer-choice-wbxml
application/vnd.uplanet.bearer-choice
application/vnd.uplanet.cacheop
application/vnd.uplanet.cacheop-wbxml
application/vnd.uplanet.channel
application/vnd.uplanet.channel-wbxml
application/vnd.uplanet.list
application/vnd.uplanet.list-wbxml
application/vnd.uplanet.listcmd
application/vnd.uplanet.listcmd-wbxml
application/vnd.uplanet.signal
application/vnd.vcx
application/vnd.vectorworks
application/vnd.vidsoft.vidconference
application/vnd.visio
application/vnd.vividence.scriptfile
application/vnd.wap.sic
application/vnd.wap.slc
application/vnd.wap.wbxml wbxml
application/vnd.wap.wmlc wmlc
application/vnd.wap.wmlscriptc wmlsc
application/vnd.webturbo
application/vnd.wrq-hp3000-labelled
application/vnd.wt.stf
application/vnd.xara
application/vnd.xfdl
application/vnd.yellowriver-custom-menu
application/whoispp-query
application/whoispp-response
application/wita
application/wordperfect5.1
application/x-bcpio bcpio
application/x-cdlink vcd
application/x-chess-pgn pgn
application/x-compress
application/x-cpio cpio
application/x-csh csh
application/x-director dcr dir dxr
application/x-dvi dvi
application/x-futuresplash spl
application/x-gtar gtar
application/x-gzip
application/x-hdf hdf
application/x-javascript js
application/x-koan skp skd skt skm
application/x-latex latex
application/x-netcdf nc cdf
application/x-sh sh
application/x-shar shar
application/x-shockwave-flash swf
application/x-stuffit sit
application/x-sv4cpio sv4cpio
application/x-sv4crc sv4crc
application/x-tar tar
application/x-tcl tcl
application/x-tex tex
application/x-texinfo texinfo texi
application/x-troff t tr roff
application/x-troff-man man
application/x-troff-me me
application/x-troff-ms ms
application/x-ustar ustar
application/x-wais-source src
application/x400-bp
application/xml
application/xml-dtd
application/xml-external-parsed-entity
application/zip zip
audio/32kadpcm
audio/basic au snd
audio/g.722.1
audio/l16
audio/midi mid midi kar
audio/mp4a-latm
audio/mpa-robust
audio/mpeg mpga mp2 mp3
audio/parityfec
audio/prs.sid
audio/telephone-event
audio/tone
audio/vnd.cisco.nse
audio/vnd.cns.anp1
audio/vnd.cns.inf1
audio/vnd.digital-winds
audio/vnd.everad.plj
audio/vnd.lucent.voice
audio/vnd.nortel.vbk
audio/vnd.nuera.ecelp4800
audio/vnd.nuera.ecelp7470
audio/vnd.nuera.ecelp9600
audio/vnd.octel.sbc
audio/vnd.qcelp
audio/vnd.rhetorex.32kadpcm
audio/vnd.vmx.cvsd
audio/x-aiff aif aiff aifc
audio/x-mpegurl m3u
audio/x-pn-realaudio ram rm
audio/x-pn-realaudio-plugin rpm
audio/x-realaudio ra
audio/x-wav wav
chemical/x-pdb pdb
chemical/x-xyz xyz
image/bmp bmp
image/cgm
image/g3fax
image/gif gif
image/ief ief
image/jpeg jpeg jpg jpe
image/naplps
image/png png
image/prs.btif
image/prs.pti
image/tiff tiff tif
image/vnd.cns.inf2
image/vnd.dwg
image/vnd.dxf
image/vnd.fastbidsheet
image/vnd.fpx
image/vnd.fst
image/vnd.fujixerox.edmics-mmr
image/vnd.fujixerox.edmics-rlc
image/vnd.mix
image/vnd.net-fpx
image/vnd.svf
image/vnd.wap.wbmp wbmp
image/vnd.xiff
image/x-cmu-raster ras
image/x-portable-anymap pnm
image/x-portable-bitmap pbm
image/x-portable-graymap pgm
image/x-portable-pixmap ppm
image/x-rgb rgb
image/x-xbitmap xbm
image/x-xpixmap xpm
image/x-xwindowdump xwd
message/delivery-status
message/disposition-notification
message/external-body
message/http
message/news
message/partial
message/rfc822
message/s-http
model/iges igs iges
model/mesh msh mesh silo
model/vnd.dwf
model/vnd.flatland.3dml
model/vnd.gdl
model/vnd.gs-gdl
model/vnd.gtw
model/vnd.mts
model/vnd.vtu
model/vrml wrl vrml
multipart/alternative
multipart/appledouble
multipart/byteranges
multipart/digest
multipart/encrypted
multipart/form-data
multipart/header-set
multipart/mixed
multipart/parallel
multipart/related
multipart/report
multipart/signed
multipart/voice-message
text/calendar
text/css css
text/directory
text/enriched
text/html html htm
text/parityfec
text/plain asc txt
text/prs.lines.tag
text/rfc822-headers
text/richtext rtx
text/rtf rtf
text/sgml sgml sgm
text/tab-separated-values tsv
text/t140
text/uri-list
text/vnd.DMClientScript
text/vnd.IPTC.NITF
text/vnd.IPTC.NewsML
text/vnd.abc
text/vnd.curl
text/vnd.flatland.3dml
text/vnd.fly
text/vnd.fmi.flexstor
text/vnd.in3d.3dml
text/vnd.in3d.spot
text/vnd.latex-z
text/vnd.motorola.reflex
text/vnd.ms-mediapackage
text/vnd.wap.si
text/vnd.wap.sl
text/vnd.wap.wml wml
text/vnd.wap.wmlscript wmls
text/x-setext etx
text/xml xml xsl
text/xml-external-parsed-entity
video/mp4v-es
video/mpeg mpeg mpg mpe
video/parityfec
video/pointer
video/quicktime qt mov
video/vnd.fvt
video/vnd.motorola.video
video/vnd.motorola.videop
video/vnd.mpegurl mxu
video/vnd.mts
video/vnd.nokia.interleaved-multimedia
video/vnd.vivo
video/x-msvideo avi
video/x-sgi-movie movie
x-conference/x-cooltalk ice
+16
View File
@@ -0,0 +1,16 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by help.rc
//
#define IDI_ICON1 101
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 102
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
+237
View File
@@ -0,0 +1,237 @@
# Microsoft Developer Studio Project File - Name="libwebserver" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
CFG=libwebserver - Win32 Release
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "libwebserver.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "libwebserver.mak" CFG="libwebserver - Win32 Release"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "libwebserver - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "libwebserver - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "libwebserver - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /I "../include" /I "./" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD BASE RSC /l 0x816 /d "NDEBUG"
# ADD RSC /l 0x816 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"../bin/libwebserver.lib"
!ELSEIF "$(CFG)" == "libwebserver - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /Gm /GX /ZI /Od /I "./" /I "../include" /D "_LIB" /D "WIN32" /D "_DEBUG" /D "_MBCS" /FA /YX /FD /GZ /c
# SUBTRACT CPP /X
# ADD BASE RSC /l 0x816 /d "_DEBUG"
# ADD RSC /l 0x816 /d "DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"../bin/libwebserver.lib"
!ENDIF
# Begin Target
# Name "libwebserver - Win32 Release"
# Name "libwebserver - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\src\client.c
# End Source File
# Begin Source File
SOURCE=..\src\clientinfo.c
# End Source File
# Begin Source File
SOURCE=.\dirent.c
# End Source File
# Begin Source File
SOURCE=..\src\error.c
# End Source File
# Begin Source File
SOURCE=.\flock.c
# End Source File
# Begin Source File
SOURCE=..\src\fnmatch.c
# End Source File
# Begin Source File
SOURCE=..\src\gethandler.c
# End Source File
# Begin Source File
SOURCE=..\src\memory.c
# End Source File
# Begin Source File
SOURCE=..\src\outgif.c
# End Source File
# Begin Source File
SOURCE=..\src\outstream.c
# End Source File
# Begin Source File
SOURCE=..\src\server.c
# End Source File
# Begin Source File
SOURCE=..\src\socket.c
# End Source File
# Begin Source File
SOURCE=..\src\utils.c
# End Source File
# Begin Source File
SOURCE=..\src\weblog.c
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\include\client.h
# End Source File
# Begin Source File
SOURCE=..\include\clientinfo.h
# End Source File
# Begin Source File
SOURCE=..\include\config.h
# End Source File
# Begin Source File
SOURCE=..\include\debug.h
# End Source File
# Begin Source File
SOURCE=.\dirent.h
# End Source File
# Begin Source File
SOURCE=..\include\error.h
# End Source File
# Begin Source File
SOURCE=.\flock.h
# End Source File
# Begin Source File
SOURCE=..\include\fnmatch.h
# End Source File
# Begin Source File
SOURCE=..\include\gethandler.h
# End Source File
# Begin Source File
SOURCE=..\include\logo.h
# End Source File
# Begin Source File
SOURCE=..\include\memory.h
# End Source File
# Begin Source File
SOURCE=..\include\module.h
# End Source File
# Begin Source File
SOURCE=..\include\outgif.h
# End Source File
# Begin Source File
SOURCE=..\include\outstream.h
# End Source File
# Begin Source File
SOURCE=..\include\server.h
# End Source File
# Begin Source File
SOURCE=..\include\socket.h
# End Source File
# Begin Source File
SOURCE=..\include\utils.h
# End Source File
# Begin Source File
SOURCE=..\include\web_server.h
# End Source File
# Begin Source File
SOURCE=..\include\weblog.h
# End Source File
# End Group
# Begin Source File
SOURCE=..\Authors
# End Source File
# Begin Source File
SOURCE=..\ChangeLog
# End Source File
# Begin Source File
SOURCE=..\Todo
# End Source File
# End Target
# End Project
+44
View File
@@ -0,0 +1,44 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "help"=".\help\help.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name libwebserver
End Project Dependency
}}}
###############################################################################
Project: "libwebserver"=".\libwebserver.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################
+9
View File
@@ -0,0 +1,9 @@
/*
* by data2header by Luis Figueiredo (stdio@netc.pt)
*/
#ifndef _ENGINE_H_
#define _ENGINE_H_
char engine[]="";
#endif
+605
View File
@@ -0,0 +1,605 @@
/*
* by data2header by Luis Figueiredo (stdio@netc.pt)
*/
#ifndef _EXAMPLES_H_
#define _EXAMPLES_H_
char examples[]="\x3C\x63\x65\x6E\x74\x65\x72\x3E\x3C\x48\x33\x3E\x3C\x66\x6F\x6E\x74\x20\x63\x6F\x6C\x6F\x72\x3D\x27"
"\x30\x30\x37\x37\x30\x30\x27\x3E\x6C\x69\x62\x77\x65\x62\x73\x65\x72\x76\x65\x72\x20\x65\x78\x61\x6D\x70"
"\x6C\x65\x73\x3C\x2F\x66\x6F\x6E\x74\x3E\x3C\x2F\x48\x33\x3E\x3C\x2F\x63\x65\x6E\x74\x65\x72\x3E\x3C\x42"
"\x52\x3E\x3C\x42\x52\x3E\xA\xA\x3C\x21\x2D\x2D\x20\x4A\x6F\x68\x61\x6E\x6E\x65\x73\x20\x45\x2E\x20\x53"
"\x63\x68\x69\x6E\x64\x65\x6C\x69\x6E\x20\x2D\x2D\x3E\xA\x3C\x63\x65\x6E\x74\x65\x72\x3E\x3C\x41\x20\x6E"
"\x61\x6D\x65\x3D\x68\x65\x6C\x6C\x6F\x77\x6F\x72\x6C\x64\x3E\x3C\x42\x3E\x3C\x66\x6F\x6E\x74\x20\x63\x6F"
"\x6C\x6F\x72\x3D\x27\x30\x30\x30\x30\x37\x37\x27\x3E\x3C\x61\x20\x68\x72\x65\x66\x3D\x2F\x68\x65\x6C\x6C"
"\x6F\x3E\x3C\x48\x33\x3E\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x3C\x2F\x48\x33\x3E\x3C\x2F\x61\x3E"
"\x3C\x2F\x66\x6F\x6E\x74\x3E\x3C\x2F\x42\x3E\x3C\x2F\x63\x65\x6E\x74\x65\x72\x3E\xA\x3C\x73\x6D\x61\x6C"
"\x6C\x3E\x20\x3C\x42\x3E\x75\x73\x65\x64\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x3A\x3C\x2F\x42\x3E\x3C"
"\x42\x52\x3E\xA\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69"
"\x6F\x6E\x73\x23\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x69\x6E\x69\x74\x27\x3E\x77\x65\x62\x5F\x73"
"\x65\x72\x76\x65\x72\x5F\x69\x6E\x69\x74\x3C\x2F\x61\x3E\x3C\x42\x52\x3E\xA\x3C\x61\x20\x68\x72\x65\x66"
"\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77\x65\x62\x5F\x73\x65\x72"
"\x76\x65\x72\x5F\x61\x64\x64\x68\x61\x6E\x64\x6C\x65\x72\x27\x3E\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72"
"\x5F\x61\x64\x64\x68\x61\x6E\x64\x6C\x65\x72\x3C\x2F\x61\x3E\x3C\x42\x52\x3E\xA\x3C\x61\x20\x68\x72\x65"
"\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77\x65\x62\x5F\x73\x65"
"\x72\x76\x65\x72\x5F\x72\x75\x6E\x27\x3E\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x72\x75\x6E\x3C\x2F"
"\x61\x3E\x3C\x42\x52\x3E\xA\x3C\x2F\x73\x6D\x61\x6C\x6C\x3E\x3C\x42\x52\x3E\xA\xA\x54\x68\x69\x73\x20"
"\x65\x78\x61\x6D\x70\x6C\x65\x20\x73\x74\x61\x72\x74\x73\x20\x74\x68\x65\x20\x73\x65\x72\x76\x65\x72\x20"
"\x77\x69\x74\x68\x20\x6F\x6E\x65\x20\x68\x61\x6E\x64\x6C\x65\x72\x20\x66\x6F\x72\x20\x61\x6C\x6C\x20\x72"
"\x65\x71\x75\x65\x73\x74\x73\x20\x70\x6F\x69\x6E\x74\x69\x6E\x67\x20\x74\x6F\x20\x68\x65\x6C\x6C\x6F\x5F"
"\x77\x6F\x72\x6C\x64\x28\x29\xA\x74\x68\x61\x74\x20\x70\x72\x69\x6E\x74\x73\x20\x74\x68\x65\x20\x63\x6F"
"\x6E\x74\x65\x6E\x74\x2D\x74\x79\x70\x65\x20\x77\x69\x74\x68\x20\x74\x68\x65\x20\x65\x6E\x64\x20\x6F\x66"
"\x20\x74\x68\x65\x20\x68\x65\x61\x64\x65\x72\x20\x22\x5C\x72\x5C\x6E\x5C\x72\x5C\x6E\x22\x20\x61\x6E\x64"
"\x20\x6F\x6E\x65\x20\x73\x69\x6D\x70\x6C\x65\x20\x70\x72\x69\x6E\x74\x66\x20\x77\x69\x74\x68\x20\x48\x65"
"\x6C\x6C\x6F\x20\x77\x6F\x72\x6C\x64\x3C\x42\x52\x3E\x3C\x42\x52\x3E\xA\xA\x3C\x54\x41\x42\x4C\x45\x20"
"\x77\x69\x64\x74\x68\x3D\x27\x31\x30\x30\x25\x27\x20\x62\x67\x63\x6F\x6C\x6F\x72\x3D\x27\x43\x46\x43\x46"
"\x43\x46\x27\x20\x62\x6F\x72\x64\x65\x72\x3D\x30\x3E\x3C\x54\x52\x3E\x3C\x54\x44\x3E\xA\x3C\x43\x4F\x44"
"\x45\x3E\x3C\x50\x52\x45\x3E\xA\x23\x69\x6E\x63\x6C\x75\x64\x65\x20\x22\x77\x65\x62\x5F\x73\x65\x72\x76"
"\x65\x72\x2E\x68\x22\xA\x23\x69\x6E\x63\x6C\x75\x64\x65\x20\x26\x6C\x74\x3B\x73\x74\x64\x69\x6F\x2E\x68"
"\x26\x67\x74\x3B\xA\xA\xA\x76\x6F\x69\x64\x20\x68\x65\x6C\x6C\x6F\x5F\x77\x6F\x72\x6C\x64\x28\x29\x20"
"\x7B\xA\x9\x70\x72\x69\x6E\x74\x66\x28\x22\x43\x6F\x6E\x74\x65\x6E\x74\x2D\x74\x79\x70\x65\x3A\x20\x74"
"\x65\x78\x74\x2F\x70\x6C\x61\x69\x6E\x5C\x72\x5C\x6E\x5C\x72\x5C\x6E\x22\x29\x3B\xA\x9\x70\x72\x69\x6E"
"\x74\x66\x28\x22\x48\x65\x6C\x6C\x6F\x2C\x20\x57\x6F\x72\x6C\x64\x21\x5C\x72\x5C\x6E\x22\x29\x3B\xA\x7D"
"\xA\xA\x69\x6E\x74\x20\x6D\x61\x69\x6E\x28\x69\x6E\x74\x20\x61\x72\x67\x63\x2C\x63\x68\x61\x72\x2A\x2A"
"\x20\x61\x72\x67\x76\x29\x20\x7B\xA\x20\x20\x20\x20\x20\x20\x20\x20\x73\x74\x72\x75\x63\x74\x20\x77\x65"
"\x62\x5F\x73\x65\x72\x76\x65\x72\x20\x73\x65\x72\x76\x65\x72\x3B\x20\x2F\x2F\x20\x73\x65\x72\x76\x65\x72"
"\x20\x68\x61\x6E\x64\x6C\x65\x72\xA\x20\x20\x20\x20\x20\x20\x20\x20\x69\x66\x28\x21\x77\x65\x62\x5F\x73"
"\x65\x72\x76\x65\x72\x5F\x69\x6E\x69\x74\x28\x26\x73\x65\x72\x76\x65\x72\x2C\x38\x30\x2C\x22\x68\x65\x6C"
"\x70\x2E\x6C\x6F\x67\x22\x2C\x30\x29\x29\x20\x7B\x20\x2F\x2F\x20\x69\x6E\x69\x74\x69\x61\x6C\x69\x7A\x65"
"\x20\x61\x6E\x64\x20\x73\x74\x61\x72\x74\x20\x74\x68\x65\x20\x73\x65\x72\x76\x65\x72\x20\x61\x74\x20\x70"
"\x6F\x72\x74\x20\x38\x30\x2C\x20\x6C\x6F\x67\x67\x69\x6E\x67\x20\x74\x6F\x20\x68\x65\x6C\x70\x2E\x6C\x6F"
"\x67\xA\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x66\x70\x72\x69\x6E\x74\x66\x28"
"\x73\x74\x64\x65\x72\x72\x2C\x22\x63\x61\x6E\x27\x74\x20\x6F\x70\x65\x6E\x20\x6C\x69\x73\x74\x65\x6E\x20"
"\x73\x6F\x63\x6B\x65\x74\x5C\x6E\x22\x29\x3B\xA\x9\x9\x72\x65\x74\x75\x72\x6E\x20\x31\x3B\xA\x20\x20"
"\x20\x20\x20\x20\x20\x20\x7D\x3B\xA\xA\x20\x20\x20\x20\x20\x20\x20\x20\x77\x65\x62\x5F\x73\x65\x72\x76"
"\x65\x72\x5F\x61\x64\x64\x68\x61\x6E\x64\x6C\x65\x72\x28\x26\x73\x65\x72\x76\x65\x72\x2C\x22\x2A\x20\x2A"
"\x22\x2C\x68\x65\x6C\x6C\x6F\x5F\x77\x6F\x72\x6C\x64\x2C\x30\x29\x3B\x20\x2F\x2F\x20\x61\x64\x64\x20\x68"
"\x61\x6E\x64\x6C\x65\x72\x20\x66\x6F\x72\x20\x61\x6C\x6C\x20\x72\x65\x71\x75\x65\x73\x74\x73\xA\x20\x20"
"\x20\x20\x20\x20\x20\x20\x77\x68\x69\x6C\x65\x28\x31\x29\x20\x7B\xA\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x72\x75\x6E\x28\x26\x73\x65\x72"
"\x76\x65\x72\x29\x3B\x20\x20\x20\x2F\x2F\x20\x72\x75\x6E\x20\x73\x65\x72\x76\x65\x72\xA\x20\x20\x20\x20"
"\x20\x20\x20\x20\x7D\x3B\xA\x7D\xA\x3C\x2F\x50\x52\x45\x3E\x3C\x2F\x43\x4F\x44\x45\x3E\xA\x3C\x2F\x54"
"\x44\x3E\x3C\x2F\x54\x52\x3E\x3C\x2F\x54\x41\x42\x4C\x45\x3E\xA\x3C\x48\x52\x3E\x3C\x42\x52\x3E\xA\xA"
"\x3C\x63\x65\x6E\x74\x65\x72\x3E\x3C\x41\x20\x6E\x61\x6D\x65\x3D\x6C\x6F\x67\x66\x69\x6C\x65\x3E\x3C\x42"
"\x3E\x3C\x66\x6F\x6E\x74\x20\x63\x6F\x6C\x6F\x72\x3D\x27\x30\x30\x30\x30\x37\x37\x27\x3E\x3C\x61\x20\x68"
"\x72\x65\x66\x3D\x27\x2F\x6C\x6F\x67\x27\x3E\x3C\x48\x33\x3E\x6C\x6F\x67\x66\x69\x6C\x65\x3C\x2F\x48\x33"
"\x3E\x3C\x2F\x61\x3E\x3C\x2F\x66\x6F\x6E\x74\x3E\x3C\x2F\x42\x3E\x3C\x2F\x63\x65\x6E\x74\x65\x72\x3E\xA"
"\x3C\x73\x6D\x61\x6C\x6C\x3E\x20\x3C\x42\x3E\x75\x73\x65\x64\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x3A"
"\x3C\x2F\x42\x3E\x3C\x42\x52\x3E\xA\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66"
"\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x69\x6E\x69\x74\x27\x3E"
"\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x69\x6E\x69\x74\x3C\x2F\x61\x3E\x3C\x42\x52\x3E\xA\x3C\x61"
"\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77\x65"
"\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x64\x64\x68\x61\x6E\x64\x6C\x65\x72\x27\x3E\x77\x65\x62\x5F\x73"
"\x65\x72\x76\x65\x72\x5F\x61\x64\x64\x68\x61\x6E\x64\x6C\x65\x72\x3C\x2F\x61\x3E\x3C\x42\x52\x3E\xA\x3C"
"\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77"
"\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x72\x75\x6E\x27\x3E\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F"
"\x72\x75\x6E\x3C\x2F\x61\x3E\x3C\x42\x52\x3E\xA\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C"
"\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x61\x64\x64"
"\x66\x69\x6C\x65\x27\x3E\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x61\x64\x64\x66\x69\x6C\x65\x3C\x2F"
"\x61\x3E\x3C\x42\x52\x3E\xA\x3C\x2F\x73\x6D\x61\x6C\x6C\x3E\x3C\x42\x52\x3E\xA\xA\x54\x68\x69\x73\x20"
"\x65\x78\x61\x6D\x70\x6C\x65\x20\x75\x73\x65\x73\x20\x74\x68\x65\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x20"
"\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23"
"\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x61\x64\x64\x66\x69\x6C\x65\x27\x3E\x77\x65\x62\x5F\x63\x6C"
"\x69\x65\x6E\x74\x5F\x61\x64\x64\x66\x69\x6C\x65\x3C\x2F\x61\x3E\x20\x74\x6F\x20\x73\x65\x6E\x64\x20\x61"
"\x20\x66\x69\x6C\x65\x20\x74\x6F\x20\x63\x6C\x69\x65\x6E\x74\xA\x3C\x42\x52\x3E\x3C\x42\x52\x3E\xA\x3C"
"\x54\x41\x42\x4C\x45\x20\x77\x69\x64\x74\x68\x3D\x27\x31\x30\x30\x25\x27\x20\x62\x67\x63\x6F\x6C\x6F\x72"
"\x3D\x27\x43\x46\x43\x46\x43\x46\x27\x20\x62\x6F\x72\x64\x65\x72\x3D\x30\x3E\x3C\x54\x52\x3E\x3C\x54\x44"
"\x3E\xA\x3C\x43\x4F\x44\x45\x3E\x3C\x50\x52\x45\x3E\xA\x23\x69\x6E\x63\x6C\x75\x64\x65\x20\x22\x77\x65"
"\x62\x5F\x73\x65\x72\x76\x65\x72\x2E\x68\x22\xA\x23\x69\x6E\x63\x6C\x75\x64\x65\x20\x26\x6C\x74\x3B\x73"
"\x74\x64\x69\x6F\x2E\x68\x26\x67\x74\x3B\xA\xA\x76\x6F\x69\x64\x20\x6C\x6F\x67\x66\x69\x6C\x65\x28\x29"
"\x20\x7B\xA\x20\x20\x20\x20\x20\x20\x20\x20\x70\x72\x69\x6E\x74\x66\x28\x22\x43\x6F\x6E\x74\x65\x6E\x74"
"\x2D\x74\x79\x70\x65\x3A\x20\x74\x65\x78\x74\x2F\x70\x6C\x61\x69\x6E\x5C\x72\x5C\x6E\x5C\x72\x5C\x6E\x22"
"\x29\x3B\xA\x20\x20\x20\x20\x20\x20\x20\x20\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x61\x64\x64\x66"
"\x69\x6C\x65\x28\x73\x65\x72\x76\x65\x72\x2E\x6C\x6F\x67\x66\x69\x6C\x65\x29\x3B\x20\x2F\x2F\x20\x61\x64"
"\x64\x20\x68\x65\x6C\x70\x2E\x6C\x6F\x67\x20\x66\x69\x6C\x65\x20\x74\x6F\x20\x6F\x75\x74\x70\x75\x74\xA"
"\x20\x20\x20\x20\x20\x20\x20\x20\x70\x72\x69\x6E\x74\x66\x28\x22\x45\x6E\x64\x20\x6F\x66\x20\x6C\x6F\x67"
"\x5C\x6E\x22\x29\x3B\xA\x7D\x3B\xA\x20\x20\x20\x20\x20\x20\x20\x20\xA\xA\x6D\x61\x69\x6E\x28\x29\x20"
"\x7B\xA\x20\x20\x20\x20\x20\x20\x20\x20\x73\x74\x72\x75\x63\x74\x20\x77\x65\x62\x5F\x73\x65\x72\x76\x65"
"\x72\x20\x73\x65\x72\x76\x65\x72\x3B\x20\x2F\x2F\x20\x73\x65\x72\x76\x65\x72\x20\x68\x61\x6E\x64\x6C\x65"
"\x72\xA\x20\x20\x20\x20\x20\x20\x20\x20\x69\x66\x28\x21\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x69"
"\x6E\x69\x74\x28\x26\x73\x65\x72\x76\x65\x72\x2C\x38\x32\x2C\x22\x68\x65\x6C\x70\x2E\x6C\x6F\x67\x22\x2C"
"\x30\x29\x29\x20\x7B\x20\x2F\x2F\x20\x69\x6E\x69\x74\x69\x61\x6C\x69\x7A\x61\x74\x65\xA\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x66\x70\x72\x69\x6E\x74\x66\x28\x73\x74\x64\x65\x72\x72"
"\x2C\x22\x63\x61\x6E\x27\x74\x20\x6F\x70\x65\x6E\x20\x6C\x69\x73\x74\x65\x6E\x20\x73\x6F\x63\x6B\x65\x74"
"\x5C\x6E\x22\x29\x3B\xA\x20\x20\x20\x20\x20\x20\x20\x20\x7D\x3B\xA\xA\x20\x20\x20\x20\x20\x20\x20\x20"
"\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x64\x64\x68\x61\x6E\x64\x6C\x65\x72\x28\x26\x73\x65\x72"
"\x76\x65\x72\x2C\x22\x2A\x20\x2F\x6C\x6F\x67\x22\x2C\x6C\x6F\x67\x66\x69\x6C\x65\x2C\x30\x29\x3B\x20\x2F"
"\x2F\x20\x61\x64\x64\x20\x68\x61\x6E\x64\x6C\x65\x72\x20\x66\x6F\x72\x20\x68\x74\x74\x70\x3A\x2F\x2F\x68"
"\x6F\x73\x74\x2F\x6C\x6F\x67\x20\x72\x65\x71\x75\x65\x73\x74\x73\xA\x20\x20\x20\x20\x20\x20\x20\x20\x77"
"\x68\x69\x6C\x65\x28\x31\x29\x20\x7B\xA\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x72\x75\x6E\x28\x26\x73\x65\x72\x76\x65\x72\x29\x3B\x20\x20"
"\x20\x2F\x2F\x20\x72\x75\x6E\x20\x73\x65\x72\x76\x65\x72\xA\x20\x20\x20\x20\x20\x20\x20\x20\x7D\x3B\xA"
"\x7D\x3B\xA\x3C\x2F\x50\x52\x45\x3E\x3C\x2F\x43\x4F\x44\x45\x3E\xA\x3C\x2F\x54\x44\x3E\x3C\x2F\x54\x52"
"\x3E\x3C\x2F\x54\x41\x42\x4C\x45\x3E\xA\x3C\x48\x52\x3E\x3C\x42\x52\x3E\xA\xA\xA\x3C\x63\x65\x6E\x74"
"\x65\x72\x3E\x3C\x41\x20\x6E\x61\x6D\x65\x3D\x69\x6D\x61\x67\x65\x75\x70\x3E\x3C\x42\x3E\x3C\x66\x6F\x6E"
"\x74\x20\x63\x6F\x6C\x6F\x72\x3D\x27\x30\x30\x30\x30\x37\x37\x27\x3E\x3C\x61\x20\x68\x72\x65\x66\x3D\x27"
"\x2F\x69\x6D\x61\x67\x65\x27\x3E\x3C\x48\x33\x3E\x49\x6D\x61\x67\x65\x20\x55\x70\x6C\x6F\x61\x64\x65\x72"
"\x3C\x2F\x48\x33\x3E\x3C\x2F\x61\x3E\x3C\x2F\x66\x6F\x6E\x74\x3E\x3C\x2F\x42\x3E\x3C\x2F\x63\x65\x6E\x74"
"\x65\x72\x3E\xA\x3C\x73\x6D\x61\x6C\x6C\x3E\x20\x3C\x42\x3E\x75\x73\x65\x64\x20\x66\x75\x6E\x63\x74\x69"
"\x6F\x6E\x73\x3A\x3C\x2F\x42\x3E\x3C\x42\x52\x3E\xA\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65"
"\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x69\x6E"
"\x69\x74\x27\x3E\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x69\x6E\x69\x74\x3C\x2F\x61\x3E\x3C\x42\x52"
"\x3E\xA\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E"
"\x73\x23\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x64\x64\x68\x61\x6E\x64\x6C\x65\x72\x27\x3E\x77"
"\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x64\x64\x68\x61\x6E\x64\x6C\x65\x72\x3C\x2F\x61\x3E\x3C\x42"
"\x52\x3E\xA\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F"
"\x6E\x73\x23\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x72\x75\x6E\x27\x3E\x77\x65\x62\x5F\x73\x65\x72"
"\x76\x65\x72\x5F\x72\x75\x6E\x3C\x2F\x61\x3E\x3C\x42\x52\x3E\xA\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F"
"\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x63\x6C\x69\x65\x6E\x74\x69\x6E\x66\x6F"
"\x27\x3E\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x3C\x2F\x61\x3E\x3C\x42\x52\x3E\xA\x3C\x2F\x73\x6D\x61"
"\x6C\x6C\x3E\x3C\x42\x52\x3E\xA\xA\xA\x54\x68\x69\x73\x20\x65\x78\x61\x6D\x70\x6C\x65\x20\x75\x73\x65"
"\x73\x20\x74\x68\x65\x20\x73\x74\x72\x75\x63\x74\x20\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65"
"\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x63\x6C\x69\x65\x6E\x74\x69\x6E\x66\x6F\x27\x3E\x43"
"\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x3C\x2F\x61\x3E\x20\x66\x6F\x72\x20\x66\x65\x74\x63\x68\x69\x6E\x67"
"\x20\x74\x68\x65\x20\x69\x6E\x70\x75\x74\x20\x66\x72\x6F\x6D\x20\x74\x68\x65\x20\x63\x6C\x69\x65\x6E\x74"
"\xA\x75\x73\x69\x6E\x67\x20\x74\x68\x65\x20\x51\x75\x65\x72\x79\x28\x22\x69\x6D\x67\x22\x29\x20\x74\x6F"
"\x20\x73\x65\x6E\x64\x20\x74\x68\x65\x20\x69\x6D\x61\x67\x65\x20\x3C\x42\x52\x3E\xA\x61\x6E\x64\x20\x6D"
"\x75\x6C\x74\x69\x70\x61\x72\x74\x20\x66\x6F\x72\x20\x66\x65\x74\x63\x68\x69\x6E\x67\x20\x74\x68\x65\x20"
"\x75\x70\x6C\x6F\x61\x64\x65\x64\x20\x66\x69\x6C\x65\x3C\x42\x52\x3E\xA\xA\xA\x3C\x42\x52\x3E\x3C\x42"
"\x52\x3E\xA\x3C\x54\x41\x42\x4C\x45\x20\x77\x69\x64\x74\x68\x3D\x27\x31\x30\x30\x25\x27\x20\x62\x67\x63"
"\x6F\x6C\x6F\x72\x3D\x27\x43\x46\x43\x46\x43\x46\x27\x20\x62\x6F\x72\x64\x65\x72\x3D\x30\x3E\x3C\x54\x52"
"\x3E\x3C\x54\x44\x3E\xA\x3C\x43\x4F\x44\x45\x3E\x3C\x50\x52\x45\x3E\xA\x23\x69\x6E\x63\x6C\x75\x64\x65"
"\x20\x22\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x2E\x68\x22\xA\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\xA\x23\x69\x6E\x63\x6C\x75\x64\x65\x20\x26\x6C\x74\x3B\x73\x74\x64\x6C\x69\x62"
"\x2E\x68\x26\x67\x74\x3B\xA\x20\x20\x20\x20\x20\x20\x20\x20\xA\x73\x74\x72\x75\x63\x74\x20\x69\x6D\x61"
"\x67\x65\x20\x7B\xA\x9\x63\x68\x61\x72\x20\x2A\x64\x61\x74\x61\x3B\xA\x9\x73\x69\x7A\x65\x5F\x74\x20"
"\x73\x69\x7A\x65\x3B\xA\x7D\x20\x69\x6D\x61\x67\x65\x3D\x7B\x4E\x55\x4C\x4C\x2C\x30\x7D\x3B\xA\xA\x76"
"\x6F\x69\x64\x20\x69\x6D\x61\x67\x65\x6F\x75\x74\x28\x29\x20\x7B\xA\x9\x69\x66\x28\x73\x74\x72\x6C\x65"
"\x6E\x28\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x2D\x3E\x51\x75\x65\x72\x79\x28\x22\x69\x6D\x67\x22\x29"
"\x29\x29\x20\x7B\xA\x9\x9\x69\x66\x28\x69\x6D\x61\x67\x65\x2E\x64\x61\x74\x61\x21\x3D\x4E\x55\x4C\x4C"
"\x29\x20\x7B\xA\x9\x9\x9\x70\x72\x69\x6E\x74\x66\x28\x22\x43\x6F\x6E\x74\x65\x6E\x74\x2D\x74\x79\x70"
"\x65\x3A\x20\x69\x6D\x61\x67\x65\x2F\x6A\x70\x65\x67\x5C\x72\x5C\x6E\x5C\x72\x5C\x6E\x22\x29\x3B\xA\x9"
"\x9\x9\x66\x77\x72\x69\x74\x65\x28\x69\x6D\x61\x67\x65\x2E\x64\x61\x74\x61\x2C\x69\x6D\x61\x67\x65\x2E"
"\x73\x69\x7A\x65\x2C\x31\x2C\x73\x74\x64\x6F\x75\x74\x29\x3B\xA\x9\x9\x7D\x3B\xA\x9\x9\x72\x65\x74"
"\x75\x72\x6E\x3B\xA\x9\x7D\x3B\xA\x9\x70\x72\x69\x6E\x74\x66\x28\x22\x43\x6F\x6E\x74\x65\x6E\x74\x2D"
"\x74\x79\x70\x65\x3A\x20\x74\x65\x78\x74\x2F\x68\x74\x6D\x6C\x5C\x72\x5C\x6E\x5C\x72\x5C\x6E\x22\x29\x3B"
"\xA\x9\x70\x72\x69\x6E\x74\x66\x28\x22\x26\x6C\x74\x3B\x48\x54\x4D\x4C\x26\x67\x74\x3B\x5C\x6E\x22\x29"
"\x3B\xA\x9\x70\x72\x69\x6E\x74\x66\x28\x22\x26\x6C\x74\x3B\x42\x4F\x44\x59\x20\x62\x67\x63\x6F\x6C\x6F"
"\x72\x3D\x27\x45\x46\x45\x46\x45\x46\x27\x26\x67\x74\x3B\x5C\x6E\x22\x29\x3B\x20\x20\x20\x20\x20\x20\x20"
"\x20\xA\x9\x70\x72\x69\x6E\x74\x66\x28\x22\x26\x6C\x74\x3B\x66\x6F\x72\x6D\x20\x61\x63\x74\x69\x6F\x6E"
"\x3D\x27\x2F\x27\x20\x65\x6E\x63\x74\x79\x70\x65\x3D\x27\x6D\x75\x6C\x74\x69\x70\x61\x72\x74\x2F\x66\x6F"
"\x72\x6D\x2D\x64\x61\x74\x61\x27\x26\x67\x74\x3B\x5C\x6E\x22\x29\x3B\xA\x9\x70\x72\x69\x6E\x74\x66\x28"
"\x22\x26\x6C\x74\x3B\x69\x6E\x70\x75\x74\x20\x74\x79\x70\x65\x3D\x66\x69\x6C\x65\x20\x6E\x61\x6D\x65\x3D"
"\x69\x6D\x61\x67\x65\x26\x67\x74\x3B\x26\x6C\x74\x3B\x42\x52\x26\x67\x74\x3B\x5C\x6E\x22\x29\x3B\xA\x9"
"\x70\x72\x69\x6E\x74\x66\x28\x22\x26\x6C\x74\x3B\x2F\x66\x6F\x72\x6D\x26\x67\x74\x3B\x5C\x6E\x22\x29\x3B"
"\xA\x9\x69\x66\x28\x73\x74\x72\x6C\x65\x6E\x28\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x2D\x3E\x4D\x75"
"\x6C\x74\x69\x50\x61\x72\x74\x28\x22\x69\x6D\x61\x67\x65\x22\x29\x2E\x64\x61\x74\x61\x29\x29\x20\x7B\xA"
"\x9\x9\x70\x72\x69\x6E\x74\x66\x28\x22\x25\x73\x26\x6C\x74\x3B\x42\x52\x26\x67\x74\x3B\x26\x6C\x74\x3B"
"\x69\x6D\x67\x20\x73\x72\x63\x3D\x27\x2F\x3F\x69\x6D\x67\x3D\x25\x73\x2E\x6A\x70\x67\x27\x26\x67\x74\x3B"
"\x5C\x6E\x22\x2C\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x2D\x3E\x4D\x75\x6C\x74\x69\x50\x61\x72\x74\x28"
"\x22\x69\x6D\x61\x67\x65\x22\x29\x2E\x66\x69\x6C\x65\x6E\x61\x6D\x65\x2C\x43\x6C\x69\x65\x6E\x74\x49\x6E"
"\x66\x6F\x2D\x3E\x4D\x75\x6C\x74\x69\x50\x61\x72\x74\x28\x22\x69\x6D\x61\x67\x65\x22\x29\x2E\x66\x69\x6C"
"\x65\x6E\x61\x6D\x65\x29\x3B\xA\x9\x9\x66\x72\x65\x65\x28\x69\x6D\x61\x67\x65\x2E\x64\x61\x74\x61\x29"
"\x3B\xA\x9\x9\x69\x6D\x61\x67\x65\x2E\x64\x61\x74\x61\x3D\x6D\x61\x6C\x6C\x6F\x63\x28\x43\x6C\x69\x65"
"\x6E\x74\x49\x6E\x66\x6F\x2D\x3E\x4D\x75\x6C\x74\x69\x50\x61\x72\x74\x28\x22\x69\x6D\x61\x67\x65\x22\x29"
"\x2E\x73\x69\x7A\x65\x2B\x31\x29\x3B\xA\x9\x9\x6D\x65\x6D\x63\x70\x79\x28\x69\x6D\x61\x67\x65\x2E\x64"
"\x61\x74\x61\x2C\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x2D\x3E\x4D\x75\x6C\x74\x69\x50\x61\x72\x74\x28"
"\x22\x69\x6D\x61\x67\x65\x22\x29\x2E\x64\x61\x74\x61\x2C\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x2D\x3E"
"\x4D\x75\x6C\x74\x69\x50\x61\x72\x74\x28\x22\x69\x6D\x61\x67\x65\x22\x29\x2E\x73\x69\x7A\x65\x29\x3B\xA"
"\x9\x9\x69\x6D\x61\x67\x65\x2E\x73\x69\x7A\x65\x3D\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x2D\x3E\x4D"
"\x75\x6C\x74\x69\x50\x61\x72\x74\x28\x22\x69\x6D\x61\x67\x65\x22\x29\x2E\x73\x69\x7A\x65\x3B\xA\x9\x7D"
"\x65\x6C\x73\x65\x20\x7B\xA\x9\x9\x66\x72\x65\x65\x28\x69\x6D\x61\x67\x65\x2E\x64\x61\x74\x61\x29\x3B"
"\xA\x9\x9\x69\x6D\x61\x67\x65\x2E\x64\x61\x74\x61\x3D\x4E\x55\x4C\x4C\x3B\xA\x9\x7D\x3B\xA\x9\x70"
"\x72\x69\x6E\x74\x66\x28\x22\x26\x6C\x74\x3B\x2F\x42\x4F\x44\x59\x26\x67\x74\x3B\x5C\x6E\x22\x29\x3B\xA"
"\x9\x70\x72\x69\x6E\x74\x66\x28\x22\x26\x6C\x74\x3B\x2F\x48\x54\x4D\x4C\x26\x67\x74\x3B\x5C\x6E\x22\x29"
"\x3B\xA\x7D\x3B\xA\xA\xA\xA\x6D\x61\x69\x6E\x28\x29\x20\x7B\xA\x9\x73\x74\x72\x75\x63\x74\x20\x77"
"\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x20\x73\x65\x72\x76\x65\x72\x3B\xA\x9\x69\x66\x28\x21\x77\x65\x62"
"\x5F\x73\x65\x72\x76\x65\x72\x5F\x69\x6E\x69\x74\x28\x26\x73\x65\x72\x76\x65\x72\x2C\x38\x30\x2C\x22\x74"
"\x65\x73\x74\x65\x2E\x6C\x6F\x67\x22\x2C\x30\x29\x29\x20\x7B\xA\x9\x9\x66\x70\x72\x69\x6E\x74\x66\x28"
"\x73\x74\x64\x65\x72\x72\x2C\x22\x63\x61\x6E\x27\x74\x20\x6F\x70\x65\x6E\x20\x6C\x69\x73\x74\x65\x6E\x20"
"\x73\x6F\x63\x6B\x65\x74\x5C\x6E\x22\x29\x3B\xA\x9\x7D\x3B\xA\x9\x77\x65\x62\x5F\x73\x65\x72\x76\x65"
"\x72\x5F\x61\x64\x64\x68\x61\x6E\x64\x6C\x65\x72\x28\x26\x73\x65\x72\x76\x65\x72\x2C\x22\x2A\x20\x2F\x22"
"\x2C\x69\x6D\x61\x67\x65\x6F\x75\x74\x2C\x30\x29\x3B\xA\x9\x77\x68\x69\x6C\x65\x28\x31\x29\x20\x7B\xA"
"\x9\x9\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x72\x75\x6E\x28\x26\x73\x65\x72\x76\x65\x72\x29\x3B"
"\xA\x9\x7D\x3B\xA\x7D\x3B\xA\x3C\x2F\x50\x52\x45\x3E\x3C\x2F\x43\x4F\x44\x45\x3E\xA\x3C\x2F\x54\x44"
"\x3E\x3C\x2F\x54\x52\x3E\x3C\x2F\x54\x41\x42\x4C\x45\x3E\xA\x3C\x48\x52\x3E\x3C\x42\x52\x3E\xA\xA\xA"
"\x3C\x63\x65\x6E\x74\x65\x72\x3E\x3C\x41\x20\x6E\x61\x6D\x65\x3D\x61\x75\x74\x68\x3E\x3C\x42\x3E\x3C\x66"
"\x6F\x6E\x74\x20\x63\x6F\x6C\x6F\x72\x3D\x27\x30\x30\x30\x30\x37\x37\x27\x3E\x3C\x61\x20\x68\x72\x65\x66"
"\x3D\x27\x2F\x61\x75\x74\x68\x27\x3E\x3C\x48\x33\x3E\x41\x75\x74\x68\x65\x6E\x74\x69\x63\x61\x74\x69\x6F"
"\x6E\x3C\x2F\x48\x33\x3E\x3C\x2F\x61\x3E\x20\x3C\x2F\x66\x6F\x6E\x74\x3E\x3C\x2F\x42\x3E\x3C\x2F\x63\x65"
"\x6E\x74\x65\x72\x3E\xA\x3C\x73\x6D\x61\x6C\x6C\x3E\x20\x3C\x42\x3E\x75\x73\x65\x64\x20\x66\x75\x6E\x63"
"\x74\x69\x6F\x6E\x73\x3A\x3C\x2F\x42\x3E\x3C\x42\x52\x3E\xA\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F"
"\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F"
"\x69\x6E\x69\x74\x27\x3E\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x69\x6E\x69\x74\x3C\x2F\x61\x3E\x3C"
"\x42\x52\x3E\xA\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69"
"\x6F\x6E\x73\x23\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x64\x64\x68\x61\x6E\x64\x6C\x65\x72\x27"
"\x3E\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x64\x64\x68\x61\x6E\x64\x6C\x65\x72\x3C\x2F\x61\x3E"
"\x3C\x42\x52\x3E\xA\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74"
"\x69\x6F\x6E\x73\x23\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x72\x75\x6E\x27\x3E\x77\x65\x62\x5F\x73"
"\x65\x72\x76\x65\x72\x5F\x72\x75\x6E\x3C\x2F\x61\x3E\x3C\x42\x52\x3E\xA\x3C\x61\x20\x68\x72\x65\x66\x3D"
"\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77\x65\x62\x5F\x63\x6C\x69\x65"
"\x6E\x74\x5F\x48\x54\x54\x50\x64\x69\x72\x65\x63\x74\x69\x76\x65\x27\x3E\x77\x65\x62\x5F\x63\x6C\x69\x65"
"\x6E\x74\x5F\x48\x54\x54\x50\x64\x69\x72\x65\x63\x74\x69\x76\x65\x3C\x2F\x61\x3E\x3C\x42\x52\x3E\xA\x3C"
"\x2F\x73\x6D\x61\x6C\x6C\x3E\x3C\x42\x52\x3E\xA\xA\x48\x65\x72\x65\x20\x77\x65\x27\x72\x65\x20\x75\x73"
"\x69\x6E\x67\x20\x74\x68\x65\x20\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75"
"\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x48\x54\x54\x50\x64\x69\x72"
"\x65\x63\x74\x69\x76\x65\x27\x3E\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x48\x54\x54\x50\x64\x69\x72"
"\x65\x63\x74\x69\x76\x65\x3C\x2F\x61\x3E\x20\x74\x6F\x20\x73\x65\x74\x20\x75\x70\x20\x74\x68\x65\x20\x73"
"\x65\x72\x76\x65\x72\x20\x72\x65\x73\x70\x6F\x6E\x73\x65\xA\xA\x3C\x42\x52\x3E\x3C\x42\x52\x3E\xA\x75"
"\x73\x65\x72\x3A\x20\x22\x75\x73\x65\x72\x6E\x61\x6D\x65\x22\x2C\x20\x70\x61\x73\x73\x3A\x20\x22\x70\x61"
"\x73\x73\x77\x6F\x72\x64\x22\xA\x3C\x42\x52\x3E\xA\x3C\x54\x41\x42\x4C\x45\x20\x77\x69\x64\x74\x68\x3D"
"\x27\x31\x30\x30\x25\x27\x20\x62\x67\x63\x6F\x6C\x6F\x72\x3D\x27\x43\x46\x43\x46\x43\x46\x27\x20\x62\x6F"
"\x72\x64\x65\x72\x3D\x30\x3E\x3C\x54\x52\x3E\x3C\x54\x44\x3E\xA\x3C\x43\x4F\x44\x45\x3E\x3C\x50\x52\x45"
"\x3E\xA\x23\x69\x6E\x63\x6C\x75\x64\x65\x20\x22\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x2E\x68\x22\xA"
"\x23\x69\x6E\x63\x6C\x75\x64\x65\x20\x26\x6C\x74\x3B\x73\x74\x64\x69\x6F\x2E\x68\x26\x67\x74\x3B\xA\x23"
"\x69\x6E\x63\x6C\x75\x64\x65\x20\x26\x6C\x74\x3B\x73\x74\x72\x69\x6E\x67\x2E\x68\x26\x67\x74\x3B\xA\xA"
"\xA\x76\x6F\x69\x64\x20\x75\x72\x6C\x61\x75\x74\x68\x65\x6E\x74\x69\x63\x61\x74\x65\x28\x29\x20\x7B\xA"
"\x20\x20\x20\x20\x20\x20\x20\x20\x69\x66\x28\x21\x73\x74\x72\x6C\x65\x6E\x28\x43\x6C\x69\x65\x6E\x74\x49"
"\x6E\x66\x6F\x2D\x3E\x75\x73\x65\x72\x29\x20\x7C\x7C\x20\x21\x73\x74\x72\x6C\x65\x6E\x28\x43\x6C\x69\x65"
"\x6E\x74\x49\x6E\x66\x6F\x2D\x3E\x70\x61\x73\x73\x29\x20\x26\x26\xA\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x73\x74\x72\x63\x6D\x70\x28\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x2D\x3E\x75\x73\x65\x72"
"\x2C\x22\x75\x73\x65\x72\x6E\x61\x6D\x65\x22\x29\x20\x7C\x7C\x20\x73\x74\x72\x63\x6D\x70\x28\x43\x6C\x69"
"\x65\x6E\x74\x49\x6E\x66\x6F\x2D\x3E\x70\x61\x73\x73\x2C\x22\x70\x61\x73\x73\x77\x6F\x72\x64\x22\x29\x29"
"\x20\x7B\x20\x2F\x2F\x20\x79\x6F\x75\x20\x63\x61\x6E\x20\x72\x65\x61\x64\x20\x74\x68\x69\x6E\x67\x73\x20"
"\x66\x72\x6F\x6D\x20\x61\x20\x61\x75\x74\x68\x20\x66\x69\x6C\x65\xA\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x48\x54\x54\x50\x64\x69\x72\x65"
"\x63\x74\x69\x76\x65\x28\x22\x48\x54\x54\x50\x2F\x31\x2E\x31\x20\x34\x30\x31\x20\x41\x75\x74\x68\x6F\x72"
"\x69\x7A\x61\x74\x69\x6F\x6E\x20\x52\x65\x71\x75\x69\x72\x65\x64\x22\x29\x3B\xA\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x70\x72\x69\x6E\x74\x66\x28\x22\x57\x57\x57\x2D\x41\x75\x74\x68"
"\x65\x6E\x74\x69\x63\x61\x74\x65\x3A\x20\x42\x61\x73\x69\x63\x20\x72\x65\x61\x6C\x6D\x3D\x5C\x22\x54\x68"
"\x69\x73\x20\x73\x69\x74\x65\x20\x69\x6E\x66\x6F\x5C\x22\x5C\x72\x5C\x6E\x22\x29\x3B\xA\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x70\x72\x69\x6E\x74\x66\x28\x22\x43\x6F\x6E\x74\x65\x6E"
"\x74\x2D\x74\x79\x70\x65\x3A\x20\x74\x65\x78\x74\x2F\x68\x74\x6D\x6C\x5C\x72\x5C\x6E\x5C\x72\x5C\x6E\x22"
"\x29\x3B\xA\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x70\x72\x69\x6E\x74\x66\x28"
"\x22\x26\x6C\x74\x3B\x42\x4F\x44\x59\x26\x67\x74\x3B\x5C\x6E\x22\x29\x3B\xA\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x70\x72\x69\x6E\x74\x66\x28\x22\x26\x6C\x74\x3B\x66\x6F\x6E\x74\x20"
"\x63\x6F\x6C\x6F\x72\x3D\x27\x46\x46\x30\x30\x30\x30\x27\x26\x67\x74\x3B\x41\x63\x63\x65\x73\x73\x20\x64"
"\x65\x6E\x69\x65\x64\x26\x6C\x74\x3B\x2F\x66\x6F\x6E\x74\x26\x67\x74\x3B\x5C\x6E\x22\x29\x3B\xA\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x70\x72\x69\x6E\x74\x66\x28\x22\x26\x6C\x74\x3B"
"\x2F\x42\x4F\x44\x59\x26\x67\x74\x3B\x5C\x6E\x22\x29\x3B\xA\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x72\x65\x74\x75\x72\x6E\x3B\xA\x20\x20\x20\x20\x20\x20\x20\x20\x7D\xA\x20\x20\x20"
"\x20\x20\x20\x20\x20\x70\x72\x69\x6E\x74\x66\x28\x22\x43\x6F\x6E\x74\x65\x6E\x74\x2D\x74\x79\x70\x65\x3A"
"\x20\x74\x65\x78\x74\x2F\x68\x74\x6D\x6C\x5C\x72\x5C\x6E\x5C\x72\x5C\x6E\x22\x29\x3B\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\xA\x20\x20\x20\x20\x20\x20\x20\x20\x70\x72\x69\x6E\x74\x66\x28\x22\x26\x6C\x74\x3B\x42"
"\x4F\x44\x59\x20\x62\x67\x63\x6F\x6C\x6F\x72\x3D\x27\x45\x46\x45\x46\x45\x46\x27\x26\x67\x74\x3B\x5C\x6E"
"\x22\x29\x3B\x20\x20\x20\x20\x20\x20\x20\x20\xA\x20\x20\x20\x20\x20\x20\x20\x20\x70\x72\x69\x6E\x74\x66"
"\x28\x22\x59\x6F\x75\x20\x65\x6E\x74\x65\x72\x65\x64\x20\x69\x6E\x20\x79\x6F\x75\x72\x20\x61\x72\x65\x61"
"\x5C\x6E\x22\x29\x3B\xA\x20\x20\x20\x20\x20\x20\x20\x20\x70\x72\x69\x6E\x74\x66\x28\x22\x26\x6C\x74\x3B"
"\x2F\x42\x4F\x44\x59\x26\x67\x74\x3B\x26\x6C\x74\x3B\x2F\x48\x54\x4D\x4C\x26\x67\x74\x3B\x5C\x6E\x22\x29"
"\x3B\xA\x7D\x3B\xA\xA\xA\x6D\x61\x69\x6E\x28\x29\x20\x7B\xA\x20\x20\x20\x20\x20\x20\x20\x20\x73\x74"
"\x72\x75\x63\x74\x20\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x20\x73\x65\x72\x76\x65\x72\x3B\x20\x2F\x2F"
"\x20\x73\x65\x72\x76\x65\x72\x20\x68\x61\x6E\x64\x6C\x65\x72\xA\x20\x20\x20\x20\x20\x20\x20\x20\x69\x66"
"\x28\x21\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x69\x6E\x69\x74\x28\x26\x73\x65\x72\x76\x65\x72\x2C"
"\x38\x33\x2C\x22\x68\x65\x6C\x70\x2E\x6C\x6F\x67\x22\x2C\x30\x29\x29\x20\x7B\x20\x2F\x2F\x20\x69\x6E\x69"
"\x74\x69\x61\x6C\x69\x7A\x65\xA\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x66\x70"
"\x72\x69\x6E\x74\x66\x28\x73\x74\x64\x65\x72\x72\x2C\x22\x63\x61\x6E\x27\x74\x20\x6F\x70\x65\x6E\x20\x6C"
"\x69\x73\x74\x65\x6E\x20\x73\x6F\x63\x6B\x65\x74\x5C\x6E\x22\x29\x3B\xA\x20\x20\x20\x20\x20\x20\x20\x20"
"\x7D\x3B\xA\xA\x20\x20\x20\x20\x20\x20\x20\x20\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x64\x64"
"\x68\x61\x6E\x64\x6C\x65\x72\x28\x26\x73\x65\x72\x76\x65\x72\x2C\x22\x2A\x20\x2F\x61\x75\x74\x68\x22\x2C"
"\x75\x72\x6C\x61\x75\x74\x68\x65\x6E\x74\x69\x63\x61\x74\x65\x2C\x30\x29\x3B\xA\x20\x20\x20\x20\x20\x20"
"\x20\x20\x77\x68\x69\x6C\x65\x28\x31\x29\x20\x7B\xA\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x72\x75\x6E\x28\x26\x73\x65\x72\x76\x65\x72\x29"
"\x3B\x20\x20\x20\x2F\x2F\x20\x72\x75\x6E\x20\x73\x65\x72\x76\x65\x72\xA\x20\x20\x20\x20\x20\x20\x20\x20"
"\x7D\x3B\xA\x7D\x3B\xA\x3C\x2F\x50\x52\x45\x3E\x3C\x2F\x43\x4F\x44\x45\x3E\xA\x3C\x2F\x54\x44\x3E\x3C"
"\x2F\x54\x52\x3E\x3C\x2F\x54\x41\x42\x4C\x45\x3E\xA\x3C\x48\x52\x3E\x3C\x42\x52\x3E\xA\xA\xA\x3C\x43"
"\x45\x4E\x54\x45\x52\x3E\x3C\x41\x20\x6E\x61\x6D\x65\x3D\x73\x73\x6C\x3E\x3C\x42\x3E\x3C\x66\x6F\x6E\x74"
"\x20\x63\x6F\x6C\x6F\x72\x3D\x27\x30\x30\x30\x30\x37\x37\x27\x3E\x3C\x48\x33\x3E\x6F\x70\x65\x6E\x73\x73"
"\x6C\x20\x66\x6F\x72\x20\x28\x68\x74\x74\x70\x73\x29\x3C\x2F\x48\x33\x3E\x3C\x2F\x66\x6F\x6E\x74\x3E\x3C"
"\x2F\x42\x3E\x3C\x2F\x43\x45\x4E\x54\x45\x52\x3E\xA\x3C\x73\x6D\x61\x6C\x6C\x3E\x20\x3C\x42\x3E\x75\x73"
"\x65\x64\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x3A\x3C\x2F\x42\x3E\x3C\x42\x52\x3E\xA\x3C\x61\x20\x68"
"\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77\x65\x62\x5F"
"\x73\x65\x72\x76\x65\x72\x5F\x48\x54\x54\x50\x64\x69\x72\x65\x63\x74\x69\x76\x65\x27\x3E\x77\x65\x62\x5F"
"\x73\x65\x72\x76\x65\x72\x5F\x75\x73\x65\x53\x53\x4C\x63\x65\x72\x74\x3C\x2F\x61\x3E\x3C\x42\x52\x3E\xA"
"\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23"
"\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x69\x6E\x69\x74\x27\x3E\x77\x65\x62\x5F\x73\x65\x72\x76\x65"
"\x72\x5F\x69\x6E\x69\x74\x3C\x2F\x61\x3E\x3C\x42\x52\x3E\xA\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F"
"\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F"
"\x72\x75\x6E\x27\x3E\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x72\x75\x6E\x3C\x2F\x61\x3E\x3C\x42\x52"
"\x3E\xA\x3C\x2F\x73\x6D\x61\x6C\x6C\x3E\x3C\x42\x52\x3E\xA\xA\x48\x65\x72\x65\x20\x77\x65\x20\x73\x65"
"\x74\x75\x70\x20\x61\x20\x73\x65\x72\x76\x65\x72\x20\x61\x6E\x64\x20\x77\x65\x20\x75\x73\x65\x20\x74\x68"
"\x65\x20\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E"
"\x73\x23\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x75\x73\x65\x53\x53\x4C\x63\x65\x72\x74\x27\x3E\x77"
"\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x75\x73\x65\x53\x53\x4C\x63\x65\x72\x74\x3C\x2F\x61\x3E\x20\x74"
"\x6F\x20\x75\x73\x65\x20\x73\x70\x65\x63\x69\x66\x69\x63\x20\x63\x65\x72\x74\x69\x66\x69\x63\x61\x74\x65"
"\x20\x66\x69\x6C\x65\xA\x61\x6E\x64\x20\x77\x65\x20\x73\x74\x61\x72\x74\x20\x74\x68\x65\x20\x73\x65\x72"
"\x76\x65\x72\x20\x77\x69\x74\x68\x20\x74\x68\x65\x20\x66\x6C\x61\x67\x20\x57\x53\x5F\x55\x53\x45\x53\x53"
"\x4C\x20\x66\x6F\x72\x20\x73\x65\x63\x75\x72\x65\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x20\x28"
"\x6C\x69\x62\x77\x65\x62\x73\x65\x72\x76\x65\x72\x20\x63\x6F\x6D\x70\x69\x6C\x65\x64\x20\x77\x2F\x20\x6F"
"\x70\x65\x6E\x73\x73\x6C\x29\x3C\x42\x52\x3E\x3C\x42\x52\x3E\xA\xA\x53\x65\x65\x20\x61\x6C\x73\x6F\x20"
"\x74\x68\x65\x20\x70\x61\x63\x6B\x65\x74\x6D\x6F\x75\x6E\x74\x65\x72\x20\x65\x78\x61\x6D\x70\x6C\x65\x20"
"\x69\x6E\x20\x74\x68\x65\x20\x65\x78\x61\x6D\x70\x6C\x65\x20\x64\x69\x72\x65\x63\x74\x6F\x72\x79\x2E\x20"
"\xA\x3C\x42\x52\x3E\xA\x3C\x54\x41\x42\x4C\x45\x20\x77\x69\x64\x74\x68\x3D\x27\x31\x30\x30\x25\x27\x20"
"\x62\x67\x63\x6F\x6C\x6F\x72\x3D\x27\x43\x46\x43\x46\x43\x46\x27\x20\x62\x6F\x72\x64\x65\x72\x3D\x30\x3E"
"\x3C\x54\x52\x3E\x3C\x54\x44\x3E\xA\x3C\x43\x4F\x44\x45\x3E\x3C\x50\x52\x45\x3E\xA\xA\x20\x20\xA\x23"
"\x69\x6E\x63\x6C\x75\x64\x65\x20\x22\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x2E\x68\x22\xA\xA\x69\x6E"
"\x74\x20\x6D\x61\x69\x6E\x28\x29\xA\x20\x20\x20\x20\x20\x20\x20\x20\x73\x74\x72\x75\x63\x74\x20\x77\x65"
"\x62\x5F\x73\x65\x72\x76\x65\x72\x20\x73\x65\x72\x76\x65\x72\x73\x73\x6C\x3B\xA\x20\x20\x20\x20\x20\x20"
"\x20\x20\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x75\x73\x65\x53\x53\x4C\x63\x65\x72\x74\x28\x26\x73"
"\x65\x72\x76\x65\x72\x73\x73\x6C\x2C\x22\x66\x6F\x6F\x2D\x63\x65\x72\x74\x2E\x70\x65\x6D\x22\x29\x3B\x20"
"\x2F\x2F\x20\x43\x65\x72\x74\x69\x66\x69\x63\x61\x74\x65\x20\x66\x69\x6C\x65\x20\x20\x20\x20\xA\x20\x20"
"\x20\x20\x20\x20\x20\x20\x69\x66\x28\x21\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x69\x6E\x69\x74\x28"
"\x26\x73\x65\x72\x76\x65\x72\x73\x73\x6C\x2C\x34\x34\x33\x2C\x22\x68\x65\x6C\x70\x2E\x6C\x6F\x67\x22\x2C"
"\x57\x53\x5F\x55\x53\x45\x53\x53\x4C\x29\x29\x20\x7B\xA\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x66\x70\x72\x69\x6E\x74\x66\x28\x73\x74\x64\x65\x72\x72\x2C\x22\x43\x61\x6E\x6E\x6F\x74"
"\x20\x6F\x70\x65\x6E\x20\x70\x6F\x72\x74\x5C\x6E\x22\x29\x3B\xA\x20\x20\x20\x20\x20\x20\x20\x20\x7D\x3B"
"\xA\x20\x20\x20\x20\x20\x20\x20\x20\x77\x68\x69\x6C\x65\x28\x31\x29\x20\x7B\xA\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x72\x75\x6E\x28\x26"
"\x73\x65\x72\x76\x65\x72\x73\x73\x6C\x29\x3B\xA\x20\x20\x20\x20\x20\x20\x20\x20\x7D\x3B\xA\x7D\x3B\xA"
"\x3C\x2F\x50\x52\x45\x3E\x3C\x2F\x43\x4F\x44\x45\x3E\xA\x3C\x2F\x54\x44\x3E\x3C\x2F\x54\x52\x3E\x3C\x2F"
"\x54\x41\x42\x4C\x45\x3E\xA\x41\x6C\x6C\x20\x74\x68\x65\x20\x72\x65\x73\x74\x20\x69\x73\x20\x74\x68\x65"
"\x20\x73\x61\x6D\x65\x20\x61\x73\x20\x77\x69\x74\x68\x6F\x75\x74\x20\x53\x53\x4C\x2E\x20\xA\x3C\x48\x52"
"\x3E\x3C\x42\x52\x3E\xA\xA\xA\x3C\x63\x65\x6E\x74\x65\x72\x3E\x3C\x41\x20\x6E\x61\x6D\x65\x3D\x6F\x75"
"\x74\x67\x69\x66\x3E\x3C\x42\x3E\x3C\x66\x6F\x6E\x74\x20\x63\x6F\x6C\x6F\x72\x3D\x27\x30\x30\x30\x30\x37"
"\x37\x27\x3E\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x67\x69\x66\x27\x3E\x3C\x48\x33\x3E\x47\x69\x66\x20"
"\x67\x65\x6E\x65\x72\x61\x74\x6F\x72\x3C\x2F\x48\x33\x3E\x3C\x2F\x61\x3E\x3C\x2F\x66\x6F\x6E\x74\x3E\x3C"
"\x2F\x42\x3E\x3C\x2F\x63\x65\x6E\x74\x65\x72\x3E\xA\x3C\x73\x6D\x61\x6C\x6C\x3E\x20\x3C\x42\x3E\x75\x73"
"\x65\x64\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x3B\x3C\x2F\x42\x3E\x3C\x42\x52\x3E\xA\x3C\x61\x20\x68"
"\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77\x65\x62\x5F"
"\x73\x65\x72\x76\x65\x72\x5F\x69\x6E\x69\x74\x27\x3E\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x69\x6E"
"\x69\x74\x3C\x2F\x61\x3E\x3C\x42\x52\x3E\xA\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70"
"\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x64\x64\x68"
"\x61\x6E\x64\x6C\x65\x72\x27\x3E\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x64\x64\x68\x61\x6E\x64"
"\x6C\x65\x72\x3C\x2F\x61\x3E\x3C\x42\x52\x3E\xA\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C"
"\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x72\x75\x6E"
"\x27\x3E\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x72\x75\x6E\x3C\x2F\x61\x3E\x3C\x42\x52\x3E\xA\x3C"
"\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77"
"\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x67\x69\x66\x73\x65\x74\x70\x61\x6C\x65\x74\x74\x65\x27\x3E\x77"
"\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x67\x69\x66\x73\x65\x74\x70\x61\x6C\x65\x74\x74\x65\x3C\x2F\x61"
"\x3E\x3C\x42\x52\x3E\xA\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63"
"\x74\x69\x6F\x6E\x73\x23\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x67\x69\x66\x6F\x75\x74\x70\x75\x74"
"\x27\x3E\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x67\x69\x66\x6F\x75\x74\x70\x75\x74\x3C\x2F\x61\x3E"
"\x3C\x42\x52\x3E\xA\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74"
"\x69\x6F\x6E\x73\x23\x63\x6C\x69\x65\x6E\x74\x69\x6E\x66\x6F\x27\x3E\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66"
"\x6F\x3C\x2F\x61\x3E\x3C\x42\x52\x3E\xA\x3C\x2F\x73\x6D\x61\x6C\x6C\x3E\x3C\x42\x52\x3E\xA\xA\x54\x68"
"\x69\x73\x20\x65\x78\x61\x6D\x70\x6C\x65\x20\x64\x72\x61\x77\x73\x20\x61\x6E\x20\x63\x69\x72\x63\x6C\x65"
"\x20\x61\x74\x20\x78\x2C\x79\x20\x72\x65\x71\x75\x65\x73\x74\x65\x64\x20\x62\x79\x20\x63\x6C\x69\x65\x6E"
"\x74\x2C\x20\x61\x6E\x64\x20\x6F\x75\x74\x70\x75\x74\x73\x20\x77\x69\x74\x68\x20\x66\x75\x6E\x63\x74\x69"
"\x6F\x6E\x20\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F"
"\x6E\x73\x23\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x67\x69\x66\x6F\x75\x74\x70\x75\x74\x27\x3E\x77"
"\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x67\x69\x66\x6F\x75\x74\x70\x75\x74\x3C\x2F\x61\x3E\xA\xA\xA"
"\x3C\x42\x52\x3E\x3C\x42\x52\x3E\xA\x3C\x54\x41\x42\x4C\x45\x20\x77\x69\x64\x74\x68\x3D\x27\x31\x30\x30"
"\x25\x27\x20\x62\x67\x63\x6F\x6C\x6F\x72\x3D\x27\x43\x46\x43\x46\x43\x46\x27\x20\x62\x6F\x72\x64\x65\x72"
"\x3D\x30\x3E\x3C\x54\x52\x3E\x3C\x54\x44\x3E\xA\x3C\x43\x4F\x44\x45\x3E\x3C\x50\x52\x45\x3E\xA\x23\x69"
"\x6E\x63\x6C\x75\x64\x65\x20\x22\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x2E\x68\x22\xA\x23\x69\x6E\x63"
"\x6C\x75\x64\x65\x20\x26\x6C\x74\x3B\x73\x74\x64\x69\x6F\x2E\x68\x26\x67\x74\x3B\xA\x23\x69\x6E\x63\x6C"
"\x75\x64\x65\x20\x26\x6C\x74\x3B\x6D\x61\x74\x68\x2E\x68\x26\x67\x74\x3B\xA\xA\xA\x23\x64\x65\x66\x69"
"\x6E\x65\x20\x47\x49\x46\x53\x49\x44\x45\x20\x33\x32\x30\xA\x63\x68\x61\x72\x20\x67\x69\x66\x64\x61\x74"
"\x61\x5B\x47\x49\x46\x53\x49\x44\x45\x2A\x47\x49\x46\x53\x49\x44\x45\x5D\x3B\xA\x76\x6F\x69\x64\x20\x6F"
"\x75\x74\x67\x69\x66\x28\x29\x20\x7B\xA\x9\x66\x6C\x6F\x61\x74\x20\x69\x3B\xA\x9\x69\x6E\x74\x20\x78"
"\x2C\x79\x2C\x78\x63\x2C\x79\x63\x3B\xA\x9\x69\x6E\x74\x20\x63\x6F\x6C\x6F\x72\x3B\xA\x9\x77\x65\x62"
"\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x67\x69\x66\x73\x65\x74\x70\x61\x6C\x65\x74\x74\x65\x28\x22\x45\x47\x41"
"\x22\x29\x3B\xA\x9\x69\x66\x28\x2A\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x2D\x3E\x51\x75\x65\x72\x79"
"\x28\x22\x69\x6D\x67\x22\x29\x21\x3D\x30\x29\x20\x7B\xA\x9\x9\x70\x72\x69\x6E\x74\x66\x28\x22\x43\x6F"
"\x6E\x74\x65\x6E\x74\x2D\x74\x79\x70\x65\x3A\x20\x69\x6D\x61\x67\x65\x2F\x67\x69\x66\x5C\x72\x5C\x6E\x5C"
"\x72\x5C\x6E\x22\x29\x3B\xA\x9\x9\x69\x66\x28\x21\x73\x74\x72\x63\x6D\x70\x28\x43\x6C\x69\x65\x6E\x74"
"\x49\x6E\x66\x6F\x2D\x3E\x51\x75\x65\x72\x79\x28\x22\x69\x6D\x67\x22\x29\x2C\x22\x63\x69\x72\x63\x6C\x65"
"\x22\x29\x29\x20\x7B\xA\x9\x9\x9\x78\x63\x3D\x61\x74\x6F\x69\x28\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66"
"\x6F\x2D\x3E\x51\x75\x65\x72\x79\x28\x22\x78\x22\x29\x29\x25\x47\x49\x46\x53\x49\x44\x45\x3B\xA\x9\x9"
"\x9\x79\x63\x3D\x61\x74\x6F\x69\x28\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x2D\x3E\x51\x75\x65\x72\x79"
"\x28\x22\x79\x22\x29\x29\x25\x47\x49\x46\x53\x49\x44\x45\x3B\xA\x9\x9\x9\x63\x6F\x6C\x6F\x72\x3D\x28"
"\x72\x61\x6E\x64\x28\x29\x25\x31\x35\x29\x2B\x31\x3B\xA\x9\x9\x9\x66\x6F\x72\x28\x69\x3D\x30\x3B\x69"
"\x3C\x36\x2E\x32\x38\x3B\x69\x2B\x3D\x30\x2E\x30\x31\x29\x20\x7B\xA\x9\x9\x9\x9\x78\x3D\x28\x69\x6E"
"\x74\x29\x28\x47\x49\x46\x53\x49\x44\x45\x2B\x28\x78\x63\x2B\x63\x6F\x73\x28\x69\x29\x2A\x31\x30\x29\x29"
"\x25\x47\x49\x46\x53\x49\x44\x45\x3B\xA\x9\x9\x9\x9\x79\x3D\x28\x69\x6E\x74\x29\x28\x47\x49\x46\x53"
"\x49\x44\x45\x2B\x28\x79\x63\x2B\x73\x69\x6E\x28\x69\x29\x2A\x31\x30\x29\x29\x25\x47\x49\x46\x53\x49\x44"
"\x45\x3B\xA\x9\x9\x9\x9\x67\x69\x66\x64\x61\x74\x61\x5B\x78\x2B\x28\x79\x2A\x47\x49\x46\x53\x49\x44"
"\x45\x29\x5D\x3D\x63\x6F\x6C\x6F\x72\x3B\xA\x9\x9\x9\x7D\x3B\xA\x9\x9\x7D\x3B\xA\x9\x9\x77\x65"
"\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x67\x69\x66\x6F\x75\x74\x70\x75\x74\x28\x67\x69\x66\x64\x61\x74\x61"
"\x2C\x47\x49\x46\x53\x49\x44\x45\x2C\x47\x49\x46\x53\x49\x44\x45\x29\x3B\xA\x9\x7D\x3B\xA\x9\x70\x72"
"\x69\x6E\x74\x66\x28\x22\x26\x6C\x74\x3B\x63\x65\x6E\x74\x65\x72\x26\x67\x74\x3B\x47\x65\x6E\x65\x72\x61"
"\x74\x65\x64\x20\x61\x20\x63\x69\x72\x63\x6C\x65\x20\x28\x63\x6C\x69\x63\x6B\x20\x69\x6E\x73\x69\x64\x65"
"\x20\x74\x68\x65\x20\x69\x6D\x61\x67\x65\x29\x26\x6C\x74\x3B\x42\x52\x26\x67\x74\x3B\x5C\x6E\x22\x29\x3B"
"\xA\x9\x70\x72\x69\x6E\x74\x66\x28\x22\x50\x72\x65\x73\x73\x65\x64\x20\x78\x3D\x25\x73\x2C\x79\x3D\x25"
"\x73\x26\x6C\x74\x3B\x42\x52\x26\x67\x74\x3B\x5C\x6E\x22\x2C\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x2D"
"\x3E\x51\x75\x65\x72\x79\x28\x22\x78\x22\x29\x2C\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x2D\x3E\x51\x75"
"\x65\x72\x79\x28\x22\x79\x22\x29\x29\x3B\xA\x9\x70\x72\x69\x6E\x74\x66\x28\x22\x26\x6C\x74\x3B\x66\x6F"
"\x72\x6D\x26\x67\x74\x3B\x26\x6C\x74\x3B\x69\x6E\x70\x75\x74\x20\x74\x79\x70\x65\x3D\x69\x6D\x61\x67\x65"
"\x20\x62\x6F\x72\x64\x65\x72\x3D\x30\x20\x73\x72\x63\x3D\x27\x2F\x67\x69\x66\x3F\x69\x6D\x67\x3D\x63\x69"
"\x72\x63\x6C\x65\x26\x78\x3D\x25\x73\x26\x79\x3D\x25\x73\x27\x26\x67\x74\x3B\x26\x6C\x74\x3B\x2F\x66\x6F"
"\x72\x6D\x26\x67\x74\x3B\x26\x6C\x74\x3B\x2F\x43\x45\x4E\x54\x45\x52\x26\x67\x74\x3B\x5C\x6E\x22\x2C\x43"
"\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x2D\x3E\x51\x75\x65\x72\x79\x28\x22\x78\x22\x29\x2C\x43\x6C\x69\x65"
"\x6E\x74\x49\x6E\x66\x6F\x2D\x3E\x51\x75\x65\x72\x79\x28\x22\x79\x22\x29\x29\x3B\xA\x7D\x3B\xA\xA\xA"
"\x6D\x61\x69\x6E\x28\x29\x20\x7B\xA\x9\x73\x74\x72\x75\x63\x74\x20\x77\x65\x62\x5F\x73\x65\x72\x76\x65"
"\x72\x20\x73\x65\x72\x76\x65\x72\x3B\x20\x2F\x2F\x20\x73\x65\x72\x76\x65\x72\x20\x68\x61\x6E\x64\x6C\x65"
"\x72\xA\x9\x6D\x65\x6D\x73\x65\x74\x28\x67\x69\x66\x64\x61\x74\x61\x2C\x30\x2C\x47\x49\x46\x53\x49\x44"
"\x45\x2A\x47\x49\x46\x53\x49\x44\x45\x29\x3B\xA\x9\x69\x66\x28\x21\x77\x65\x62\x5F\x73\x65\x72\x76\x65"
"\x72\x5F\x69\x6E\x69\x74\x28\x26\x73\x65\x72\x76\x65\x72\x2C\x38\x33\x2C\x22\x68\x65\x6C\x70\x2E\x6C\x6F"
"\x67\x22\x2C\x30\x29\x29\x20\x7B\x20\x2F\x2F\x20\x69\x6E\x69\x74\x69\x61\x6C\x69\x7A\x65\xA\x9\x9\x66"
"\x70\x72\x69\x6E\x74\x66\x28\x73\x74\x64\x65\x72\x72\x2C\x22\x63\x61\x6E\x27\x74\x20\x6F\x70\x65\x6E\x20"
"\x6C\x69\x73\x74\x65\x6E\x20\x73\x6F\x63\x6B\x65\x74\x5C\x6E\x22\x29\x3B\xA\x9\x7D\x3B\xA\xA\x9\x77"
"\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x64\x64\x68\x61\x6E\x64\x6C\x65\x72\x28\x26\x73\x65\x72\x76"
"\x65\x72\x2C\x22\x2A\x20\x2F\x67\x69\x66\x22\x2C\x6F\x75\x74\x67\x69\x66\x2C\x30\x29\x3B\xA\x9\x77\x68"
"\x69\x6C\x65\x28\x31\x29\x20\x7B\xA\x9\x9\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x72\x75\x6E\x28"
"\x26\x73\x65\x72\x76\x65\x72\x29\x3B\x20\x20\x20\x2F\x2F\x20\x72\x75\x6E\x20\x73\x65\x72\x76\x65\x72\xA"
"\x9\x7D\x3B\xA\x7D\x3B\xA\x3C\x2F\x50\x52\x45\x3E\x3C\x2F\x43\x4F\x44\x45\x3E\xA\x3C\x2F\x54\x44\x3E"
"\x3C\x2F\x54\x52\x3E\x3C\x2F\x54\x41\x42\x4C\x45\x3E\xA\x3C\x48\x52\x3E\x3C\x42\x52\x3E\xA\xA\xA\xA"
"\x3C\x43\x45\x4E\x54\x45\x52\x3E\x3C\x41\x20\x6E\x61\x6D\x65\x3D\x63\x6F\x6F\x6B\x69\x65\x3E\x3C\x42\x3E"
"\x3C\x66\x6F\x6E\x74\x20\x63\x6F\x6C\x6F\x72\x3D\x27\x30\x30\x30\x30\x37\x37\x27\x3E\x3C\x61\x20\x68\x72"
"\x65\x66\x3D\x2F\x63\x6F\x6F\x6B\x69\x65\x3E\x3C\x48\x33\x3E\x43\x6F\x6F\x6B\x69\x65\x73\x3C\x2F\x48\x33"
"\x3E\x3C\x2F\x61\x3E\x3C\x2F\x66\x6F\x6E\x74\x3E\x3C\x2F\x42\x3E\x3C\x2F\x43\x45\x4E\x54\x45\x52\x3E\xA"
"\x3C\x73\x6D\x61\x6C\x6C\x3E\x20\x3C\x42\x3E\x75\x73\x65\x64\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x3B"
"\x3C\x2F\x42\x3E\x3C\x42\x52\x3E\xA\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66"
"\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x69\x6E\x69\x74\x27\x3E"
"\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x69\x6E\x69\x74\x3C\x2F\x61\x3E\x3C\x42\x52\x3E\xA\x3C\x61"
"\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77\x65"
"\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x64\x64\x68\x61\x6E\x64\x6C\x65\x72\x27\x3E\x77\x65\x62\x5F\x73"
"\x65\x72\x76\x65\x72\x5F\x61\x64\x64\x68\x61\x6E\x64\x6C\x65\x72\x3C\x2F\x61\x3E\x3C\x42\x52\x3E\xA\x3C"
"\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77"
"\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x72\x75\x6E\x27\x3E\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F"
"\x72\x75\x6E\x3C\x2F\x61\x3E\x3C\x42\x52\x3E\xA\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C"
"\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x63\x6C\x69\x65\x6E\x74\x69\x6E\x66\x6F\x27\x3E\x43\x6C"
"\x69\x65\x6E\x74\x49\x6E\x66\x6F\x3C\x2F\x61\x3E\x3C\x42\x52\x3E\xA\x3C\x61\x20\x68\x72\x65\x66\x3D\x27"
"\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E"
"\x74\x5F\x73\x65\x74\x63\x6F\x6F\x6B\x69\x65\x27\x3E\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x73\x65"
"\x74\x63\x6F\x6F\x6B\x69\x65\x3C\x2F\x61\x3E\x3C\x42\x52\x3E\xA\x3C\x2F\x73\x6D\x61\x6C\x6C\x3E\x3C\x42"
"\x52\x3E\xA\xA\x54\x68\x69\x73\x20\x65\x78\x61\x6D\x70\x6C\x65\x20\x66\x65\x74\x63\x68\x73\x20\x61\x6E"
"\x20\x63\x6C\x69\x65\x6E\x74\x20\x69\x6E\x70\x75\x74\x20\x61\x6E\x64\x20\x73\x65\x74\x27\x73\x20\x61\x6E"
"\x20\x63\x6F\x6F\x6B\x69\x65\x20\x66\x6F\x72\x20\x31\x35\x20\x6D\x69\x6E\x75\x74\x65\x73\x20\x22\x2B\x31"
"\x35\x4D\x22\x20\x75\x73\x69\x6E\x67\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x20\x3C\x61\x20\x68\x72\x65\x66"
"\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77\x65\x62\x5F\x63\x6C\x69"
"\x65\x6E\x74\x5F\x73\x65\x74\x63\x6F\x6F\x6B\x69\x65\x27\x3E\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F"
"\x73\x65\x74\x63\x6F\x6F\x6B\x69\x65\x3C\x2F\x61\x3E\xA\xA\x3C\x42\x52\x3E\x3C\x42\x52\x3E\xA\x3C\x54"
"\x41\x42\x4C\x45\x20\x77\x69\x64\x74\x68\x3D\x27\x31\x30\x30\x25\x27\x20\x62\x67\x63\x6F\x6C\x6F\x72\x3D"
"\x27\x43\x46\x43\x46\x43\x46\x27\x20\x62\x6F\x72\x64\x65\x72\x3D\x30\x3E\x3C\x54\x52\x3E\x3C\x54\x44\x3E"
"\xA\x3C\x43\x4F\x44\x45\x3E\x3C\x50\x52\x45\x3E\xA\x23\x69\x6E\x63\x6C\x75\x64\x65\x20\x22\x77\x65\x62"
"\x5F\x73\x65\x72\x76\x65\x72\x2E\x68\x22\xA\x23\x69\x6E\x63\x6C\x75\x64\x65\x20\x26\x6C\x74\x3B\x73\x74"
"\x64\x69\x6F\x2E\x68\x26\x67\x74\x3B\xA\xA\xA\x76\x6F\x69\x64\x20\x63\x6F\x6F\x6B\x69\x65\x28\x29\x20"
"\x7B\xA\x9\x69\x66\x28\x73\x74\x72\x6C\x65\x6E\x28\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x2D\x3E\x50"
"\x6F\x73\x74\x28\x22\x75\x73\x65\x72\x22\x29\x29\x29\xA\x9\x9\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74"
"\x5F\x73\x65\x74\x63\x6F\x6F\x6B\x69\x65\x28\x22\x75\x73\x65\x72\x6E\x61\x6D\x65\x22\x2C\x43\x6C\x69\x65"
"\x6E\x74\x49\x6E\x66\x6F\x2D\x3E\x50\x6F\x73\x74\x28\x22\x75\x73\x65\x72\x22\x29\x2C\x22\x2B\x31\x35\x4D"
"\x22\x29\x3B\xA\x9\x70\x72\x69\x6E\x74\x66\x28\x22\x43\x6F\x6E\x74\x65\x6E\x74\x2D\x74\x79\x70\x65\x3A"
"\x20\x74\x65\x78\x74\x2F\x68\x74\x6D\x6C\x5C\x72\x5C\x6E\x5C\x72\x5C\x6E\x22\x29\x3B\xA\x9\x70\x72\x69"
"\x6E\x74\x66\x28\x22\x26\x6C\x74\x3B\x66\x6F\x72\x6D\x20\x6D\x65\x74\x68\x6F\x64\x3D\x27\x50\x4F\x53\x54"
"\x27\x26\x67\x74\x3B\x5C\x72\x5C\x6E\x22\x29\x3B\xA\x9\x70\x72\x69\x6E\x74\x66\x28\x22\x26\x6C\x74\x3B"
"\x69\x6E\x70\x75\x74\x20\x74\x79\x70\x65\x3D\x27\x74\x65\x78\x74\x27\x20\x6E\x61\x6D\x65\x3D\x27\x75\x73"
"\x65\x72\x27\x20\x76\x61\x6C\x75\x65\x3D\x27\x25\x73\x27\x26\x67\x74\x3B\x5C\x72\x5C\x6E\x26\x6C\x74\x3B"
"\x42\x52\x26\x67\x74\x3B\x22\x2C\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x2D\x3E\x43\x6F\x6F\x6B\x69\x65"
"\x28\x22\x75\x73\x65\x72\x6E\x61\x6D\x65\x22\x29\x29\x3B\xA\x9\x70\x72\x69\x6E\x74\x66\x28\x22\x26\x6C"
"\x74\x3B\x69\x6E\x70\x75\x74\x20\x74\x79\x70\x65\x3D\x27\x73\x75\x62\x6D\x69\x74\x27\x20\x6E\x61\x6D\x65"
"\x3D\x27\x73\x65\x6E\x64\x27\x20\x76\x61\x6C\x75\x65\x3D\x27\x20\x47\x4F\x21\x20\x27\x26\x67\x74\x3B\x5C"
"\x72\x5C\x6E\x26\x6C\x74\x3B\x42\x52\x26\x67\x74\x3B\x22\x29\x3B\xA\x9\x70\x72\x69\x6E\x74\x66\x28\x22"
"\x26\x6C\x74\x3B\x2F\x66\x6F\x72\x6D\x26\x67\x74\x3B\x5C\x72\x5C\x6E\x22\x29\x3B\xA\x7D\xA\xA\x69\x6E"
"\x74\x20\x6D\x61\x69\x6E\x28\x69\x6E\x74\x20\x61\x72\x67\x63\x2C\x63\x68\x61\x72\x2A\x2A\x20\x61\x72\x67"
"\x76\x29\x20\x7B\xA\x20\x20\x20\x20\x20\x20\x20\x20\x73\x74\x72\x75\x63\x74\x20\x77\x65\x62\x5F\x73\x65"
"\x72\x76\x65\x72\x20\x73\x65\x72\x76\x65\x72\x3B\x20\x2F\x2F\x20\x73\x65\x72\x76\x65\x72\x20\x68\x61\x6E"
"\x64\x6C\x65\x72\xA\x20\x20\x20\x20\x20\x20\x20\x20\x69\x66\x28\x21\x77\x65\x62\x5F\x73\x65\x72\x76\x65"
"\x72\x5F\x69\x6E\x69\x74\x28\x26\x73\x65\x72\x76\x65\x72\x2C\x38\x30\x2C\x22\x68\x65\x6C\x70\x2E\x6C\x6F"
"\x67\x22\x2C\x30\x29\x29\x20\x7B\x20\x2F\x2F\x20\x69\x6E\x69\x74\x69\x61\x6C\x69\x7A\x65\xA\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x66\x70\x72\x69\x6E\x74\x66\x28\x73\x74\x64\x65\x72"
"\x72\x2C\x22\x63\x61\x6E\x27\x74\x20\x6F\x70\x65\x6E\x20\x6C\x69\x73\x74\x65\x6E\x20\x73\x6F\x63\x6B\x65"
"\x74\x5C\x6E\x22\x29\x3B\xA\x9\x9\x72\x65\x74\x75\x72\x6E\x20\x31\x3B\xA\x20\x20\x20\x20\x20\x20\x20"
"\x20\x7D\x3B\xA\xA\x20\x20\x20\x20\x20\x20\x20\x20\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x64"
"\x64\x68\x61\x6E\x64\x6C\x65\x72\x28\x26\x73\x65\x72\x76\x65\x72\x2C\x22\x2A\x20\x2F\x2A\x22\x2C\x63\x6F"
"\x6F\x6B\x69\x65\x2C\x30\x29\x3B\x20\x2F\x2F\x20\x61\x64\x64\x20\x68\x61\x6E\x64\x6C\x65\x72\x20\x66\x6F"
"\x72\x20\x61\x6C\x6C\x20\x72\x65\x71\x75\x65\x73\x74\x73\xA\x20\x20\x20\x20\x20\x20\x20\x20\x77\x68\x69"
"\x6C\x65\x28\x31\x29\x20\x7B\xA\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x77\x65"
"\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x72\x75\x6E\x28\x26\x73\x65\x72\x76\x65\x72\x29\x3B\x20\x20\x20\x2F"
"\x2F\x20\x72\x75\x6E\x20\x73\x65\x72\x76\x65\x72\xA\x20\x20\x20\x20\x20\x20\x20\x20\x7D\x3B\xA\x7D\xA"
"\xA\x3C\x2F\x50\x52\x45\x3E\x3C\x2F\x43\x4F\x44\x45\x3E\xA\x3C\x2F\x54\x44\x3E\x3C\x2F\x54\x52\x3E\x3C"
"\x2F\x54\x41\x42\x4C\x45\x3E\xA\x3C\x48\x52\x3E\x3C\x42\x52\x3E\xA\xA\x3C\x63\x65\x6E\x74\x65\x72\x3E"
"\x3C\x41\x20\x6E\x61\x6D\x65\x3D\x63\x68\x65\x63\x6B\x62\x6F\x78\x3E\x3C\x42\x3E\x3C\x66\x6F\x6E\x74\x20"
"\x63\x6F\x6C\x6F\x72\x3D\x27\x30\x30\x30\x30\x37\x37\x27\x3E\x3C\x61\x20\x68\x72\x65\x66\x3D\x2F\x63\x68"
"\x65\x63\x6B\x62\x6F\x78\x3E\x3C\x48\x33\x3E\x43\x68\x65\x63\x6B\x62\x6F\x78\x3C\x2F\x48\x33\x3E\x3C\x2F"
"\x61\x3E\x3C\x2F\x66\x6F\x6E\x74\x3E\x3C\x2F\x42\x3E\x3C\x2F\x63\x65\x6E\x74\x65\x72\x3E\xA\x3C\x73\x6D"
"\x61\x6C\x6C\x3E\x20\x3C\x42\x3E\x75\x73\x65\x64\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x3B\x3C\x2F\x42"
"\x3E\x3C\x42\x52\x3E\xA\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63"
"\x74\x69\x6F\x6E\x73\x23\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x69\x6E\x69\x74\x27\x3E\x77\x65\x62"
"\x5F\x73\x65\x72\x76\x65\x72\x5F\x69\x6E\x69\x74\x3C\x2F\x61\x3E\x3C\x42\x52\x3E\xA\x3C\x61\x20\x68\x72"
"\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77\x65\x62\x5F\x73"
"\x65\x72\x76\x65\x72\x5F\x61\x64\x64\x68\x61\x6E\x64\x6C\x65\x72\x27\x3E\x77\x65\x62\x5F\x73\x65\x72\x76"
"\x65\x72\x5F\x61\x64\x64\x68\x61\x6E\x64\x6C\x65\x72\x3C\x2F\x61\x3E\x3C\x42\x52\x3E\xA\x3C\x61\x20\x68"
"\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77\x65\x62\x5F"
"\x73\x65\x72\x76\x65\x72\x5F\x72\x75\x6E\x27\x3E\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x72\x75\x6E"
"\x3C\x2F\x61\x3E\x3C\x42\x52\x3E\xA\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66"
"\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x63\x6C\x69\x65\x6E\x74\x69\x6E\x66\x6F\x27\x3E\x43\x6C\x69\x65\x6E"
"\x74\x49\x6E\x66\x6F\x3C\x2F\x61\x3E\x3C\x42\x52\x3E\xA\x3C\x2F\x73\x6D\x61\x6C\x6C\x3E\x3C\x42\x52\x3E"
"\xA\xA\x54\x68\x69\x73\x20\x65\x78\x61\x6D\x70\x6C\x65\x20\x75\x73\x65\x73\x20\x61\x20\x65\x73\x70\x65"
"\x63\x69\x66\x69\x63\x20\x63\x61\x73\x65\x20\x66\x72\x6F\x6D\x20\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F"
"\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x63\x6C\x69\x65\x6E\x74\x69\x6E\x66\x6F"
"\x27\x3E\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x3C\x2F\x61\x3E\x20\x71\x75\x65\x72\x79\x20\x61\x6E\x64"
"\x20\x70\x6F\x73\x74\x2C\x20\x75\x73\x69\x6E\x67\x20\x74\x68\x65\x20\x27\x23\x27\x20\x61\x73\x20\x70\x72"
"\x65\x66\x69\x78\x20\x6F\x66\x20\x76\x61\x72\x6E\x61\x6D\x65\x20\x72\x65\x74\x75\x72\x6E\x69\x6E\x67\x20"
"\x74\x68\x65\x20\x6E\x75\x6D\x62\x65\x72\x20\x6F\x66\x20\x6F\x63\x63\x75\x72\x65\x6E\x63\x65\x73\xA\xA"
"\xA\x3C\x42\x52\x3E\x3C\x42\x52\x3E\xA\x3C\x54\x41\x42\x4C\x45\x20\x77\x69\x64\x74\x68\x3D\x27\x31\x30"
"\x30\x25\x27\x20\x62\x67\x63\x6F\x6C\x6F\x72\x3D\x27\x43\x46\x43\x46\x43\x46\x27\x20\x62\x6F\x72\x64\x65"
"\x72\x3D\x30\x3E\x3C\x54\x52\x3E\x3C\x54\x44\x3E\xA\x3C\x43\x4F\x44\x45\x3E\x3C\x50\x52\x45\x3E\xA\xA"
"\x23\x69\x6E\x63\x6C\x75\x64\x65\x20\x22\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x2E\x68\x22\xA\x23\x69"
"\x6E\x63\x6C\x75\x64\x65\x20\x26\x6C\x74\x3B\x73\x74\x64\x69\x6F\x2E\x68\x26\x67\x74\x3B\xA\xA\xA\x76"
"\x6F\x69\x64\x20\x63\x68\x65\x63\x6B\x62\x6F\x78\x28\x29\x20\x7B\xA\x9\x69\x6E\x74\x20\x69\x3D\x30\x3B"
"\xA\x9\x63\x68\x61\x72\x20\x2A\x74\x78\x74\x5B\x5D\x3D\x7B\x22\x6F\x6E\x65\x22\x2C\x22\x74\x77\x6F\x22"
"\x2C\x22\x74\x68\x72\x65\x65\x22\x2C\x22\x66\x6F\x75\x72\x22\x2C\x22\x66\x69\x76\x65\x22\x7D\x3B\xA\x9"
"\x70\x72\x69\x6E\x74\x66\x28\x22\x43\x6F\x6E\x74\x65\x6E\x74\x2D\x74\x79\x70\x65\x3A\x20\x74\x65\x78\x74"
"\x2F\x68\x74\x6D\x6C\x5C\x72\x5C\x6E\x5C\x72\x5C\x6E\x22\x29\x3B\xA\x9\x70\x72\x69\x6E\x74\x66\x28\x22"
"\x26\x6C\x74\x3B\x66\x6F\x72\x6D\x20\x6D\x65\x74\x68\x6F\x64\x3D\x27\x51\x55\x45\x52\x59\x27\x26\x67\x74"
"\x3B\x5C\x72\x5C\x6E\x22\x29\x3B\xA\x9\xA\x9\x66\x6F\x72\x28\x69\x3D\x30\x3B\x69\x3C\x35\x3B\x69\x2B"
"\x2B\x29\x20\x7B\x9\xA\x9\x9\x70\x72\x69\x6E\x74\x66\x28\x22\x26\x6C\x74\x3B\x69\x6E\x70\x75\x74\x20"
"\x74\x79\x70\x65\x3D\x27\x63\x68\x65\x63\x6B\x62\x6F\x78\x27\x20\x6E\x61\x6D\x65\x3D\x27\x6E\x75\x6D\x62"
"\x65\x72\x27\x20\x76\x61\x6C\x75\x65\x3D\x27\x25\x73\x27\x26\x67\x74\x3B\x5C\x72\x5C\x6E\x26\x6C\x74\x3B"
"\x42\x52\x26\x67\x74\x3B\x22\x2C\x74\x78\x74\x5B\x69\x5D\x29\x3B\x9\xA\x9\x7D\x3B\xA\x9\x70\x72\x69"
"\x6E\x74\x66\x28\x22\x26\x6C\x74\x3B\x69\x6E\x70\x75\x74\x20\x74\x79\x70\x65\x3D\x27\x73\x75\x62\x6D\x69"
"\x74\x27\x20\x6E\x61\x6D\x65\x3D\x27\x73\x65\x6E\x64\x27\x20\x76\x61\x6C\x75\x65\x3D\x27\x20\x53\x45\x4E"
"\x44\x20\x27\x26\x67\x74\x3B\x5C\x72\x5C\x6E\x26\x6C\x74\x3B\x42\x52\x26\x67\x74\x3B\x22\x29\x3B\xA\x9"
"\x70\x72\x69\x6E\x74\x66\x28\x22\x26\x6C\x74\x3B\x2F\x66\x6F\x72\x6D\x26\x67\x74\x3B\x5C\x72\x5C\x6E\x22"
"\x29\x3B\xA\x9\xA\x9\x70\x72\x69\x6E\x74\x66\x28\x22\x59\x6F\x75\x20\x68\x61\x76\x65\x20\x63\x68\x6F"
"\x6F\x73\x65\x6E\x20\x26\x6C\x74\x3B\x66\x6F\x6E\x74\x20\x63\x6F\x6C\x6F\x72\x3D\x27\x46\x46\x30\x30\x30"
"\x30\x27\x26\x67\x74\x3B\x25\x64\x26\x6C\x74\x3B\x2F\x66\x6F\x6E\x74\x26\x67\x74\x3B\x20\x6E\x75\x6D\x62"
"\x65\x72\x73\x3A\x20\x5C\x72\x5C\x6E\x22\x2C\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x2D\x3E\x51\x75\x65"
"\x72\x79\x28\x22\x23\x6E\x75\x6D\x62\x65\x72\x22\x29\x29\x3B\xA\x9\x66\x6F\x72\x28\x69\x3D\x30\x3B\x69"
"\x26\x6C\x74\x3B\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x2D\x3E\x51\x75\x65\x72\x79\x28\x22\x23\x6E\x75"
"\x6D\x62\x65\x72\x22\x29\x3B\x69\x2B\x2B\x29\x20\x7B\x9\xA\x9\x9\x70\x72\x69\x6E\x74\x66\x28\x22\x26"
"\x6C\x74\x3B\x62\x3E\x25\x73\x26\x6C\x74\x3B\x2F\x62\x26\x67\x74\x3B\x2C\x5C\x72\x5C\x6E\x5C\x72\x5C\x6E"
"\x22\x2C\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x2D\x3E\x51\x75\x65\x72\x79\x28\x22\x6E\x75\x6D\x62\x65"
"\x72\x22\x29\x29\x3B\xA\x9\x7D\x3B\xA\x9\x70\x72\x69\x6E\x74\x66\x28\x22\x2E\x2E\x2E\x26\x6C\x74\x3B"
"\x42\x52\x26\x67\x74\x3B\x5C\x72\x5C\x6E\x5C\x72\x5C\x6E\x22\x29\x3B\xA\x9\xA\x7D\xA\x69\x6E\x74\x20"
"\x6D\x61\x69\x6E\x28\x69\x6E\x74\x20\x61\x72\x67\x63\x2C\x63\x68\x61\x72\x2A\x2A\x20\x61\x72\x67\x76\x29"
"\x20\x7B\xA\x20\x20\x20\x20\x20\x20\x20\x20\x73\x74\x72\x75\x63\x74\x20\x77\x65\x62\x5F\x73\x65\x72\x76"
"\x65\x72\x20\x73\x65\x72\x76\x65\x72\x3B\x20\x2F\x2F\x20\x73\x65\x72\x76\x65\x72\x20\x68\x61\x6E\x64\x6C"
"\x65\x72\xA\x20\x20\x20\x20\x20\x20\x20\x20\x69\x66\x28\x21\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F"
"\x69\x6E\x69\x74\x28\x26\x73\x65\x72\x76\x65\x72\x2C\x38\x30\x2C\x22\x68\x65\x6C\x70\x2E\x6C\x6F\x67\x22"
"\x2C\x30\x29\x29\x20\x7B\x20\x2F\x2F\x20\x69\x6E\x69\x74\x69\x61\x6C\x69\x7A\x65\xA\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x66\x70\x72\x69\x6E\x74\x66\x28\x73\x74\x64\x65\x72\x72\x2C"
"\x22\x63\x61\x6E\x27\x74\x20\x6F\x70\x65\x6E\x20\x6C\x69\x73\x74\x65\x6E\x20\x73\x6F\x63\x6B\x65\x74\x5C"
"\x6E\x22\x29\x3B\xA\x9\x9\x72\x65\x74\x75\x72\x6E\x20\x31\x3B\xA\x20\x20\x20\x20\x20\x20\x20\x20\x7D"
"\x3B\xA\xA\x20\x20\x20\x20\x20\x20\x20\x20\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x64\x64\x68"
"\x61\x6E\x64\x6C\x65\x72\x28\x26\x73\x65\x72\x76\x65\x72\x2C\x22\x2A\x20\x2F\x2A\x22\x2C\x63\x68\x65\x63"
"\x6B\x62\x6F\x78\x2C\x30\x29\x3B\x20\x2F\x2F\x20\x61\x64\x64\x20\x68\x61\x6E\x64\x6C\x65\x72\x20\x66\x6F"
"\x72\x20\x61\x6C\x6C\x20\x72\x65\x71\x75\x65\x73\x74\x73\xA\x20\x20\x20\x20\x20\x20\x20\x20\x77\x68\x69"
"\x6C\x65\x28\x31\x29\x20\x7B\xA\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x77\x65"
"\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x72\x75\x6E\x28\x26\x73\x65\x72\x76\x65\x72\x29\x3B\x20\x20\x20\x2F"
"\x2F\x20\x72\x75\x6E\x20\x73\x65\x72\x76\x65\x72\xA\x20\x20\x20\x20\x20\x20\x20\x20\x7D\x3B\xA\x7D\xA"
"\xA\x3C\x2F\x50\x52\x45\x3E\x3C\x2F\x43\x4F\x44\x45\x3E\xA\x3C\x2F\x54\x44\x3E\x3C\x2F\x54\x52\x3E\x3C"
"\x2F\x54\x41\x42\x4C\x45\x3E\xA\x3C\x48\x52\x3E\x3C\x42\x52\x3E\xA\xA\x3C\x41\x20\x6E\x61\x6D\x65\x3D"
"\x63\x6F\x6E\x66\x65\x78\x61\x6D\x70\x6C\x65\x3E\x3C\x42\x3E\x3C\x66\x6F\x6E\x74\x20\x63\x6F\x6C\x6F\x72"
"\x3D\x27\x30\x30\x30\x30\x37\x37\x27\x3E\x3C\x61\x20\x68\x72\x65\x66\x3D\x2F\x63\x6F\x6E\x66\x65\x78\x61"
"\x6D\x70\x6C\x65\x3E\x3C\x48\x33\x3E\x43\x6F\x6E\x66\x69\x67\x20\x65\x78\x61\x6D\x70\x6C\x65\x3C\x2F\x48"
"\x33\x3E\x3C\x2F\x61\x3E\x3C\x2F\x66\x6F\x6E\x74\x3E\x3C\x2F\x42\x3E\xA\x3C\x73\x6D\x61\x6C\x6C\x3E\x20"
"\x3C\x42\x3E\x75\x73\x65\x64\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x3B\x3C\x2F\x42\x3E\x3C\x42\x52\x3E"
"\xA\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73"
"\x23\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x69\x6E\x69\x74\x27\x3E\x77\x65\x62\x5F\x73\x65\x72\x76"
"\x65\x72\x5F\x69\x6E\x69\x74\x3C\x2F\x61\x3E\x3C\x42\x52\x3E\xA\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F"
"\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72"
"\x5F\x61\x64\x64\x68\x61\x6E\x64\x6C\x65\x72\x27\x3E\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x64"
"\x64\x68\x61\x6E\x64\x6C\x65\x72\x3C\x2F\x61\x3E\x3C\x42\x52\x3E\xA\x3C\x61\x20\x68\x72\x65\x66\x3D\x27"
"\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77\x65\x62\x5F\x73\x65\x72\x76\x65"
"\x72\x5F\x72\x75\x6E\x27\x3E\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x72\x75\x6E\x3C\x2F\x61\x3E\x3C"
"\x42\x52\x3E\xA\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69"
"\x6F\x6E\x73\x23\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x61\x64\x64\x66\x69\x6C\x65\x27\x3E\x77\x65"
"\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x61\x64\x64\x66\x69\x6C\x65\x3C\x2F\x61\x3E\x3C\x42\x52\x3E\xA\x3C"
"\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x63"
"\x6C\x69\x65\x6E\x74\x69\x6E\x66\x6F\x27\x3E\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x3C\x2F\x61\x3E\x3C"
"\x42\x52\x3E\xA\x3C\x2F\x73\x6D\x61\x6C\x6C\x3E\x3C\x42\x52\x3E\xA\xA\xA\x3C\x42\x52\x3E\x3C\x42\x52"
"\x3E\xA\x3C\x54\x41\x42\x4C\x45\x20\x77\x69\x64\x74\x68\x3D\x27\x31\x30\x30\x25\x27\x20\x62\x67\x63\x6F"
"\x6C\x6F\x72\x3D\x27\x43\x46\x43\x46\x43\x46\x27\x20\x62\x6F\x72\x64\x65\x72\x3D\x30\x3E\x3C\x54\x52\x3E"
"\x3C\x54\x44\x3E\xA\x3C\x43\x4F\x44\x45\x3E\x3C\x50\x52\x45\x3E\xA\x23\x69\x6E\x63\x6C\x75\x64\x65\x20"
"\x22\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x2E\x68\x22\xA\x23\x69\x6E\x63\x6C\x75\x64\x65\x20\x26\x6C"
"\x74\x3B\x73\x74\x64\x69\x6F\x2E\x68\x26\x67\x74\x3B\xA\xA\xA\x76\x6F\x69\x64\x20\x63\x6F\x6E\x66\x65"
"\x78\x61\x6D\x70\x6C\x65\x28\x29\x20\x7B\xA\x9\x70\x72\x69\x6E\x74\x66\x28\x22\x43\x6F\x6E\x74\x65\x6E"
"\x74\x2D\x74\x79\x70\x65\x3A\x20\x74\x65\x78\x74\x2F\x68\x74\x6D\x6C\x5C\x72\x5C\x6E\x5C\x72\x5C\x6E\x22"
"\x29\x3B\xA\x9\x70\x72\x69\x6E\x74\x66\x28\x22\x26\x6C\x74\x3B\x50\x52\x45\x26\x67\x74\x3B\x22\x29\x3B"
"\xA\x9\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x61\x64\x64\x66\x69\x6C\x65\x28\x73\x65\x72\x76\x65"
"\x72\x2E\x63\x6F\x6E\x66\x66\x69\x6C\x65\x29\x3B\x20\x2F\x2F\x20\x61\x64\x64\x20\x68\x65\x6C\x70\x2E\x63"
"\x66\x67\x20\x66\x69\x6C\x65\x20\x74\x6F\x20\x6F\x75\x74\x70\x75\x74\x9\xA\x9\x70\x72\x69\x6E\x74\x66"
"\x28\x22\x26\x6C\x74\x3B\x2F\x50\x52\x45\x26\x67\x74\x3B\x22\x29\x3B\xA\x9\x70\x72\x69\x6E\x74\x66\x28"
"\x22\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x2D\x3E\x43\x6F\x6E\x66\x28\x5C\x22\x50\x45\x52\x53\x4F\x4E"
"\x41\x4C\x5F\x43\x4F\x4E\x46\x5C\x22\x2C\x5C\x22\x50\x4F\x52\x54\x5C\x22\x29\x3D\x25\x73\x26\x6C\x74\x3B"
"\x42\x52\x26\x67\x74\x3B\x5C\x6E\x22\x2C\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x2D\x3E\x43\x6F\x6E\x66"
"\x28\x22\x50\x45\x52\x53\x4F\x4E\x41\x4C\x5F\x43\x4F\x4E\x46\x22\x2C\x22\x50\x4F\x52\x54\x22\x29\x29\x3B"
"\xA\x9\x70\x72\x69\x6E\x74\x66\x28\x22\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x2D\x3E\x43\x6F\x6E\x66"
"\x28\x5C\x22\x50\x45\x52\x53\x4F\x4E\x41\x4C\x5F\x43\x4F\x4E\x46\x5C\x22\x2C\x5C\x22\x49\x50\x5C\x22\x29"
"\x3D\x25\x73\x26\x6C\x74\x3B\x42\x52\x26\x67\x74\x3B\x5C\x6E\x22\x2C\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66"
"\x6F\x2D\x3E\x43\x6F\x6E\x66\x28\x22\x50\x45\x52\x53\x4F\x4E\x41\x4C\x5F\x43\x4F\x4E\x46\x22\x2C\x22\x49"
"\x50\x22\x29\x29\x3B\xA\x9\x70\x72\x69\x6E\x74\x66\x28\x22\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x2D"
"\x3E\x43\x6F\x6E\x66\x28\x5C\x22\x4C\x49\x42\x57\x45\x42\x53\x45\x52\x56\x45\x52\x5C\x22\x2C\x5C\x22\x50"
"\x4F\x52\x54\x5C\x22\x29\x3D\x25\x73\x26\x6C\x74\x3B\x42\x52\x26\x67\x74\x3B\x5C\x6E\x22\x2C\x43\x6C\x69"
"\x65\x6E\x74\x49\x6E\x66\x6F\x2D\x3E\x43\x6F\x6E\x66\x28\x22\x4C\x49\x42\x57\x45\x42\x53\x45\x52\x56\x45"
"\x52\x22\x2C\x22\x50\x4F\x52\x54\x22\x29\x29\x3B\xA\x9\xA\x7D\xA\xA\x69\x6E\x74\x20\x6D\x61\x69\x6E"
"\x28\x69\x6E\x74\x20\x61\x72\x67\x63\x2C\x63\x68\x61\x72\x2A\x2A\x20\x61\x72\x67\x76\x29\x20\x7B\xA\x20"
"\x20\x20\x20\x20\x20\x20\x20\x73\x74\x72\x75\x63\x74\x20\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x20\x73"
"\x65\x72\x76\x65\x72\x3B\x20\x2F\x2F\x20\x73\x65\x72\x76\x65\x72\x20\x68\x61\x6E\x64\x6C\x65\x72\xA\x20"
"\x20\x20\x20\x20\x20\x20\x20\x69\x66\x28\x21\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x69\x6E\x69\x74"
"\x28\x26\x73\x65\x72\x76\x65\x72\x2C\x38\x30\x2C\x22\x68\x65\x6C\x70\x2E\x63\x66\x67\x22\x2C\x57\x53\x5F"
"\x55\x53\x45\x45\x58\x54\x43\x4F\x4E\x46\x29\x29\x20\x7B\x20\x2F\x2F\x20\x69\x6E\x69\x74\x69\x61\x6C\x69"
"\x7A\x65\xA\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x66\x70\x72\x69\x6E\x74\x66"
"\x28\x73\x74\x64\x65\x72\x72\x2C\x22\x63\x61\x6E\x27\x74\x20\x6F\x70\x65\x6E\x20\x6C\x69\x73\x74\x65\x6E"
"\x20\x73\x6F\x63\x6B\x65\x74\x5C\x6E\x22\x29\x3B\xA\x9\x9\x72\x65\x74\x75\x72\x6E\x20\x31\x3B\xA\x20"
"\x20\x20\x20\x20\x20\x20\x20\x7D\x3B\xA\xA\x20\x20\x20\x20\x20\x20\x20\x20\x77\x65\x62\x5F\x73\x65\x72"
"\x76\x65\x72\x5F\x61\x64\x64\x68\x61\x6E\x64\x6C\x65\x72\x28\x26\x73\x65\x72\x76\x65\x72\x2C\x22\x2A\x20"
"\x2A\x22\x2C\x63\x6F\x6E\x66\x65\x78\x61\x6D\x70\x6C\x65\x2C\x30\x29\x3B\x20\x2F\x2F\x20\x61\x64\x64\x20"
"\x68\x61\x6E\x64\x6C\x65\x72\x20\x66\x6F\x72\x20\x61\x6C\x6C\x20\x72\x65\x71\x75\x65\x73\x74\x73\xA\x20"
"\x20\x20\x20\x20\x20\x20\x20\x77\x68\x69\x6C\x65\x28\x31\x29\x20\x7B\xA\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x72\x75\x6E\x28\x26\x73\x65"
"\x72\x76\x65\x72\x29\x3B\x20\x20\x20\x2F\x2F\x20\x72\x75\x6E\x20\x73\x65\x72\x76\x65\x72\xA\x20\x20\x20"
"\x20\x20\x20\x20\x20\x7D\x3B\xA\x7D\xA\x3C\x2F\x50\x52\x45\x3E\x3C\x2F\x43\x4F\x44\x45\x3E\xA\x3C\x2F"
"\x54\x44\x3E\x3C\x2F\x54\x52\x3E\x3C\x2F\x54\x41\x42\x4C\x45\x3E";
#endif
+800
View File
@@ -0,0 +1,800 @@
/*
* by data2header by Luis Figueiredo (stdio@netc.pt)
*/
#ifndef _FUNCTIONS_H_
#define _FUNCTIONS_H_
char functions[]="\x3C\x63\x65\x6E\x74\x65\x72\x3E\x3C\x48\x33\x3E\x3C\x66\x6F\x6E\x74\x20\x63\x6F\x6C\x6F\x72\x3D\x27"
"\x30\x30\x37\x37\x30\x30\x27\x3E\x6C\x69\x62\x77\x65\x62\x73\x65\x72\x76\x65\x72\x20\x46\x75\x6E\x63\x74"
"\x69\x6F\x6E\x73\x3C\x2F\x66\x6F\x6E\x74\x3E\x3C\x2F\x48\x33\x3E\x3C\x2F\x63\x65\x6E\x74\x65\x72\x3E\x3C"
"\x42\x52\x3E\x3C\x42\x52\x3E\xA\x3C\x66\x6F\x6E\x74\x20\x66\x61\x63\x65\x3D\x27\x56\x65\x72\x64\x61\x6E"
"\x61\x27\x3E\xA\xA\x3C\x41\x20\x6E\x61\x6D\x65\x3D\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x69\x6E"
"\x69\x74\x3E\x3C\x42\x3E\x3C\x66\x6F\x6E\x74\x20\x63\x6F\x6C\x6F\x72\x3D\x27\x30\x30\x30\x30\x37\x37\x27"
"\x3E\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x69\x6E\x69\x74\x28\x29\x3C\x2F\x66\x6F\x6E\x74\x3E\x3C"
"\x2F\x42\x3E\x3C\x42\x52\x3E\x3C\x42\x52\x3E\xA\x3C\x42\x3E\x4E\x41\x4D\x45\x3C\x2F\x42\x3E\xA\x3C\x55"
"\x4C\x3E\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x69\x6E\x69\x74\x20\x2D\x20\x49\x6E\x69\x74\x69\x61"
"\x6C\x69\x7A\x65\x20\x77\x65\x62\x73\x65\x72\x76\x65\x72\x3C\x2F\x55\x4C\x3E\xA\x3C\x42\x3E\x53\x59\x4E"
"\x4F\x50\x53\x49\x53\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x23\x69\x6E\x63\x6C\x75\x64\x65\x20\x22\x77\x65"
"\x62\x5F\x73\x65\x72\x76\x65\x72\x2E\x68\x22\x3C\x42\x52\x3E\x3C\x42\x52\x3E\x69\x6E\x74\x20\x77\x65\x62"
"\x5F\x73\x65\x72\x76\x65\x72\x5F\x69\x6E\x69\x74\x28\x73\x74\x72\x75\x63\x74\x20\x77\x65\x62\x5F\x73\x65"
"\x72\x76\x65\x72\x20\x2A\x3C\x55\x3E\x73\x65\x72\x76\x65\x72\x3C\x2F\x55\x3E\x2C\x20\x69\x6E\x74\x20\x3C"
"\x55\x3E\x70\x6F\x72\x74\x3C\x2F\x55\x3E\x2C\x20\x63\x6F\x6E\x73\x74\x20\x63\x68\x61\x72\x20\x2A\x3C\x55"
"\x3E\x6C\x6F\x67\x66\x69\x6C\x65\x3C\x2F\x55\x3E\x2C\x20\x69\x6E\x74\x20\x3C\x55\x3E\x66\x6C\x61\x67\x73"
"\x3C\x2F\x55\x3E\x29\x3B\x3C\x2F\x55\x4C\x3E\xA\x3C\x42\x3E\x44\x45\x53\x43\x52\x49\x50\x54\x49\x4F\x4E"
"\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x54\x68\x65\x20\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x69\x6E"
"\x69\x74\x28\x29\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x20\x69\x6E\x69\x74\x69\x61\x6C\x69\x7A\x65\x73\x20"
"\x74\x68\x65\x20\x73\x65\x72\x76\x65\x72\x20\x68\x61\x6E\x64\x6C\x65\x72\x20\x3C\x55\x3E\x73\x65\x72\x76"
"\x65\x72\x3C\x2F\x55\x3E\x2C\x20\x73\x74\x61\x72\x74\x20\x61\x20\x6C\x69\x73\x74\x65\x6E\x20\x73\x6F\x63"
"\x6B\x65\x74\x20\x61\x74\x20\x70\x6F\x72\x74\x20\x3C\x55\x3E\x70\x6F\x72\x74\x3C\x2F\x55\x3E\x2C\x20\x77"
"\x69\x74\x68\x20\x74\x68\x65\x20\x6C\x6F\x67\x66\x69\x6C\x65\x20\x3C\x55\x3E\x6C\x6F\x67\x66\x69\x6C\x65"
"\x3C\x2F\x55\x3E\x20\x74\x6F\x20\x70\x72\x6F\x64\x75\x63\x65\x20\x74\x68\x65\x20\x77\x65\x62\x73\x65\x72"
"\x76\x65\x72\x20\x6C\x6F\x67\x3C\x42\x52\x3E\x20\x69\x66\x20\x57\x53\x5F\x55\x53\x45\x45\x58\x54\x43\x4F"
"\x4E\x46\x20\x66\x6C\x61\x67\x20\x69\x73\x20\x75\x73\x65\x64\x2C\x20\x74\x68\x65\x20\x3C\x55\x3E\x6C\x6F"
"\x67\x66\x69\x6C\x65\x3C\x2F\x55\x3E\x20\x77\x69\x6C\x6C\x20\x62\x65\x20\x74\x68\x65\x20\x63\x6F\x6E\x66"
"\x69\x67\x20\x66\x69\x6C\x65\x20\x3C\x42\x52\x3E\xA\x3C\x55\x3E\x66\x6C\x61\x67\x73\x3C\x2F\x55\x3E\x20"
"\x3C\x42\x52\x3E\xA\x57\x53\x5F\x55\x53\x45\x53\x53\x4C\x20\x66\x6F\x72\x20\x6F\x70\x65\x6E\x73\x73\x6C"
"\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x20\x28\x68\x74\x74\x70\x73\x20\x73\x75\x70\x70\x6F\x72"
"\x74\x29\x3C\x42\x52\x3E\xA\x57\x53\x5F\x55\x53\x45\x45\x58\x54\x43\x4F\x4E\x46\x20\x66\x6F\x72\x20\x75"
"\x73\x69\x6E\x67\x20\x61\x20\x65\x78\x74\x65\x72\x6E\x61\x6C\x20\x63\x6F\x6E\x66\x69\x67\x20\x66\x69\x6C"
"\x65\x3C\x42\x52\x3E\xA\x57\x53\x5F\x4C\x4F\x43\x41\x4C\x20\x6F\x6E\x6C\x79\x20\x61\x63\x63\x65\x70\x74"
"\x73\x20\x31\x32\x37\x2E\x30\x2E\x30\x2E\x31\x20\x28\x6C\x6F\x63\x61\x6C\x29\x20\x63\x6F\x6E\x6E\x65\x63"
"\x74\x69\x6F\x6E\x73\xA\x3C\x2F\x55\x4C\x3E\xA\xA\x3C\x42\x3E\x52\x45\x54\x55\x52\x4E\x20\x56\x41\x4C"
"\x55\x45\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x4F\x6E\x20\x73\x75\x63\x63\x65\x73\x73\x2C\x20\x31\x20\x69"
"\x73\x20\x72\x65\x74\x75\x72\x6E\x65\x64\x2C\x20\x4F\x6E\x20\x65\x72\x72\x6F\x72\x2C\x20\x30\x20\x69\x73"
"\x20\x72\x65\x74\x75\x72\x6E\x65\x64\x3C\x2F\x55\x4C\x3E\xA\x3C\x48\x52\x3E\x3C\x42\x52\x3E\xA\x20\xA"
"\xA\x3C\x41\x20\x6E\x61\x6D\x65\x3D\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x64\x64\x68\x61\x6E"
"\x64\x6C\x65\x72\x3E\x3C\x42\x3E\x3C\x66\x6F\x6E\x74\x20\x63\x6F\x6C\x6F\x72\x3D\x27\x30\x30\x30\x30\x37"
"\x37\x27\x3E\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x64\x64\x68\x61\x6E\x64\x6C\x65\x72\x28\x29"
"\x3C\x2F\x66\x6F\x6E\x74\x3E\x3C\x2F\x42\x3E\x3C\x42\x52\x3E\x3C\x42\x52\x3E\xA\x3C\x42\x3E\x4E\x41\x4D"
"\x45\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x64\x64\x68\x61"
"\x6E\x64\x6C\x65\x72\x20\x2D\x20\x61\x64\x64\x73\x20\x61\x20\x72\x65\x71\x75\x65\x73\x74\x20\x68\x61\x6E"
"\x64\x6C\x65\x72\x3C\x2F\x55\x4C\x3E\xA\x3C\x42\x3E\x53\x59\x4E\x4F\x50\x53\x49\x53\x3C\x2F\x42\x3E\xA"
"\x3C\x55\x4C\x3E\x23\x69\x6E\x63\x6C\x75\x64\x65\x20\x22\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x2E\x68"
"\x22\x3C\x42\x52\x3E\x3C\x42\x52\x3E\x69\x6E\x74\x20\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x64"
"\x64\x68\x61\x6E\x64\x6C\x65\x72\x28\x73\x74\x72\x75\x63\x74\x20\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72"
"\x20\x2A\x3C\x55\x3E\x73\x65\x72\x76\x65\x72\x3C\x2F\x55\x3E\x2C\x20\x63\x6F\x6E\x73\x74\x20\x63\x68\x61"
"\x72\x20\x2A\x3C\x55\x3E\x6D\x73\x74\x72\x3C\x2F\x55\x3E\x2C\x20\x76\x6F\x69\x64\x20\x28\x2A\x3C\x55\x3E"
"\x66\x75\x6E\x63\x3C\x2F\x55\x3E\x29\x28\x29\x2C\x20\x69\x6E\x74\x20\x3C\x55\x3E\x66\x6C\x61\x67\x73\x3C"
"\x2F\x55\x3E\x29\x3B\x3C\x2F\x55\x4C\x3E\xA\x3C\x42\x3E\x44\x45\x53\x43\x52\x49\x50\x54\x49\x4F\x4E\x3C"
"\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x54\x68\x65\x20\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x64\x64"
"\x68\x61\x6E\x64\x6C\x65\x72\x28\x29\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x20\x61\x64\x64\x73\x20\x61\x20"
"\x72\x65\x71\x75\x65\x73\x74\x20\x68\x61\x6E\x64\x6C\x65\x72\x20\x3C\x55\x3E\x6D\x73\x74\x72\x3C\x2F\x55"
"\x3E\x20\x74\x6F\x20\x74\x68\x65\x20\x73\x65\x72\x76\x65\x72\x20\x68\x61\x6E\x64\x6C\x65\x72\x20\x3C\x55"
"\x3E\x73\x65\x72\x76\x65\x72\x3C\x2F\x55\x3E\x20\x74\x68\x72\x6F\x75\x67\x68\x20\x74\x68\x65\x20\x66\x75"
"\x6E\x63\x74\x69\x6F\x6E\x20\x3C\x55\x3E\x66\x75\x6E\x63\x3C\x2F\x55\x3E\x2E\x3C\x42\x52\x3E\xA\x3C\x55"
"\x3E\x6D\x73\x74\x72\x3C\x2F\x55\x3E\x20\x69\x73\x20\x61\x20\x73\x74\x72\x69\x6E\x67\x20\x63\x6F\x6E\x74"
"\x61\x69\x6E\x69\x6E\x67\x20\x65\x78\x70\x72\x65\x73\x73\x69\x6F\x6E\x73\x20\x28\x61\x73\x20\x6D\x61\x74"
"\x63\x68\x69\x6E\x67\x20\x66\x69\x6C\x65\x73\x29\x20\x74\x6F\x20\x6D\x61\x74\x63\x68\x20\x77\x69\x74\x68"
"\x20\x74\x68\x65\x20\x63\x6C\x69\x65\x6E\x74\x20\x72\x65\x71\x75\x65\x73\x74\x20\x28\x47\x45\x54\x20\x2F"
"\x3C\x42\x3E\x62\x6C\x61\x68\x2E\x68\x74\x6D\x6C\x3C\x2F\x42\x3E\x3F\x69\x64\x3D\x31\x20\x48\x54\x54\x50"
"\x2F\x31\x2E\x30\x2C\x20\x77\x69\x6C\x6C\x20\x62\x65\x20\x6D\x61\x74\x63\x68\x65\x64\x20\x62\x79\x20\x3C"
"\x55\x3E\x6D\x73\x74\x72\x3C\x2F\x55\x3E\x3D\x22\x2A\x20\x2F\x62\x6C\x61\x68\x2E\x68\x74\x6D\x6C\x22\x29"
"\x3C\x42\x52\x3E\xA\x3C\x55\x3E\x66\x6C\x61\x67\x73\x3A\x3C\x2F\x55\x3E\x20\x3C\x42\x52\x3E\xA\x57\x53"
"\x5F\x4C\x4F\x43\x41\x4C\x20\x2D\x20\x6F\x6E\x6C\x79\x20\x6C\x6F\x63\x61\x6C\x20\x63\x6F\x6E\x6E\x65\x63"
"\x74\x69\x6F\x6E\x73\x20\x61\x72\x65\x20\x68\x61\x6E\x64\x6C\x65\x64\x3C\x42\x52\x3E\xA\x57\x53\x5F\x44"
"\x59\x4E\x56\x41\x52\x20\x2D\x20\x74\x72\x65\x61\x74\x20\x64\x79\x6E\x61\x6D\x69\x63\x20\x76\x61\x72\x69"
"\x61\x62\x6C\x65\x73\x20\x6F\x6E\x20\x6F\x75\x74\x70\x75\x74\x20\x28\x41\x74\x65\x6E\x74\x69\x6F\x6E\x3A"
"\x20\x74\x68\x69\x73\x20\x64\x69\x73\x61\x62\x6C\x65\x73\x20\x22\x43\x6F\x6E\x74\x65\x6E\x74\x2D\x72\x61"
"\x6E\x67\x65\x22\x20\x61\x6E\x64\x20\x22\x43\x6F\x6E\x74\x65\x6E\x74\x2D\x6C\x65\x6E\x67\x74\x68\x22\x20"
"\x68\x65\x61\x64\x65\x72\x2C\x20\x72\x65\x73\x70\x6F\x6E\x64\x69\x6E\x67\x20\x22\x35\x30\x31\x20\x6E\x6F"
"\x74\x20\x69\x6D\x70\x6C\x65\x6D\x65\x6E\x74\x65\x64\x22\x29\x3C\x42\x52\x3E\xA\x57\x53\x5F\x55\x53\x45"
"\x4C\x45\x4E\x20\x2D\x20\x57\x69\x74\x68\x20\x74\x68\x69\x73\x20\x66\x6C\x61\x67\x2C\x20\x6C\x69\x62\x72"
"\x61\x72\x79\x20\x63\x61\x6C\x63\x75\x6C\x61\x74\x65\x20\x74\x68\x65\x20\x68\x65\x61\x64\x65\x72\x20\x22"
"\x43\x6F\x6E\x74\x65\x6E\x74\x2D\x6C\x65\x6E\x67\x74\x68\x22\x20\x61\x6E\x64\x20\x22\x43\x6F\x6E\x74\x65"
"\x6E\x74\x2D\x72\x61\x6E\x67\x65\x22\x20\x69\x74\x20\x73\x65\x6C\x66\x2C\x20\x75\x73\x65\x66\x75\x6C\x20"
"\x66\x6F\x72\x20\x72\x65\x73\x75\x6D\x69\x6E\x67\x2C\x20\x63\x6F\x6E\x74\x65\x6E\x74\x2D\x6C\x65\x6E\x67"
"\x74\x68\x20\x63\x61\x6E\x20\x62\x65\x20\x6D\x69\x73\x63\x61\x6C\x63\x75\x6C\x61\x74\x65\x64\x20\x69\x66"
"\x20\x74\x68\x65\x20\x66\x69\x6C\x65\x20\x61\x64\x64\x65\x64\x20\x62\x79\x20\x28\x77\x65\x62\x5F\x63\x6C"
"\x69\x65\x6E\x74\x5F\x61\x64\x64\x66\x69\x6C\x65\x29\x20\x63\x68\x61\x6E\x67\x65\x73\x20\x74\x68\x65\x20"
"\x73\x69\x7A\x65\x20\x6F\x66\x20\x63\x6F\x6E\x74\x65\x6E\x74\x73\x2C\x20\x62\x65\x74\x77\x65\x65\x6E\x20"
"\x63\x61\x6C\x63\x75\x6C\x61\x74\x69\x6E\x67\x20\x61\x6E\x64\x20\x6F\x75\x74\x70\x75\x74\x3C\x42\x52\x3E"
"\xA\x3C\x2F\x55\x4C\x3E\xA\x3C\x42\x3E\x52\x45\x54\x55\x52\x4E\x20\x56\x41\x4C\x55\x45\x3C\x2F\x42\x3E"
"\xA\x3C\x55\x4C\x3E\x4F\x6E\x20\x73\x75\x63\x63\x65\x73\x73\x2C\x20\x31\x20\x69\x73\x20\x72\x65\x74\x75"
"\x72\x6E\x65\x64\x2C\x20\x4F\x6E\x20\x65\x72\x72\x6F\x72\x2C\x20\x30\x20\x69\x73\x20\x72\x65\x74\x75\x72"
"\x6E\x65\x64\x3C\x2F\x55\x4C\x3E\xA\x3C\x48\x52\x3E\x3C\x42\x52\x3E\xA\xA\x3C\x41\x20\x6E\x61\x6D\x65"
"\x3D\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x6C\x69\x61\x73\x64\x69\x72\x3E\x3C\x42\x3E\x3C\x66"
"\x6F\x6E\x74\x20\x63\x6F\x6C\x6F\x72\x3D\x27\x30\x30\x30\x30\x37\x37\x27\x3E\x77\x65\x62\x5F\x73\x65\x72"
"\x76\x65\x72\x5F\x61\x6C\x69\x61\x73\x64\x69\x72\x28\x29\x3C\x2F\x66\x6F\x6E\x74\x3E\x3C\x2F\x42\x3E\x3C"
"\x42\x52\x3E\x3C\x42\x52\x3E\xA\x3C\x42\x3E\x4E\x41\x4D\x45\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x77\x65"
"\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x6C\x69\x61\x73\x64\x69\x72\x20\x2D\x20\x47\x65\x6E\x65\x72\x61"
"\x74\x65\x73\x20\x61\x20\x64\x69\x72\x65\x63\x74\x6F\x72\x79\x20\x6C\x69\x73\x74\x2C\x20\x61\x6E\x64\x20"
"\x75\x73\x65\x20\x66\x69\x6C\x65\x20\x62\x61\x73\x65\x64\x20\x73\x65\x72\x76\x65\x72\x3C\x2F\x55\x4C\x3E"
"\xA\x3C\x42\x3E\x53\x59\x4E\x4F\x50\x53\x49\x53\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x23\x69\x6E\x63\x6C"
"\x75\x64\x65\x20\x22\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x2E\x68\x22\x3C\x42\x52\x3E\x3C\x42\x52\x3E"
"\x69\x6E\x74\x20\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x6C\x69\x61\x73\x64\x69\x72\x28\x73\x74"
"\x72\x75\x63\x74\x20\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x20\x2A\x3C\x55\x3E\x73\x65\x72\x76\x65\x72"
"\x3C\x2F\x55\x3E\x2C\x20\x63\x6F\x6E\x73\x74\x20\x63\x68\x61\x72\x20\x2A\x3C\x55\x3E\x61\x6C\x69\x61\x73"
"\x3C\x2F\x55\x3E\x2C\x20\x63\x68\x61\x72\x20\x2A\x3C\x55\x3E\x70\x61\x74\x68\x3C\x2F\x55\x3E\x2C\x20\x69"
"\x6E\x74\x20\x3C\x55\x3E\x66\x6C\x61\x67\x73\x3C\x2F\x55\x3E\x29\x3B\x3C\x2F\x55\x4C\x3E\xA\x3C\x42\x3E"
"\x44\x45\x53\x43\x52\x49\x50\x54\x49\x4F\x4E\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x54\x68\x65\x20\x77\x65"
"\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x6C\x69\x61\x73\x64\x69\x72\x28\x29\x20\x66\x75\x6E\x63\x74\x69"
"\x6F\x6E\x20\x61\x64\x64\x73\x20\x61\x6E\x20\x61\x6C\x69\x61\x73\x20\x3C\x55\x3E\x61\x6C\x69\x61\x73\x3C"
"\x2F\x55\x3E\x20\x74\x6F\x20\x74\x68\x65\x20\x73\x65\x72\x76\x65\x72\x20\x68\x61\x6E\x64\x6C\x65\x72\x20"
"\x3C\x55\x3E\x73\x65\x72\x76\x65\x72\x3C\x2F\x55\x3E\x20\x61\x6E\x64\x20\x75\x73\x65\x20\x66\x69\x6C\x65"
"\x73\x20\x66\x72\x6F\x6D\x20\x3C\x55\x3E\x70\x61\x74\x68\x3C\x2F\x55\x3E\x2E\x3C\x42\x52\x3E\xA\x3C\x55"
"\x3E\x66\x6C\x61\x67\x73\x3A\x3C\x2F\x55\x3E\x20\x3C\x42\x52\x3E\xA\x57\x53\x5F\x4C\x4F\x43\x41\x4C\x20"
"\x2D\x20\x6F\x6E\x6C\x79\x20\x6C\x6F\x63\x61\x6C\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x20\x61"
"\x72\x65\x20\x68\x61\x6E\x64\x6C\x65\x64\x3C\x42\x52\x3E\xA\x57\x53\x5F\x44\x59\x4E\x56\x41\x52\x20\x2D"
"\x20\x74\x72\x65\x61\x74\x20\x64\x79\x6E\x61\x6D\x69\x63\x20\x76\x61\x72\x69\x61\x62\x6C\x65\x73\x20\x6F"
"\x6E\x20\x6F\x75\x74\x70\x75\x74\x20\x28\x41\x74\x65\x6E\x74\x69\x6F\x6E\x3A\x20\x74\x68\x69\x73\x20\x64"
"\x69\x73\x61\x62\x6C\x65\x73\x20\x22\x43\x6F\x6E\x74\x65\x6E\x74\x2D\x72\x61\x6E\x67\x65\x22\x20\x61\x6E"
"\x64\x20\x22\x43\x6F\x6E\x74\x65\x6E\x74\x2D\x6C\x65\x6E\x67\x74\x68\x22\x20\x68\x65\x61\x64\x65\x72\x2C"
"\x20\x72\x65\x73\x70\x6F\x6E\x64\x69\x6E\x67\x20\x22\x35\x30\x31\x20\x6E\x6F\x74\x20\x69\x6D\x70\x6C\x65"
"\x6D\x65\x6E\x74\x65\x64\x22\x29\x3C\x42\x52\x3E\xA\x57\x53\x5F\x55\x53\x45\x4C\x45\x4E\x20\x2D\x20\x57"
"\x69\x74\x68\x20\x74\x68\x69\x73\x20\x66\x6C\x61\x67\x2C\x20\x6C\x69\x62\x72\x61\x72\x79\x20\x63\x61\x6C"
"\x63\x75\x6C\x61\x74\x65\x20\x74\x68\x65\x20\x68\x65\x61\x64\x65\x72\x20\x22\x43\x6F\x6E\x74\x65\x6E\x74"
"\x2D\x6C\x65\x6E\x67\x74\x68\x22\x20\x61\x6E\x64\x20\x22\x43\x6F\x6E\x74\x65\x6E\x74\x2D\x72\x61\x6E\x67"
"\x65\x22\x20\x69\x74\x20\x73\x65\x6C\x66\x2C\x20\x75\x73\x65\x66\x75\x6C\x20\x66\x6F\x72\x20\x72\x65\x73"
"\x75\x6D\x69\x6E\x67\x2C\x20\x63\x6F\x6E\x74\x65\x6E\x74\x2D\x6C\x65\x6E\x67\x74\x68\x20\x63\x61\x6E\x20"
"\x62\x65\x20\x6D\x69\x73\x63\x61\x6C\x63\x75\x6C\x61\x74\x65\x64\x20\x69\x66\x20\x74\x68\x65\x20\x66\x69"
"\x6C\x65\x20\x61\x64\x64\x65\x64\x20\x62\x79\x20\x28\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x61\x64"
"\x64\x66\x69\x6C\x65\x29\x20\x63\x68\x61\x6E\x67\x65\x73\x20\x74\x68\x65\x20\x73\x69\x7A\x65\x20\x6F\x66"
"\x20\x63\x6F\x6E\x74\x65\x6E\x74\x73\x2C\x20\x62\x65\x74\x77\x65\x65\x6E\x20\x63\x61\x6C\x63\x75\x6C\x61"
"\x74\x69\x6E\x67\x20\x61\x6E\x64\x20\x6F\x75\x74\x70\x75\x74\x3C\x42\x52\x3E\xA\x3C\x2F\x55\x4C\x3E\xA"
"\x3C\x42\x3E\x52\x45\x54\x55\x52\x4E\x20\x56\x41\x4C\x55\x45\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x4F\x6E"
"\x20\x73\x75\x63\x63\x65\x73\x73\x2C\x20\x31\x20\x69\x73\x20\x72\x65\x74\x75\x72\x6E\x65\x64\x2C\x20\x4F"
"\x6E\x20\x65\x72\x72\x6F\x72\x2C\x20\x30\x20\x69\x73\x20\x72\x65\x74\x75\x72\x6E\x65\x64\x3C\x2F\x55\x4C"
"\x3E\xA\x3C\x48\x52\x3E\x3C\x42\x52\x3E\xA\xA\x3C\x41\x20\x6E\x61\x6D\x65\x3D\x77\x65\x62\x5F\x73\x65"
"\x72\x76\x65\x72\x5F\x72\x75\x6E\x3E\x3C\x42\x3E\x3C\x66\x6F\x6E\x74\x20\x63\x6F\x6C\x6F\x72\x3D\x27\x30"
"\x30\x30\x30\x37\x37\x27\x3E\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x72\x75\x6E\x28\x29\x3C\x2F\x66"
"\x6F\x6E\x74\x3E\x3C\x2F\x42\x3E\x3C\x42\x52\x3E\x3C\x42\x52\x3E\xA\x3C\x42\x3E\x4E\x41\x4D\x45\x3C\x2F"
"\x42\x3E\xA\x3C\x55\x4C\x3E\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x72\x75\x6E\x20\x2D\x20\x72\x75"
"\x6E\x20\x74\x68\x65\x20\x73\x65\x72\x76\x65\x72\x3C\x2F\x55\x4C\x3E\xA\x3C\x42\x3E\x53\x59\x4E\x4F\x50"
"\x53\x49\x53\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x23\x69\x6E\x63\x6C\x75\x64\x65\x20\x22\x77\x65\x62\x5F"
"\x73\x65\x72\x76\x65\x72\x2E\x68\x22\x3C\x42\x52\x3E\x3C\x42\x52\x3E\x69\x6E\x74\x20\x77\x65\x62\x5F\x73"
"\x65\x72\x76\x65\x72\x5F\x72\x75\x6E\x28\x73\x74\x72\x75\x63\x74\x20\x77\x65\x62\x5F\x73\x65\x72\x76\x65"
"\x72\x20\x2A\x3C\x55\x3E\x73\x65\x72\x76\x65\x72\x3C\x2F\x55\x3E\x29\x3B\x3C\x2F\x55\x4C\x3E\xA\x3C\x42"
"\x3E\x44\x45\x53\x43\x52\x49\x50\x54\x49\x4F\x4E\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x54\x68\x65\x20\x77"
"\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x72\x75\x6E\x28\x29\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x20\x70"
"\x72\x6F\x63\x65\x73\x73\x65\x73\x20\x72\x65\x71\x75\x65\x73\x74\x73\x20\x74\x6F\x20\x74\x68\x65\x20\x73"
"\x65\x72\x76\x65\x72\x20\x3C\x55\x3E\x73\x65\x72\x76\x65\x72\x3C\x2F\x55\x3E\x2E\x20\x54\x68\x69\x73\x20"
"\x66\x75\x6E\x63\x74\x69\x6F\x6E\x20\x6D\x75\x73\x74\x20\x62\x65\x20\x63\x61\x6C\x6C\x65\x64\x20\x66\x72"
"\x6F\x6D\x20\x74\x68\x65\x20\x6D\x61\x69\x6E\x20\x61\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x20\x6C\x6F"
"\x6F\x70\x20\x28\x74\x68\x65\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x20\x64\x6F\x65\x73\x6E\x27\x74\x20"
"\x6C\x6F\x6F\x70\x20\x69\x74\x20\x73\x65\x6C\x66\x29\x3C\x2F\x55\x4C\x3E\xA\x3C\x42\x3E\x52\x45\x54\x55"
"\x52\x4E\x20\x56\x41\x4C\x55\x45\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x4F\x6E\x20\x73\x75\x63\x63\x65\x73"
"\x73\x2C\x20\x67\x72\x65\x61\x74\x65\x72\x20\x74\x68\x61\x6E\x20\x30\x2C\x20\x69\x73\x20\x72\x65\x74\x75"
"\x72\x6E\x65\x64\x20\x28\x32\x20\x69\x66\x20\x74\x68\x65\x72\x65\x20\x77\x61\x73\x6E\x27\x74\x20\x63\x6C"
"\x69\x65\x6E\x74\x2C\x20\x31\x20\x69\x66\x20\x73\x6F\x6D\x65\x20\x72\x65\x71\x75\x65\x73\x74\x20\x77\x61"
"\x73\x20\x70\x72\x6F\x63\x65\x73\x73\x65\x64\x29\x2C\x20\x4F\x6E\x20\x65\x72\x72\x6F\x72\x2C\x20\x30\x20"
"\x69\x73\x20\x72\x65\x74\x75\x72\x6E\x65\x64\x3C\x2F\x55\x4C\x3E\xA\x3C\x48\x52\x3E\x3C\x42\x52\x3E\xA"
"\xA\x3C\x41\x20\x6E\x61\x6D\x65\x3D\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x67\x65\x74\x63\x6F\x6E"
"\x66\x3E\x3C\x42\x3E\x3C\x66\x6F\x6E\x74\x20\x63\x6F\x6C\x6F\x72\x3D\x27\x30\x30\x30\x30\x37\x37\x27\x3E"
"\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x67\x65\x74\x63\x6F\x6E\x66\x28\x29\x3C\x2F\x66\x6F\x6E\x74"
"\x3E\x3C\x2F\x42\x3E\x3C\x42\x52\x3E\x3C\x42\x52\x3E\xA\x3C\x42\x3E\x4E\x41\x4D\x45\x3C\x2F\x42\x3E\xA"
"\x3C\x55\x4C\x3E\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x67\x65\x74\x63\x6F\x6E\x66\x20\x2D\x20\x67"
"\x65\x74\x20\x64\x61\x74\x61\x20\x66\x72\x6F\x6D\x20\x63\x6F\x6E\x66\x69\x67\x20\x66\x69\x6C\x65\x72\x3C"
"\x2F\x55\x4C\x3E\xA\x3C\x42\x3E\x53\x59\x4E\x4F\x50\x53\x49\x53\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x23"
"\x69\x6E\x63\x6C\x75\x64\x65\x20\x22\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x2E\x68\x22\x3C\x42\x52\x3E"
"\x3C\x42\x52\x3E\x63\x68\x61\x72\x20\x2A\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x67\x65\x74\x63\x6F"
"\x6E\x66\x28\x73\x74\x72\x75\x63\x74\x20\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x20\x2A\x3C\x55\x3E\x73"
"\x65\x72\x76\x65\x72\x3C\x2F\x55\x3E\x2C\x63\x68\x61\x72\x20\x2A\x3C\x55\x3E\x74\x6F\x70\x69\x63\x3C\x2F"
"\x55\x3E\x2C\x63\x68\x61\x72\x20\x2A\x3C\x55\x3E\x6B\x65\x79\x3C\x2F\x55\x3E\x29\x3B\x3C\x2F\x55\x4C\x3E"
"\xA\x3C\x42\x3E\x44\x45\x53\x43\x52\x49\x50\x54\x49\x4F\x4E\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x54\x68"
"\x65\x20\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x67\x65\x74\x63\x6F\x6E\x66\x28\x29\x20\x66\x75\x6E"
"\x63\x74\x69\x6F\x6E\x20\x61\x6C\x6C\x6F\x63\x61\x74\x65\x73\x20\x61\x6E\x64\x20\x72\x65\x74\x75\x72\x6E"
"\x20\x61\x20\x73\x74\x72\x69\x6E\x67\x20\x66\x72\x6F\x6D\x20\x63\x6F\x6E\x66\x69\x67\x20\x66\x69\x6C\x65"
"\x20\x72\x65\x6C\x61\x74\x65\x64\x20\x74\x6F\x20\x3C\x55\x3E\x74\x6F\x70\x69\x63\x3C\x2F\x55\x3E\x20\x61"
"\x6E\x64\x20\x3C\x55\x3E\x6B\x65\x79\x3C\x2F\x55\x3E\x20\x28\x73\x65\x65\x20\x3C\x61\x20\x68\x72\x65\x66"
"\x3D\x22\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x63\x6F\x6E\x66\x69\x67\x66"
"\x69\x6C\x65\x22\x3E\x63\x6F\x6E\x66\x69\x67\x20\x66\x69\x6C\x65\x20\x68\x65\x6C\x70\x3C\x2F\x61\x3E\x29"
"\x20\x54\x68\x69\x73\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x20\x6D\x75\x73\x74\x20\x62\x65\x20\x63\x61\x6C"
"\x6C\x65\x64\x20\x61\x66\x74\x65\x72\x20\x74\x68\x65\x20\x69\x6E\x69\x74\x20\x6F\x66\x20\x74\x68\x65\x20"
"\x76\x61\x72\x20\x3C\x55\x3E\x73\x65\x72\x76\x65\x72\x3C\x2F\x55\x3E\x3C\x2F\x55\x4C\x3E\xA\x3C\x42\x3E"
"\x52\x45\x54\x55\x52\x4E\x20\x56\x41\x4C\x55\x45\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x72\x65\x74\x75\x72"
"\x6E\x73\x20\x61\x6C\x6C\x6F\x63\x61\x74\x65\x64\x20\x73\x74\x72\x69\x6E\x67\x2C\x20\x28\x79\x6F\x75\x20"
"\x73\x68\x6F\x75\x6C\x64\x20\x66\x72\x65\x65\x20\x61\x66\x74\x65\x72\x20\x75\x73\x65\x29\x20\x6F\x72\x20"
"\x6E\x75\x6C\x6C\x20\x69\x66\x20\x6E\x6F\x74\x68\x69\x6E\x67\x20\x72\x65\x6C\x61\x74\x65\x64\x20\x74\x6F"
"\x20\x61\x72\x67\x75\x6D\x65\x6E\x74\x73\x20\x66\x6F\x75\x6E\x64\x3C\x2F\x55\x4C\x3E\xA\x3C\x48\x52\x3E"
"\x3C\x42\x52\x3E\xA\xA\x3C\x41\x20\x6E\x61\x6D\x65\x3D\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x75"
"\x73\x65\x53\x53\x4C\x63\x65\x72\x74\x3E\x3C\x42\x3E\x3C\x66\x6F\x6E\x74\x20\x63\x6F\x6C\x6F\x72\x3D\x27"
"\x30\x30\x30\x30\x37\x37\x27\x3E\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x75\x73\x65\x53\x53\x4C\x63"
"\x65\x72\x74\x28\x29\x3C\x2F\x66\x6F\x6E\x74\x3E\x3C\x2F\x42\x3E\x3C\x42\x52\x3E\x3C\x42\x52\x3E\xA\x3C"
"\x42\x3E\x4E\x41\x4D\x45\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F"
"\x75\x73\x65\x53\x53\x4C\x63\x65\x72\x74\x20\x2D\x20\x75\x73\x65\x20\x63\x65\x72\x74\x69\x66\x69\x63\x61"
"\x74\x65\x3C\x2F\x55\x4C\x3E\xA\x3C\x42\x3E\x53\x59\x4E\x4F\x50\x53\x49\x53\x3C\x2F\x42\x3E\xA\x3C\x55"
"\x4C\x3E\x23\x69\x6E\x63\x6C\x75\x64\x65\x20\x22\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x2E\x68\x22\x3C"
"\x42\x52\x3E\x3C\x42\x52\x3E\x76\x6F\x69\x64\x20\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x75\x73\x65"
"\x53\x53\x4C\x63\x65\x72\x74\x28\x73\x74\x72\x75\x63\x74\x20\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x20"
"\x2A\x3C\x55\x3E\x73\x65\x72\x76\x65\x72\x3C\x2F\x55\x3E\x2C\x20\x63\x6F\x6E\x73\x74\x20\x63\x68\x61\x72"
"\x20\x2A\x3C\x55\x3E\x66\x69\x6C\x65\x3C\x2F\x55\x3E\x29\x3B\x3C\x2F\x55\x4C\x3E\xA\x3C\x42\x3E\x44\x45"
"\x53\x43\x52\x49\x50\x54\x49\x4F\x4E\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x54\x68\x65\x20\x77\x65\x62\x5F"
"\x73\x65\x72\x76\x65\x72\x5F\x75\x73\x65\x53\x53\x4C\x63\x65\x72\x74\x28\x29\x20\x66\x75\x6E\x63\x74\x69"
"\x6F\x6E\x20\x74\x65\x6C\x6C\x73\x20\x73\x65\x72\x76\x65\x72\x20\x3C\x55\x3E\x73\x65\x72\x76\x65\x72\x3C"
"\x2F\x55\x3E\x20\x74\x6F\x20\x75\x73\x65\x20\x63\x65\x72\x74\x69\x66\x69\x63\x61\x74\x65\x20\x66\x69\x6C"
"\x65\x20\x3C\x55\x3E\x66\x69\x6C\x65\x3C\x2F\x55\x3E\x20\x6F\x6E\x20\x73\x73\x6C\x20\x63\x6F\x6E\x6E\x65"
"\x63\x74\x69\x6F\x6E\x73\x20\x28\x69\x6E\x69\x74\x69\x61\x6C\x69\x7A\x61\x74\x65\x64\x20\x77\x2F\x20\x66"
"\x6C\x61\x67\x20\x57\x53\x5F\x55\x53\x45\x53\x53\x4C\x29\x3C\x2F\x55\x4C\x3E\xA\x3C\x48\x52\x3E\x3C\x42"
"\x52\x3E\xA\xA\x3C\x41\x20\x6E\x61\x6D\x65\x3D\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x75\x73\x65"
"\x4D\x49\x4D\x45\x66\x69\x6C\x65\x3E\x3C\x42\x3E\x3C\x66\x6F\x6E\x74\x20\x63\x6F\x6C\x6F\x72\x3D\x27\x30"
"\x30\x30\x30\x37\x37\x27\x3E\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x75\x73\x65\x4D\x49\x4D\x45\x66"
"\x69\x6C\x65\x28\x29\x3C\x2F\x66\x6F\x6E\x74\x3E\x3C\x2F\x42\x3E\x3C\x42\x52\x3E\x3C\x42\x52\x3E\xA\x3C"
"\x42\x3E\x4E\x41\x4D\x45\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F"
"\x75\x73\x65\x4D\x49\x4D\x45\x66\x69\x6C\x65\x20\x2D\x20\x75\x73\x65\x20\x6D\x69\x6D\x65\x20\x74\x79\x70"
"\x65\x73\x20\x66\x69\x6C\x65\x3C\x2F\x55\x4C\x3E\xA\x3C\x42\x3E\x53\x59\x4E\x4F\x50\x53\x49\x53\x3C\x2F"
"\x42\x3E\xA\x3C\x55\x4C\x3E\x23\x69\x6E\x63\x6C\x75\x64\x65\x20\x22\x77\x65\x62\x5F\x73\x65\x72\x76\x65"
"\x72\x2E\x68\x22\x3C\x42\x52\x3E\x3C\x42\x52\x3E\x76\x6F\x69\x64\x20\x77\x65\x62\x5F\x73\x65\x72\x76\x65"
"\x72\x5F\x75\x73\x65\x4D\x49\x4D\x45\x66\x69\x6C\x65\x28\x73\x74\x72\x75\x63\x74\x20\x77\x65\x62\x5F\x73"
"\x65\x72\x76\x65\x72\x20\x2A\x3C\x55\x3E\x73\x65\x72\x76\x65\x72\x3C\x2F\x55\x3E\x2C\x20\x63\x6F\x6E\x73"
"\x74\x20\x63\x68\x61\x72\x20\x2A\x3C\x55\x3E\x66\x69\x6C\x65\x3C\x2F\x55\x3E\x29\x3B\x3C\x2F\x55\x4C\x3E"
"\xA\x3C\x42\x3E\x44\x45\x53\x43\x52\x49\x50\x54\x49\x4F\x4E\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x54\x68"
"\x65\x20\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x75\x73\x65\x4D\x49\x4D\x45\x66\x69\x6C\x65\x28\x29"
"\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x20\x74\x65\x6C\x6C\x73\x20\x73\x65\x72\x76\x65\x72\x20\x3C\x55\x3E"
"\x73\x65\x72\x76\x65\x72\x3C\x2F\x55\x3E\x20\x74\x6F\x20\x75\x73\x65\x20\x6D\x69\x6D\x65\x73\x20\x74\x79"
"\x70\x65\x20\x66\x69\x6C\x65\x20\x3C\x55\x3E\x66\x69\x6C\x65\x3C\x2F\x55\x3E\x20\x66\x6F\x72\x20\x64\x65"
"\x74\x65\x72\x6D\x69\x6E\x69\x6E\x67\x20\x6D\x69\x6D\x65\x20\x74\x79\x70\x65\x20\x62\x79\x20\x65\x78\x74"
"\x65\x6E\x73\x69\x6F\x6E\x20\x75\x73\x65\x64\x20\x62\x79\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x20\x3C\x61"
"\x20\x68\x72\x65\x66\x3D\x22\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77\x65"
"\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x63\x6F\x6E\x74\x65\x6E\x74\x74\x79\x70\x65\x22\x3E\x77\x65\x62\x5F"
"\x63\x6C\x69\x65\x6E\x74\x5F\x63\x6F\x6E\x74\x65\x6E\x74\x74\x79\x70\x65\x28\x29\x3C\x2F\x61\x3E\x3C\x2F"
"\x55\x4C\x3E\xA\x3C\x48\x52\x3E\x3C\x42\x52\x3E\xA\xA\xA\x3C\x41\x20\x6E\x61\x6D\x65\x3D\x77\x65\x62"
"\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x61\x64\x64\x73\x74\x72\x65\x61\x6D\x3E\x3C\x42\x3E\x3C\x66\x6F\x6E\x74"
"\x20\x63\x6F\x6C\x6F\x72\x3D\x27\x30\x30\x30\x30\x37\x37\x27\x3E\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74"
"\x5F\x61\x64\x64\x73\x74\x72\x65\x61\x6D\x28\x29\x3C\x2F\x66\x6F\x6E\x74\x3E\x3C\x2F\x42\x3E\x3C\x42\x52"
"\x3E\x3C\x42\x52\x3E\xA\x3C\x42\x3E\x4E\x41\x4D\x45\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x77\x65\x62\x5F"
"\x63\x6C\x69\x65\x6E\x74\x5F\x61\x64\x64\x73\x74\x72\x65\x61\x6D\x20\x2D\x20\x61\x64\x64\x20\x61\x6E\x20"
"\x6F\x75\x74\x70\x75\x74\x20\x73\x74\x72\x65\x61\x6D\x20\x74\x6F\x20\x74\x68\x65\x20\x63\x6C\x69\x65\x6E"
"\x74\x20\x73\x74\x72\x75\x63\x74\x20\x6F\x6E\x20\x77\x65\x62\x73\x65\x72\x76\x65\x72\x3C\x2F\x55\x4C\x3E"
"\xA\x3C\x42\x3E\x53\x59\x4E\x4F\x50\x53\x49\x53\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x23\x69\x6E\x63\x6C"
"\x75\x64\x65\x20\x22\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x2E\x68\x22\x3C\x42\x52\x3E\x3C\x42\x52\x3E"
"\x69\x6E\x74\x20\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x61\x64\x64\x73\x74\x72\x65\x61\x6D\x28\x46"
"\x49\x4C\x45\x20\x2A\x3C\x55\x3E\x73\x74\x72\x65\x61\x6D\x3C\x2F\x55\x3E\x29\x3B\x3C\x2F\x55\x4C\x3E\xA"
"\x3C\x42\x3E\x44\x45\x53\x43\x52\x49\x50\x54\x49\x4F\x4E\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x54\x68\x65"
"\x20\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x61\x64\x64\x73\x74\x72\x65\x61\x6D\x28\x29\x20\x66\x75"
"\x6E\x63\x74\x69\x6F\x6E\x20\x61\x64\x64\x73\x20\x74\x68\x65\x20\x73\x74\x72\x65\x61\x6D\x20\x3C\x55\x3E"
"\x73\x74\x72\x65\x61\x6D\x3C\x2F\x55\x3E\x20\x74\x6F\x20\x74\x68\x65\x20\x6F\x75\x74\x70\x75\x74\x20\x73"
"\x74\x72\x65\x61\x6D\x20\x6C\x69\x73\x74\x20\x69\x6E\x20\x74\x68\x65\x20\x63\x75\x72\x72\x65\x6E\x74\x20"
"\x63\x6C\x69\x65\x6E\x74\x20\x6E\x6F\x64\x65\x3C\x2F\x55\x4C\x3E\xA\x20\x3C\x42\x3E\x4E\x4F\x54\x45\x3C"
"\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x54\x68\x65\x20\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x61\x64\x64"
"\x73\x74\x72\x65\x61\x6D\x28\x29\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x20\x63\x61\x6E\x20\x3C\x42\x3E\x6F"
"\x6E\x6C\x79\x3C\x2F\x42\x3E\x20\x62\x65\x20\x63\x61\x6C\x6C\x65\x64\x20\x66\x72\x6F\x6D\x20\x66\x75\x6E"
"\x63\x74\x69\x6F\x6E\x73\x20\x63\x61\x6C\x6C\x65\x64\x20\x62\x79\x20\x67\x65\x74\x68\x61\x6E\x64\x6C\x65"
"\x72\x73\x20\x72\x65\x67\x69\x73\x74\x65\x72\x65\x64\x20\x62\x79\x20\x3C\x61\x20\x68\x72\x65\x66\x3D\x27"
"\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77\x65\x62\x5F\x73\x65\x72\x76\x65"
"\x72\x5F\x61\x64\x64\x68\x61\x6E\x64\x6C\x65\x72\x27\x3E\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61"
"\x64\x64\x68\x61\x6E\x64\x6C\x65\x72\x28\x29\x3C\x2F\x61\x3E\x2E\x3C\x2F\x55\x4C\x3E\xA\x3C\x55\x4C\x3E"
"\x54\x68\x65\x20\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x61\x64\x64\x73\x74\x72\x65\x61\x6D\x28\x29"
"\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x20\x69\x73\x20\x6F\x62\x73\x6F\x6C\x65\x74\x65\x20\x61\x6E\x64\x20"
"\x6E\x6F\x20\x6C\x6F\x6E\x67\x65\x72\x20\x69\x6E\x20\x75\x73\x65\x20\x6F\x6E\x20\x30\x2E\x33\x2E\x34\x20"
"\x76\x65\x72\x73\x69\x6F\x6E\x73\x2C\x20\x75\x73\x65\x20\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x61"
"\x64\x64\x66\x69\x6C\x65\x20\x69\x6E\x73\x74\x65\x61\x64\x3C\x2F\x75\x6C\x3E\xA\x3C\x42\x3E\x52\x45\x54"
"\x55\x52\x4E\x20\x56\x41\x4C\x55\x45\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x4F\x6E\x20\x73\x75\x63\x63\x65"
"\x73\x73\x2C\x20\x31\x20\x69\x73\x20\x72\x65\x74\x75\x72\x6E\x65\x64\x2C\x20\x4F\x6E\x20\x65\x72\x72\x6F"
"\x72\x2C\x20\x30\x20\x69\x73\x20\x72\x65\x74\x75\x72\x6E\x65\x64\x3C\x2F\x55\x4C\x3E\xA\x3C\x48\x52\x3E"
"\x3C\x42\x52\x3E\xA\xA\x3C\x41\x20\x6E\x61\x6D\x65\x3D\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x61"
"\x64\x64\x66\x69\x6C\x65\x3E\x3C\x42\x3E\x3C\x66\x6F\x6E\x74\x20\x63\x6F\x6C\x6F\x72\x3D\x27\x30\x30\x30"
"\x30\x37\x37\x27\x3E\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x61\x64\x64\x66\x69\x6C\x65\x28\x29\x3C"
"\x2F\x66\x6F\x6E\x74\x3E\x3C\x2F\x42\x3E\x3C\x42\x52\x3E\x3C\x42\x52\x3E\xA\x3C\x42\x3E\x4E\x41\x4D\x45"
"\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x61\x64\x64\x66\x69\x6C"
"\x65\x20\x2D\x20\x61\x64\x64\x20\x61\x20\x66\x69\x6C\x65\x20\x74\x6F\x20\x74\x68\x65\x20\x6F\x75\x74\x70"
"\x75\x74\x20\x73\x74\x72\x65\x61\x6D\x20\x6F\x66\x20\x74\x68\x65\x20\x63\x6C\x69\x65\x6E\x74\x20\x73\x74"
"\x72\x75\x63\x74\x20\x6F\x6E\x20\x74\x68\x65\x20\x77\x65\x62\x73\x65\x72\x76\x65\x72\x3C\x2F\x55\x4C\x3E"
"\xA\x3C\x42\x3E\x53\x59\x4E\x4F\x50\x53\x49\x53\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x23\x69\x6E\x63\x6C"
"\x75\x64\x65\x20\x22\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x2E\x68\x22\x3C\x42\x52\x3E\x3C\x42\x52\x3E"
"\x69\x6E\x74\x20\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x61\x64\x64\x66\x69\x6C\x65\x28\x63\x6F\x6E"
"\x73\x74\x20\x63\x68\x61\x72\x20\x2A\x3C\x55\x3E\x66\x69\x6C\x65\x3C\x2F\x55\x3E\x29\x3B\x3C\x2F\x55\x4C"
"\x3E\xA\x3C\x42\x3E\x44\x45\x53\x43\x52\x49\x50\x54\x49\x4F\x4E\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x54"
"\x68\x65\x20\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x61\x64\x64\x66\x69\x6C\x65\x28\x29\x20\x66\x75"
"\x6E\x63\x74\x69\x6F\x6E\x20\x6F\x70\x65\x6E\x73\x20\x74\x68\x65\x20\x66\x69\x6C\x65\x20\x3C\x55\x3E\x66"
"\x69\x6C\x65\x3C\x2F\x55\x3E\x20\x61\x6E\x64\x20\x61\x64\x64\x73\x20\x69\x74\x20\x61\x73\x20\x73\x74\x72"
"\x65\x61\x6D\x20\x74\x6F\x20\x74\x68\x65\x20\x6F\x75\x74\x70\x75\x74\x20\x73\x74\x72\x65\x61\x6D\x20\x6C"
"\x69\x73\x74\x20\x69\x6E\x20\x74\x68\x65\x20\x63\x75\x72\x72\x65\x6E\x74\x20\x63\x6C\x69\x65\x6E\x74\x20"
"\x6E\x6F\x64\x65\x3C\x2F\x55\x4C\x3E\xA\x20\x3C\x42\x3E\x4E\x4F\x54\x45\x3C\x2F\x42\x3E\xA\x3C\x55\x4C"
"\x3E\x54\x68\x65\x20\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x61\x64\x64\x66\x69\x6C\x65\x28\x29\x20"
"\x66\x75\x6E\x63\x74\x69\x6F\x6E\x20\x63\x61\x6E\x20\x62\x65\x20\x63\x61\x6C\x6C\x65\x64\x20\x3C\x42\x3E"
"\x6F\x6E\x6C\x79\x3C\x2F\x42\x3E\x20\x66\x72\x6F\x6D\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x20\x63\x61"
"\x6C\x6C\x65\x64\x20\x62\x79\x20\x67\x65\x74\x68\x61\x6E\x64\x6C\x65\x72\x73\x20\x72\x65\x67\x69\x73\x74"
"\x65\x72\x65\x64\x20\x76\x69\x61\x20\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66"
"\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x64\x64\x68\x61\x6E"
"\x64\x6C\x65\x72\x27\x3E\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x64\x64\x68\x61\x6E\x64\x6C\x65"
"\x72\x28\x29\x3C\x2F\x61\x3E\x2E\x3C\x2F\x55\x4C\x3E\xA\x3C\x42\x3E\x52\x45\x54\x55\x52\x4E\x20\x56\x41"
"\x4C\x55\x45\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x4F\x6E\x20\x53\x75\x63\x63\x65\x73\x73\x2C\x20\x31\x20"
"\x69\x73\x20\x72\x65\x74\x75\x72\x6E\x65\x64\x2C\x20\x4F\x6E\x20\x65\x72\x72\x6F\x72\x2C\x20\x30\x20\x69"
"\x73\x20\x72\x65\x74\x75\x72\x6E\x65\x64\x3C\x2F\x55\x4C\x3E\xA\x3C\x48\x52\x3E\x3C\x42\x52\x3E\xA\xA"
"\x3C\x41\x20\x6E\x61\x6D\x65\x3D\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x67\x69\x66\x6F\x75\x74\x70"
"\x75\x74\x3E\x3C\x42\x3E\x3C\x66\x6F\x6E\x74\x20\x63\x6F\x6C\x6F\x72\x3D\x27\x30\x30\x30\x30\x37\x37\x27"
"\x3E\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x67\x69\x66\x6F\x75\x74\x70\x75\x74\x28\x29\x3C\x2F\x66"
"\x6F\x6E\x74\x3E\x3C\x2F\x42\x3E\x3C\x42\x52\x3E\x3C\x42\x52\x3E\xA\x3C\x42\x3E\x4E\x41\x4D\x45\x3C\x2F"
"\x42\x3E\xA\x3C\x55\x4C\x3E\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x67\x69\x66\x6F\x75\x74\x70\x75"
"\x74\x20\x2D\x20\x65\x78\x70\x6F\x72\x74\x20\x64\x61\x74\x61\x20\x61\x73\x20\x67\x69\x66\x3C\x2F\x55\x4C"
"\x3E\xA\x3C\x42\x3E\x53\x59\x4E\x4F\x50\x53\x49\x53\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x23\x69\x6E\x63"
"\x6C\x75\x64\x65\x20\x22\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x2E\x68\x22\x3C\x42\x52\x3E\x3C\x42\x52"
"\x3E\x69\x6E\x74\x20\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x67\x69\x66\x6F\x75\x74\x70\x75\x74\x28"
"\x63\x68\x61\x72\x20\x2A\x3C\x55\x3E\x64\x61\x74\x61\x3C\x2F\x55\x3E\x2C\x69\x6E\x74\x20\x3C\x55\x3E\x77"
"\x3C\x2F\x55\x3E\x2C\x69\x6E\x74\x20\x3C\x55\x3E\x68\x3C\x2F\x75\x3E\x29\x3B\x3C\x2F\x55\x4C\x3E\xA\x3C"
"\x42\x3E\x44\x45\x53\x43\x52\x49\x50\x54\x49\x4F\x4E\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x54\x68\x65\x20"
"\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x67\x69\x66\x6F\x75\x74\x70\x75\x74\x28\x29\x20\x66\x75\x6E"
"\x63\x74\x69\x6F\x6E\x20\x70\x72\x69\x6E\x74\x73\x20\x74\x6F\x20\x73\x74\x64\x6F\x75\x74\x20\x61\x20\x67"
"\x69\x66\x20\x68\x65\x61\x64\x65\x72\x20\x28\x77\x69\x74\x68\x20\x77\x69\x64\x74\x68\x20\x3C\x55\x3E\x77"
"\x3C\x2F\x55\x3E\x20\x61\x6E\x64\x20\x68\x65\x69\x67\x68\x74\x20\x3C\x55\x3E\x68\x3C\x2F\x55\x3E\x29\x20"
"\x61\x6E\x64\x20\x74\x68\x65\x20\x69\x6D\x61\x67\x65\x20\x70\x6F\x69\x6E\x74\x65\x64\x20\x62\x79\x20\x3C"
"\x55\x3E\x64\x61\x74\x61\x3C\x2F\x55\x3E\x2E\x3C\x42\x52\x3E\xA\x54\x68\x65\x20\x61\x6C\x6C\x6F\x63\x61"
"\x74\x65\x64\x20\x6D\x65\x6D\x6F\x72\x79\x20\x3C\x55\x3E\x64\x61\x74\x61\x3C\x2F\x55\x3E\x20\x70\x6F\x69"
"\x6E\x74\x73\x20\x74\x6F\x20\x6D\x75\x73\x74\x6E\x27\x74\x20\x62\x65\x20\x73\x6D\x61\x6C\x6C\x65\x72\x20"
"\x74\x68\x61\x6E\x20\x3C\x55\x3E\x77\x3C\x2F\x55\x3E\x2A\x3C\x55\x3E\x68\x3C\x2F\x55\x3E\x2E\x3C\x42\x52"
"\x3E\xA\x54\x68\x65\x20\x67\x69\x66\x20\x70\x61\x6C\x65\x74\x74\x65\x20\x69\x73\x20\x64\x65\x73\x63\x72"
"\x69\x62\x65\x64\x20\x62\x79\x20\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75"
"\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x67\x69\x66\x73\x65\x74\x70"
"\x61\x6C\x65\x74\x74\x65\x27\x3E\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x67\x69\x66\x73\x65\x74\x70"
"\x61\x6C\x65\x74\x74\x65\x3C\x2F\x61\x3E\xA\x3C\x2F\x55\x4C\x3E\xA\x3C\x42\x3E\x4E\x4F\x54\x45\x3C\x2F"
"\x42\x3E\xA\x3C\x55\x4C\x3E\x54\x68\x65\x20\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x67\x69\x66\x6F"
"\x75\x74\x70\x75\x74\x28\x29\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x20\x63\x61\x6E\x20\x62\x65\x20\x63\x61"
"\x6C\x6C\x65\x64\x20\x3C\x42\x3E\x6F\x6E\x6C\x79\x3C\x2F\x42\x3E\x20\x66\x72\x6F\x6D\x20\x66\x75\x6E\x63"
"\x74\x69\x6F\x6E\x73\x20\x63\x61\x6C\x6C\x65\x64\x20\x62\x79\x20\x67\x65\x74\x68\x61\x6E\x64\x6C\x65\x72"
"\x73\x20\x72\x65\x67\x69\x73\x74\x65\x72\x65\x64\x20\x76\x69\x61\x20\x3C\x61\x20\x68\x72\x65\x66\x3D\x27"
"\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77\x65\x62\x5F\x73\x65\x72\x76\x65"
"\x72\x5F\x61\x64\x64\x68\x61\x6E\x64\x6C\x65\x72\x27\x3E\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61"
"\x64\x64\x68\x61\x6E\x64\x6C\x65\x72\x28\x29\x3C\x2F\x61\x3E\x2E\x3C\x2F\x55\x4C\x3E\xA\x3C\x42\x3E\x52"
"\x45\x54\x55\x52\x4E\x20\x56\x41\x4C\x55\x45\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x4F\x6E\x20\x53\x75\x63"
"\x63\x65\x73\x73\x2C\x20\x30\x20\x69\x73\x20\x72\x65\x74\x75\x72\x6E\x65\x64\x2C\x20\x4F\x6E\x20\x65\x72"
"\x72\x6F\x72\x2C\x20\x6E\x6F\x6E\x20\x7A\x65\x72\x6F\x20\x69\x73\x20\x72\x65\x74\x75\x72\x6E\x65\x64\x2E"
"\x3C\x2F\x55\x4C\x3E\xA\x3C\x48\x52\x3E\x3C\x42\x52\x3E\xA\xA\x3C\x41\x20\x6E\x61\x6D\x65\x3D\x77\x65"
"\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x67\x69\x66\x73\x65\x74\x70\x61\x6C\x65\x74\x74\x65\x3E\x3C\x42\x3E"
"\x3C\x66\x6F\x6E\x74\x20\x63\x6F\x6C\x6F\x72\x3D\x27\x30\x30\x30\x30\x37\x37\x27\x3E\x77\x65\x62\x5F\x63"
"\x6C\x69\x65\x6E\x74\x5F\x67\x69\x66\x73\x65\x74\x70\x61\x6C\x65\x74\x74\x65\x28\x29\x3C\x2F\x66\x6F\x6E"
"\x74\x3E\x3C\x2F\x42\x3E\x3C\x42\x52\x3E\x3C\x42\x52\x3E\xA\x3C\x42\x3E\x4E\x41\x4D\x45\x3C\x2F\x42\x3E"
"\xA\x3C\x55\x4C\x3E\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x67\x69\x66\x73\x65\x74\x70\x61\x6C\x65"
"\x74\x74\x65\x20\x2D\x20\x53\x65\x74\x75\x70\x20\x74\x68\x65\x20\x67\x69\x66\x20\x70\x61\x6C\x65\x74\x74"
"\x65\x3C\x2F\x55\x4C\x3E\xA\x3C\x42\x3E\x53\x59\x4E\x4F\x50\x53\x49\x53\x3C\x2F\x42\x3E\xA\x3C\x55\x4C"
"\x3E\x23\x69\x6E\x63\x6C\x75\x64\x65\x20\x22\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x2E\x68\x22\x3C\x42"
"\x52\x3E\x3C\x42\x52\x3E\x76\x6F\x69\x64\x20\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x67\x69\x66\x73"
"\x65\x74\x70\x61\x6C\x65\x74\x74\x65\x28\x63\x68\x61\x72\x20\x2A\x3C\x55\x3E\x66\x69\x6C\x65\x3C\x2F\x55"
"\x3E\x29\x3B\x3C\x2F\x55\x4C\x3E\xA\x3C\x42\x3E\x44\x45\x53\x43\x52\x49\x50\x54\x49\x4F\x4E\x3C\x2F\x42"
"\x3E\xA\x3C\x55\x4C\x3E\x54\x68\x65\x20\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x67\x69\x66\x73\x65"
"\x74\x70\x61\x6C\x65\x74\x74\x65\x28\x29\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x20\x6C\x6F\x61\x64\x73\x20"
"\x72\x61\x77\x20\x70\x61\x6C\x65\x74\x74\x65\x20\x28\x2E\x61\x63\x74\x29\x20\x66\x72\x6F\x6D\x20\x3C\x55"
"\x3E\x66\x69\x6C\x65\x3C\x2F\x55\x3E\x20\x6F\x72\x20\x69\x66\x20\x3C\x55\x3E\x66\x69\x6C\x65\x3C\x2F\x55"
"\x3E\x20\x69\x73\x20\x22\x45\x47\x41\x22\x20\x74\x68\x65\x6E\x20\x74\x68\x69\x73\x20\x66\x75\x6E\x63\x74"
"\x69\x6F\x6E\x20\x73\x65\x74\x75\x70\x73\x20\x74\x68\x65\x20\x70\x61\x6C\x65\x74\x74\x65\x20\x74\x6F\x20"
"\x45\x47\x41\x20\x6D\x6F\x64\x65\x3C\x42\x52\x3E\xA\x3C\x2F\x55\x4C\x3E\xA\x3C\x48\x52\x3E\x3C\x42\x52"
"\x3E\xA\xA\xA\x3C\x41\x20\x6E\x61\x6D\x65\x3D\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x73\x65\x74"
"\x63\x6F\x6F\x6B\x69\x65\x3E\x3C\x42\x3E\x3C\x66\x6F\x6E\x74\x20\x63\x6F\x6C\x6F\x72\x3D\x27\x30\x30\x30"
"\x30\x37\x37\x27\x3E\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x73\x65\x74\x63\x6F\x6F\x6B\x69\x65\x28"
"\x29\x3C\x2F\x66\x6F\x6E\x74\x3E\x3C\x2F\x42\x3E\x3C\x42\x52\x3E\x3C\x42\x52\x3E\xA\x3C\x42\x3E\x4E\x41"
"\x4D\x45\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x73\x65\x74\x63"
"\x6F\x6F\x6B\x69\x65\x20\x2D\x20\x73\x65\x74\x20\x61\x20\x63\x6F\x6F\x6B\x69\x65\x3C\x2F\x55\x4C\x3E\xA"
"\x3C\x42\x3E\x53\x59\x4E\x4F\x50\x53\x49\x53\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x23\x69\x6E\x63\x6C\x75"
"\x64\x65\x20\x22\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x2E\x68\x22\x3C\x42\x52\x3E\x3C\x42\x52\x3E\x76"
"\x6F\x69\x64\x20\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x73\x65\x74\x63\x6F\x6F\x6B\x69\x65\x28\x63"
"\x68\x61\x72\x20\x2A\x3C\x55\x3E\x6B\x65\x79\x3C\x2F\x55\x3E\x2C\x20\x63\x68\x61\x72\x20\x2A\x3C\x55\x3E"
"\x76\x61\x6C\x75\x65\x3C\x2F\x55\x3E\x2C\x20\x63\x68\x61\x72\x20\x2A\x3C\x55\x3E\x74\x69\x6D\x65\x6F\x66"
"\x66\x73\x65\x74\x3C\x2F\x55\x3E\x2C\x20\x63\x68\x61\x72\x20\x2A\x3C\x55\x3E\x70\x61\x74\x68\x3C\x2F\x55"
"\x3E\x2C\x63\x68\x61\x72\x20\x2A\x3C\x55\x3E\x64\x6F\x6D\x61\x69\x6E\x3C\x2F\x55\x3E\x2C\x69\x6E\x74\x20"
"\x3C\x55\x3E\x73\x65\x63\x75\x72\x65\x3C\x2F\x55\x3E\x29\x3B\x3C\x2F\x55\x4C\x3E\xA\x3C\x42\x3E\x44\x45"
"\x53\x43\x52\x49\x50\x54\x49\x4F\x4E\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x54\x68\x65\x20\x77\x65\x62\x5F"
"\x63\x6C\x69\x65\x6E\x74\x5F\x73\x65\x74\x63\x6F\x6F\x6B\x69\x65\x28\x29\x20\x66\x75\x6E\x63\x74\x69\x6F"
"\x6E\x20\x73\x65\x74\x73\x20\x61\x20\x63\x6F\x6F\x6B\x69\x65\x20\x6F\x6E\x20\x63\x6C\x69\x65\x6E\x74\x20"
"\x62\x72\x6F\x77\x73\x65\x72\x20\x77\x69\x74\x68\x20\x6B\x65\x79\x20\x3C\x55\x3E\x6B\x65\x79\x3C\x2F\x55"
"\x3E\x2C\x20\x76\x61\x6C\x75\x65\x20\x3C\x55\x3E\x76\x61\x6C\x75\x65\x3C\x2F\x55\x3E\x20\x61\x6E\x64\x20"
"\x65\x78\x70\x69\x72\x65\x73\x20\x61\x74\x20\x3C\x55\x3E\x74\x69\x6D\x65\x6F\x66\x66\x73\x65\x74\x3C\x2F"
"\x55\x3E\x2E\x3C\x42\x52\x3E\xA\x74\x69\x6D\x65\x6F\x66\x66\x73\x65\x74\x20\x66\x6F\x72\x6D\x61\x74\x20"
"\x69\x73\x20\x6F\x6E\x65\x20\x6C\x69\x6B\x65\x20\x3C\x55\x3E\x73\x69\x67\x6E\x3C\x2F\x55\x3E\x2C\x20\x3C"
"\x55\x3E\x6E\x75\x6D\x62\x65\x72\x20\x6F\x66\x66\x73\x65\x74\x3C\x2F\x55\x3E\x20\x61\x6E\x64\x20\x3C\x55"
"\x3E\x64\x69\x72\x65\x63\x74\x69\x76\x65\x3C\x2F\x55\x3E\x20\x3C\x73\x6D\x61\x6C\x6C\x3E\x20\x28\x69\x2E"
"\x65\x20\x2B\x31\x30\x6D\x2C\x20\x31\x30\x20\x6D\x6F\x6E\x74\x68\x73\x29\x3C\x2F\x73\x6D\x61\x6C\x6C\x3E"
"\xA\x9\x3C\x55\x4C\x3E\x3C\x55\x3E\x73\x69\x67\x6E\x3C\x2F\x55\x3E\x20\x69\x73\x20\x6F\x6E\x20\x6C\x69"
"\x6B\x65\x20\x27\x2D\x27\x20\x6F\x72\x20\x27\x2B\x27\x3C\x2F\x55\x4C\x3E\xA\x9\x3C\x55\x4C\x3E\x3C\x55"
"\x3E\x6E\x75\x6D\x62\x65\x72\x20\x6F\x66\x66\x73\x65\x74\x3C\x2F\x55\x3E\x20\x69\x73\x20\x6C\x69\x6B\x65"
"\x20\x2B\x3C\x55\x3E\x35\x3C\x2F\x55\x3E\x4D\x20\x6D\x65\x61\x6E\x73\x20\x65\x78\x70\x69\x72\x65\x73\x20"
"\x61\x74\x20\x6E\x65\x78\x74\x20\x35\x20\x6D\x69\x6E\x75\x74\x65\x73\x20\x3C\x2F\x55\x4C\x3E\xA\x9\x3C"
"\x55\x4C\x3E\x3C\x55\x3E\x64\x69\x72\x65\x63\x74\x69\x76\x65\x3C\x2F\x55\x3E\x20\x69\x73\x3A\xA\x9\x9"
"\x3C\x55\x4C\x3E\x53\x20\x2D\x20\x73\x65\x63\x6F\x6E\x64\x73\x3C\x2F\x55\x4C\x3E\xA\x9\x9\x3C\x55\x4C"
"\x3E\x4D\x20\x2D\x20\x6D\x69\x6E\x75\x74\x65\x73\x3C\x2F\x55\x4C\x3E\xA\x9\x9\x3C\x55\x4C\x3E\x48\x20"
"\x2D\x20\x68\x6F\x75\x72\x73\x3C\x2F\x55\x4C\x3E\xA\x9\x9\x3C\x55\x4C\x3E\x64\x20\x2D\x20\x64\x61\x79"
"\x73\x3C\x2F\x55\x4C\x3E\xA\x9\x9\x3C\x55\x4C\x3E\x6D\x20\x2D\x20\x6D\x6F\x6E\x74\x68\x73\x3C\x2F\x55"
"\x4C\x3E\xA\x9\x9\x3C\x55\x4C\x3E\x79\x20\x2D\x20\x79\x65\x61\x72\x73\x3C\x2F\x55\x4C\x3E\xA\x9\x3C"
"\x2F\x55\x4C\x3E\xA\x9\x70\x61\x74\x68\x20\x2D\x20\x53\x75\x62\x73\x65\x74\x20\x6F\x66\x20\x55\x52\x4C"
"\x73\x20\x69\x6E\x20\x61\x20\x64\x6F\x6D\x61\x69\x6E\x20\x66\x6F\x72\x20\x77\x68\x69\x63\x68\x20\x74\x68"
"\x65\x20\x63\x6F\x6F\x6B\x69\x65\x20\x69\x73\x20\x76\x61\x6C\x69\x64\xA\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x28\x49\x66\x20\x74\x68\x65\x20\x70\x61\x74\x68\x20\x69\x73\x20\x6E\x6F\x74\x20\x73\x70\x65"
"\x63\x69\x66\x69\x65\x64\x20\x28\x70\x61\x74\x68\x20\x3D\x3D\x20\x4E\x55\x4C\x4C\x29\x2C\x20\x69\x74\x20"
"\x61\x73\x20\x61\x73\x73\x75\x6D\x65\x64\x20\x74\x6F\x20\x62\x65\xA\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x74\x68\x65\x20\x73\x61\x6D\x65\x20\x70\x61\x74\x68\x20\x61\x73\x20\x74\x68\x65\x20\x64\x6F"
"\x63\x75\x6D\x65\x6E\x74\x20\x62\x65\x69\x6E\x67\x20\x64\x65\x73\x63\x72\x69\x62\x65\x64\x20\x62\x79\x20"
"\x74\x68\x65\x20\x68\x65\x61\x64\x65\x72\x20\x77\x68\x69\x63\x68\xA\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x63\x6F\x6E\x74\x61\x69\x6E\x73\x20\x74\x68\x65\x20\x63\x6F\x6F\x6B\x69\x65\x2E\x29\x3C\x42"
"\x52\x3E\xA\x20\x20\x20\x20\x64\x6F\x6D\x61\x69\x6E\x20\x3D\x20\x44\x6F\x6D\x61\x69\x6E\x20\x74\x68\x65"
"\x20\x63\x6F\x6F\x6B\x69\x65\x20\x69\x73\x20\x76\x61\x6C\x69\x64\x20\x66\x6F\x72\xA\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x28\x49\x66\x20\x74\x68\x65\x20\x64\x6F\x6D\x61\x69\x6E\x20\x69\x73\x20"
"\x6E\x6F\x74\x20\x73\x65\x74\x20\x28\x64\x6F\x6D\x61\x69\x6E\x20\x3D\x3D\x20\x4E\x55\x4C\x4C\x29\x2C\x20"
"\x74\x68\x65\x20\x64\x65\x66\x61\x75\x6C\x74\x20\x76\x61\x6C\x75\x65\x20\x6F\x66\xA\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x64\x6F\x6D\x61\x69\x6E\x20\x69\x73\x20\x74\x68\x65\x20\x68\x6F\x73\x74"
"\x20\x6E\x61\x6D\x65\x20\x6F\x66\x20\x74\x68\x65\x20\x73\x65\x72\x76\x65\x72\x20\x77\x68\x69\x63\x68\x20"
"\x67\x65\x6E\x65\x72\x61\x74\x65\x64\x20\x74\x68\x65\x20\x63\x6F\x6F\x6B\x69\x65\xA\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x72\x65\x73\x70\x6F\x6E\x73\x65\x2E\x29\x3C\x42\x52\x3E\xA\x9\x73\x65"
"\x63\x75\x72\x65\x20\x3D\x20\x49\x66\x20\x61\x20\x63\x6F\x6F\x6B\x69\x65\x20\x69\x73\x20\x6D\x61\x72\x6B"
"\x65\x64\x20\x73\x65\x63\x75\x72\x65\x20\x28\x73\x65\x63\x75\x72\x65\x20\x3D\x3D\x20\x31\x29\x2C\x20\x69"
"\x74\x20\x77\x69\x6C\x6C\x20\x6F\x6E\x6C\x79\x20\x62\x65\xA\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x74\x72\x61\x6E\x73\x6D\x69\x74\x74\x65\x64\x20\x69\x66\x20\x74\x68\x65\x20\x63\x6F\x6D\x6D\x75"
"\x6E\x69\x63\x61\x74\x69\x6F\x6E\x73\x20\x63\x68\x61\x6E\x6E\x65\x6C\x20\x77\x69\x74\x68\x20\x74\x68\x65"
"\x20\x68\x6F\x73\x74\x20\x69\x73\x20\x61\xA\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x73\x65"
"\x63\x75\x72\x65\x20\x6F\x6E\x65\x2E\x20\x43\x75\x72\x72\x65\x6E\x74\x6C\x79\x20\x74\x68\x69\x73\x20\x6D"
"\x65\x61\x6E\x73\x20\x74\x68\x61\x74\x20\x73\x65\x63\x75\x72\x65\x20\x63\x6F\x6F\x6B\x69\x65\x73\x20\x77"
"\x69\x6C\x6C\x20\x6F\x6E\x6C\x79\x20\x62\x65\xA\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x73"
"\x65\x6E\x74\x20\x74\x6F\x20\x48\x54\x54\x50\x53\x20\x28\x48\x54\x54\x50\x20\x6F\x76\x65\x72\x20\x53\x53"
"\x4C\x29\x20\x73\x65\x72\x76\x65\x72\x73\x2E\xA\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x28"
"\x49\x66\x20\x73\x65\x63\x75\x72\x65\x20\x69\x73\x20\x6E\x6F\x74\x20\x73\x70\x65\x63\x69\x66\x69\x65\x64"
"\x20\x28\x73\x65\x63\x75\x72\x65\x20\x3D\x3D\x20\x30\x29\x2C\x20\x61\x20\x63\x6F\x6F\x6B\x69\x65\x20\x69"
"\x73\x20\x63\x6F\x6E\x73\x69\x64\x65\x72\x65\x64\xA\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x73\x61\x66\x65\x20\x74\x6F\x20\x62\x65\x20\x73\x65\x6E\x74\x20\x69\x6E\x20\x74\x68\x65\x20\x63\x6C"
"\x65\x61\x72\x20\x6F\x76\x65\x72\x20\x75\x6E\x73\x65\x63\x75\x72\x65\x64\x20\x63\x68\x61\x6E\x6E\x65\x6C"
"\x73\x2E\x20\x29\x3C\x42\x52\x3E\xA\x20\xA\x3C\x2F\x55\x4C\x3E\xA\x3C\x42\x3E\x4E\x4F\x54\x45\x3C\x2F"
"\x42\x3E\xA\x3C\x55\x4C\x3E\x20\x54\x68\x65\x20\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x73\x65\x74"
"\x63\x6F\x6F\x6B\x69\x65\x28\x29\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x20\x73\x68\x6F\x75\x6C\x64\x20\x62"
"\x65\x20\x63\x61\x6C\x6C\x65\x64\x20\x3C\x42\x3E\x6F\x6E\x6C\x79\x3C\x2F\x42\x3E\x20\x66\x72\x6F\x6D\x20"
"\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x20\x63\x61\x6C\x6C\x65\x64\x20\x62\x79\x20\x67\x65\x74\x68\x61\x6E"
"\x64\x6C\x65\x72\x73\x20\x72\x65\x67\x69\x73\x74\x65\x72\x65\x64\x20\x76\x69\x61\x20\x3C\x61\x20\x68\x72"
"\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77\x65\x62\x5F\x73"
"\x65\x72\x76\x65\x72\x5F\x61\x64\x64\x68\x61\x6E\x64\x6C\x65\x72\x27\x3E\x77\x65\x62\x5F\x73\x65\x72\x76"
"\x65\x72\x5F\x61\x64\x64\x68\x61\x6E\x64\x6C\x65\x72\x28\x29\x3C\x2F\x61\x3E\x3C\x42\x52\x3E\x3C\x2F\x55"
"\x4C\x3E\xA\x3C\x48\x52\x3E\x3C\x42\x52\x3E\xA\xA\xA\x3C\x41\x20\x6E\x61\x6D\x65\x3D\x77\x65\x62\x5F"
"\x63\x6C\x69\x65\x6E\x74\x5F\x64\x65\x6C\x65\x74\x65\x63\x6F\x6F\x6B\x69\x65\x3E\x3C\x42\x3E\x3C\x66\x6F"
"\x6E\x74\x20\x63\x6F\x6C\x6F\x72\x3D\x27\x30\x30\x30\x30\x37\x37\x27\x3E\x77\x65\x62\x5F\x63\x6C\x69\x65"
"\x6E\x74\x5F\x64\x65\x6C\x65\x74\x65\x63\x6F\x6F\x6B\x69\x65\x28\x29\x3C\x2F\x66\x6F\x6E\x74\x3E\x3C\x2F"
"\x42\x3E\x3C\x42\x52\x3E\x3C\x42\x52\x3E\xA\x3C\x42\x3E\x4E\x41\x4D\x45\x3C\x2F\x42\x3E\xA\x3C\x55\x4C"
"\x3E\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x64\x65\x6C\x65\x74\x65\x63\x6F\x6F\x6B\x69\x65\x20\x2D"
"\x20\x64\x65\x6C\x65\x74\x65\x20\x61\x20\x63\x6F\x6F\x6B\x69\x65\x3C\x2F\x55\x4C\x3E\xA\x3C\x42\x3E\x53"
"\x59\x4E\x4F\x50\x53\x49\x53\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x23\x69\x6E\x63\x6C\x75\x64\x65\x20\x22"
"\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x2E\x68\x22\x3C\x42\x52\x3E\x3C\x42\x52\x3E\x76\x6F\x69\x64\x20"
"\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x64\x65\x6C\x65\x74\x65\x63\x6F\x6F\x6B\x69\x65\x28\x63\x68"
"\x61\x72\x20\x2A\x3C\x55\x3E\x6B\x65\x79\x3C\x2F\x55\x3E\x29\x3B\x3C\x2F\x55\x4C\x3E\xA\x3C\x42\x3E\x44"
"\x45\x53\x43\x52\x49\x50\x54\x49\x4F\x4E\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x54\x68\x65\x20\x77\x65\x62"
"\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x64\x65\x6C\x65\x74\x65\x63\x6F\x6F\x6B\x69\x65\x28\x29\x20\x66\x75\x6E"
"\x63\x74\x69\x6F\x6E\x20\x64\x65\x6C\x65\x74\x65\x20\x61\x20\x63\x6F\x6F\x6B\x69\x65\x20\x6F\x6E\x20\x63"
"\x6C\x69\x65\x6E\x74\x20\x62\x72\x6F\x77\x73\x65\x72\x20\x77\x69\x74\x68\x20\x6B\x65\x79\x20\x3C\x55\x3E"
"\x6B\x65\x79\x3C\x2F\x55\x3E\x3C\x42\x52\x3E\xA\xA\x3C\x2F\x55\x4C\x3E\xA\x3C\x42\x3E\x4E\x4F\x54\x45"
"\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x20\x54\x68\x65\x20\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x64"
"\x65\x6C\x65\x74\x65\x63\x6F\x6F\x6B\x69\x65\x28\x29\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x20\x73\x68\x6F"
"\x75\x6C\x64\x20\x62\x65\x20\x63\x61\x6C\x6C\x65\x64\x20\x3C\x42\x3E\x6F\x6E\x6C\x79\x3C\x2F\x42\x3E\x20"
"\x66\x72\x6F\x6D\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x20\x63\x61\x6C\x6C\x65\x64\x20\x62\x79\x20\x67"
"\x65\x74\x68\x61\x6E\x64\x6C\x65\x72\x73\x20\x72\x65\x67\x69\x73\x74\x65\x72\x65\x64\x20\x76\x69\x61\x20"
"\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23"
"\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x64\x64\x68\x61\x6E\x64\x6C\x65\x72\x27\x3E\x77\x65\x62"
"\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x64\x64\x68\x61\x6E\x64\x6C\x65\x72\x28\x29\x3C\x2F\x61\x3E\x3C\x42"
"\x52\x3E\x3C\x2F\x55\x4C\x3E\xA\x3C\x48\x52\x3E\x3C\x42\x52\x3E\xA\xA\x3C\x41\x20\x6E\x61\x6D\x65\x3D"
"\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x73\x65\x74\x76\x61\x72\x3E\x3C\x42\x3E\x3C\x66\x6F\x6E\x74"
"\x20\x63\x6F\x6C\x6F\x72\x3D\x27\x30\x30\x30\x30\x37\x37\x27\x3E\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74"
"\x5F\x73\x65\x74\x76\x61\x72\x28\x29\x3C\x2F\x66\x6F\x6E\x74\x3E\x3C\x2F\x42\x3E\x3C\x42\x52\x3E\x3C\x42"
"\x52\x3E\xA\x3C\x42\x3E\x4E\x41\x4D\x45\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x77\x65\x62\x5F\x63\x6C\x69"
"\x65\x6E\x74\x5F\x73\x65\x74\x76\x61\x72\x20\x2D\x20\x73\x65\x74\x73\x20\x61\x20\x76\x61\x72\x69\x61\x62"
"\x6C\x65\x3C\x2F\x55\x4C\x3E\xA\x3C\x42\x3E\x53\x59\x4E\x4F\x50\x53\x49\x53\x3C\x2F\x42\x3E\xA\x3C\x55"
"\x4C\x3E\x23\x69\x6E\x63\x6C\x75\x64\x65\x20\x22\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x2E\x68\x22\x3C"
"\x42\x52\x3E\x3C\x42\x52\x3E\x69\x6E\x74\x20\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x73\x65\x74\x76"
"\x61\x72\x28\x63\x68\x61\x72\x20\x2A\x3C\x55\x3E\x6E\x61\x6D\x65\x3C\x2F\x55\x3E\x2C\x20\x63\x68\x61\x72"
"\x20\x2A\x3C\x55\x3E\x76\x61\x6C\x75\x65\x3C\x2F\x55\x3E\x29\x3B\x3C\x2F\x55\x4C\x3E\xA\x3C\x42\x3E\x44"
"\x45\x53\x43\x52\x49\x50\x54\x49\x4F\x4E\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x54\x68\x65\x20\x77\x65\x62"
"\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x73\x65\x74\x76\x61\x72\x28\x29\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x20"
"\x73\x65\x74\x73\x20\x61\x6E\x20\x76\x61\x72\x69\x61\x62\x6C\x65\x20\x6E\x61\x6D\x65\x64\x20\x3C\x55\x3E"
"\x6E\x61\x6D\x65\x3C\x2F\x55\x3E\x20\x77\x69\x74\x68\x20\x76\x61\x6C\x75\x65\x20\x3C\x55\x3E\x76\x61\x6C"
"\x75\x65\x3C\x2F\x55\x3E\x20\x69\x6E\x20\x61\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x2C\x20\x74\x6F"
"\x20\x62\x65\x20\x75\x73\x65\x64\x20\x69\x6E\x20\x6F\x75\x74\x70\x75\x74\x20\x28\x6F\x6E\x6C\x79\x20\x61"
"\x76\x61\x69\x6C\x61\x62\x6C\x65\x20\x69\x66\x20\x57\x53\x5F\x44\x59\x4E\x56\x41\x52\x20\x66\x6C\x61\x67"
"\x20\x75\x73\x65\x64\x29\x3C\x42\x52\x3E\xA\x9\x20\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x73\x65"
"\x74\x76\x61\x72\x28\x22\x62\x67\x63\x22\x2C\x22\x23\x66\x66\x30\x30\x64\x64\x22\x29\x3B\x3C\x42\x52\x3E"
"\xA\x20\x20\x20\x20\x20\x70\x72\x69\x6E\x74\x66\x28\x22\x26\x6C\x74\x3B\x42\x4F\x44\x59\x20\x62\x67\x63"
"\x6F\x6C\x6F\x72\x3D\x27\x24\x62\x67\x63\x3B\x27\x26\x67\x74\x3B\x22\x29\x3B\x20\x20\x2D\x20\x77\x69\x6C"
"\x6C\x20\x65\x78\x63\x68\x61\x6E\x67\x65\x20\x74\x68\x65\x20\x73\x74\x72\x69\x6E\x67\x20\x24\x62\x67\x63"
"\x3B\x20\x74\x6F\x20\x23\x66\x66\x30\x30\x64\x64\x20\x6F\x6E\x20\x6F\x75\x74\x70\x75\x74\x3C\x2F\x55\x4C"
"\x3E\xA\xA\x3C\x42\x3E\x4E\x4F\x54\x45\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x54\x68\x65\x20\x77\x65\x62"
"\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x73\x65\x74\x76\x61\x72\x28\x29\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x20"
"\x3C\x42\x3E\x73\x68\x6F\x75\x6C\x64\x3C\x2F\x42\x3E\x20\x62\x65\x20\x63\x61\x6C\x6C\x65\x64\x20\x3C\x42"
"\x3E\x6F\x6E\x6C\x79\x3C\x2F\x42\x3E\x20\x66\x72\x6F\x6D\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x20\x63"
"\x61\x6C\x6C\x65\x64\x20\x62\x79\x20\x67\x65\x74\x68\x61\x6E\x64\x6C\x65\x72\x73\x20\x72\x65\x67\x69\x73"
"\x74\x65\x72\x65\x64\x20\x76\x69\x61\x20\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D"
"\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x64\x64\x68\x61"
"\x6E\x64\x6C\x65\x72\x27\x3E\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x64\x64\x68\x61\x6E\x64\x6C"
"\x65\x72\x28\x29\x3C\x2F\x61\x3E\x2E\x3C\x2F\x55\x4C\x3E\xA\x3C\x48\x52\x3E\x3C\x42\x52\x3E\xA\xA\x3C"
"\x41\x20\x6E\x61\x6D\x65\x3D\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x67\x65\x74\x76\x61\x72\x3E\x3C"
"\x42\x3E\x3C\x66\x6F\x6E\x74\x20\x63\x6F\x6C\x6F\x72\x3D\x27\x30\x30\x30\x30\x37\x37\x27\x3E\x77\x65\x62"
"\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x67\x65\x74\x76\x61\x72\x28\x29\x3C\x2F\x66\x6F\x6E\x74\x3E\x3C\x2F\x42"
"\x3E\x3C\x42\x52\x3E\x3C\x42\x52\x3E\xA\x3C\x42\x3E\x4E\x41\x4D\x45\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E"
"\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x67\x65\x74\x76\x61\x72\x20\x2D\x20\x67\x65\x74\x73\x20\x61"
"\x20\x76\x61\x72\x69\x61\x62\x6C\x65\x20\x76\x61\x6C\x75\x65\x3C\x2F\x55\x4C\x3E\xA\x3C\x42\x3E\x53\x59"
"\x4E\x4F\x50\x53\x49\x53\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x23\x69\x6E\x63\x6C\x75\x64\x65\x20\x22\x77"
"\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x2E\x68\x22\x3C\x42\x52\x3E\x3C\x42\x52\x3E\x69\x6E\x74\x20\x77\x65"
"\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x67\x65\x74\x76\x61\x72\x28\x63\x68\x61\x72\x20\x2A\x3C\x55\x3E\x6E"
"\x61\x6D\x65\x3C\x2F\x55\x3E\x29\x3B\x3C\x2F\x55\x4C\x3E\xA\x3C\x42\x3E\x44\x45\x53\x43\x52\x49\x50\x54"
"\x49\x4F\x4E\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x54\x68\x65\x20\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74"
"\x5F\x67\x65\x74\x76\x61\x72\x28\x29\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x20\x67\x65\x74\x73\x20\x74\x68"
"\x65\x20\x76\x61\x6C\x75\x65\x20\x6F\x66\x20\x76\x61\x72\x69\x61\x62\x6C\x65\x20\x3C\x55\x3E\x6E\x61\x6D"
"\x65\x3C\x2F\x55\x3E\x2C\x20\x28\x73\x65\x65\x20\x61\x6C\x73\x6F\x20\x3C\x61\x20\x68\x72\x65\x66\x3D\x2F"
"\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74"
"\x5F\x73\x65\x74\x76\x61\x72\x3E\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x73\x65\x74\x76\x61\x72\x28"
"\x29\x3C\x2F\x61\x3E\x29\x3C\x42\x52\x3E\x3C\x2F\x55\x4C\x3E\xA\x3C\x42\x3E\x4E\x4F\x54\x45\x3C\x2F\x42"
"\x3E\xA\x3C\x55\x4C\x3E\x54\x68\x65\x20\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x67\x65\x74\x76\x61"
"\x72\x28\x29\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x20\x3C\x42\x3E\x73\x68\x6F\x75\x6C\x64\x3C\x2F\x42\x3E"
"\x20\x62\x65\x20\x63\x61\x6C\x6C\x65\x64\x20\x3C\x42\x3E\x6F\x6E\x6C\x79\x3C\x2F\x42\x3E\x20\x66\x72\x6F"
"\x6D\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x20\x63\x61\x6C\x6C\x65\x64\x20\x62\x79\x20\x67\x65\x74\x68"
"\x61\x6E\x64\x6C\x65\x72\x73\x20\x72\x65\x67\x69\x73\x74\x65\x72\x65\x64\x20\x76\x69\x61\x20\x3C\x61\x20"
"\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77\x65\x62"
"\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x64\x64\x68\x61\x6E\x64\x6C\x65\x72\x27\x3E\x77\x65\x62\x5F\x73\x65"
"\x72\x76\x65\x72\x5F\x61\x64\x64\x68\x61\x6E\x64\x6C\x65\x72\x28\x29\x3C\x2F\x61\x3E\x2E\x3C\x2F\x55\x4C"
"\x3E\xA\x3C\x48\x52\x3E\x3C\x42\x52\x3E\xA\xA\x3C\x41\x20\x6E\x61\x6D\x65\x3D\x77\x65\x62\x5F\x63\x6C"
"\x69\x65\x6E\x74\x5F\x64\x65\x6C\x76\x61\x72\x3E\x3C\x42\x3E\x3C\x66\x6F\x6E\x74\x20\x63\x6F\x6C\x6F\x72"
"\x3D\x27\x30\x30\x30\x30\x37\x37\x27\x3E\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x64\x65\x6C\x76\x61"
"\x72\x28\x29\x3C\x2F\x66\x6F\x6E\x74\x3E\x3C\x2F\x42\x3E\x3C\x42\x52\x3E\x3C\x42\x52\x3E\xA\x3C\x42\x3E"
"\x4E\x41\x4D\x45\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x64\x65"
"\x6C\x76\x61\x72\x20\x2D\x20\x64\x65\x6C\x65\x74\x65\x20\x61\x20\x76\x61\x72\x69\x61\x62\x6C\x65\x3C\x2F"
"\x55\x4C\x3E\xA\x3C\x42\x3E\x53\x59\x4E\x4F\x50\x53\x49\x53\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x23\x69"
"\x6E\x63\x6C\x75\x64\x65\x20\x22\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x2E\x68\x22\x3C\x42\x52\x3E\x3C"
"\x42\x52\x3E\x69\x6E\x74\x20\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x64\x65\x6C\x76\x61\x72\x28\x63"
"\x68\x61\x72\x20\x2A\x3C\x55\x3E\x6E\x61\x6D\x65\x3C\x2F\x55\x3E\x29\x3B\x3C\x2F\x55\x4C\x3E\xA\x3C\x42"
"\x3E\x44\x45\x53\x43\x52\x49\x50\x54\x49\x4F\x4E\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x54\x68\x65\x20\x77"
"\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x64\x65\x6C\x76\x61\x72\x28\x29\x20\x66\x75\x6E\x63\x74\x69\x6F"
"\x6E\x20\x64\x65\x6C\x65\x74\x65\x73\x20\x61\x20\x76\x61\x72\x69\x61\x62\x6C\x65\x20\x77\x69\x74\x68\x20"
"\x6E\x61\x6D\x65\x20\x3C\x55\x3E\x6E\x61\x6D\x65\x3C\x2F\x55\x3E\x3C\x42\x52\x3E\x3C\x2F\x55\x4C\x3E\xA"
"\x3C\x42\x3E\x4E\x4F\x54\x45\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x54\x68\x65\x20\x77\x65\x62\x5F\x63\x6C"
"\x69\x65\x6E\x74\x5F\x64\x65\x6C\x76\x61\x72\x28\x29\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x20\x3C\x42\x3E"
"\x73\x68\x6F\x75\x6C\x64\x3C\x2F\x42\x3E\x20\x62\x65\x20\x63\x61\x6C\x6C\x65\x64\x20\x3C\x42\x3E\x6F\x6E"
"\x6C\x79\x3C\x2F\x42\x3E\x20\x66\x72\x6F\x6D\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x20\x63\x61\x6C\x6C"
"\x65\x64\x20\x62\x79\x20\x67\x65\x74\x68\x61\x6E\x64\x6C\x65\x72\x73\x20\x72\x65\x67\x69\x73\x74\x65\x72"
"\x65\x64\x20\x76\x69\x61\x20\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E"
"\x63\x74\x69\x6F\x6E\x73\x23\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x64\x64\x68\x61\x6E\x64\x6C"
"\x65\x72\x27\x3E\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x64\x64\x68\x61\x6E\x64\x6C\x65\x72\x28"
"\x29\x3C\x2F\x61\x3E\x2E\x3C\x2F\x55\x4C\x3E\xA\x3C\x48\x52\x3E\x3C\x42\x52\x3E\xA\xA\xA\x3C\x41\x20"
"\x6E\x61\x6D\x65\x3D\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x48\x54\x54\x50\x64\x69\x72\x65\x63\x74"
"\x69\x76\x65\x3E\x3C\x42\x3E\x3C\x66\x6F\x6E\x74\x20\x63\x6F\x6C\x6F\x72\x3D\x27\x30\x30\x30\x30\x37\x37"
"\x27\x3E\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x48\x54\x54\x50\x64\x69\x72\x65\x63\x74\x69\x76\x65"
"\x28\x29\x3C\x2F\x66\x6F\x6E\x74\x3E\x3C\x2F\x42\x3E\x3C\x42\x52\x3E\x3C\x42\x52\x3E\xA\x3C\x42\x3E\x4E"
"\x41\x4D\x45\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x48\x54\x54"
"\x50\x64\x69\x72\x65\x63\x74\x69\x76\x65\x20\x2D\x20\x43\x68\x61\x6E\x67\x65\x20\x74\x68\x65\x20\x48\x54"
"\x54\x50\x20\x68\x65\x61\x64\x65\x72\x20\x73\x74\x61\x74\x75\x73\x3C\x2F\x55\x4C\x3E\xA\x3C\x42\x3E\x53"
"\x59\x4E\x4F\x50\x53\x49\x53\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x23\x69\x6E\x63\x6C\x75\x64\x65\x20\x22"
"\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x2E\x68\x22\x3C\x42\x52\x3E\x3C\x42\x52\x3E\x76\x6F\x69\x64\x20"
"\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x48\x54\x54\x50\x64\x69\x72\x65\x63\x74\x69\x76\x65\x28\x63"
"\x68\x61\x72\x20\x2A\x3C\x55\x3E\x64\x69\x72\x65\x63\x74\x69\x76\x65\x3C\x2F\x55\x3E\x29\x3B\x3C\x2F\x55"
"\x4C\x3E\xA\x3C\x42\x3E\x44\x45\x53\x43\x52\x49\x50\x54\x49\x4F\x4E\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E"
"\x54\x68\x65\x20\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x48\x54\x54\x50\x64\x69\x72\x65\x63\x74\x69"
"\x76\x65\x28\x29\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x20\x63\x68\x61\x6E\x67\x65\x73\x20\x74\x68\x65\x20"
"\x48\x54\x54\x50\x20\x68\x65\x61\x64\x65\x72\x20\x73\x74\x61\x74\x75\x73\x20\x28\x69\x2E\x65\x2E\x20\x22"
"\x48\x54\x54\x50\x2F\x31\x2E\x31\x20\x32\x30\x30\x20\x4F\x4B\x22\x29\x20\x74\x6F\x20\x74\x68\x65\x20\x73"
"\x74\x72\x69\x6E\x67\x20\x3C\x55\x3E\x64\x69\x72\x65\x63\x74\x69\x76\x65\x3C\x2F\x55\x3E\x3C\x42\x52\x3E"
"\xA\x3C\x73\x6D\x61\x6C\x6C\x3E\x3C\x69\x3E\x75\x73\x65\x66\x75\x6C\x20\x66\x6F\x72\x20\x22\x48\x54\x54"
"\x50\x2F\x31\x2E\x31\x20\x34\x30\x31\x20\x41\x75\x74\x68\x6F\x72\x69\x7A\x61\x74\x69\x6F\x6E\x20\x52\x65"
"\x71\x75\x69\x72\x65\x64\x22\x20\x28\x74\x6F\x20\x72\x65\x71\x75\x69\x72\x65\x20\x61\x20\x70\x61\x73\x73"
"\x77\x6F\x72\x64\x29\x2C\x20\x72\x65\x64\x69\x72\x65\x63\x74\x69\x6F\x6E\x20\x6F\x72\x20\x73\x69\x6D\x69"
"\x6C\x61\x72\x20\x61\x63\x74\x69\x6F\x6E\x73\x20\x6F\x6E\x20\x74\x68\x65\x20\x63\x6C\x69\x65\x6E\x74\x20"
"\x73\x69\x64\x65\x3C\x2F\x69\x3E\x3C\x2F\x73\x6D\x61\x6C\x6C\x3E\x2E\x3C\x2F\x55\x4C\x3E\xA\x20\x3C\x42"
"\x3E\x4E\x4F\x54\x45\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x54\x68\x65\x20\x77\x65\x62\x5F\x63\x6C\x69\x65"
"\x6E\x74\x5F\x48\x54\x54\x50\x64\x69\x72\x65\x63\x74\x69\x76\x65\x28\x29\x20\x66\x75\x6E\x63\x74\x69\x6F"
"\x6E\x20\x63\x61\x6E\x20\x62\x65\x20\x63\x61\x6C\x6C\x65\x64\x20\x3C\x42\x3E\x6F\x6E\x6C\x79\x3C\x2F\x42"
"\x3E\x20\x66\x72\x6F\x6D\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x20\x63\x61\x6C\x6C\x65\x64\x20\x62\x79"
"\x20\x67\x65\x74\x68\x61\x6E\x64\x6C\x65\x72\x73\x20\x72\x65\x67\x69\x73\x74\x65\x72\x65\x64\x20\x76\x69"
"\x61\x20\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E"
"\x73\x23\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x64\x64\x68\x61\x6E\x64\x6C\x65\x72\x27\x3E\x77"
"\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x64\x64\x68\x61\x6E\x64\x6C\x65\x72\x28\x29\x3C\x2F\x61\x3E"
"\x2E\x3C\x2F\x55\x4C\x3E\xA\x3C\x48\x52\x3E\x3C\x42\x52\x3E\xA\xA\x3C\x41\x20\x6E\x61\x6D\x65\x3D\x77"
"\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x63\x6F\x6E\x74\x65\x6E\x74\x74\x79\x70\x65\x3E\x3C\x42\x3E\x3C"
"\x66\x6F\x6E\x74\x20\x63\x6F\x6C\x6F\x72\x3D\x27\x30\x30\x30\x30\x37\x37\x27\x3E\x77\x65\x62\x5F\x63\x6C"
"\x69\x65\x6E\x74\x5F\x63\x6F\x6E\x74\x65\x6E\x74\x74\x79\x70\x65\x28\x29\x3C\x2F\x66\x6F\x6E\x74\x3E\x3C"
"\x2F\x42\x3E\x3C\x42\x52\x3E\x3C\x42\x52\x3E\xA\x3C\x42\x3E\x4E\x41\x4D\x45\x3C\x2F\x42\x3E\xA\x3C\x55"
"\x4C\x3E\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x63\x6F\x6E\x74\x65\x6E\x74\x74\x79\x70\x65\x20\x2D"
"\x20\x70\x72\x69\x6E\x74\x73\x20\x74\x6F\x20\x73\x74\x64\x6F\x75\x74\x20\x74\x68\x65\x20\x68\x65\x61\x64"
"\x65\x72\x20\x22\x43\x6F\x6E\x74\x65\x6E\x74\x2D\x74\x79\x70\x65\x3A\x20\x2A\x2F\x2A\x22\x3C\x2F\x55\x4C"
"\x3E\xA\x3C\x42\x3E\x53\x59\x4E\x4F\x50\x53\x49\x53\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x23\x69\x6E\x63"
"\x6C\x75\x64\x65\x20\x22\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x2E\x68\x22\x3C\x42\x52\x3E\x3C\x42\x52"
"\x3E\x76\x6F\x69\x64\x20\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x63\x6F\x6E\x74\x65\x6E\x74\x74\x79"
"\x70\x65\x28\x63\x68\x61\x72\x20\x2A\x3C\x55\x3E\x65\x78\x74\x65\x6E\x73\x69\x6F\x6E\x3C\x2F\x55\x3E\x29"
"\x3B\x3C\x2F\x55\x4C\x3E\xA\x3C\x42\x3E\x44\x45\x53\x43\x52\x49\x50\x54\x49\x4F\x4E\x3C\x2F\x42\x3E\xA"
"\x3C\x55\x4C\x3E\x54\x68\x65\x20\x77\x65\x62\x5F\x63\x6C\x69\x65\x6E\x74\x5F\x63\x6F\x6E\x74\x65\x6E\x74"
"\x74\x79\x70\x65\x28\x29\x20\x70\x72\x69\x6E\x74\x73\x20\x74\x6F\x20\x73\x74\x64\x6F\x75\x74\x20\x74\x68"
"\x65\x20\x68\x65\x61\x64\x65\x72\x20\x22\x43\x6F\x6E\x74\x65\x6E\x74\x2D\x74\x79\x70\x65\x3A\x20\x2A\x2F"
"\x2A\x22\x2C\x20\x77\x68\x65\x72\x65\x20\x27\x2A\x2F\x2A\x27\x20\x69\x73\x20\x64\x65\x74\x65\x72\x6D\x69"
"\x6E\x65\x64\x20\x62\x79\x20\x3C\x55\x3E\x65\x78\x74\x65\x6E\x73\x69\x6F\x6E\x3C\x2F\x55\x3E\x20\x28\x69"
"\x2E\x65\x2E\x20\x22\x68\x74\x6D\x6C\x22\x20\x62\x61\x73\x65\x64\x20\x6F\x6E\x20\x6D\x69\x6D\x65\x66\x69"
"\x6C\x65\x20\x70\x72\x6F\x64\x75\x63\x65\x73\x20\x22\x43\x6F\x6E\x74\x65\x6E\x74\x2D\x74\x79\x70\x65\x3A"
"\x20\x74\x65\x78\x74\x2F\x68\x74\x6D\x6C\x5C\x72\x5C\x6E\x5C\x72\x5C\x6E\x22\x20\x61\x6E\x64\x20\x22\x6A"
"\x70\x67\x22\x20\x70\x72\x6F\x64\x75\x63\x65\x73\x20\x22\x43\x6F\x6E\x74\x65\x6E\x74\x2D\x74\x79\x70\x65"
"\x3A\x20\x69\x6D\x61\x67\x65\x2F\x6A\x70\x65\x67\x5C\x72\x5C\x6E\x5C\x72\x5C\x6E\x22\x29\x3C\x42\x52\x3E"
"\xA\x3C\x73\x6D\x61\x6C\x6C\x3E\x74\x68\x69\x73\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x20\x69\x73\x20\x75"
"\x73\x65\x64\x20\x6F\x6E\x20\x3C\x61\x20\x68\x72\x65\x66\x3D\x22\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E"
"\x63\x74\x69\x6F\x6E\x73\x23\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x6C\x69\x61\x73\x64\x69\x72"
"\x22\x3E\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x61\x6C\x69\x61\x73\x64\x69\x72\x28\x29\x3C\x2F\x61"
"\x3E\x3C\x2F\x73\x6D\x61\x6C\x6C\x3E\x3C\x2F\x55\x4C\x3E\xA\x20\x3C\x42\x3E\x4E\x4F\x54\x45\x3C\x2F\x42"
"\x3E\xA\x3C\x55\x4C\x3E\x54\x68\x69\x73\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x20\x75\x73\x65\x73\x20\x6D"
"\x69\x6D\x65\x20\x74\x79\x70\x65\x73\x20\x6C\x6F\x61\x64\x65\x64\x20\x61\x74\x20\x3C\x61\x20\x68\x72\x65"
"\x66\x3D\x22\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77\x65\x62\x5F\x73\x65"
"\x72\x76\x65\x72\x5F\x75\x73\x65\x4D\x49\x4D\x45\x66\x69\x6C\x65\x22\x3E\x77\x65\x62\x5F\x73\x65\x72\x76"
"\x65\x72\x5F\x75\x73\x65\x4D\x49\x4D\x45\x66\x69\x6C\x65\x28\x29\x3C\x2F\x61\x3E\x20\x65\x6C\x73\x65\x20"
"\x69\x74\x20\x77\x69\x6C\x6C\x20\x70\x72\x69\x6E\x74\x20\x6F\x6E\x6C\x79\x20\x22\x43\x6F\x6E\x74\x65\x6E"
"\x74\x2D\x74\x79\x70\x65\x3A\x20\x74\x65\x78\x74\x2F\x70\x6C\x61\x69\x6E\x5C\x72\x5C\x6E\x5C\x72\x5C\x6E"
"\x22\x3C\x2F\x55\x4C\x3E\xA\x3C\x48\x52\x3E\x3C\x42\x52\x3E\xA\xA\x3C\x41\x20\x6E\x61\x6D\x65\x3D\x77"
"\x65\x62\x5F\x6C\x6F\x67\x3E\x3C\x42\x3E\x3C\x66\x6F\x6E\x74\x20\x63\x6F\x6C\x6F\x72\x3D\x27\x30\x30\x30"
"\x30\x37\x37\x27\x3E\x77\x65\x62\x5F\x6C\x6F\x67\x28\x29\x3C\x2F\x66\x6F\x6E\x74\x3E\x3C\x2F\x42\x3E\x3C"
"\x42\x52\x3E\x3C\x42\x52\x3E\xA\x3C\x42\x3E\x4E\x41\x4D\x45\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x77\x65"
"\x62\x5F\x6C\x6F\x67\x20\x2D\x20\x77\x72\x69\x74\x65\x20\x74\x6F\x20\x6C\x6F\x67\x66\x69\x6C\x65\x3C\x2F"
"\x55\x4C\x3E\xA\x3C\x42\x3E\x53\x59\x4E\x4F\x50\x53\x49\x53\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x23\x69"
"\x6E\x63\x6C\x75\x64\x65\x20\x22\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x2E\x68\x22\x3C\x42\x52\x3E\x3C"
"\x42\x52\x3E\x76\x6F\x69\x64\x20\x77\x65\x62\x5F\x6C\x6F\x67\x28\x63\x6F\x6E\x73\x74\x20\x63\x68\x61\x72"
"\x20\x2A\x3C\x55\x3E\x66\x6F\x72\x6D\x61\x74\x3C\x2F\x55\x3E\x2C\x3C\x55\x3E\x2E\x2E\x2E\x3C\x2F\x55\x3E"
"\x29\x3B\x3C\x2F\x55\x4C\x3E\xA\x3C\x42\x3E\x44\x45\x53\x43\x52\x49\x50\x54\x49\x4F\x4E\x3C\x2F\x42\x3E"
"\xA\x3C\x55\x4C\x3E\x54\x68\x65\x20\x77\x65\x62\x5F\x6C\x6F\x67\x28\x29\x20\x69\x73\x20\x73\x69\x6D\x69"
"\x6C\x61\x72\x20\x74\x6F\x20\x70\x72\x69\x6E\x74\x66\x2C\x20\x62\x75\x74\x20\x77\x72\x69\x74\x65\x73\x20"
"\x74\x6F\x20\x61\x20\x6C\x6F\x67\x66\x69\x6C\x65\x20\x28\x73\x70\x65\x63\x69\x66\x69\x65\x64\x20\x69\x6E"
"\x20\x3C\x61\x20\x68\x72\x65\x66\x3D\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23"
"\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F\x69\x6E\x69\x74\x3E\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72"
"\x5F\x69\x6E\x69\x74\x28\x29\x3C\x2F\x61\x3E\x29\x2E\x20\x4A\x75\x73\x74\x20\x61\x73\x20\x70\x72\x69\x6E"
"\x74\x66\x2C\x20\x69\x74\x20\x64\x6F\x65\x73\x6E\x27\x74\x20\x61\x64\x64\x20\x61\x20\x6E\x65\x77\x6C\x69"
"\x6E\x65\x20\x61\x74\x20\x74\x68\x65\x20\x65\x6E\x64\x2E\x3C\x2F\x55\x4C\x3E\xA\x20\x3C\x42\x3E\x4E\x4F"
"\x54\x45\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x54\x68\x65\x20\x77\x65\x62\x5F\x6C\x6F\x67\x28\x29\x20\x66"
"\x75\x6E\x63\x74\x69\x6F\x6E\x20\x3C\x42\x3E\x73\x68\x6F\x75\x6C\x64\x3C\x2F\x42\x3E\x20\x62\x65\x20\x63"
"\x61\x6C\x6C\x65\x64\x20\x3C\x42\x3E\x6F\x6E\x6C\x79\x3C\x2F\x42\x3E\x20\x66\x72\x6F\x6D\x20\x66\x75\x6E"
"\x63\x74\x69\x6F\x6E\x73\x20\x63\x61\x6C\x6C\x65\x64\x20\x62\x79\x20\x67\x65\x74\x68\x61\x6E\x64\x6C\x65"
"\x72\x73\x20\x72\x65\x67\x69\x73\x74\x65\x72\x65\x64\x20\x76\x69\x61\x20\x3C\x61\x20\x68\x72\x65\x66\x3D"
"\x27\x2F\x3F\x68\x65\x6C\x70\x3D\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x23\x77\x65\x62\x5F\x73\x65\x72\x76"
"\x65\x72\x5F\x61\x64\x64\x68\x61\x6E\x64\x6C\x65\x72\x27\x3E\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x5F"
"\x61\x64\x64\x68\x61\x6E\x64\x6C\x65\x72\x28\x29\x3C\x2F\x61\x3E\x2E\x3C\x2F\x55\x4C\x3E\xA\x3C\x48\x52"
"\x3E\x3C\x42\x52\x3E\xA\xA\x3C\x41\x20\x6E\x61\x6D\x65\x3D\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x3E"
"\x3C\x42\x3E\x3C\x66\x6F\x6E\x74\x20\x63\x6F\x6C\x6F\x72\x3D\x27\x30\x30\x30\x30\x37\x37\x27\x3E\x43\x6C"
"\x69\x65\x6E\x74\x49\x6E\x66\x6F\x3C\x2F\x66\x6F\x6E\x74\x3E\x3C\x2F\x42\x3E\x3C\x42\x52\x3E\x3C\x42\x52"
"\x3E\xA\x3C\x42\x3E\x4E\x41\x4D\x45\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x43\x6C\x69\x65\x6E\x74\x49\x6E"
"\x66\x6F\x20\x2D\x20\x61\x20\x73\x74\x72\x75\x63\x74\x20\x74\x6F\x20\x63\x6F\x6E\x74\x72\x6F\x6C\x20\x63"
"\x6C\x69\x65\x6E\x74\x20\x48\x65\x61\x64\x65\x72\x3C\x2F\x55\x4C\x3E\xA\x3C\x42\x3E\x53\x59\x4E\x4F\x50"
"\x53\x49\x53\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x20\x44\x65\x63\x6C\x61\x72\x65\x64\x20\x69\x6E\x20\x77"
"\x65\x62\x5F\x73\x65\x72\x76\x65\x72\x2E\x68\x20\x3C\x42\x52\x3E\x3C\x42\x52\x3E\xA\x65\x78\x74\x65\x72"
"\x6E\x20\x73\x74\x72\x75\x63\x74\x20\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x20\x7B\x3C\x42\x52\x3E\xA"
"\x3C\x55\x4C\x3E\xA\x20\x20\x20\x20\x20\x20\x20\x20\x69\x6E\x74\x20\x3C\x55\x3E\x6F\x75\x74\x66\x64\x3C"
"\x2F\x55\x3E\x3B\x3C\x42\x52\x3E\xA\x20\x20\x20\x20\x20\x20\x20\x20\x63\x68\x61\x72\x20\x2A\x3C\x55\x3E"
"\x69\x6E\x65\x74\x6E\x61\x6D\x65\x3C\x2F\x55\x3E\x3B\x3C\x42\x52\x3E\xA\x20\x20\x20\x20\x20\x20\x20\x20"
"\x63\x68\x61\x72\x20\x2A\x3C\x55\x3E\x72\x65\x71\x75\x65\x73\x74\x3C\x2F\x55\x3E\x3B\x3C\x42\x52\x3E\xA"
"\x20\x20\x20\x20\x20\x20\x20\x20\x63\x68\x61\x72\x20\x2A\x3C\x55\x3E\x6D\x65\x74\x68\x6F\x64\x3C\x2F\x55"
"\x3E\x3B\x3C\x42\x52\x3E\xA\x20\x20\x20\x20\x20\x20\x20\x20\x63\x68\x61\x72\x20\x2A\x3C\x55\x3E\x75\x73"
"\x65\x72\x3C\x2F\x55\x3E\x3B\x3C\x42\x52\x3E\xA\x20\x20\x20\x20\x20\x20\x20\x20\x63\x68\x61\x72\x20\x2A"
"\x3C\x55\x3E\x70\x61\x73\x73\x3C\x2F\x55\x3E\x3B\x3C\x42\x52\x3E\xA\x9\x9\x63\x68\x61\x72\x20\x2A\x28"
"\x2A\x3C\x55\x3E\x48\x65\x61\x64\x65\x72\x3C\x2F\x55\x3E\x29\x28\x63\x68\x61\x72\x20\x2A\x68\x61\x6E\x64"
"\x6C\x65\x29\x3B\x3C\x42\x52\x3E\xA\x20\x20\x20\x20\x20\x20\x20\x20\x63\x68\x61\x72\x20\x2A\x28\x2A\x3C"
"\x55\x3E\x51\x75\x65\x72\x79\x3C\x2F\x55\x3E\x29\x28\x63\x68\x61\x72\x20\x2A\x68\x61\x6E\x64\x6C\x65\x29"
"\x3B\x3C\x42\x52\x3E\xA\x20\x20\x20\x20\x20\x20\x20\x20\x63\x68\x61\x72\x20\x2A\x28\x2A\x3C\x55\x3E\x50"
"\x6F\x73\x74\x3C\x2F\x55\x3E\x29\x28\x63\x68\x61\x72\x20\x2A\x68\x61\x6E\x64\x6C\x65\x29\x3B\x3C\x42\x52"
"\x3E\xA\x20\x20\x20\x20\x20\x20\x20\x20\x63\x68\x61\x72\x20\x2A\x28\x2A\x3C\x55\x3E\x43\x6F\x6F\x6B\x69"
"\x65\x3C\x2F\x55\x3E\x29\x28\x63\x68\x61\x72\x20\x2A\x68\x61\x6E\x64\x6C\x65\x29\x3B\x3C\x42\x52\x3E\xA"
"\x9\x9\x63\x68\x61\x72\x20\x2A\x28\x2A\x3C\x55\x3E\x43\x6F\x6E\x66\x3C\x2F\x55\x3E\x29\x28\x63\x68\x61"
"\x72\x20\x2A\x68\x61\x6E\x64\x6C\x65\x29\x3B\x3C\x42\x52\x3E\xA\x20\x20\x20\x20\x20\x20\x20\x20\x73\x74"
"\x72\x75\x63\x74\x20\x5F\x4D\x75\x6C\x74\x69\x50\x61\x72\x74\x20\x28\x2A\x3C\x55\x3E\x4D\x75\x6C\x74\x69"
"\x50\x61\x72\x74\x3C\x2F\x55\x3E\x29\x28\x63\x68\x61\x72\x20\x2A\x68\x61\x6E\x64\x6C\x65\x29\x3B\x3C\x42"
"\x52\x3E\xA\x20\x20\x20\x20\x20\x20\x20\x20\x76\x6F\x69\x64\x20\x2A\x5F\x5F\x70\x61\x64\x5B\x35\x5D\x3B"
"\x3C\x42\x52\x3E\xA\x3C\x2F\x55\x4C\x3E\xA\x7D\x20\x2A\x3C\x55\x3E\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66"
"\x6F\x3C\x2F\x55\x3E\x3B\xA\x3C\x2F\x55\x4C\x3E\xA\x3C\x42\x3E\x44\x45\x53\x43\x52\x49\x50\x54\x49\x4F"
"\x4E\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\xA\x3C\x42\x3E\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x2D\x26"
"\x67\x74\x3B\x3C\x55\x3E\x6F\x75\x74\x66\x64\x3C\x2F\x55\x3E\x3C\x2F\x42\x3E\x20\x3C\x55\x4C\x3E\x69\x73"
"\x20\x74\x68\x65\x20\x66\x69\x6C\x65\x64\x65\x73\x63\x72\x69\x70\x74\x6F\x72\x20\x6F\x66\x20\x74\x68\x65"
"\x20\x63\x75\x72\x72\x65\x6E\x74\x20\x6F\x75\x74\x70\x75\x74\x20\x73\x74\x72\x65\x61\x6D\x20\x28\x75\x73"
"\x65\x66\x75\x6C\x20\x66\x6F\x72\x20\x63\x67\x69\x20\x68\x61\x6E\x64\x6C\x65\x72\x73\x20\x61\x6E\x64\x20"
"\x66\x72\x69\x65\x6E\x64\x73\x29\x2E\x3C\x2F\x55\x4C\x3E\x3C\x42\x52\x3E\xA\x3C\x42\x3E\x43\x6C\x69\x65"
"\x6E\x74\x49\x6E\x66\x6F\x2D\x26\x67\x74\x3B\x3C\x55\x3E\x69\x6E\x65\x74\x6E\x61\x6D\x65\x3C\x2F\x55\x3E"
"\x3C\x2F\x42\x3E\x20\x3C\x55\x4C\x3E\x61\x20\x73\x74\x72\x69\x6E\x67\x20\x74\x6F\x20\x69\x6E\x65\x74\x6E"
"\x61\x6D\x65\x20\x28\x69\x2E\x65\x2E\x20\x22\x31\x32\x37\x2E\x30\x2E\x30\x2E\x31\x22\x29\x3C\x2F\x55\x4C"
"\x3E\x20\x3C\x42\x52\x3E\xA\x3C\x42\x3E\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x2D\x26\x67\x74\x3B\x3C"
"\x55\x3E\x72\x65\x71\x75\x65\x73\x74\x3C\x2F\x55\x3E\x3C\x2F\x42\x3E\x20\x3C\x55\x4C\x3E\x69\x73\x20\x74"
"\x68\x65\x20\x72\x65\x71\x75\x65\x73\x74\x65\x64\x20\x27\x66\x69\x6C\x65\x27\x20\x28\x69\x2E\x65\x2E\x20"
"\x66\x6F\x72\x20\x22\x47\x45\x54\x20\x2F\x69\x6E\x64\x65\x78\x2E\x68\x74\x6D\x6C\x20\x48\x54\x54\x50\x2F"
"\x31\x2E\x30\x5C\x72\x5C\x6E\x22\x20\x74\x68\x65\x20\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x2D\x26\x67"
"\x74\x3B\x72\x65\x71\x75\x65\x73\x74\x20\x69\x73\x20\x22\x2F\x69\x6E\x64\x65\x78\x2E\x68\x74\x6D\x6C\x22"
"\x29\x3C\x2F\x55\x4C\x3E\x3C\x42\x52\x3E\xA\x3C\x42\x3E\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x2D\x26"
"\x67\x74\x3B\x3C\x55\x3E\x6D\x65\x74\x68\x6F\x64\x3C\x2F\x55\x3E\x3C\x2F\x42\x3E\x20\x3C\x55\x4C\x3E\x69"
"\x73\x20\x74\x68\x65\x20\x72\x65\x71\x75\x65\x73\x74\x20\x6D\x65\x74\x68\x6F\x64\x20\x28\x22\x47\x45\x54"
"\x22\x20\x6F\x72\x20\x22\x50\x4F\x53\x54\x22\x20\x65\x74\x63\x2E\x2E\x29\x3C\x2F\x55\x4C\x3E\x3C\x42\x52"
"\x3E\xA\x3C\x42\x3E\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x2D\x26\x67\x74\x3B\x3C\x55\x3E\x75\x73\x65"
"\x72\x3C\x2F\x55\x3E\x3C\x2F\x42\x3E\x20\x3C\x55\x4C\x3E\x41\x75\x74\x68\x52\x65\x61\x6C\x6D\x20\x75\x73"
"\x65\x72\x6E\x61\x6D\x65\x3C\x2F\x55\x4C\x3E\x3C\x42\x52\x3E\xA\x3C\x42\x3E\x43\x6C\x69\x65\x6E\x74\x49"
"\x6E\x66\x6F\x2D\x26\x67\x74\x3B\x3C\x55\x3E\x70\x61\x73\x73\x3C\x2F\x55\x3E\x3C\x2F\x42\x3E\x20\x3C\x55"
"\x4C\x3E\x41\x75\x74\x68\x52\x65\x61\x6C\x6D\x20\x70\x61\x73\x73\x77\x6F\x72\x64\x3C\x2F\x55\x4C\x3E\x3C"
"\x42\x52\x3E\xA\x3C\x42\x3E\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x2D\x26\x67\x74\x3B\x3C\x55\x3E\x48"
"\x65\x61\x64\x65\x72\x28\x3C\x2F\x55\x3E\x63\x68\x61\x72\x20\x2A\x3C\x55\x3E\x68\x61\x6E\x64\x6C\x65\x3C"
"\x2F\x55\x3E\x29\x3C\x2F\x42\x3E\x20\x3C\x55\x4C\x3E\x46\x75\x6E\x63\x74\x69\x6F\x6E\x20\x74\x6F\x20\x70"
"\x61\x72\x73\x65\x20\x74\x68\x65\x20\x68\x65\x61\x64\x65\x72\x2C\x20\x61\x6E\x64\x20\x72\x65\x74\x75\x72"
"\x6E\x73\x20\x48\x65\x61\x64\x65\x72\x20\x69\x6E\x66\x6F\x72\x6D\x61\x74\x69\x6F\x6E\x20\x28\x69\x2E\x65"
"\x2E\x20\x66\x6F\x72\x20\x22\x48\x6F\x73\x74\x3A\x20\x68\x74\x74\x70\x3A\x2F\x2F\x31\x32\x37\x2E\x30\x2E"
"\x30\x2E\x31\x3A\x38\x31\x22\x20\x74\x68\x65\x20\x72\x65\x73\x75\x6C\x74\x20\x6F\x66\x20\x43\x6C\x69\x65"
"\x6E\x74\x49\x6E\x66\x6F\x2D\x26\x67\x74\x3B\x48\x65\x61\x64\x65\x72\x28\x22\x48\x6F\x73\x74\x22\x29\x20"
"\x69\x73\x20\x22\x68\x74\x74\x70\x3A\x2F\x2F\x31\x32\x37\x2E\x30\x2E\x30\x2E\x31\x3A\x38\x31\x22\x29\x20"
"\x69\x66\x20\x61\x72\x67\x75\x6D\x65\x6E\x74\x20\x3C\x55\x3E\x68\x61\x6E\x64\x6C\x65\x3C\x2F\x55\x3E\x20"
"\x69\x73\x20\x4E\x55\x4C\x4C\x20\x74\x68\x65\x6E\x20\x74\x68\x69\x73\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E"
"\x20\x72\x65\x74\x75\x72\x6E\x73\x20\x77\x68\x6F\x6C\x65\x20\x48\x65\x61\x64\x65\x72\x20\x66\x72\x6F\x6D"
"\x20\x63\x6C\x69\x65\x6E\x74\x3C\x2F\x55\x4C\x3E\x3C\x42\x52\x3E\xA\x3C\x42\x3E\x43\x6C\x69\x65\x6E\x74"
"\x49\x6E\x66\x6F\x2D\x26\x67\x74\x3B\x3C\x55\x3E\x51\x75\x65\x72\x79\x28\x3C\x2F\x55\x3E\x63\x68\x61\x72"
"\x20\x2A\x3C\x55\x3E\x68\x61\x6E\x64\x6C\x65\x3C\x2F\x55\x3E\x29\x3C\x2F\x42\x3E\x20\x3C\x55\x4C\x3E\x41"
"\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x20\x74\x68\x61\x74\x20\x72\x65\x74\x75\x72\x6E\x73\x20\x74\x68\x65"
"\x20\x71\x75\x65\x72\x79\x20\x76\x61\x6C\x75\x65\x20\x66\x72\x6F\x6D\x20\x74\x68\x65\x20\x62\x72\x6F\x77"
"\x73\x65\x72\x20\x28\x69\x2E\x65\x20\x66\x6F\x72\x20\x74\x68\x65\x20\x72\x65\x71\x75\x65\x73\x74\x20\x22"
"\x68\x74\x74\x70\x3A\x2F\x2F\x73\x6F\x6D\x65\x68\x6F\x73\x74\x2E\x6E\x65\x74\x2F\x72\x65\x71\x2E\x68\x74"
"\x6D\x6C\x3F\x69\x64\x3D\x35\x26\x66\x3D\x31\x22\x2C\x20\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x2D\x26"
"\x67\x74\x3B\x51\x75\x65\x72\x79\x28\x22\x69\x64\x22\x29\x20\x69\x73\x20\x22\x35\x22\x2E\x69\x66\x20\x61"
"\x72\x67\x75\x6D\x65\x6E\x74\x20\x3C\x55\x3E\x68\x61\x6E\x64\x6C\x65\x3C\x2F\x55\x3E\x20\x69\x73\x20\x4E"
"\x55\x4C\x4C\x20\x74\x68\x65\x6E\x20\x74\x68\x69\x73\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x20\x72\x65\x74"
"\x75\x72\x6E\x73\x20\x77\x68\x6F\x6C\x65\x20\x51\x75\x65\x72\x79\x20\x73\x74\x72\x69\x6E\x67\x20\x66\x72"
"\x6F\x6D\x20\x63\x6C\x69\x65\x6E\x74\x3C\x42\x52\x3E\x69\x66\x20\x74\x68\x65\x20\x68\x61\x6E\x64\x6C\x65"
"\x20\x68\x61\x76\x65\x20\x74\x68\x65\x20\x63\x68\x61\x72\x20\x23\x20\x66\x69\x72\x73\x74\x20\x28\x6C\x69"
"\x6B\x65\x20\x22\x23\x68\x61\x6E\x64\x6C\x65\x22\x29\x20\x69\x74\x20\x72\x65\x74\x75\x72\x6E\x73\x20\x74"
"\x68\x65\x20\x6E\x75\x6D\x62\x65\x72\x20\x6F\x66\x20\x76\x61\x72\x69\x61\x62\x6C\x65\x73\x20\x28\x75\x73"
"\x65\x66\x75\x6C\x6C\x20\x66\x6F\x72\x20\x63\x68\x65\x63\x6B\x62\x6F\x78\x65\x73\x20\x61\x6E\x64\x20\x65"
"\x74\x63\x2E\x2E\x2E\x29\x20\x43\x68\x65\x63\x6B\x20\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F\x3F\x68\x65"
"\x6C\x70\x3D\x65\x78\x61\x6D\x70\x6C\x65\x73\x23\x63\x68\x65\x63\x6B\x62\x6F\x78\x27\x3E\x63\x68\x65\x63"
"\x6B\x62\x6F\x78\x20\x65\x78\x61\x6D\x70\x6C\x65\x3C\x2F\x61\x3E\x3C\x2F\x55\x4C\x3E\x3C\x42\x52\x3E\xA"
"\x3C\x42\x3E\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x2D\x26\x67\x74\x3B\x3C\x55\x3E\x50\x6F\x73\x74\x28"
"\x3C\x2F\x55\x3E\x63\x68\x61\x72\x20\x2A\x3C\x55\x3E\x68\x61\x6E\x64\x6C\x65\x3C\x2F\x55\x3E\x29\x3C\x2F"
"\x42\x3E\x20\x3C\x55\x4C\x3E\x41\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x20\x74\x68\x61\x74\x20\x72\x65\x74"
"\x75\x72\x6E\x73\x20\x74\x68\x65\x20\x50\x6F\x73\x74\x20\x64\x61\x74\x61\x20\x66\x72\x6F\x6D\x20\x74\x68"
"\x65\x20\x66\x6F\x72\x6D\x73\x20\x77\x69\x74\x68\x20\x6D\x65\x74\x68\x6F\x64\x20\x27\x50\x4F\x53\x54\x27"
"\x2E\x20\x3C\x55\x3E\x68\x61\x6E\x64\x6C\x65\x3C\x2F\x55\x3E\x20\x69\x73\x20\x74\x68\x65\x20\x6E\x61\x6D"
"\x65\x20\x6F\x66\x20\x73\x6F\x6D\x65\x20\x26\x6C\x74\x3B\x69\x6E\x70\x75\x74\x26\x67\x74\x3B\x20\x74\x61"
"\x67\x2E\x69\x66\x20\x61\x72\x67\x75\x6D\x65\x6E\x74\x20\x3C\x55\x3E\x68\x61\x6E\x64\x6C\x65\x3C\x2F\x55"
"\x3E\x20\x69\x73\x20\x4E\x55\x4C\x4C\x20\x74\x68\x65\x6E\x20\x74\x68\x69\x73\x20\x66\x75\x6E\x63\x74\x69"
"\x6F\x6E\x20\x72\x65\x74\x75\x72\x6E\x73\x20\x77\x68\x6F\x6C\x65\x20\x50\x6F\x73\x74\x20\x64\x61\x74\x61"
"\x20\x66\x72\x6F\x6D\x20\x63\x6C\x69\x65\x6E\x74\x3C\x42\x52\x3E\x69\x66\x20\x74\x68\x65\x20\x68\x61\x6E"
"\x64\x6C\x65\x20\x68\x61\x76\x65\x20\x74\x68\x65\x20\x63\x68\x61\x72\x20\x23\x20\x66\x69\x72\x73\x74\x20"
"\x28\x6C\x69\x6B\x65\x20\x22\x23\x68\x61\x6E\x64\x6C\x65\x22\x29\x20\x69\x74\x20\x72\x65\x74\x75\x72\x6E"
"\x73\x20\x74\x68\x65\x20\x6E\x75\x6D\x62\x65\x72\x20\x6F\x66\x20\x76\x61\x72\x69\x61\x62\x6C\x65\x73\x20"
"\x28\x75\x73\x65\x66\x75\x6C\x6C\x20\x66\x6F\x72\x20\x63\x68\x65\x63\x6B\x62\x6F\x78\x65\x73\x20\x61\x6E"
"\x64\x20\x65\x74\x63\x2E\x2E\x2E\x29\x20\x43\x68\x65\x63\x6B\x20\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x2F"
"\x3F\x68\x65\x6C\x70\x3D\x65\x78\x61\x6D\x70\x6C\x65\x73\x23\x63\x68\x65\x63\x6B\x62\x6F\x78\x27\x3E\x63"
"\x68\x65\x63\x6B\x62\x6F\x78\x20\x65\x78\x61\x6D\x70\x6C\x65\x3C\x2F\x61\x3E\x3C\x2F\x55\x4C\x3E\x3C\x42"
"\x52\x3E\xA\x3C\x42\x3E\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x2D\x26\x67\x74\x3B\x3C\x55\x3E\x43\x6F"
"\x6F\x6B\x69\x65\x28\x3C\x2F\x55\x3E\x63\x68\x61\x72\x20\x2A\x3C\x55\x3E\x68\x61\x6E\x64\x6C\x65\x3C\x2F"
"\x55\x3E\x29\x3C\x2F\x42\x3E\x20\x3C\x55\x4C\x3E\x41\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x20\x74\x68\x61"
"\x74\x20\x72\x65\x74\x75\x72\x6E\x73\x20\x74\x68\x65\x20\x43\x6F\x6F\x6B\x69\x65\x20\x64\x61\x74\x61\x20"
"\x66\x72\x6F\x6D\x20\x62\x72\x6F\x77\x73\x65\x72\x2E\x20\x69\x66\x20\x61\x72\x67\x75\x6D\x65\x6E\x74\x20"
"\x3C\x55\x3E\x68\x61\x6E\x64\x6C\x65\x3C\x2F\x55\x3E\x20\x69\x73\x20\x4E\x55\x4C\x4C\x20\x74\x68\x65\x6E"
"\x20\x74\x68\x69\x73\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x20\x72\x65\x74\x75\x72\x6E\x73\x20\x77\x68\x6F"
"\x6C\x65\x20\x43\x6F\x6F\x6B\x69\x65\x73\x74\x72\x69\x6E\x67\x20\x66\x72\x6F\x6D\x20\x63\x6C\x69\x65\x6E"
"\x74\x3C\x2F\x55\x4C\x3E\x3C\x42\x52\x3E\xA\x3C\x42\x3E\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x2D\x26"
"\x67\x74\x3B\x3C\x55\x3E\x43\x6F\x6E\x66\x28\x3C\x2F\x55\x3E\x63\x68\x61\x72\x20\x2A\x20\x3C\x55\x3E\x74"
"\x6F\x70\x69\x63\x3C\x2F\x55\x3E\x2C\x63\x68\x61\x72\x20\x2A\x3C\x55\x3E\x68\x61\x6E\x64\x6C\x65\x3C\x2F"
"\x55\x3E\x29\x3C\x2F\x42\x3E\x20\x3C\x55\x4C\x3E\x41\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x20\x74\x68\x61"
"\x74\x20\x72\x65\x74\x75\x72\x6E\x73\x20\x61\x6E\x20\x76\x61\x6C\x75\x65\x20\x66\x72\x6F\x6D\x20\x61\x20"
"\x3C\x55\x3E\x6B\x65\x79\x3C\x2F\x55\x3E\x20\x69\x6E\x20\x3C\x55\x3E\x74\x6F\x70\x69\x63\x3C\x2F\x55\x3E"
"\x20\x69\x6E\x20\x74\x68\x65\x20\x63\x6F\x6E\x66\x69\x67\x20\x66\x69\x6C\x65\x20\x69\x66\x20\x75\x73\x65"
"\x64\x3C\x2F\x55\x4C\x3E\x3C\x42\x52\x3E\xA\x3C\x42\x3E\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x2D\x26"
"\x67\x74\x3B\x3C\x55\x3E\x4D\x75\x6C\x74\x69\x50\x61\x72\x74\x28\x3C\x2F\x55\x3E\x63\x68\x61\x72\x20\x2A"
"\x3C\x55\x3E\x68\x61\x6E\x64\x6C\x65\x3C\x2F\x55\x3E\x29\x3C\x2F\x42\x3E\x20\x3C\x55\x4C\x3E\x41\x20\x66"
"\x75\x6E\x63\x74\x69\x6F\x6E\x20\x74\x68\x61\x74\x20\x72\x65\x74\x75\x72\x6E\x73\x20\x61\x20\x64\x61\x74"
"\x61\x20\x73\x74\x72\x75\x63\x74\x75\x72\x65\x20\x66\x72\x6F\x6D\x20\x74\x68\x65\x20\x66\x6F\x72\x6D\x73"
"\x20\x77\x69\x74\x68\x20\x6D\x65\x74\x68\x6F\x64\x20\x27\x50\x4F\x53\x54\x27\x20\x61\x6E\x64\x20\x65\x6E"
"\x63\x74\x79\x70\x65\x3D\x27\x6D\x75\x6C\x74\x69\x70\x61\x72\x74\x2F\x66\x6F\x72\x6D\x2D\x64\x61\x74\x61"
"\x27\x20\x28\x75\x73\x65\x66\x75\x6C\x20\x66\x6F\x72\x20\x75\x70\x6C\x6F\x61\x64\x69\x6E\x67\x20\x66\x69"
"\x6C\x65\x73\x29\x2E\x20\x3C\x55\x3E\x68\x61\x6E\x64\x6C\x65\x3C\x2F\x55\x3E\x20\x69\x73\x20\x74\x68\x65"
"\x20\x6E\x61\x6D\x65\x20\x6F\x66\x20\x73\x6F\x6D\x65\x20\x26\x6C\x74\x3B\x69\x6E\x70\x75\x74\x26\x67\x74"
"\x3B\x20\x74\x61\x67\x2E\x3C\x42\x52\x3E\x3C\x42\x52\x3E\xA\x74\x68\x65\x20\x73\x74\x72\x75\x63\x74\x75"
"\x72\x65\x20\x69\x73\x3C\x42\x52\x3E\xA\x73\x74\x72\x75\x63\x74\x20\x5F\x4D\x75\x6C\x74\x69\x50\x61\x72"
"\x74\x20\x7B\xA\x3C\x55\x4C\x3E\xA\x63\x68\x61\x72\x20\x2A\x3C\x55\x3E\x69\x64\x3C\x2F\x75\x3E\x3B\x3C"
"\x42\x52\x3E\xA\x63\x68\x61\x72\x20\x2A\x3C\x55\x3E\x64\x61\x74\x61\x3C\x2F\x55\x3E\x3B\x3C\x42\x52\x3E"
"\xA\x75\x6E\x73\x69\x67\x6E\x65\x64\x20\x69\x6E\x74\x20\x3C\x55\x3E\x73\x69\x7A\x65\x3C\x2F\x55\x3E\x3B"
"\x3C\x42\x52\x3E\xA\x63\x68\x61\x72\x20\x2A\x3C\x55\x3E\x66\x69\x6C\x65\x6E\x61\x6D\x65\x3C\x2F\x55\x3E"
"\x3B\x3C\x42\x52\x3E\xA\x76\x6F\x69\x64\x20\x2A\x3C\x55\x3E\x70\x61\x64\x3C\x2F\x55\x3E\x3B\x3C\x42\x52"
"\x3E\xA\x3C\x2F\x55\x4C\x3E\xA\x7D\x3B\x3C\x42\x52\x3E\xA\x74\x6F\x20\x62\x65\x20\x75\x73\x65\x64\x20"
"\x61\x73\x20\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x2D\x26\x67\x74\x3B\x3C\x55\x3E\x4D\x75\x6C\x74\x69"
"\x50\x61\x72\x74\x3C\x2F\x55\x3E\x28\x22\x66\x69\x6C\x65\x31\x22\x29\x2E\x3C\x55\x3E\x64\x61\x74\x61\x3C"
"\x2F\x55\x3E\x3B\x20\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x2D\x26\x67\x74\x3B\x3C\x55\x3E\x4D\x75\x6C"
"\x74\x69\x50\x61\x72\x74\x3C\x2F\x55\x3E\x28\x22\x66\x69\x6C\x65\x31\x22\x29\x2E\x3C\x55\x3E\x73\x69\x7A"
"\x65\x3C\x2F\x55\x3E\x3B\x20\x43\x6C\x69\x65\x6E\x74\x49\x6E\x66\x6F\x2D\x26\x67\x74\x3B\x3C\x55\x3E\x4D"
"\x75\x6C\x74\x69\x50\x61\x72\x74\x3C\x2F\x55\x3E\x28\x22\x66\x69\x6C\x65\x31\x22\x29\x2E\x3C\x55\x3E\x66"
"\x69\x6C\x65\x6E\x61\x6D\x65\x3C\x2F\x55\x3E\x3B\xA\x3C\x2F\x55\x4C\x3E\xA\xA\x3C\x2F\x55\x4C\x3E\xA"
"\x3C\x48\x52\x3E\x3C\x42\x52\x3E\xA\x3C\x41\x20\x6E\x61\x6D\x65\x3D\x63\x6F\x6E\x66\x69\x67\x66\x69\x6C"
"\x65\x3E\x3C\x42\x3E\x3C\x66\x6F\x6E\x74\x20\x63\x6F\x6C\x6F\x72\x3D\x27\x30\x30\x30\x30\x37\x37\x27\x3E"
"\x54\x68\x65\x20\x63\x6F\x6E\x66\x69\x67\x20\x66\x69\x6C\x65\x3C\x2F\x66\x6F\x6E\x74\x3E\x3C\x2F\x42\x3E"
"\x3C\x42\x52\x3E\x3C\x42\x52\x3E\xA\x3C\x55\x4C\x3E\x74\x68\x65\x20\x63\x6F\x6E\x66\x69\x67\x20\x66\x69"
"\x6C\x65\x20\x69\x73\x20\x75\x73\x65\x64\x20\x61\x73\x3C\x42\x52\x3E\x3C\x42\x52\x3E\xA\x3C\x50\x52\x45"
"\x3E\xA\x5B\x54\x4F\x50\x49\x43\x5D\xA\x4B\x45\x59\x3D\x56\x41\x4C\x55\x45\xA\xA\x6C\x69\x62\x77\x65"
"\x62\x73\x65\x72\x76\x65\x72\x20\x63\x6F\x6E\x66\x69\x67\x75\x72\x61\x74\x69\x6F\x6E\x73\x20\x6D\x75\x73"
"\x74\x20\x62\x65\x20\x69\x6E\x20\x74\x6F\x70\x69\x63\x20\x4C\x49\x42\x57\x45\x42\x53\x45\x52\x56\x45\x52"
"\x20\x61\x73\x3A\xA\x5B\x4C\x49\x42\x57\x45\x42\x53\x45\x52\x56\x45\x52\x5D\xA\x4C\x4F\x47\x3D\x68\x65"
"\x6C\x70\x2E\x6C\x6F\x67\x20\xA\x50\x4F\x52\x54\x3D\x38\x30\xA\x55\x53\x45\x53\x53\x4C\x3D\x31\xA\x43"
"\x45\x52\x54\x46\x49\x4C\x45\x3D\x66\x6F\x6F\x63\x65\x72\x74\x2E\x70\x6D\xA\x4D\x49\x4D\x45\x46\x49\x4C"
"\x45\x3D\x2F\x65\x74\x63\x2F\x6D\x69\x6D\x65\x2E\x74\x79\x70\x65\x73\xA\x4C\x4F\x43\x41\x4C\x3D\x31\xA"
"\xA\x4C\x4F\x47\x20\x2D\x3E\x20\x74\x68\x65\x20\x6C\x6F\x67\x20\x66\x69\x6C\x65\xA\x50\x4F\x52\x54\x20"
"\x2D\x3E\x20\x74\x68\x65\x20\x6C\x69\x73\x74\x65\x6E\x20\x70\x6F\x72\x74\x20\x74\x68\x61\x74\x20\x77\x69"
"\x6C\x6C\x20\x62\x65\x20\x75\x73\x65\x64\x20\x66\x6F\x72\x20\x74\x63\x70\x20\x63\x6F\x6E\x6E\x65\x63\x74"
"\x69\x6F\x6E\x73\xA\xA\x55\x53\x45\x53\x53\x4C\x20\x2D\x3E\x20\x74\x68\x65\x20\x73\x73\x6C\x20\x66\x6C"
"\x61\x67\x20\x69\x66\x20\x79\x6F\x75\x20\x77\x61\x6E\x74\x20\x74\x6F\x20\x75\x73\x65\x20\x6F\x70\x65\x6E"
"\x73\x73\x6C\x20\x66\x6F\x72\x20\x73\x65\x63\x75\x72\x65\x20\x73\x65\x72\x76\x65\x72\x20\x28\x68\x74\x74"
"\x70\x73\x29\xA\x43\x45\x52\x54\x46\x49\x4C\x45\x20\x2D\x3E\x20\x74\x68\x65\x20\x66\x69\x6C\x65\x20\x74"
"\x68\x61\x74\x20\x63\x6F\x6E\x74\x61\x69\x6E\x73\x20\x63\x65\x72\x74\x69\x66\x69\x63\x61\x74\x65\x20\x66"
"\x6F\x72\x20\x73\x73\x6C\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\xA\x4D\x49\x4D\x45\x46\x49\x4C"
"\x45\x20\x2D\x3E\x20\x74\x68\x65\x20\x66\x69\x6C\x65\x20\x74\x68\x61\x74\x20\x63\x6F\x6E\x74\x61\x69\x6E"
"\x73\x20\x6D\x69\x6D\x65\x2E\x74\x79\x70\x65\x73\x20\x73\x69\x6D\x69\x6C\x65\x72\x20\x74\x6F\x20\x61\x70"
"\x61\x63\x68\x65\x20\x6D\x69\x6D\x65\x66\x69\x6C\x65\xA\x4C\x4F\x43\x41\x4C\x20\x2D\x3E\x20\x6F\x6E\x6C"
"\x79\x20\x61\x63\x63\x65\x70\x74\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x20\x66\x72\x6F\x6D\x20"
"\x31\x32\x37\x2E\x30\x2E\x30\x2E\x31\xA\xA\x3C\x2F\x50\x52\x45\x3E\xA\x3C\x2F\x55\x4C\x3E\xA\xA\x3C"
"\x2F\x66\x6F\x6E\x74\x3E\xA\xA\xA\xA";
#endif
+421
View File
@@ -0,0 +1,421 @@
#include "web_server.h"
#include <string.h>
#include <signal.h>
#include <stdlib.h>
#include <math.h>
#include "info.h"
#include "functions.h"
#include "examples.h"
#include "security.h"
struct web_server server;
#ifdef WIN32
#include <windows.h>
#endif
int PORT=81;
void teste1() {
printf("Content-type: text/html\r\n\r\n");
printf("here's location:<BR>\n");
printf("%s\r\n",ClientInfo->Header("Location"));
printf("NOTHING=%s\n<BR>",ClientInfo->Conf("[PERSONAL_CONF]","NOTHING"));
printf("IP=%s\n<BR>",ClientInfo->Conf("[PERSONAL_CONF]","IP"));
printf("MOST=%s\n<BR>",ClientInfo->Conf("[PERSONAL_CONF]","MOST"));
printf("IP=%s\n<BR>",ClientInfo->Conf("[LIBWEBSERVER]","IP"));
printf("Connection: %s\n",ClientInfo->Header("Connection"));
};
void varteste() {
web_client_setvar("bg",ClientInfo->Conf("PAGE_1","background"));
web_client_setvar("pata","#00FF00");
printf("Content-type: text/html\r\n\r\n");
printf("<HR>\n");
printf("$;pata;=\"$pata;\"");
printf("<B>&lt;$pata;BODY bgcolor=\"$pata;\"&gt;</B> $ (prototipe 0.5.1)<BR>\n");
printf("Luis Figueiredo$pata;coninhas\r\n");
};
void teste() {
int i=0;
web_client_setcookie("caos","teste da noia",NULL,NULL,NULL,0);
printf("content-type: text/html\r\n\r\n");
printf("hal is \"%s\" hallo is \"%s\"<BR>\n",ClientInfo->Post("hal"),ClientInfo->Post("hallo"));
printf("hal is \"%s\" hallo is \"%s\"<BR>\n",ClientInfo->Post("hal"),ClientInfo->Post("hallo"));
printf("<form method=post>\n");
printf("<input type=text name=hal value='%s'>\n",ClientInfo->Cookie("stdio"));
web_client_setcookie("teste",ClientInfo->Post("hallo"),"+1m",NULL,NULL,0);
printf("<input type=text name=hallo value='%s'>\n",ClientInfo->Cookie("teste"));
printf("<input type=submit name=send value='POST'>\n");
printf("</form>\n");
printf("<form method=query>\n");
for (i=0;i<5;i++) {
printf("<input type=checkbox name=teste value='%d'>%d<BR>\n",i,i);
};
printf("<input type=submit name=send1 value='SEND'>\n");
printf("</form>\n");
printf("You choose: ");
printf("%d numbers: \n",ClientInfo->Query("#teste"));
for(i=0;i<(int)ClientInfo->Query("#teste");i++){
printf("%s,",ClientInfo->Query("teste"));
};
web_client_setcookie("quatro","ratata","+1m","/","127.0.0.1",0);
printf("...<BR>");
printf("<form method=post>\n");
for (i=0;i<5;i++) {
printf("<input type=checkbox name=teste value='%d'>post %d<BR>\n",i,i);
};
printf("<input type=submit name=send1 value='SEND'>\n");
printf("</form>\n");
printf("You choose: ");
web_client_setcookie("tres","ratata","+1m",NULL,NULL,0);
printf("%d numbers: ",ClientInfo->Post("#teste"));
for (i=0;i<(int)ClientInfo->Post("#teste");i++) {
printf("%s,",ClientInfo->Post("teste"));
};
printf("...<BR>");
web_client_deletecookie("cinco");
printf("<form method=query>\n");
printf("<input type=submit name=test value='pipi'><BR>\n");
printf("</form>\n");
printf("The value of test is '%s'<BR>\n",ClientInfo->Query("test"));
printf("The value of test is '%s'<BR>\n",ClientInfo->Query("test"));
printf("The value of test is '%s'<BR>\n",ClientInfo->Query("test"));
printf("ClientInfo->Cookie(\"teste\")='%s'<BR>\n",ClientInfo->Cookie("teste"));
printf("ClientInfo->Cookie(\"stdio\")='%s'<BR>\n",ClientInfo->Cookie("stdio"));
printf("ClientInfo->Cookie(\"merdinha\")='%s'<BR>\n",ClientInfo->Cookie("merdinha"));
printf("ClientInfo->Cookie(\"activo\")='%s'<BR>\n",ClientInfo->Cookie("activo"));
printf("ClientInfo->Cookie(\"caos\")='%s'<BR>\n",ClientInfo->Cookie("caos"));
printf("ClientInfo->Cookie(\"caos\")='%s'<BR>\n",ClientInfo->Cookie("caos"));
printf("Method is %s\n<BR>",ClientInfo->method);
printf("Inetaddr=%s\n<BR>",ClientInfo->inetname);
for(i=0;i<10;i++) {
printf("<BR>ClientInfo->Post(\"teste\")='%s'\n",ClientInfo->Post("teste"));
};
printf("<BR>ClientInfo->Cookie(NULL)=\"%s\"<BR>",ClientInfo->Cookie(NULL));
printf("<BR>ClientInfo->Post(NULL)=\"%s\"<BR>",ClientInfo->Post(NULL));
printf("<BR>ClientInfo->Query(NULL)=\"%s\"<BR>",ClientInfo->Query(NULL));
printf("<BR>ClientInfo->Query(\"teste 0\")=\"%s\"<BR>",ClientInfo->Query("teste 0"));
printf("<PRE>ClientInfo->Header(NULL)=\"%s\"</PRE>\r\n",ClientInfo->Header(NULL));
};
void links() {
printf("[<a href='/'>main</a>] [<a href='/?help=info'>info</a>] [<a href='/?help=functions'>functions</a>] [<a href='/?help=examples'>examples</a>] [<a href='/?help=security'>security</a>] [<a href='/?help=Authors'>authors</a>] ");
};
void startpage(char *topic) {
printf("Content-type: text/html\r\n\r\n");
printf("<HTML>\n<body bgcolor='EFEFFF'>\n<CENTER>\n<TABLE><TR><TD align=center>\n<a href='http://libwebserver.sourceforge.net'><img border=0 src='/libwebserver.gif'></a>\n</TD><TR><TR><TD align=center>\n<font face='Verdana'><B>HELP<BR>(%s)</B></font>\n</TD></TR></TABLE>\n</CENTER>\n",topic);
links();
printf("<HR><BR>\n");
};
void endpage() {
printf("<HR>");
links();
printf("<p align=right> <small> by Luis Figueiredo (<a href='mailto:stdio@netc.pt'>stdio@netc.pt</a>) (%s)</BODY></HTML>\n",_libwebserver_version);
};
//Johannes E. Schindelin // new on 0.4.0
void hello_world() {
startpage("hello world example");
printf("Hello, World!\r\n");
endpage();
}
//
// NEW on 0.4.1
void checkbox() {
int i=0;
char *txt[]={"one","two","three","four","five"};
startpage("checkbox example");
printf("<form method=query>\n");
for(i=0;i<5;i++) {
printf("<input type=checkbox name=number value='%s'\n> %s<BR>",txt[i],txt[i]);
};
printf("<input type=submit name=send value=' SEND '>\n");
printf("</form>\n");
printf("You have choosen <font color='FF0000'>%d</font> numbers: \n",ClientInfo->Query("#number"));
for(i=0;i<(int)ClientInfo->Query("#number");i++) {
printf("<b>%s</b>,\n",ClientInfo->Query("number"));
};
printf("...<BR>");
endpage();
};
// NEW on 0.4.0
void cookie() {
if(strlen(ClientInfo->Post("user")))
web_client_setcookie("username",ClientInfo->Post("user"),"+15M",NULL,NULL,0);
startpage("Cookie example");
printf("<form method='POST'>\n");
printf("<input type=text name='user' value='%s'>\r\n<BR>",ClientInfo->Cookie("username"));
printf("<input type=submit name='send' value=' GO! '><BR>\r\n");
printf("</form>\n");
endpage();
};
//
void logfile() {
startpage("logfile");
printf("<PRE>\n");
web_client_addfile(server.logfile);
printf("</PRE>\n");
endpage();
};
struct image {
char *data;
size_t size;
} image={NULL,0};
void imageout() {
if(strlen(ClientInfo->Query("img"))) {
if(image.data!=NULL) {
printf("Content-type: image/jpeg\r\n\r\n");
fwrite(image.data,image.size,1,stdout);
};
return;
};
startpage("Image example");
printf("<form action='/image' method='POST' enctype='multipart/form-data'>\n");
printf("<input type=file name=image><BR>\n");
printf("<input type=submit name='GOO' value='See'>\n");
printf("</form>\n");
if(strlen(ClientInfo->MultiPart("image").data)) {
printf("%s<BR><img src='/image?img=%s.jpg'>\n",ClientInfo->MultiPart("image").filename,ClientInfo->MultiPart("image").filename);
free(image.data);
image.data=malloc(ClientInfo->MultiPart("image").size+1);
memcpy(image.data,ClientInfo->MultiPart("image").data,ClientInfo->MultiPart("image").size);
image.size=ClientInfo->MultiPart("image").size;
}else {
free(image.data);
image.data=NULL;
};
endpage();
};
#define GIFSIDE 320
char gifdata[GIFSIDE*GIFSIDE];
void outgif() {
float i;
int x,y,xc,yc;
char color;
web_client_gifsetpalette("EGA");
if(*ClientInfo->Query("img")!=0) {
printf("Content-type: image/gif\r\n\r\n");
if(!strcmp(ClientInfo->Query("img"),"circle")) {
xc=atoi(ClientInfo->Query("x"))%GIFSIDE;
yc=atoi(ClientInfo->Query("y"))%GIFSIDE;
color=(char)(rand()%15)+1;
for(i=0;i<6.28;i+=(float)0.01) {
x=(int)((GIFSIDE+xc+cos(i)*10))%GIFSIDE; // Johannes E. Schindelin bugfix
y=(int)((GIFSIDE+yc+sin(i)*10))%GIFSIDE; // Johannes E. Schindelin bugfix
gifdata[x+(y*GIFSIDE)]=color;
};
};
web_client_gifoutput(gifdata,GIFSIDE,GIFSIDE,0);
};
startpage("Gif example");
printf("<center>Generated a circle (click inside the image)<BR>\n");
printf("Pressed x=%s,y=%s<BR>\n",ClientInfo->Query("x"),ClientInfo->Query("y"));
printf("<form><input type=image border=0 src='/gif?img=circle&x=%s&y=%s'></form></CENTER>\n",ClientInfo->Query("x"),ClientInfo->Query("y"));
endpage();
};
void urlauthenticate() {
if(!strlen(ClientInfo->user) || !strlen(ClientInfo->pass) &&
strcmp(ClientInfo->user,"username") || strcmp(ClientInfo->pass,"password")) { // you can read things from a auth file
web_client_HTTPdirective("HTTP/1.1 401 Authorization Required\r\n"
"WWW-Authenticate: Basic realm=\"This site info\"");
startpage("Authenticate example");
printf("<CENTER><font color='FF0000'>Access denied</font></CENTER>\n");
endpage();
return;
}
startpage("Authenticate example");
printf("You entered in your area\n");
endpage();
};
void help() {
// info
// engine // removed (read the source)
// functions help
// functionall examples
// security
// regards
// authors
if(!strlen(ClientInfo->Query("help"))) {
startpage("Table of contents");
printf("<B>\n");
printf("<ol>\n");
printf("<li><a href='/?help=info'>libwebserver info</a></li>\n");
printf("<ul><li><a href='/?help=info#what'>What's libwebserver for?</a></li></ul>\n");
printf("<ul><li><a href='/?help=info#who'>Who's supposed to use libwebserver?</a></li></ul>\n"); // Johannes E. Schindelin spellcheck
printf("<ul><li><a href='/?help=info#when'>When am i supposed to use libwebserver?</a></li></ul>\n"); // Johannes E. Schindelin spellcheck
printf("<ul><li><a href='/?help=info#server_scripts'>Is there support for server scripts such as .php .cgi .asp?</a></li></ul>\n"); // Johannes E. Schindelin spellcheck
printf("<li><a href='/?help=functions'>libwebserver functions</a></li>\n");
printf("<ul><li><a href='/?help=functions#web_server_init'>web_server_init()</a></li></ul>\n");
printf("<ul><li><a href='/?help=functions#web_server_addhandler'>web_server_addhandler()</a></li></ul>\n");
printf("<ul><li><a href='/?help=functions#web_server_aliasdir'>web_server_aliasdir()</a><small>(new)</small></li></ul>\n");
printf("<ul><li><a href='/?help=functions#web_server_run'>web_server_run()</a></li></ul>\n");
printf("<ul><li><a href='/?help=functions#web_server_getconf'>web_server_getconf()</a></li></ul>\n");
printf("<ul><li><a href='/?help=functions#web_server_useSSLcert'>web_server_useSSLcert()</a></li></ul>\n");
printf("<ul><li><a href='/?help=functions#web_server_useMIMEfile'>web_server_useMIMEfile()</a><small>(new)</small></li></ul>\n");
printf("<ul><li><a href='/?help=functions#web_client_addstream'>web_client_addstream() </a><small><small>(obsolet, no longer in use in 0.3.4) use web_client_addfile instead</small></small></li></ul>\n");
printf("<ul><li><a href='/?help=functions#web_client_addfile'>web_client_addfile()</a></li></ul>\n");
printf("<ul><li><a href='/?help=functions#web_client_gifoutput'>web_client_gifoutput()</a><small>(changed)</small></li></ul>\n");
printf("<ul><li><a href='/?help=functions#web_client_gifsetpalette'>web_client_gifsetpalette()</a><small>(new)</small></li></ul>\n");
printf("<ul><li><a href='/?help=functions#web_client_setcookie'>web_client_setcookie()</a></li></ul>\n");
printf("<ul><li><a href='/?help=functions#web_client_deletecookie'>web_client_deletecookie()</a></li></ul>\n");
printf("<ul><li><a href='/?help=functions#web_client_setvar'>web_client_setvar()</a></li></ul>\n");
printf("<ul><li><a href='/?help=functions#web_client_getvar'>web_client_getvar()</a></li></ul>\n");
printf("<ul><li><a href='/?help=functions#web_client_delvar'>web_client_delvar()</a></li></ul>\n");
printf("<ul><li><a href='/?help=functions#web_client_HTTPdirective'>web_client_HTTPdirective()</a></li></ul>\n");
printf("<ul><li><a href='/?help=functions#web_client_contenttype'>web_client_contenttype()</a><small>(new)</small></li></ul>\n");
printf("<ul><li><a href='/?help=functions#web_log'>web_log()</a></li></ul>\n");
printf("<ul><li><a href='/?help=functions#ClientInfo'>ClientInfo</a></li></ul>\n");
printf("<ul><li><a href='/?help=functions#configfile'>The config file</a></li></ul>\n");
printf("<li><a href='/?help=examples'>libwebserver examples</a></li>\n");
printf("<ul><li><a href='/?help=examples#helloworld'>Hello, World!</a></li></ul>\n");
printf("<ul><li><a href='/?help=examples#logfile'>Show's log file</a></li></ul>\n");
printf("<ul><li><a href='/?help=examples#imageup'>Image Uploader</a></li></ul>\n");
printf("<ul><li><a href='/?help=examples#auth'>Authentication</a></li></ul>\n");
printf("<ul><li><a href='/?help=examples#ssl'>Openssl for (https)</a></li></ul>\n");
printf("<ul><li><a href='/?help=examples#outgif'>Gif generator</a><small>Changed</small></li></ul>\n");
printf("<ul><li><a href='/?help=examples#cookie'>Cookies</a></li></ul>\n");
printf("<ul><li><a href='/?help=examples#checkbox'>checkbox</a></li></ul>\n");
printf("<ul><li><a href='/?help=examples#confexample'>Config example</a></li></ul>\n");
printf("<ul><li><a href='/brokenlink'>Broken link</a></li></ul>\n");
printf("<ul><li><a href='/fs/'>aliasdir</a></li></ul>\n");
printf("<li><a href='/?help=security'>libwebserver security</a></li>\n");
printf("<ul><li><a href='/?help=security#safe'>It is safe to use?</a></li></ul>\n"); // Johannes E. Schindelin spellcheck
printf("<ul><li><a href='/?help=security#certificate'>How do I create my own certificate?</a></li></ul>\n"); // Johannes E. Schindelin made
printf("<ul><li><a href='/?help=security#racecondition'>Avoid race condition problems</a></li></ul>\n"); // Johannes E. Schindelin made
printf("<li><a href='/?help=Authors'>Authors</a></li>\n");
printf("</ol>\n");
printf("</B>\n");
endpage();
return;
};
startpage(ClientInfo->Query("help"));
if(!strcmp(ClientInfo->Query("help"),"info")) {
fwrite(info,sizeof(info),1,stdout);
//web_client_addfile("help.html/info.html");
};
if(!strcmp(ClientInfo->Query("help"),"security")) {
fwrite(security,sizeof(security),1,stdout);
//web_client_addfile("help.html/security.html");
};
if(!strcmp(ClientInfo->Query("help"),"functions")) {
fwrite(functions,sizeof(functions),1,stdout);
//web_client_addfile("help.html/functions.html");
};
if(!strcmp(ClientInfo->Query("help"),"examples")) {
fwrite(examples,sizeof(examples),1,stdout);
//web_client_addfile("help.html/examples.html");
};
if(!strcmp(ClientInfo->Query("help"),"Authors")) {
printf("Luis Figueiredo (<a href='mailto:stdio@netc.pt'>stdio@netc.pt</a>) - Main programmer, designer<BR><BR>\n");
printf("People who contributed:<BR>\n");
printf("<UL>João Luis Marques (<a href='mailto:Lamego@PTLink.net'>Lamego@PTLink.net</a>)<BR>\n");
printf("<UL>minor bug reported (redirectors, stdout)</UL></UL>\n");
printf("<UL>'oddsock' (<a href='mailto:oddsock@oddsock.org'>oddsock@oddsock.org</a>)<BR>\n");
printf("<UL>Licensing tip, and minor bug reported (segv in querystring)</UL></UL>\n");
printf("<UL>Rocco Carbone (<a href='mailto:rocco@tecsiel.it'>rocco@tecsiel.it</a>)<BR>\n");
printf("<UL>Return code for web_server_run tip</UL></UL>\n");
printf("<UL>Johannes E. Schindelin (<a href='mailto:Johannes.Schindelin@gmx.de'>Johannes.Schindelin@gmx.de</a>)<BR>\n");
printf("<UL>Spell checking, Makefile portability, and security 'How do I create my own certificate?'<BR>\n");
printf("bugfixes, example 'hello world!'</UL></UL>\n");
printf("<UL>Richard Offer (<a href='mailto:offer@sgi.com'>offer@sgi.com</a>)<BR>\n");
printf("<UL>checkboxes, (multiple variables) tip</UL></UL>\n");
printf("<UL>Sven Anders (<a href='mailto:anders@anduras.de'>anders@anduras.de</a>)<BR>\n");
printf("<UL>Created a new web_client_setcookie()(i made some changes)</UL></UL>\n");
printf("<UL>Hilobok Andrew (<a href='mailto:han@km.if.ua'>han@km.if.ua</a>)<BR>\n");
printf("<UL>FreeBSD portability</UL></UL>\n");
};
endpage();
};
void confexample() {
startpage("confexample");
printf("<PRE>\n");
web_client_addfile(server.conffile);
printf("</PRE>\n");
printf("ClientInfo->Conf(\"PERSONAL_CONF\",\"PORT\")->%s<BR>\n",ClientInfo->Conf("PERSONAL_CONF","PORT"));
printf("ClientInfo->Conf(\"PERSONAL_CONF\",\"IP\")->%s<BR>\n",ClientInfo->Conf("PERSONAL_CONF","IP"));
printf("ClientInfo->Conf(\"LIBWEBSERVER\",\"PORT\")->%s<BR>\n",ClientInfo->Conf("LIBWEBSERVER","PORT"));
endpage();
};
int main() {
#ifdef DEBUG
//FILE *err=freopen("debug.log","w",stderr);
#endif // DEBUG
memset(gifdata,0,GIFSIDE*GIFSIDE);
while(!web_server_init(&server,PORT,"help.cfg",WS_USEEXTCONF|WS_USELEN))PORT++;
web_server_useMIMEfile(&server,"mime.types");
//web_server_addhandler(&server,"* /",skip,0);
web_server_addhandler(&server,"* /",help,0);
web_server_addhandler(&server,"* /teste",teste,WS_LOCAL);
web_server_addhandler(&server,"* /varteste",varteste,WS_DYNVAR|WS_USELEN);
web_server_addhandler(&server,"* /teste1",teste1,WS_LOCAL);
web_server_addhandler(&server,"* /hello",hello_world,0);
web_server_addhandler(&server,"* /log",logfile,WS_USELEN); // turn off global flag
web_server_addhandler(&server,"* /image",imageout,0);
web_server_addhandler(&server,"* /gif",outgif,0);
web_server_addhandler(&server,"* /auth",urlauthenticate,0);
web_server_addhandler(&server,"* /cookie",cookie,0);
web_server_addhandler(&server,"* /checkbox",checkbox,0);
web_server_addhandler(&server,"* /confexample",confexample,0);
web_server_aliasdir(&server,"fs","/",0);
_tmpnameprefix="lws";
printf("http://localhost:%d\n",server.port);
//putenv("TEMP=c:\\temp");
for(;;) {
web_server_run(&server);
};
};
+13
View File
@@ -0,0 +1,13 @@
[LIBWEBSERVER]
LOG=help.log
PORT=81
USESSL=0
LOCAL=0
DYNVAR=0
[PERSONAL_CONF]
PORT=Portability
MOST=general key guard
IP=127.0.0.1
+87
View File
@@ -0,0 +1,87 @@
/*
* by data2header by Luis Figueiredo (stdio@netc.pt)
*/
#ifndef _INFO_H_
#define _INFO_H_
char info[]="\x3C\x63\x65\x6E\x74\x65\x72\x3E\x3C\x48\x33\x3E\x3C\x66\x6F\x6E\x74\x20\x63\x6F\x6C\x6F\x72\x3D\x27"
"\x30\x30\x37\x37\x30\x30\x27\x3E\x6C\x69\x62\x77\x65\x62\x73\x65\x72\x76\x65\x72\x20\x49\x6E\x66\x6F\x3C"
"\x2F\x66\x6F\x6E\x74\x3E\x3C\x2F\x48\x33\x3E\x3C\x2F\x63\x65\x6E\x74\x65\x72\x3E\x3C\x42\x52\x3E\x3C\x42"
"\x52\x3E\xA\x3C\x41\x20\x6E\x61\x6D\x65\x3D\x77\x68\x61\x74\x3E\x3C\x42\x3E\x3C\x66\x6F\x6E\x74\x20\x63"
"\x6F\x6C\x6F\x72\x3D\x27\x30\x30\x30\x30\x37\x37\x27\x3E\x57\x68\x61\x74\x27\x73\x20\x6C\x69\x62\x77\x65"
"\x62\x73\x65\x72\x76\x65\x72\x20\x66\x6F\x72\x3F\x3C\x2F\x66\x6F\x6E\x74\x3E\x3C\x2F\x42\x3E\x3C\x42\x52"
"\x3E\xA\x3C\x55\x4C\x3E\x54\x68\x69\x73\x20\x6C\x69\x62\x20\x69\x73\x20\x69\x6E\x74\x65\x6E\x64\x65\x64"
"\x20\x74\x6F\x20\x61\x64\x64\x20\x77\x65\x62\x73\x65\x72\x76\x65\x72\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E"
"\x61\x6C\x69\x74\x79\x20\x74\x6F\x20\x70\x72\x6F\x67\x72\x61\x6D\x73\x20\x69\x6E\x73\x74\x65\x61\x64\x20"
"\x6F\x66\x20\x75\x73\x69\x6E\x67\x20\x61\x6E\x20\x65\x78\x74\x65\x72\x6E\x61\x6C\x20\x77\x65\x62\x73\x65"
"\x72\x76\x65\x72\x2E\x3C\x42\x52\x3E\xA\x9\x54\x77\x6F\x20\x65\x78\x61\x6D\x70\x6C\x65\x73\x20\x66\x6F"
"\x72\x20\x65\x6D\x62\x65\x64\x64\x65\x64\x20\x77\x65\x62\x73\x65\x72\x76\x65\x72\x73\x20\x74\x68\x61\x74"
"\x20\x69\x20\x6B\x6E\x6F\x77\x20\x6F\x66\x20\x61\x72\x65\x20\x73\x69\x6D\x70\x6C\x65\x20\x28\x73\x68\x6F"
"\x75\x74\x63\x61\x73\x74\x20\x28\x69\x20\x67\x75\x65\x73\x73\x29\x2C\x20\x61\x6E\x64\x20\x77\x65\x62\x54"
"\x56\x20\x28\x74\x65\x6C\x65\x74\x65\x78\x74\x20\x61\x73\x20\x61\x20\x77\x65\x62\x70\x61\x67\x65\x20\x28"
"\x66\x72\x6F\x6D\x20\x70\x69\x6E\x6E\x61\x63\x6C\x65\x29\x29\x3B\x20\x61\x6E\x64\x20\x6D\x61\x6E\x79\x20"
"\x6F\x74\x68\x65\x72\x73\x20\x70\x72\x6F\x62\x61\x62\x6C\x79\x20\x64\x6F\x20\x74\x68\x65\x20\x73\x61\x6D"
"\x65\x2E\xA\x3C\x2F\x55\x4C\x3E\xA\x3C\x48\x52\x3E\xA\x3C\x41\x20\x6E\x61\x6D\x65\x3D\x77\x68\x6F\x3E"
"\x3C\x42\x3E\x3C\x66\x6F\x6E\x74\x20\x63\x6F\x6C\x6F\x72\x3D\x27\x30\x30\x30\x30\x37\x37\x27\x3E\x57\x68"
"\x6F\x27\x73\x20\x73\x75\x70\x70\x6F\x73\x65\x64\x20\x74\x6F\x20\x75\x73\x65\x20\x6C\x69\x62\x77\x65\x62"
"\x73\x65\x72\x76\x65\x72\x3F\x3C\x2F\x66\x6F\x6E\x74\x3E\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x54\x68\x69"
"\x73\x20\x69\x73\x20\x6D\x61\x69\x6E\x6C\x79\x20\x64\x65\x76\x65\x6C\x6F\x70\x65\x64\x20\x66\x6F\x72\x20"
"\x64\x65\x76\x65\x6C\x6F\x70\x65\x72\x73\x20\x74\x6F\x20\x6D\x61\x6B\x65\x20\x69\x74\x20\x65\x61\x73\x69"
"\x65\x72\x20\x74\x6F\x20\x77\x72\x69\x74\x65\x20\x61\x20\x77\x65\x62\x20\x69\x6E\x74\x65\x72\x66\x61\x63"
"\x65\x20\x74\x6F\x20\x74\x68\x65\x69\x72\x20\x73\x6F\x66\x74\x77\x61\x72\x65\x2C\x20\x28\x6E\x6F\x74\x65"
"\x20\x61\x20\x77\x65\x62\x62\x72\x6F\x77\x73\x65\x72\x20\x69\x73\x20\x63\x6F\x6D\x6D\x6F\x6E\x6C\x79\x20"
"\x61\x76\x61\x69\x6C\x61\x62\x6C\x65\x20\x69\x6E\x20\x6D\x6F\x73\x74\x20\x6F\x70\x65\x72\x61\x74\x69\x6E"
"\x67\xA\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x73\x79\x73\x74\x65\x6D\x73\x29\x20\x73\x6F"
"\x20\x69\x74\x20\x69\x73\x20\x6C\x69\x6B\x65\x20\x61\x20\x70\x6F\x72\x74\x61\x62\x6C\x65\x20\x22\x74\x65"
"\x72\x6D\x69\x6E\x61\x6C\x22\x20\x74\x68\x61\x74\x20\x63\x61\x6E\x20\x62\x65\x20\x61\x63\x63\x65\x73\x73"
"\x65\x64\x20\x66\x72\x6F\x6D\x20\x61\x6E\x79\x20\x63\x6F\x6D\x70\x75\x74\x65\x72\x20\x28\x77\x69\x74\x68"
"\x20\x61\x20\x62\x72\x6F\x77\x73\x65\x72\x20\x6F\x66\x20\x63\x6F\x75\x72\x73\x65\x2E\x2E\x2E\x29\x2E\x3C"
"\x2F\x55\x4C\x3E\xA\x3C\x48\x52\x3E\xA\x3C\x41\x20\x6E\x61\x6D\x65\x3D\x77\x68\x65\x6E\x3E\x3C\x42\x3E"
"\x3C\x66\x6F\x6E\x74\x20\x63\x6F\x6C\x6F\x72\x3D\x27\x30\x30\x30\x30\x37\x37\x27\x3E\x57\x68\x65\x6E\x20"
"\x61\x6D\x20\x69\x20\x73\x75\x70\x70\x6F\x73\x65\x64\x20\x74\x6F\x20\x75\x73\x65\x20\x6C\x69\x62\x77\x65"
"\x62\x73\x65\x72\x76\x65\x72\x3F\x3C\x2F\x66\x6F\x6E\x74\x3E\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x46\x6F"
"\x72\x20\x65\x78\x61\x6D\x70\x6C\x65\x2C\x20\x69\x6D\x61\x67\x69\x6E\x65\x20\x74\x68\x61\x74\x20\x79\x6F"
"\x75\x20\x61\x72\x65\x20\x64\x65\x76\x65\x6C\x6F\x70\x69\x6E\x67\x20\x61\x20\x64\x61\x65\x6D\x6F\x6E\x20"
"\x61\x6E\x64\x20\x77\x61\x6E\x74\x20\x74\x6F\x20\x63\x68\x65\x63\x6B\x20\x73\x74\x61\x74\x73\x20\x6F\x72"
"\x20\x72\x65\x2D\x63\x6F\x6E\x66\x69\x67\x75\x72\x65\x20\x61\x74\x20\x72\x75\x6E\x2D\x74\x69\x6D\x65\x3B"
"\xA\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x77\x69\x74\x68\x20\x74\x68"
"\x69\x73\x20\x6C\x69\x62\x72\x61\x72\x79\x20\x79\x6F\x75\x20\x63\x61\x6E\x20\x61\x64\x64\x20\x61\x20\x6C"
"\x69\x73\x74\x65\x6E\x20\x70\x6F\x72\x74\x20\x66\x6F\x72\x20\x72\x75\x6E\x74\x69\x6D\x65\x2C\x20\x61\x6E"
"\x64\x20\x63\x6F\x6E\x6E\x65\x63\x74\x20\x77\x69\x74\x68\x20\x77\x68\x61\x74\x65\x76\x65\x72\x20\x62\x72"
"\x6F\x77\x73\x65\x72\x20\x28\x76\x69\x61\x20\x48\x54\x4D\x4C\x20\x69\x6E\x74\x65\x72\x66\x61\x63\x65\x29"
"\xA\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x77\x69\x74\x68\x6F\x75\x74"
"\x20\x64\x65\x70\x65\x6E\x64\x65\x6E\x63\x69\x65\x73\x20\x6F\x66\x20\x61\x6E\x20\x65\x78\x74\x65\x72\x6E"
"\x61\x6C\x20\x77\x65\x62\x73\x65\x72\x76\x65\x72\x2E\x3C\x42\x52\x3E\xA\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x59\x6F\x75\x20\x63\x61\x6E\x20\x65\x76\x65\x6E\x20\x64\x6F\x20"
"\x61\x20\x77\x65\x62\x73\x65\x72\x76\x65\x72\x20\x28\x6F\x66\x20\x63\x6F\x75\x72\x73\x65\x29\x2C\x20\x6A"
"\x75\x73\x74\x20\x75\x73\x65\x20\x79\x6F\x75\x72\x20\x69\x6D\x61\x67\x69\x6E\x61\x74\x69\x6F\x6E\x2E\x3C"
"\x42\x52\x3E\xA\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x41\x6E\x6F\x74"
"\x68\x65\x72\x20\x71\x75\x69\x74\x65\x20\x73\x69\x6D\x70\x6C\x65\x20\x65\x78\x61\x6D\x70\x6C\x65\x2C\x20"
"\x61\x20\x73\x6F\x75\x6E\x64\x20\x72\x65\x63\x6F\x72\x64\x65\x72\x20\x28\x75\x73\x69\x6E\x67\x20\x6F\x6E"
"\x6C\x79\x20\x6C\x6F\x63\x61\x6C\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x20\x66\x6F\x72\x20\x73"
"\x65\x63\x75\x72\x69\x74\x79\x20\x72\x65\x61\x73\x6F\x6E\x73\x29\x20\x75\x73\x65\x73\x20\x61\x20\x77\x65"
"\x62\x20\x69\x6E\x74\x65\x72\x66\x61\x63\x65\x20\x74\x6F\x20\x63\x6F\x6E\x74\x72\x6F\x6C\xA\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x2F\x64\x65\x76\x2F\x64\x73\x70\x20\x72\x65"
"\x61\x64\x69\x6E\x67\x2F\x77\x72\x69\x74\x69\x6E\x67\x20\x28\x76\x69\x61\x20\x48\x54\x4D\x4C\x20\x69\x6E"
"\x74\x65\x72\x66\x61\x63\x65\x29\x2E\xA\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x74\x68\x65\x72\x65\x20\x61\x72\x65\x20\x6D\x61\x6E\x79\x20\x6F\x74\x68\x65\x72\x20\x74\x68\x69"
"\x6E\x67\x73\x20\x79\x6F\x75\x20\x63\x61\x6E\x20\x64\x6F\x20\x2E\x2E\x2E\x3C\x2F\x55\x4C\x3E\xA\xA\x3C"
"\x48\x52\x3E\xA\x3C\x41\x20\x6E\x61\x6D\x65\x3D\x73\x65\x72\x76\x65\x72\x5F\x73\x63\x72\x69\x70\x74\x73"
"\x3E\x3C\x42\x3E\x3C\x66\x6F\x6E\x74\x20\x63\x6F\x6C\x6F\x72\x3D\x27\x30\x30\x30\x30\x37\x37\x27\x3E\x49"
"\x73\x20\x74\x68\x65\x72\x65\x20\x73\x75\x70\x70\x6F\x72\x74\x20\x66\x6F\x72\x20\x73\x65\x72\x76\x65\x72"
"\x20\x73\x63\x72\x69\x70\x74\x73\x20\x73\x75\x63\x68\x20\x61\x73\x20\x2E\x70\x68\x70\x20\x2E\x63\x67\x69"
"\x20\x2E\x61\x73\x70\x3F\x3C\x2F\x66\x6F\x6E\x74\x3E\x3C\x2F\x42\x3E\xA\x3C\x55\x4C\x3E\x20\x57\x65\x6C"
"\x6C\x2C\x20\x74\x68\x69\x73\x20\x6C\x69\x62\x72\x61\x72\x79\x20\x6F\x6E\x6C\x79\x20\x70\x72\x6F\x76\x69"
"\x64\x65\x73\x20\x77\x65\x62\x20\x73\x65\x72\x76\x65\x72\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x73\x20\x74"
"\x68\x61\x74\x20\x6D\x61\x6B\x65\x20\x61\x20\x73\x65\x72\x76\x65\x72\x20\x72\x75\x6E\x6E\x69\x6E\x67\x2C"
"\x20\x73\x65\x72\x76\x65\x72\x20\x73\x63\x72\x69\x70\x74\x73\x20\x63\x61\x6E\x20\x62\x65\x20\x73\x75\x70"
"\x70\x6F\x72\x74\x65\x64\x20\x69\x66\x20\x79\x6F\x75\x20\x77\x61\x6E\x74\x20\x74\x6F\x20\x64\x6F\x20\x69"
"\x74\x3A\xA\x20\x20\x20\x20\x20\x20\x79\x6F\x75\x20\x63\x61\x6E\x20\x64\x65\x76\x65\x6C\x6F\x70\x20\x61"
"\x20\x68\x61\x6E\x64\x6C\x65\x72\x20\x66\x6F\x72\x20\x74\x79\x70\x65\x20\x22\x2E\x73\x6F\x6D\x65\x74\x68"
"\x69\x6E\x67\x22\x20\x6F\x72\x20\x77\x68\x61\x74\x65\x76\x65\x72\x2C\x20\x74\x68\x69\x73\x20\x70\x61\x63"
"\x6B\x61\x67\x65\x20\x70\x72\x6F\x76\x69\x64\x65\x73\x20\x61\x20\x2E\x63\x67\x69\x20\x68\x61\x6E\x64\x6C"
"\x65\x72\x20\x61\x73\x20\x61\x6E\x20\x65\x78\x61\x6D\x70\x6C\x65\x2C\x20\x28\x75\x73\x65\x20\x61\x74\x20"
"\x79\x6F\x75\x72\x20\x6F\x77\x6E\x20\x72\x69\x73\x6B\x20\x6F\x72\x20\x6D\x61\x6B\x65\x20\x69\x74\x20\x62"
"\x65\x74\x74\x65\x72\x29\x2E\x3C\x2F\x55\x4C\x3E\xA\xA\xA";
#endif
+4
View File
@@ -0,0 +1,4 @@
type ..\help.html\info.html |..\tools\data2header.exe info >info.h
type ..\help.html\functions.html |..\tools\data2header.exe functions >functions.h
type ..\help.html\examples.html |..\tools\data2header.exe examples >examples.h
type ..\help.html\security.html |..\tools\data2header.exe security >security.h
+469
View File
@@ -0,0 +1,469 @@
# This is a comment. I love comments.
# This file controls what Internet media types are sent to the client for
# given file extension(s). Sending the correct media type to the client
# is important so they know how to handle the content of the file.
# Extra types can either be added here or by using an AddType directive
# in your config files. For more information about Internet media types,
# please read RFC 2045, 2046, 2047, 2048, and 2077. The Internet media type
# registry is at <ftp://ftp.iana.org/in-notes/iana/assignments/media-types/>.
# MIME type Extension
application/EDI-Consent
application/EDI-X12
application/EDIFACT
application/activemessage
application/andrew-inset ez
application/applefile
application/atomicmail
application/batch-SMTP
application/beep+xml
application/cals-1840
application/commonground
application/cybercash
application/dca-rft
application/dec-dx
application/dvcs
application/eshop
application/http
application/hyperstudio
application/iges
application/index
application/index.cmd
application/index.obj
application/index.response
application/index.vnd
application/iotp
application/ipp
application/isup
application/font-tdpfr
application/mac-binhex40 hqx
application/mac-compactpro cpt
application/macwriteii
application/marc
application/mathematica
application/mathematica-old
application/msword doc
application/news-message-id
application/news-transmission
application/ocsp-request
application/ocsp-response
application/octet-stream bin dms lha lzh exe class so dll
application/oda oda
application/parityfec
application/pdf pdf
application/pgp-encrypted
application/pgp-keys
application/pgp-signature
application/pkcs10
application/pkcs7-mime
application/pkcs7-signature
application/pkix-cert
application/pkix-crl
application/pkixcmp
application/postscript ai eps ps
application/prs.alvestrand.titrax-sheet
application/prs.cww
application/prs.nprend
application/qsig
application/remote-printing
application/riscos
application/rtf
application/sdp
application/set-payment
application/set-payment-initiation
application/set-registration
application/set-registration-initiation
application/sgml
application/sgml-open-catalog
application/sieve
application/slate
application/smil smi smil
application/timestamp-query
application/timestamp-reply
application/vemmi
application/vnd.3M.Post-it-Notes
application/vnd.FloGraphIt
application/vnd.accpac.simply.aso
application/vnd.accpac.simply.imp
application/vnd.acucobol
application/vnd.aether.imp
application/vnd.anser-web-certificate-issue-initiation
application/vnd.anser-web-funds-transfer-initiation
application/vnd.audiograph
application/vnd.businessobjects
application/vnd.bmi
application/vnd.canon-cpdl
application/vnd.canon-lips
application/vnd.claymore
application/vnd.commerce-battelle
application/vnd.commonspace
application/vnd.comsocaller
application/vnd.contact.cmsg
application/vnd.cosmocaller
application/vnd.cups-postscript
application/vnd.cups-raster
application/vnd.cups-raw
application/vnd.ctc-posml
application/vnd.cybank
application/vnd.dna
application/vnd.dpgraph
application/vnd.dxr
application/vnd.ecdis-update
application/vnd.ecowin.chart
application/vnd.ecowin.filerequest
application/vnd.ecowin.fileupdate
application/vnd.ecowin.series
application/vnd.ecowin.seriesrequest
application/vnd.ecowin.seriesupdate
application/vnd.enliven
application/vnd.epson.esf
application/vnd.epson.msf
application/vnd.epson.quickanime
application/vnd.epson.salt
application/vnd.epson.ssf
application/vnd.ericsson.quickcall
application/vnd.eudora.data
application/vnd.fdf
application/vnd.ffsns
application/vnd.framemaker
application/vnd.fsc.weblaunch
application/vnd.fujitsu.oasys
application/vnd.fujitsu.oasys2
application/vnd.fujitsu.oasys3
application/vnd.fujitsu.oasysgp
application/vnd.fujitsu.oasysprs
application/vnd.fujixerox.ddd
application/vnd.fujixerox.docuworks
application/vnd.fujixerox.docuworks.binder
application/vnd.fut-misnet
application/vnd.grafeq
application/vnd.groove-account
application/vnd.groove-identity-message
application/vnd.groove-injector
application/vnd.groove-tool-message
application/vnd.groove-tool-template
application/vnd.groove-vcard
application/vnd.hhe.lesson-player
application/vnd.hp-HPGL
application/vnd.hp-PCL
application/vnd.hp-PCLXL
application/vnd.hp-hpid
application/vnd.hp-hps
application/vnd.httphone
application/vnd.hzn-3d-crossword
application/vnd.ibm.afplinedata
application/vnd.ibm.MiniPay
application/vnd.ibm.modcap
application/vnd.informix-visionary
application/vnd.intercon.formnet
application/vnd.intertrust.digibox
application/vnd.intertrust.nncp
application/vnd.intu.qbo
application/vnd.intu.qfx
application/vnd.irepository.package+xml
application/vnd.is-xpr
application/vnd.japannet-directory-service
application/vnd.japannet-jpnstore-wakeup
application/vnd.japannet-payment-wakeup
application/vnd.japannet-registration
application/vnd.japannet-registration-wakeup
application/vnd.japannet-setstore-wakeup
application/vnd.japannet-verification
application/vnd.japannet-verification-wakeup
application/vnd.koan
application/vnd.lotus-1-2-3
application/vnd.lotus-approach
application/vnd.lotus-freelance
application/vnd.lotus-notes
application/vnd.lotus-organizer
application/vnd.lotus-screencam
application/vnd.lotus-wordpro
application/vnd.mcd
application/vnd.mediastation.cdkey
application/vnd.meridian-slingshot
application/vnd.mif mif
application/vnd.minisoft-hp3000-save
application/vnd.mitsubishi.misty-guard.trustweb
application/vnd.mobius.daf
application/vnd.mobius.dis
application/vnd.mobius.msl
application/vnd.mobius.plc
application/vnd.mobius.txf
application/vnd.motorola.flexsuite
application/vnd.motorola.flexsuite.adsi
application/vnd.motorola.flexsuite.fis
application/vnd.motorola.flexsuite.gotap
application/vnd.motorola.flexsuite.kmr
application/vnd.motorola.flexsuite.ttc
application/vnd.motorola.flexsuite.wem
application/vnd.mozilla.xul+xml
application/vnd.ms-artgalry
application/vnd.ms-asf
application/vnd.ms-excel xls
application/vnd.ms-lrm
application/vnd.ms-powerpoint ppt
application/vnd.ms-project
application/vnd.ms-tnef
application/vnd.ms-works
application/vnd.mseq
application/vnd.msign
application/vnd.music-niff
application/vnd.musician
application/vnd.netfpx
application/vnd.noblenet-directory
application/vnd.noblenet-sealer
application/vnd.noblenet-web
application/vnd.novadigm.EDM
application/vnd.novadigm.EDX
application/vnd.novadigm.EXT
application/vnd.osa.netdeploy
application/vnd.palm
application/vnd.pg.format
application/vnd.pg.osasli
application/vnd.powerbuilder6
application/vnd.powerbuilder6-s
application/vnd.powerbuilder7
application/vnd.powerbuilder7-s
application/vnd.powerbuilder75
application/vnd.powerbuilder75-s
application/vnd.previewsystems.box
application/vnd.publishare-delta-tree
application/vnd.pvi.ptid1
application/vnd.pwg-xhtml-print+xml
application/vnd.rapid
application/vnd.s3sms
application/vnd.seemail
application/vnd.shana.informed.formdata
application/vnd.shana.informed.formtemplate
application/vnd.shana.informed.interchange
application/vnd.shana.informed.package
application/vnd.sss-cod
application/vnd.sss-dtf
application/vnd.sss-ntf
application/vnd.street-stream
application/vnd.svd
application/vnd.swiftview-ics
application/vnd.triscape.mxs
application/vnd.trueapp
application/vnd.truedoc
application/vnd.tve-trigger
application/vnd.ufdl
application/vnd.uplanet.alert
application/vnd.uplanet.alert-wbxml
application/vnd.uplanet.bearer-choice-wbxml
application/vnd.uplanet.bearer-choice
application/vnd.uplanet.cacheop
application/vnd.uplanet.cacheop-wbxml
application/vnd.uplanet.channel
application/vnd.uplanet.channel-wbxml
application/vnd.uplanet.list
application/vnd.uplanet.list-wbxml
application/vnd.uplanet.listcmd
application/vnd.uplanet.listcmd-wbxml
application/vnd.uplanet.signal
application/vnd.vcx
application/vnd.vectorworks
application/vnd.vidsoft.vidconference
application/vnd.visio
application/vnd.vividence.scriptfile
application/vnd.wap.sic
application/vnd.wap.slc
application/vnd.wap.wbxml wbxml
application/vnd.wap.wmlc wmlc
application/vnd.wap.wmlscriptc wmlsc
application/vnd.webturbo
application/vnd.wrq-hp3000-labelled
application/vnd.wt.stf
application/vnd.xara
application/vnd.xfdl
application/vnd.yellowriver-custom-menu
application/whoispp-query
application/whoispp-response
application/wita
application/wordperfect5.1
application/x-bcpio bcpio
application/x-cdlink vcd
application/x-chess-pgn pgn
application/x-compress
application/x-cpio cpio
application/x-csh csh
application/x-director dcr dir dxr
application/x-dvi dvi
application/x-futuresplash spl
application/x-gtar gtar
application/x-gzip
application/x-hdf hdf
application/x-javascript js
application/x-koan skp skd skt skm
application/x-latex latex
application/x-netcdf nc cdf
application/x-sh sh
application/x-shar shar
application/x-shockwave-flash swf
application/x-stuffit sit
application/x-sv4cpio sv4cpio
application/x-sv4crc sv4crc
application/x-tar tar
application/x-tcl tcl
application/x-tex tex
application/x-texinfo texinfo texi
application/x-troff t tr roff
application/x-troff-man man
application/x-troff-me me
application/x-troff-ms ms
application/x-ustar ustar
application/x-wais-source src
application/x400-bp
application/xml
application/xml-dtd
application/xml-external-parsed-entity
application/zip zip
audio/32kadpcm
audio/basic au snd
audio/g.722.1
audio/l16
audio/midi mid midi kar
audio/mp4a-latm
audio/mpa-robust
audio/mpeg mpga mp2 mp3
audio/parityfec
audio/prs.sid
audio/telephone-event
audio/tone
audio/vnd.cisco.nse
audio/vnd.cns.anp1
audio/vnd.cns.inf1
audio/vnd.digital-winds
audio/vnd.everad.plj
audio/vnd.lucent.voice
audio/vnd.nortel.vbk
audio/vnd.nuera.ecelp4800
audio/vnd.nuera.ecelp7470
audio/vnd.nuera.ecelp9600
audio/vnd.octel.sbc
audio/vnd.qcelp
audio/vnd.rhetorex.32kadpcm
audio/vnd.vmx.cvsd
audio/x-aiff aif aiff aifc
audio/x-mpegurl m3u
audio/x-pn-realaudio ram rm
audio/x-pn-realaudio-plugin rpm
audio/x-realaudio ra
audio/x-wav wav
chemical/x-pdb pdb
chemical/x-xyz xyz
image/bmp bmp
image/cgm
image/g3fax
image/gif gif
image/ief ief
image/jpeg jpeg jpg jpe
image/naplps
image/png png
image/prs.btif
image/prs.pti
image/tiff tiff tif
image/vnd.cns.inf2
image/vnd.dwg
image/vnd.dxf
image/vnd.fastbidsheet
image/vnd.fpx
image/vnd.fst
image/vnd.fujixerox.edmics-mmr
image/vnd.fujixerox.edmics-rlc
image/vnd.mix
image/vnd.net-fpx
image/vnd.svf
image/vnd.wap.wbmp wbmp
image/vnd.xiff
image/x-cmu-raster ras
image/x-portable-anymap pnm
image/x-portable-bitmap pbm
image/x-portable-graymap pgm
image/x-portable-pixmap ppm
image/x-rgb rgb
image/x-xbitmap xbm
image/x-xpixmap xpm
image/x-xwindowdump xwd
message/delivery-status
message/disposition-notification
message/external-body
message/http
message/news
message/partial
message/rfc822
message/s-http
model/iges igs iges
model/mesh msh mesh silo
model/vnd.dwf
model/vnd.flatland.3dml
model/vnd.gdl
model/vnd.gs-gdl
model/vnd.gtw
model/vnd.mts
model/vnd.vtu
model/vrml wrl vrml
multipart/alternative
multipart/appledouble
multipart/byteranges
multipart/digest
multipart/encrypted
multipart/form-data
multipart/header-set
multipart/mixed
multipart/parallel
multipart/related
multipart/report
multipart/signed
multipart/voice-message
text/calendar
text/css css
text/directory
text/enriched
text/html html htm
text/parityfec
text/plain asc txt
text/prs.lines.tag
text/rfc822-headers
text/richtext rtx
text/rtf rtf
text/sgml sgml sgm
text/tab-separated-values tsv
text/t140
text/uri-list
text/vnd.DMClientScript
text/vnd.IPTC.NITF
text/vnd.IPTC.NewsML
text/vnd.abc
text/vnd.curl
text/vnd.flatland.3dml
text/vnd.fly
text/vnd.fmi.flexstor
text/vnd.in3d.3dml
text/vnd.in3d.spot
text/vnd.latex-z
text/vnd.motorola.reflex
text/vnd.ms-mediapackage
text/vnd.wap.si
text/vnd.wap.sl
text/vnd.wap.wml wml
text/vnd.wap.wmlscript wmls
text/x-setext etx
text/xml xml xsl
text/xml-external-parsed-entity
video/mp4v-es
video/mpeg mpeg mpg mpe
video/parityfec
video/pointer
video/quicktime qt mov
video/vnd.fvt
video/vnd.motorola.video
video/vnd.motorola.videop
video/vnd.mpegurl mxu
video/vnd.mts
video/vnd.nokia.interleaved-multimedia
video/vnd.vivo
video/x-msvideo avi
video/x-sgi-movie movie
x-conference/x-cooltalk ice
+143
View File
@@ -0,0 +1,143 @@
/*
* by data2header by Luis Figueiredo (stdio@netc.pt)
*/
#ifndef _SECURITY_H_
#define _SECURITY_H_
char security[]="\x3C\x63\x65\x6E\x74\x65\x72\x3E\x3C\x48\x33\x3E\x3C\x66\x6F\x6E\x74\x20\x63\x6F\x6C\x6F\x72\x3D\x27"
"\x30\x30\x37\x37\x30\x30\x27\x3E\x6C\x69\x62\x77\x65\x62\x73\x65\x72\x76\x65\x72\x20\x53\x65\x63\x75\x72"
"\x69\x74\x79\x3C\x2F\x66\x6F\x6E\x74\x3E\x3C\x2F\x48\x33\x3E\x3C\x2F\x63\x65\x6E\x74\x65\x72\x3E\x3C\x42"
"\x52\x3E\x3C\x42\x52\x3E\xA\xA\x3C\x41\x20\x6E\x61\x6D\x65\x3D\x77\x68\x61\x74\x3E\x3C\x42\x3E\x3C\x66"
"\x6F\x6E\x74\x20\x63\x6F\x6C\x6F\x72\x3D\x27\x30\x30\x30\x30\x37\x37\x27\x3E\x49\x73\x20\x69\x74\x20\x73"
"\x61\x66\x65\x20\x74\x6F\x20\x75\x73\x65\x3F\x3C\x2F\x66\x6F\x6E\x74\x3E\x3C\x2F\x42\x3E\x3C\x42\x52\x3E"
"\xA\x3C\x55\x4C\x3E\x57\x65\x6C\x6C\x2C\x20\x49\x20\x63\x61\x6E\x27\x74\x20\x70\x72\x6F\x6D\x69\x73\x65"
"\x20\x74\x68\x61\x74\x20\x69\x74\x27\x73\x20\x61\x20\x73\x65\x63\x75\x72\x65\x20\x73\x6F\x66\x74\x77\x61"
"\x72\x65\x20\x73\x69\x6E\x63\x65\x20\x74\x68\x61\x74\x20\x6E\x6F\x74\x20\x6F\x6E\x6C\x79\x20\x64\x65\x70"
"\x65\x6E\x64\x73\x20\x6F\x6E\x20\x74\x68\x65\x20\x73\x6F\x66\x74\x77\x61\x72\x65\x2C\x20\xA\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x62\x75\x74\x20\x61\x6C\x6C\x20\x69\x20\x63\x61\x6E\x20\x73\x61\x79\x20\x69\x73"
"\x20\x74\x68\x61\x74\x20\x77\x61\x73\x6E\x27\x74\x20\x66\x6F\x75\x6E\x64\x20\x61\x6E\x79\x20\x73\x65\x63"
"\x75\x72\x69\x74\x79\x20\x62\x75\x67\x20\x79\x65\x74\x2C\x20\x74\x68\x69\x73\x20\x77\x61\x73\x20\x64\x65"
"\x76\x65\x6C\x6F\x70\x65\x64\x20\x69\x6E\x74\x65\x6E\x64\x65\x64\x20\x74\x6F\x20\x62\x65\x20\x73\x65\x63"
"\x75\x72\x65\x2C\x20\x20\xA\x9\x9\x20\x79\x6F\x75\x20\x63\x61\x6E\x20\x75\x73\x65\x20\x6F\x70\x65\x6E"
"\x73\x73\x6C\x20\x28\x65\x6E\x63\x72\x79\x70\x74\x65\x64\x20\x73\x74\x72\x65\x61\x6D\x73\x29\x20\x74\x6F"
"\x20\x70\x72\x6F\x74\x65\x63\x74\x20\x69\x6E\x66\x6F\x72\x6D\x61\x74\x69\x6F\x6E\x20\x74\x68\x61\x74\x20"
"\x70\x61\x73\x73\x65\x73\x20\x66\x72\x6F\x6D\x20\x77\x65\x62\x73\x65\x72\x76\x65\x72\x28\x6C\x69\x62\x29"
"\x20\x74\x6F\x20\x63\x6C\x69\x65\x6E\x74\x3C\x2F\x55\x4C\x3E\xA\x9\xA\x3C\x41\x20\x6E\x61\x6D\x65\x3D"
"\x63\x65\x72\x74\x69\x66\x69\x63\x61\x74\x65\x3E\x3C\x42\x3E\x3C\x66\x6F\x6E\x74\x20\x63\x6F\x6C\x6F\x72"
"\x3D\x27\x30\x30\x30\x30\x37\x37\x27\x3E\x48\x6F\x77\x20\x64\x6F\x20\x49\x20\x63\x72\x65\x61\x74\x65\x20"
"\x6D\x79\x20\x6F\x77\x6E\x20\x63\x65\x72\x74\x69\x66\x69\x63\x61\x74\x65\x3F\x3C\x2F\x66\x6F\x6E\x74\x3E"
"\x3C\x2F\x42\x3E\x3C\x42\x52\x3E\xA\x3C\x55\x4C\x3E\x59\x6F\x75\x20\x63\x61\x6E\x20\x65\x69\x74\x68\x65"
"\x72\x20\x62\x75\x79\x20\x6F\x6E\x65\x20\x66\x72\x6F\x6D\x20\x6F\x6E\x65\x20\x6F\x66\x20\x74\x68\x65\x20"
"\x62\x69\x67\x20\x76\x65\x6E\x64\x6F\x72\x73\x20\x28\x73\x65\x65\x20\x79\x6F\x75\x72\x20\x62\x72\x6F\x77"
"\x73\x65\x72\x27\x73\x20\x73\x74\x6F\x72\x65\x64\x20\x63\x65\x72\x74\x69\x66\x69\x63\x61\x74\x65\x73\xA"
"\x9\x66\x6F\x72\x20\x74\x68\x65\x69\x72\x20\x61\x64\x64\x72\x65\x73\x73\x65\x73\x29\x20\x6F\x72\x20\x73"
"\x65\x6C\x66\x2D\x73\x69\x67\x6E\x20\x61\x20\x73\x65\x6C\x66\x2D\x63\x72\x65\x61\x74\x65\x64\x20\x6F\x6E"
"\x65\x2E\x20\x54\x68\x65\x20\x75\x70\x73\x69\x64\x65\x20\x6F\x66\x20\x74\x68\x65\x20\x62\x6F\x75\x67\x68"
"\x74\xA\x9\x63\x65\x72\x74\x69\x66\x69\x63\x61\x74\x65\x73\x20\x69\x73\x2C\x20\x74\x68\x61\x74\x20\x74"
"\x68\x65\x20\x77\x65\x62\x62\x72\x6F\x77\x73\x65\x72\x20\x64\x6F\x65\x73\x6E\x27\x74\x20\x61\x73\x6B\x20"
"\x69\x66\x20\x74\x68\x65\x20\x75\x73\x65\x72\x20\x77\x61\x6E\x74\x73\x20\x74\x6F\xA\x9\x61\x63\x63\x65"
"\x70\x74\x20\x74\x68\x61\x74\x20\x63\x65\x72\x74\x69\x66\x69\x63\x61\x74\x65\x2C\x20\x62\x75\x74\x20\x69"
"\x6E\x73\x74\x65\x61\x64\x20\x63\x68\x65\x63\x6B\x73\x20\x77\x69\x74\x68\x20\x74\x68\x65\x20\x63\x65\x72"
"\x74\x69\x66\x69\x63\x61\x74\x69\x6F\x6E\x20\x61\x75\x74\x68\x6F\x72\x69\x74\x79\xA\x9\x79\x6F\x75\x20"
"\x62\x6F\x75\x67\x68\x74\x20\x79\x6F\x75\x72\x20\x63\x65\x72\x74\x69\x66\x69\x63\x61\x74\x65\x20\x66\x72"
"\x6F\x6D\x2E\x3C\x62\x72\x3E\xA\x9\x54\x68\x65\x20\x64\x6F\x77\x6E\x73\x69\x64\x65\x20\x69\x73\x20\x74"
"\x68\x61\x74\x20\x69\x74\x20\x63\x6F\x73\x74\x73\x20\x71\x75\x69\x74\x65\x20\x61\x20\x6C\x6F\x74\x20\x6F"
"\x66\x20\x6D\x6F\x6E\x65\x79\x2E\x3C\x62\x72\x3E\xA\x9\x54\x6F\x20\x63\x72\x65\x61\x74\x65\x20\x79\x6F"
"\x75\x72\x20\x6F\x77\x6E\x20\x63\x65\x72\x74\x69\x66\x69\x63\x61\x74\x65\x20\x75\x73\x65\x20\x6F\x70\x65"
"\x6E\x73\x73\x6C\x20\x6C\x69\x6B\x65\x20\x74\x68\x61\x74\x3A\xA\x9\x3C\x75\x6C\x3E\x3C\x6C\x69\x3E\x63"
"\x72\x65\x61\x74\x65\x20\x61\x20\x6B\x65\x79\x20\x61\x6E\x64\x20\x72\x65\x71\x75\x65\x73\x74\x3A\x3C\x62"
"\x72\x3E\xA\x9\x9\x3C\x70\x72\x65\x3E\x3C\x62\x3E\x6F\x70\x65\x6E\x73\x73\x6C\x20\x72\x65\x71\x20\x2D"
"\x6E\x65\x77\x20\x3E\x20\x66\x6F\x6F\x2D\x63\x65\x72\x74\x2E\x63\x73\x72\x3C\x2F\x62\x3E\x3C\x2F\x70\x72"
"\x65\x3E\x3C\x62\x72\x3E\xA\x9\x9\x41\x73\x20\x22\x43\x6F\x6D\x6D\x6F\x6E\x20\x4E\x61\x6D\x65\x22\x20"
"\x79\x6F\x75\x20\x68\x61\x76\x65\x20\x74\x6F\x20\x74\x79\x70\x65\x20\x69\x6E\x20\x74\x68\x65\x20\x6E\x61"
"\x6D\x65\x20\x70\x61\x72\x74\x20\x6F\x66\xA\x9\x9\x79\x6F\x75\x72\x20\x55\x52\x4C\x2C\x20\x69\x2E\x65"
"\x2E\x20\x69\x66\x20\x79\x6F\x75\x72\x20\x77\x65\x62\x20\x73\x69\x74\x65\x20\x77\x69\x6C\x6C\x20\x62\x65"
"\xA\x9\x9\x22\x68\x74\x74\x70\x73\x3A\x2F\x2F\x77\x77\x77\x2E\x6C\x69\x62\x77\x65\x62\x73\x65\x72\x76"
"\x65\x72\x2E\x72\x75\x6C\x65\x73\x3A\x34\x34\x33\x2F\x22\x20\x74\x68\x65\x20\x43\x6F\x6D\x6D\x6F\x6E\x20"
"\x4E\x61\x6D\x65\x20\x69\x73\xA\x9\x9\x22\x77\x77\x77\x2E\x6C\x69\x62\x77\x65\x62\x73\x65\x72\x76\x65"
"\x72\x2E\x72\x75\x6C\x65\x73\x22\x2E\xA\x9\x3C\x6C\x69\x3E\x20\x72\x65\x6D\x6F\x76\x65\x20\x74\x68\x65"
"\x20\x70\x61\x73\x73\x70\x68\x72\x61\x73\x65\x20\x66\x72\x6F\x6D\x20\x74\x68\x65\x20\x6B\x65\x79\x3A\x3C"
"\x62\x72\x3E\xA\x9\x9\x3C\x70\x72\x65\x3E\x3C\x62\x3E\x6F\x70\x65\x6E\x73\x73\x6C\x20\x72\x73\x61\x20"
"\x2D\x69\x6E\x20\x70\x72\x69\x76\x6B\x65\x79\x2E\x70\x65\x6D\x20\x2D\x6F\x75\x74\x20\x66\x6F\x6F\x2D\x63"
"\x65\x72\x74\x2E\x6B\x65\x79\x3C\x2F\x62\x3E\x3C\x2F\x70\x72\x65\x3E\x3C\x62\x72\x3E\xA\x9\x3C\x6C\x69"
"\x3E\x63\x6F\x6E\x76\x65\x72\x74\x20\x72\x65\x71\x75\x65\x73\x74\x20\x69\x6E\x74\x6F\x20\x61\x20\x73\x69"
"\x67\x6E\x65\x64\x20\x63\x65\x72\x74\x69\x66\x69\x63\x61\x74\x65\x3A\x3C\x62\x72\x3E\xA\x9\x9\x3C\x70"
"\x72\x65\x3E\x3C\x62\x3E\x6F\x70\x65\x6E\x73\x73\x6C\x20\x78\x35\x30\x39\x20\x2D\x69\x6E\x20\x66\x6F\x6F"
"\x2D\x63\x65\x72\x74\x2E\x63\x73\x72\x20\x2D\x6F\x75\x74\x20\x66\x6F\x6F\x2D\x63\x65\x72\x74\x2E\x63\x65"
"\x72\x74\x20\x2D\x72\x65\x71\x20\x2D\x73\x69\x67\x6E\x6B\x65\x79\x20\x66\x6F\x6F\x2D\x63\x65\x72\x74\x2E"
"\x6B\x65\x79\x20\x2D\x64\x61\x79\x73\x20\x33\x35\x36\x3C\x2F\x62\x3E\x3C\x2F\x70\x72\x65\x3E\x3C\x62\x72"
"\x3E\xA\x9\x3C\x6C\x69\x3E\x63\x72\x65\x61\x74\x65\x20\x2E\x70\x65\x6D\x20\x66\x69\x6C\x65\x3A\x3C\x62"
"\x72\x3E\xA\x9\x9\x3C\x70\x72\x65\x3E\x3C\x62\x3E\x63\x61\x74\x20\x66\x6F\x6F\x2D\x63\x65\x72\x74\x2E"
"\x63\x65\x72\x74\x20\x66\x6F\x6F\x2D\x63\x65\x72\x74\x2E\x6B\x65\x79\x20\x3E\x66\x6F\x6F\x2D\x63\x65\x72"
"\x74\x2E\x70\x65\x6D\x3C\x2F\x62\x3E\x3C\x2F\x70\x72\x65\x3E\x3C\x62\x72\x3E\xA\x9\x3C\x2F\x75\x6C\x3E"
"\xA\x3C\x2F\x75\x6C\x3E\xA\xA\xA\x3C\x41\x20\x6E\x61\x6D\x65\x3D\x74\x69\x70\x73\x3E\x3C\x42\x3E\x3C"
"\x66\x6F\x6E\x74\x20\x73\x69\x7A\x65\x3D\x34\x20\x63\x6F\x6C\x6F\x72\x3D\x27\x37\x37\x30\x30\x37\x37\x27"
"\x3E\x53\x65\x63\x75\x72\x69\x74\x79\x20\x74\x69\x70\x73\x3C\x2F\x66\x6F\x6E\x74\x3E\x3C\x2F\x42\x3E\x3C"
"\x42\x52\x3E\x3C\x48\x52\x3E\xA\xA\x3C\x41\x20\x6E\x61\x6D\x65\x3D\x72\x61\x63\x65\x63\x6F\x6E\x64\x69"
"\x74\x69\x6F\x6E\x3E\x3C\x42\x3E\x3C\x66\x6F\x6E\x74\x20\x63\x6F\x6C\x6F\x72\x3D\x27\x30\x30\x30\x30\x37"
"\x37\x27\x3E\x41\x76\x6F\x69\x64\x20\x72\x61\x63\x65\x20\x63\x6F\x6E\x64\x69\x74\x69\x6F\x6E\x20\x70\x72"
"\x6F\x62\x6C\x65\x6D\x73\x3C\x2F\x66\x6F\x6E\x74\x3E\x3C\x2F\x42\x3E\x3C\x42\x52\x3E\xA\x3C\x55\x4C\x3E"
"\xA\x9\x3C\x42\x3E\x20\x57\x68\x61\x74\x20\x69\x73\x20\x72\x61\x63\x65\x20\x63\x6F\x6E\x64\x69\x74\x69"
"\x6F\x6E\x3F\x3C\x2F\x42\x3E\xA\x9\x9\x3C\x55\x4C\x3E\x41\x20\x72\x61\x63\x65\x20\x63\x6F\x6E\x64\x69"
"\x74\x69\x6F\x6E\x20\x6F\x63\x63\x75\x72\x73\x20\x77\x68\x65\x6E\x20\x74\x77\x6F\x20\x6F\x72\x20\x6D\x6F"
"\x72\x65\x20\x6F\x70\x65\x72\x61\x74\x69\x6F\x6E\x73\x20\x6F\x63\x63\x75\x72\x20\x69\x6E\x20\x61\x6E\x20"
"\xA\x20\x20\x20\x20\x20\x20\x75\x6E\x64\x65\x66\x69\x6E\x65\x64\x20\x6D\x61\x6E\x6E\x65\x72\x20\x28\x4D"
"\x63\x4B\x75\x73\x69\x63\x6B\x20\x65\x74\x20\x61\x6C\x2E\x20\x31\x39\x39\x36\x29\x2E\x20\x53\x70\x65\x63"
"\x69\x66\x69\x63\x61\x6C\x6C\x79\x20\x69\x6E\x20\x66\x69\x6C\x65\x20\xA\x20\x20\x20\x20\x20\x20\x73\x79"
"\x73\x74\x65\x6D\x20\x72\x61\x63\x65\x73\x20\x74\x68\x65\x20\x61\x74\x74\x61\x63\x6B\x65\x72\x20\x61\x74"
"\x74\x65\x6D\x70\x74\x73\x20\x74\x6F\x20\x63\x68\x61\x6E\x67\x65\x20\x74\x68\x65\x20\x73\x74\x61\x74\x65"
"\x20\x6F\x66\x20\x74\x68\x65\x20\xA\x20\x20\x20\x20\x20\x20\x66\x69\x6C\x65\x20\x73\x79\x73\x74\x65\x6D"
"\x20\x69\x6E\x20\x62\x65\x74\x77\x65\x65\x6E\x20\x74\x77\x6F\x20\x66\x69\x6C\x65\x20\x73\x79\x73\x74\x65"
"\x6D\x20\x6F\x70\x65\x72\x61\x74\x69\x6F\x6E\x73\x20\x6F\x6E\x20\x74\x68\x65\x20\x70\x61\x72\x74\x20\xA"
"\x20\x20\x20\x20\x20\x20\x6F\x66\x20\x74\x68\x65\x20\x70\x72\x6F\x67\x72\x61\x6D\x2E\x3C\x2F\x55\x4C\x3E"
"\x3C\x42\x52\x3E\x20\xA\x9\x3C\x42\x3E\x20\x48\x6F\x77\x20\x74\x68\x65\x20\x6C\x69\x62\x20\x64\x65\x74"
"\x65\x72\x6D\x69\x6E\x65\x20\x74\x65\x6D\x70\x6F\x72\x61\x72\x79\x20\x66\x69\x6C\x65\x20\x6E\x61\x6D\x65"
"\x3F\x3C\x2F\x42\x3E\xA\x9\x3C\x55\x4C\x3E\x20\xA\x9\x3C\x6C\x69\x3E\x67\x65\x6E\x65\x72\x61\x74\x65"
"\x20\x66\x69\x6C\x65\x20\x6E\x61\x6D\x65\x20\x28\x6E\x6F\x74\x65\x3A\x20\x6B\x65\x65\x70\x20\x67\x65\x6E"
"\x65\x72\x61\x74\x69\x6E\x67\x20\x75\x6E\x74\x69\x6C\x20\x69\x74\x20\x64\x6F\x65\x73\x6E\x27\x74\x20\x65"
"\x78\x69\x73\x74\x73\x29\x3C\x42\x52\x3E\x3C\x2F\x6C\x69\x3E\xA\x9\x3C\x6C\x69\x3E\x63\x68\x65\x63\x6B"
"\x20\x69\x66\x20\x66\x69\x6C\x65\x20\x65\x78\x69\x73\x74\x73\x3C\x42\x52\x3E\xA\x9\x2D\x3C\x73\x6D\x61"
"\x6C\x6C\x3E\x61\x74\x74\x61\x63\x6B\x65\x72\x20\x63\x61\x6E\x20\x63\x72\x65\x61\x74\x65\x20\x74\x68\x65"
"\x20\x66\x69\x6C\x65\x20\x6E\x6F\x77\x2C\x20\x69\x66\x20\x68\x65\x20\x6B\x6E\x6F\x77\x73\x20\x74\x68\x65"
"\x20\x72\x69\x67\x68\x74\x20\x66\x69\x6C\x65\x6E\x61\x6D\x65\x3C\x2F\x73\x6D\x61\x6C\x6C\x3E\x3C\x42\x52"
"\x3E\x3C\x2F\x6C\x69\x3E\xA\x9\x3C\x6C\x69\x3E\x63\x68\x65\x63\x6B\x20\x69\x66\x20\x73\x79\x6D\x6C\x69"
"\x6E\x6B\x20\x65\x78\x69\x73\x74\x73\x3C\x42\x52\x3E\xA\x9\x2D\x3C\x73\x6D\x61\x6C\x6C\x3E\x61\x74\x74"
"\x61\x63\x6B\x65\x72\x20\x63\x61\x6E\x20\x63\x72\x65\x61\x74\x65\x20\x74\x68\x65\x20\x73\x79\x6D\x6C\x69"
"\x6E\x6B\x20\x6E\x6F\x77\x2C\x20\x69\x66\x20\x68\x65\x20\x6B\x6E\x6F\x77\x73\x20\x74\x68\x65\x20\x72\x69"
"\x67\x68\x74\x20\x66\x69\x6C\x65\x6E\x61\x6D\x65\x3C\x2F\x73\x6D\x61\x6C\x6C\x3E\x3C\x42\x52\x3E\x3C\x2F"
"\x6C\x69\x3E\xA\x9\x3C\x6C\x69\x3E\x63\x72\x65\x61\x74\x65\x20\x74\x68\x65\x20\x66\x69\x6C\x65\x20\x61"
"\x6E\x64\x20\x72\x65\x64\x69\x72\x65\x63\x74\x20\x73\x74\x64\x6F\x75\x74\x20\x74\x6F\x20\x69\x74\x20\x3C"
"\x42\x52\x3E\xA\x9\x2D\x3C\x73\x6D\x61\x6C\x6C\x3E\x61\x74\x74\x61\x63\x6B\x65\x72\x20\x63\x61\x6E\x20"
"\x6F\x70\x65\x6E\x20\x74\x68\x65\x20\x66\x69\x6C\x65\x20\x61\x6E\x64\x20\x77\x72\x69\x74\x65\x20\x74\x6F"
"\x20\x69\x74\x3C\x2F\x73\x6D\x61\x6C\x6C\x3E\x3C\x42\x52\x3E\x3C\x2F\x6C\x69\x3E\xA\x9\x3C\x6C\x69\x3E"
"\x70\x6C\x61\x63\x65\x73\x20\x61\x20\x6C\x6F\x63\x6B\x20\x69\x6E\x74\x6F\x20\x66\x69\x6C\x65\x20\x28\x6E"
"\x6F\x74\x65\x3A\x20\x6E\x6F\x74\x20\x69\x6E\x20\x77\x69\x6E\x39\x38\x29\x3C\x42\x52\x3E\x20\x3C\x2F\x6C"
"\x69\x3E\xA\x9\x3C\x6C\x69\x3E\x75\x73\x65\x72\x73\x20\x6F\x70\x65\x72\x61\x74\x69\x6F\x6E\x73\x2C\x20"
"\x77\x72\x69\x74\x65\x2C\x20\x66\x6C\x75\x73\x68\x2C\x20\x72\x65\x61\x64\x3C\x42\x52\x3E\x3C\x2F\x6C\x69"
"\x3E\xA\x9\x3C\x6C\x69\x3E\x75\x6E\x6C\x69\x6E\x6B\x20\x74\x68\x65\x20\x66\x69\x6C\x65\x6E\x61\x6D\x65"
"\x20\x66\x72\x6F\x6D\x20\x74\x68\x65\x20\x4F\x53\x3C\x42\x52\x3E\x3C\x2F\x6C\x69\x3E\xA\x9\x3C\x2F\x55"
"\x4C\x3E\x3C\x42\x52\x3E\xA\x9\xA\x9\xA\x9\x6C\x69\x62\x77\x65\x62\x73\x65\x72\x76\x65\x72\x20\x75"
"\x73\x65\x73\x20\x74\x65\x6D\x70\x6F\x72\x61\x72\x79\x20\x66\x69\x6C\x65\x6E\x61\x6D\x65\x73\x20\x74\x6F"
"\x20\x68\x6F\x6C\x64\x20\x61\x6E\x64\x20\x70\x72\x6F\x63\x65\x73\x73\x20\x64\x61\x74\x61\x20\x62\x65\x66"
"\x6F\x72\x65\x20\x73\x65\x6E\x64\x20\x69\x74\x20\x74\x6F\x20\x63\x6C\x69\x65\x6E\x74\x2C\x20\x69\x74\x20"
"\x75\x73\x65\x73\x20\x74\x68\x65\x20\x61\x6D\x62\x69\x65\x6E\x74\x20\x76\x61\x72\x69\x61\x62\x6C\x65\x73"
"\x20\x74\x6F\x20\xA\x9\x64\x65\x74\x65\x72\x6D\x69\x6E\x65\x20\x74\x65\x6D\x70\x6F\x72\x61\x72\x79\x20"
"\x64\x69\x72\x65\x63\x74\x6F\x72\x79\x20\x62\x79\x20\x66\x6F\x6C\x6C\x6F\x77\x69\x6E\x67\x20\x6F\x72\x64"
"\x65\x72\x20\x22\x24\x54\x45\x4D\x50\x2C\x24\x54\x4D\x50\x2C\x24\x54\x4D\x50\x44\x49\x52\x20\x61\x6E\x64"
"\x20\x74\x68\x65\x20\x73\x74\x64\x69\x6F\x2E\x68\x20\x50\x5F\x74\x6D\x70\x64\x69\x72\x22\x2C\x20\x6C\x69"
"\x62\x77\x65\x62\x73\x65\x72\x76\x65\x72\x20\x68\x61\x76\x65\x20\x73\x65\x76\x65\x72\x61\x6C\x20\x63\x68"
"\x65\x63\x6B\x73\xA\x9\x61\x6E\x64\x20\x69\x74\x20\x6C\x6F\x63\x6B\x73\x20\x66\x69\x6C\x65\x20\x66\x6F"
"\x72\x20\x61\x76\x6F\x69\x64\x20\x61\x74\x74\x61\x63\x6B\x65\x72\x73\x20\x66\x72\x6F\x6D\x20\x6D\x65\x73"
"\x73\x69\x6E\x67\x20\x77\x69\x74\x68\x20\x74\x65\x6D\x70\x6F\x72\x61\x72\x79\x20\x66\x69\x6C\x65\x73\x2C"
"\x20\x6D\x65\x61\x6E\x77\x68\x69\x6C\x65\x20\x69\x73\x20\x73\x61\x66\x65\x6C\x79\x20\x74\x6F\x20\x63\x68"
"\x61\x6E\x67\x65\x20\x74\x68\x65\x20\x74\x65\x6D\x70\x64\x69\x72\x20\x28\x73\x65\x74\x74\x69\x6E\x67\x20"
"\x74\x68\x65\x20\x61\x6D\x62\x69\x65\x6E\x74\x20\x76\x61\x72\x69\x61\x62\x6C\x65\x29\xA\x9\x74\x6F\x20"
"\x61\x6E\x20\x64\x69\x72\x65\x63\x74\x6F\x72\x79\x20\x74\x68\x61\x74\x20\x69\x73\x20\x6E\x6F\x74\x20\x77"
"\x72\x69\x74\x61\x62\x6C\x65\x20\x66\x6F\x72\x20\x65\x76\x65\x72\x79\x6F\x6E\x65\x20\x61\x6E\x64\x20\x77"
"\x72\x69\x74\x61\x62\x6C\x65\x20\x74\x6F\x20\x6C\x69\x62\x20\x28\x73\x65\x74\x65\x6E\x76\x28\x22\x54\x45"
"\x4D\x50\x22\x2C\x22\x2F\x73\x61\x66\x65\x64\x69\x72\x22\x29\x3B\x20\x79\x6F\x75\x20\x63\x61\x6E\x20\x64"
"\x6F\x20\x69\x74\x20\x62\x65\x66\x6F\x72\x65\x20\x74\x68\x65\x20\x77\x65\x62\x5F\x73\x65\x72\x76\x65\x72"
"\x5F\x72\x75\x6E\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\xA\xA\x9\xA\xA\x3C\x2F\x55\x4C\x3E\xA\xA\xA"
"\xA";
#endif
+4
View File
@@ -0,0 +1,4 @@
echo "checking pid $1";
while true; do echo -e "\33[2J\33[0;0H";cat /proc/$1/status ;done
+41
View File
@@ -0,0 +1,41 @@
/*
* by Luis Figueiredo (stdio@netc.pt)
*/
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#ifdef WIN32
#include <io.h>
#endif
int main(int argc, char *argv[]) { // Johannes E. Schindelin
unsigned char ch;
char *vn;
unsigned int i=0;
if(argc<2) {
fprintf(stderr,"Need a name for VAR\n");
exit(1); // Johannes E. Schindelin
};
vn=malloc(strlen(argv[1])+1);
for(i=0;i<strlen(argv[1]);i++)vn[i]=toupper(argv[1][i]);
vn[i]='\0';
printf("/*\n * by data2header by Luis Figueiredo (stdio@netc.pt)\n */\n");
printf("#ifndef _%s_H_\n",vn);
printf("#define _%s_H_\n\n",vn);
free(vn);
i=0;
printf("char %s[]=\"",argv[1]);
while(read(0,&ch,1)) {
i++;if(i>25){i=0;printf("\"\n\"");};
printf("\\x%X",ch);
};
printf("\";\n\n");
printf("#endif\n");
return 0; // Johannes E. Schindelin
};
+195
View File
@@ -0,0 +1,195 @@
#!/usr/bin/perl
use Socket;
sub newdata {
#my $self = shift;
my ($nfound,$timeout,$rin,$rout)=(0,0.2,"");
vec($rin,fileno(shift()),1)=1;
$nfound=select($rout=$rin,undef,undef,$timeout);
return $nfound;
};
my $host = shift;
my $port = shift || 80;
print "\n\tWARNING: If program exit before msg that's mean that the server crashed or something happened to server\n\n";
$saddr=sockaddr_in($port,inet_aton($host));
$SIG{PIPE}=NULL;
socket(SOCK,AF_INET,SOCK_STREAM,6) or print "Died";
print "a normal connection\n";
<STDIN>;
connect(SOCK,$saddr) or exit;
print "Connected\n";
$header="GET / HTTP/1.0\r\nConnection: Keep-Alive\r\nUser-Agent: Mozilla/4.73 [en] (X11; U; Linux 2.4.12 i686)\r\nHost: localhost:81\r\nAccept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*\r\nAccept-Encoding: gzip\r\nAccept-Language: en\r\nAccept-Charset: iso-8859-1,*,utf-8\r\n\r\n";
syswrite(SOCK,"$header");
$keep=1;
while($keep) {
if(newdata(SOCK)) {
if(($data=<SOCK>)) {
print "Read: ".$data;
}else {
$keep=0;
};
};
};
close(SOCK);
socket(SOCK,AF_INET,SOCK_STREAM,6) or exit;
print "Trying to send (nothing) press (enter) to continue\n";
<STDIN>;
connect(SOCK,$saddr) or exit;
print "Connected\n";
$header="";
syswrite(SOCK,"$header");
$keep=1;
while($keep) {
if(newdata(SOCK)) {
if(($data=<SOCK>)) {
print "Read: ".$data;
}else {
$keep=0;
};
};
};
close(SOCK);
socket(SOCK,AF_INET,SOCK_STREAM,6) or print "Died";
print "a post (foo)value with 10000000 bytes press (enter) to continue\n";
<STDIN>;
connect(SOCK,$saddr) or exit;
print "Connected\n";
$header="POST / HTTP/1.0\r\nConnection: Keep-Alive\r\nUser-Agent: Mozilla/4.73 [en] (X11; U; Linux 2.4.12 i686)\r\nHost: localhost:81\r\nAccept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*\r\nAccept-Encoding: gzip\r\nAccept-Language: en\r\nAccept-Charset: iso-8859-1,*,utf-8\r\n\r\ndev=".("a"x1000000)."&teste=1\r\n\r\n"; #big values
syswrite(SOCK,"$header");
$keep=1;
while($keep) {
if(newdata(SOCK)) {
if(($data=<SOCK>)) {
print "Read: ".$data;
}else {
$keep=0;
};
};
};
close(SOCK);
socket(SOCK,AF_INET,SOCK_STREAM,6) or exit;
print "Trying to send a big data for ClientInfo\n";
<STDIN>;
connect(SOCK,$saddr) or exit;
print "Connected\n";
$header="GET / HTTP/1.0\r\nConnection: Keep-Alive\r\nUser-Agent: Mozilla/4.73 [en] (X11; U; Linux 2.4.12 i686)\r\nHost: localhost:81\r\nAccept: ".("a"x1000000)."\r\nAccept-Encoding: gzip\r\nAccept-Language: en\r\nAccept-Charset: iso-8859-1,*,utf-8\r\n\r\n";
syswrite(SOCK,"$header");
$keep=1;
while($keep) {
if(newdata(SOCK)) {
if(($data=<SOCK>)) {
print "Read: ".$data;
}else {
$keep=0;
};
};
};
close(SOCK);
socket(SOCK,AF_INET,SOCK_STREAM,6) or exit;
print "Change method by a big name\n";
<STDIN>;
connect(SOCK,$saddr) or exit;
print "Connected\n";
$header=("a"x1000000)." / HTTP/1.0\r\nConnection: Keep-Alive\r\nUser-Agent: Mozilla/4.73 [en] (X11; U; Linux 2.4.12 i686)\r\nAccept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*\r\nAccept-Encoding: gzip\r\nAccept-Language: en\r\nAccept-Charset: iso-8859-1,*,utf-8\r\n\r\n";
syswrite(SOCK,"$header");
$keep=1;
while($keep) {
if(newdata(SOCK)) {
if(($data=<SOCK>)) {
print "Read: ".$data;
}else {
$keep=0;
};
};
};
close(SOCK);
socket(SOCK,AF_INET,SOCK_STREAM,6) or exit;
print "big query value\n";
<STDIN>;
connect(SOCK,$saddr) or exit;
print "Connected\n";
$header="GET /?teste=".("a"x1000000)." / HTTP/1.0\r\nConnection: Keep-Alive\r\nUser-Agent: Mozilla/4.73 [en] (X11; U; Linux 2.4.12 i686)\r\nAccept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*\r\nAccept-Encoding: gzip\r\nAccept-Language: en\r\nAccept-Charset: iso-8859-1,*,utf-8\r\n\r\n";
syswrite(SOCK,"$header");
$keep=1;
while($keep) {
if(newdata(SOCK)) {
if(($data=<SOCK>)) {
print "Read: ".$data;
}else {
$keep=0;
};
};
};
close(SOCK);
socket(SOCK,AF_INET,SOCK_STREAM,6) or exit;
print "requestname filled w 0's\n";
<STDIN>;
connect(SOCK,$saddr) or exit;
print "Connected\n";
$header="GET /".("\0"x1000000)." HTTP/1.0\r\nConnection: Keep-Alive\r\nUser-Agent: Mozilla/4.73 [en] (X11; U; Linux 2.4.12 i686)\r\nAccept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*\r\nAccept-Encoding: gzip\r\nAccept-Language: en\r\nAccept-Charset: iso-8859-1,*,utf-8\r\n\r\n";
syswrite(SOCK,"$header");
$keep=1;
while($keep) {
if(newdata(SOCK)) {
if(($data=<SOCK>)) {
print "Read: ".$data;
}else {
$keep=0;
};
};
};
close(SOCK);
socket(SOCK,AF_INET,SOCK_STREAM,6) or exit;
print "query filled w 0's\n";
<STDIN>;
connect(SOCK,$saddr) or exit;
print "Connected\n";
$header="GET /teste?teste=".("\0"x1000000)." HTTP/1.0\r\nConnection: Keep-Alive\r\nUser-Agent: Mozilla/4.73 [en] (X11; U; Linux 2.4.12 i686)\r\nAccept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*\r\nAccept-Encoding: gzip\r\nAccept-Language: en\r\nAccept-Charset: iso-8859-1,*,utf-8\r\n\r\n";
syswrite(SOCK,"$header");
$keep=1;
while($keep) {
if(newdata(SOCK)) {
if(($data=<SOCK>)) {
print "Read: ".$data;
}else {
$keep=0;
};
};
};
close(SOCK);
socket(SOCK,AF_INET,SOCK_STREAM,6) or print "Died";
print "a post (foo)value with 10000000 bytes press (enter) to continue\n";
<STDIN>;
connect(SOCK,$saddr) or exit;
print "Connected\n";
$header="POST / HTTP/1.0\r\nConnection: Keep-Alive\r\nUser-Agent: Mozilla/4.73 [en] (X11; U; Linux 2.4.12 i686)\r\nHost: localhost:81\r\nAccept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*\r\nAccept-Encoding: gzip\r\nAccept-Language: en\r\nAccept-Charset: iso-8859-1,*,utf-8\r\n\r\ndev=teste".("\0"x1000000)."&teste=1\r\n\r\n"; #big values
syswrite(SOCK,"$header");
$keep=1;
while($keep) {
if(newdata(SOCK)) {
if(($data=<SOCK>)) {
print "Read: ".$data;
}else {
$keep=0;
};
};
};
print "--------- END --------\n"
+1
View File
@@ -0,0 +1 @@
copy ..\bin\libwebserver.lib "C:\Programas\Microsoft Visual Studio\VC98\Lib\libwebserver.lib"
+2
View File
@@ -0,0 +1,2 @@
#!/bin/sh
for i in `find . -name "*" -xtype f`; do echo "Messing with $i";cat $i |tr -d \\r >.1; mv .1 $i ; done
+445
View File
@@ -0,0 +1,445 @@
<center><H3><font color='007700'>libwebserver examples</font></H3></center><BR><BR>
<!-- Johannes E. Schindelin -->
<center><A name=helloworld><B><font color='000077'><a href=/hello><H3>Hello World</H3></a></font></B></center>
<small> <B>used functions:</B><BR>
<a href='/?help=functions#web_server_init'>web_server_init</a><BR>
<a href='/?help=functions#web_server_addhandler'>web_server_addhandler</a><BR>
<a href='/?help=functions#web_server_run'>web_server_run</a><BR>
</small><BR>
This example starts the server with one handler for all requests pointing to hello_world()
that prints the content-type with the end of the header "\r\n\r\n" and one simple printf with Hello world<BR><BR>
<TABLE width='100%' bgcolor='CFCFCF' border=0><TR><TD>
<CODE><PRE>
#include "web_server.h"
#include &lt;stdio.h&gt;
void hello_world() {
printf("Content-type: text/plain\r\n\r\n");
printf("Hello, World!\r\n");
}
int main(int argc,char** argv) {
struct web_server server; // server handler
if(!web_server_init(&server,80,"help.log",0)) { // initialize and start the server at port 80, logging to help.log
fprintf(stderr,"can't open listen socket\n");
return 1;
};
web_server_addhandler(&server,"* *",hello_world,0); // add handler for all requests
while(1) {
web_server_run(&server); // run server
};
}
</PRE></CODE>
</TD></TR></TABLE>
<HR><BR>
<center><A name=logfile><B><font color='000077'><a href='/log'><H3>logfile</H3></a></font></B></center>
<small> <B>used functions:</B><BR>
<a href='/?help=functions#web_server_init'>web_server_init</a><BR>
<a href='/?help=functions#web_server_addhandler'>web_server_addhandler</a><BR>
<a href='/?help=functions#web_server_run'>web_server_run</a><BR>
<a href='/?help=functions#web_client_addfile'>web_client_addfile</a><BR>
</small><BR>
This example uses the function <a href='/?help=functions#web_client_addfile'>web_client_addfile</a> to send a file to client
<BR><BR>
<TABLE width='100%' bgcolor='CFCFCF' border=0><TR><TD>
<CODE><PRE>
#include "web_server.h"
#include &lt;stdio.h&gt;
void logfile() {
printf("Content-type: text/plain\r\n\r\n");
web_client_addfile(server.logfile); // add help.log file to output
printf("End of log\n");
};
main() {
struct web_server server; // server handler
if(!web_server_init(&server,82,"help.log",0)) { // initializate
fprintf(stderr,"can't open listen socket\n");
};
web_server_addhandler(&server,"* /log",logfile,0); // add handler for http://host/log requests
while(1) {
web_server_run(&server); // run server
};
};
</PRE></CODE>
</TD></TR></TABLE>
<HR><BR>
<center><A name=imageup><B><font color='000077'><a href='/image'><H3>Image Uploader</H3></a></font></B></center>
<small> <B>used functions:</B><BR>
<a href='/?help=functions#web_server_init'>web_server_init</a><BR>
<a href='/?help=functions#web_server_addhandler'>web_server_addhandler</a><BR>
<a href='/?help=functions#web_server_run'>web_server_run</a><BR>
<a href='/?help=functions#clientinfo'>ClientInfo</a><BR>
</small><BR>
This example uses the struct <a href='/?help=functions#clientinfo'>ClientInfo</a> for fetching the input from the client
using the Query("img") to send the image <BR>
and multipart for fetching the uploaded file<BR>
<BR><BR>
<TABLE width='100%' bgcolor='CFCFCF' border=0><TR><TD>
<CODE><PRE>
#include "web_server.h"
#include &lt;stdlib.h&gt;
struct image {
char *data;
size_t size;
} image={NULL,0};
void imageout() {
if(strlen(ClientInfo->Query("img"))) {
if(image.data!=NULL) {
printf("Content-type: image/jpeg\r\n\r\n");
fwrite(image.data,image.size,1,stdout);
};
return;
};
printf("Content-type: text/html\r\n\r\n");
printf("&lt;HTML&gt;\n");
printf("&lt;BODY bgcolor='EFEFEF'&gt;\n");
printf("&lt;form action='/' enctype='multipart/form-data'&gt;\n");
printf("&lt;input type=file name=image&gt;&lt;BR&gt;\n");
printf("&lt;/form&gt;\n");
if(strlen(ClientInfo->MultiPart("image").data)) {
printf("%s&lt;BR&gt;&lt;img src='/?img=%s.jpg'&gt;\n",ClientInfo->MultiPart("image").filename,ClientInfo->MultiPart("image").filename);
free(image.data);
image.data=malloc(ClientInfo->MultiPart("image").size+1);
memcpy(image.data,ClientInfo->MultiPart("image").data,ClientInfo->MultiPart("image").size);
image.size=ClientInfo->MultiPart("image").size;
}else {
free(image.data);
image.data=NULL;
};
printf("&lt;/BODY&gt;\n");
printf("&lt;/HTML&gt;\n");
};
main() {
struct web_server server;
if(!web_server_init(&server,80,"teste.log",0)) {
fprintf(stderr,"can't open listen socket\n");
};
web_server_addhandler(&server,"* /",imageout,0);
while(1) {
web_server_run(&server);
};
};
</PRE></CODE>
</TD></TR></TABLE>
<HR><BR>
<center><A name=auth><B><font color='000077'><a href='/auth'><H3>Authentication</H3></a> </font></B></center>
<small> <B>used functions:</B><BR>
<a href='/?help=functions#web_server_init'>web_server_init</a><BR>
<a href='/?help=functions#web_server_addhandler'>web_server_addhandler</a><BR>
<a href='/?help=functions#web_server_run'>web_server_run</a><BR>
<a href='/?help=functions#web_client_HTTPdirective'>web_client_HTTPdirective</a><BR>
</small><BR>
Here we're using the <a href='/?help=functions#web_client_HTTPdirective'>web_client_HTTPdirective</a> to set up the server response
<BR><BR>
user: "username", pass: "password"
<BR>
<TABLE width='100%' bgcolor='CFCFCF' border=0><TR><TD>
<CODE><PRE>
#include "web_server.h"
#include &lt;stdio.h&gt;
#include &lt;string.h&gt;
void urlauthenticate() {
if(!strlen(ClientInfo->user) || !strlen(ClientInfo->pass) &&
strcmp(ClientInfo->user,"username") || strcmp(ClientInfo->pass,"password")) { // you can read things from a auth file
web_client_HTTPdirective("HTTP/1.1 401 Authorization Required");
printf("WWW-Authenticate: Basic realm=\"This site info\"\r\n");
printf("Content-type: text/html\r\n\r\n");
printf("&lt;BODY&gt;\n");
printf("&lt;font color='FF0000'&gt;Access denied&lt;/font&gt;\n");
printf("&lt;/BODY&gt;\n");
return;
}
printf("Content-type: text/html\r\n\r\n");
printf("&lt;BODY bgcolor='EFEFEF'&gt;\n");
printf("You entered in your area\n");
printf("&lt;/BODY&gt;&lt;/HTML&gt;\n");
};
main() {
struct web_server server; // server handler
if(!web_server_init(&server,83,"help.log",0)) { // initialize
fprintf(stderr,"can't open listen socket\n");
};
web_server_addhandler(&server,"* /auth",urlauthenticate,0);
while(1) {
web_server_run(&server); // run server
};
};
</PRE></CODE>
</TD></TR></TABLE>
<HR><BR>
<CENTER><A name=ssl><B><font color='000077'><H3>openssl for (https)</H3></font></B></CENTER>
<small> <B>used functions:</B><BR>
<a href='/?help=functions#web_server_HTTPdirective'>web_server_useSSLcert</a><BR>
<a href='/?help=functions#web_server_init'>web_server_init</a><BR>
<a href='/?help=functions#web_server_run'>web_server_run</a><BR>
</small><BR>
Here we setup a server and we use the <a href='/?help=functions#web_server_useSSLcert'>web_server_useSSLcert</a> to use specific certificate file
and we start the server with the flag WS_USESSL for secure connections (libwebserver compiled w/ openssl)<BR><BR>
See also the packetmounter example in the example directory.
<BR>
<TABLE width='100%' bgcolor='CFCFCF' border=0><TR><TD>
<CODE><PRE>
#include "web_server.h"
int main()
struct web_server serverssl;
web_server_useSSLcert(&serverssl,"foo-cert.pem"); // Certificate file
if(!web_server_init(&serverssl,443,"help.log",WS_USESSL)) {
fprintf(stderr,"Cannot open port\n");
};
while(1) {
web_server_run(&serverssl);
};
};
</PRE></CODE>
</TD></TR></TABLE>
All the rest is the same as without SSL.
<HR><BR>
<center><A name=outgif><B><font color='000077'><a href='/gif'><H3>Gif generator</H3></a></font></B></center>
<small> <B>used functions;</B><BR>
<a href='/?help=functions#web_server_init'>web_server_init</a><BR>
<a href='/?help=functions#web_server_addhandler'>web_server_addhandler</a><BR>
<a href='/?help=functions#web_server_run'>web_server_run</a><BR>
<a href='/?help=functions#web_client_gifsetpalette'>web_client_gifsetpalette</a><BR>
<a href='/?help=functions#web_client_gifoutput'>web_client_gifoutput</a><BR>
<a href='/?help=functions#clientinfo'>ClientInfo</a><BR>
</small><BR>
This example draws an circle at x,y requested by client, and outputs with function <a href='/?help=functions#web_client_gifoutput'>web_client_gifoutput</a>
<BR><BR>
<TABLE width='100%' bgcolor='CFCFCF' border=0><TR><TD>
<CODE><PRE>
#include "web_server.h"
#include &lt;stdio.h&gt;
#include &lt;math.h&gt;
#define GIFSIDE 320
char gifdata[GIFSIDE*GIFSIDE];
void outgif() {
float i;
int x,y,xc,yc;
int color;
web_client_gifsetpalette("EGA");
if(*ClientInfo->Query("img")!=0) {
printf("Content-type: image/gif\r\n\r\n");
if(!strcmp(ClientInfo->Query("img"),"circle")) {
xc=atoi(ClientInfo->Query("x"))%GIFSIDE;
yc=atoi(ClientInfo->Query("y"))%GIFSIDE;
color=(rand()%15)+1;
for(i=0;i<6.28;i+=0.01) {
x=(int)(GIFSIDE+(xc+cos(i)*10))%GIFSIDE;
y=(int)(GIFSIDE+(yc+sin(i)*10))%GIFSIDE;
gifdata[x+(y*GIFSIDE)]=color;
};
};
web_client_gifoutput(gifdata,GIFSIDE,GIFSIDE);
};
printf("&lt;center&gt;Generated a circle (click inside the image)&lt;BR&gt;\n");
printf("Pressed x=%s,y=%s&lt;BR&gt;\n",ClientInfo->Query("x"),ClientInfo->Query("y"));
printf("&lt;form&gt;&lt;input type=image border=0 src='/gif?img=circle&x=%s&y=%s'&gt;&lt;/form&gt;&lt;/CENTER&gt;\n",ClientInfo->Query("x"),ClientInfo->Query("y"));
};
main() {
struct web_server server; // server handler
memset(gifdata,0,GIFSIDE*GIFSIDE);
if(!web_server_init(&server,83,"help.log",0)) { // initialize
fprintf(stderr,"can't open listen socket\n");
};
web_server_addhandler(&server,"* /gif",outgif,0);
while(1) {
web_server_run(&server); // run server
};
};
</PRE></CODE>
</TD></TR></TABLE>
<HR><BR>
<CENTER><A name=cookie><B><font color='000077'><a href=/cookie><H3>Cookies</H3></a></font></B></CENTER>
<small> <B>used functions;</B><BR>
<a href='/?help=functions#web_server_init'>web_server_init</a><BR>
<a href='/?help=functions#web_server_addhandler'>web_server_addhandler</a><BR>
<a href='/?help=functions#web_server_run'>web_server_run</a><BR>
<a href='/?help=functions#clientinfo'>ClientInfo</a><BR>
<a href='/?help=functions#web_client_setcookie'>web_client_setcookie</a><BR>
</small><BR>
This example fetchs an client input and set's an cookie for 15 minutes "+15M" using function <a href='/?help=functions#web_client_setcookie'>web_client_setcookie</a>
<BR><BR>
<TABLE width='100%' bgcolor='CFCFCF' border=0><TR><TD>
<CODE><PRE>
#include "web_server.h"
#include &lt;stdio.h&gt;
void cookie() {
if(strlen(ClientInfo->Post("user")))
web_client_setcookie("username",ClientInfo->Post("user"),"+15M");
printf("Content-type: text/html\r\n\r\n");
printf("&lt;form method='POST'&gt;\r\n");
printf("&lt;input type='text' name='user' value='%s'&gt;\r\n&lt;BR&gt;",ClientInfo->Cookie("username"));
printf("&lt;input type='submit' name='send' value=' GO! '&gt;\r\n&lt;BR&gt;");
printf("&lt;/form&gt;\r\n");
}
int main(int argc,char** argv) {
struct web_server server; // server handler
if(!web_server_init(&server,80,"help.log",0)) { // initialize
fprintf(stderr,"can't open listen socket\n");
return 1;
};
web_server_addhandler(&server,"* /*",cookie,0); // add handler for all requests
while(1) {
web_server_run(&server); // run server
};
}
</PRE></CODE>
</TD></TR></TABLE>
<HR><BR>
<center><A name=checkbox><B><font color='000077'><a href=/checkbox><H3>Checkbox</H3></a></font></B></center>
<small> <B>used functions;</B><BR>
<a href='/?help=functions#web_server_init'>web_server_init</a><BR>
<a href='/?help=functions#web_server_addhandler'>web_server_addhandler</a><BR>
<a href='/?help=functions#web_server_run'>web_server_run</a><BR>
<a href='/?help=functions#clientinfo'>ClientInfo</a><BR>
</small><BR>
This example uses a especific case from <a href='/?help=functions#clientinfo'>ClientInfo</a> query and post, using the '#' as prefix of varname returning the number of occurences
<BR><BR>
<TABLE width='100%' bgcolor='CFCFCF' border=0><TR><TD>
<CODE><PRE>
#include "web_server.h"
#include &lt;stdio.h&gt;
void checkbox() {
int i=0;
char *txt[]={"one","two","three","four","five"};
printf("Content-type: text/html\r\n\r\n");
printf("&lt;form method='QUERY'&gt;\r\n");
for(i=0;i<5;i++) {
printf("&lt;input type='checkbox' name='number' value='%s'&gt;\r\n&lt;BR&gt;",txt[i]);
};
printf("&lt;input type='submit' name='send' value=' SEND '&gt;\r\n&lt;BR&gt;");
printf("&lt;/form&gt;\r\n");
printf("You have choosen &lt;font color='FF0000'&gt;%d&lt;/font&gt; numbers: \r\n",ClientInfo->Query("#number"));
for(i=0;i&lt;ClientInfo->Query("#number");i++) {
printf("&lt;b>%s&lt;/b&gt;,\r\n\r\n",ClientInfo->Query("number"));
};
printf("...&lt;BR&gt;\r\n\r\n");
}
int main(int argc,char** argv) {
struct web_server server; // server handler
if(!web_server_init(&server,80,"help.log",0)) { // initialize
fprintf(stderr,"can't open listen socket\n");
return 1;
};
web_server_addhandler(&server,"* /*",checkbox,0); // add handler for all requests
while(1) {
web_server_run(&server); // run server
};
}
</PRE></CODE>
</TD></TR></TABLE>
<HR><BR>
<center><A name=confexample><B><font color='000077'><a href=/confexample><H3>Config example</H3></a></font></B></center>
<small> <B>used functions;</B><BR>
<a href='/?help=functions#web_server_init'>web_server_init</a><BR>
<a href='/?help=functions#web_server_addhandler'>web_server_addhandler</a><BR>
<a href='/?help=functions#web_server_run'>web_server_run</a><BR>
<a href='/?help=functions#web_client_addfile'>web_client_addfile</a><BR>
<a href='/?help=functions#clientinfo'>ClientInfo</a><BR>
</small><BR>
<BR><BR>
<TABLE width='100%' bgcolor='CFCFCF' border=0><TR><TD>
<CODE><PRE>
#include "web_server.h"
#include &lt;stdio.h&gt;
void confexample() {
printf("Content-type: text/html\r\n\r\n");
printf("&lt;PRE&gt;");
web_client_addfile(server.conffile); // add help.cfg file to output
printf("&lt;/PRE&gt;");
printf("ClientInfo->Conf(\"PERSONAL_CONF\",\"PORT\")=%s&lt;BR&gt;\n",ClientInfo->Conf("PERSONAL_CONF","PORT"));
printf("ClientInfo->Conf(\"PERSONAL_CONF\",\"IP\")=%s&lt;BR&gt;\n",ClientInfo->Conf("PERSONAL_CONF","IP"));
printf("ClientInfo->Conf(\"LIBWEBSERVER\",\"PORT\")=%s&lt;BR&gt;\n",ClientInfo->Conf("LIBWEBSERVER","PORT"));
}
int main(int argc,char** argv) {
struct web_server server; // server handler
if(!web_server_init(&server,80,"help.cfg",WS_USEEXTCONF)) { // initialize
fprintf(stderr,"can't open listen socket\n");
return 1;
};
web_server_addhandler(&server,"* *",confexample,0); // add handler for all requests
while(1) {
web_server_run(&server); // run server
};
}
</PRE></CODE>
</TD></TR></TABLE>
@@ -0,0 +1,24 @@
/* by Luis Figueiredo (stdio@netc.pt)
*
*
* date: Sat Mar 30 14:16:05 GMT 2002
*
* DEBUG macros
*
*/
#ifndef _DEBUG_H_
#define _DEBUG_H_
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef DEBUG
#define IFDEBUG(x) x
#else
#define IFDEBUG(x)
#endif
#endif
@@ -0,0 +1,39 @@
/* by Luis Figueiredo (stdio@netc.pt)
*
* file: sound_buffers.h
*
* description: Holds sound data structures and functions
*
* date: 13:14,29-14-2002
*/
#ifndef _SOUND_BUFFERS_H_
#define _SOUND_BUFFERS_H_
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
struct sound_buf {
char *id;
unsigned char *data;
unsigned int data_i;
unsigned int play_i;
unsigned int startloop,endloop;
unsigned char volume;
unsigned char channels;
int mode;
struct sound_buf *next;
};
struct sound_buf *sbuf_init();
struct sound_buf *sbuf_add(struct sound_buf *list,char *id);
struct sound_buf *sbuf_select(struct sound_buf *list,char *id);
int sbuf_delete(struct sound_buf *list,char *id);
#endif
@@ -0,0 +1,31 @@
/* by Luis Figueiredo (stdio@netc.pt)
*
* file: soundcard.h
*
* description: handlers soundcard setup
*
* date: 17:00,13-00-2002
*/
#ifndef _SOUNDCARD_H_
#define _SOUNDCARD_H_
#include <fcntl.h>
#include <sys/soundcard.h>
#include <stdio.h>
#include <sys/ioctl.h>
#include "debug.h"
struct soundcard_setup {
int rate;
char channels;
int fmt;
};
int soundcard_init(const char *, struct soundcard_setup *);
#endif
@@ -0,0 +1,23 @@
/* by Luis Figueiredo (stdio@netc.pt)
*
* file: soundmixer.h
*
* description: Sound mixer using (soundbuffers.c)
*
* date: 17:13,13-13-2002
*/
#ifndef _SOUNDMIXER_H_
#define _SOUNDMIXER_H_
#include <stdio.h>
#include <unistd.h>
#include "soundbuffers.h"
#define _SDMAX 44100 // quarter second *2 *2
void sound_process(int soundfd,struct sound_buf *list);
#endif
+296
View File
@@ -0,0 +1,296 @@
/* by Luis Figueiredo (stdio@netc.pt)
*
* file: main.c
*
* description: Programa main
*
* date: 16:47,13-47-2002
*/
#include "soundcard.h"
#include "soundbuffers.h"
#include "soundmixer.h"
#include "web_server.h"
#include <signal.h>
#define ADJUST_VOLUME(s, v) (s = (s*v)/128)
int PORT=80;
struct sound_buf *SoundBuf;
void outgif() {
char *nam;
struct sound_buf *sbuf=NULL;
char gif[640*40+1];
int x=0,y=0;
int i,h=20;
short d;
nam=malloc(strlen(ClientInfo->request)-3);
memcpy(nam,ClientInfo->request+1,strlen(ClientInfo->request)-4);
nam[strlen(ClientInfo->request)-5]=0;
sbuf=sbuf_select(SoundBuf,nam);
if(sbuf!=NULL) {
if(sbuf->data_i>_SDMAX) {
if(gif!=NULL) {
memset(gif,0,640*40);
for(i=0;i<1280;i++) {
x=i/2;
//y=(*((unsigned short *)sbuf->data+((i*4)%640))%20)+10;
d=((sbuf->data[((i*((sbuf->data_i-1280)/2560))*2)+1]<<8)|sbuf->data[((i*((sbuf->data_i-1280)/2560))*2)]);
y=d/(32767/20)+20;
//fprintf(stderr,"y=%d\n",y);
//gif[x+y*640]=10;
if(h>y) {
for(h=20;h>y;h--) gif[x+h*640]=10;
} else {
for(h=20;h<=y;h++) gif[x+h*640]=10;
};
};
printf("Cache-control: no-cache\r\n");
printf("Content-type: image/gif\r\n\r\n");
web_client_gifoutput(gif,640,40,0);
};
};
};
free(nam);
return;
};
void dlbuf() {
char *nam;
struct sound_buf *sbuf=NULL;
nam=malloc(strlen(ClientInfo->request)-3);
memcpy(nam,ClientInfo->request+1,strlen(ClientInfo->request)-4);
nam[strlen(ClientInfo->request)-5]=0;
sbuf=sbuf_select(SoundBuf,nam);
printf("Content-type: x-form/application\r\n\r\n");
if(sbuf!=NULL) {
fwrite(sbuf->data,sbuf->data_i,1,stdout);
};
};
void index_html() {
struct sound_buf *sbuf=NULL;
char *id;
char *tmp;
int i;
unsigned char *soundout=NULL;
short src1,src2;
int dst_sample;
const int max_audioval =((1<<(16-1))-1);
const int min_audioval =-(1<<(16-1));
int bigger=0;
printf("Cache-control: no-cache\r\n");
printf("Content-type: text/html\r\n\r\n");
printf("<HTML>\n");
printf("<BODY>\n");
printf("<center>Sound Recorder (webgui)</center>\n");
if(*ClientInfo->Post("sbufnew")!=0) {
if(*ClientInfo->Post("sbufname")!=0) {
if(!sbuf_select(SoundBuf,ClientInfo->Post("sbufname"))) {
sbuf=sbuf_add(SoundBuf,ClientInfo->Post("sbufname"));
if(ClientInfo->MultiPart("sbufdata").size>0) {
sbuf->data=malloc(ClientInfo->MultiPart("sbufdata").size);
memcpy(sbuf->data,ClientInfo->MultiPart("sbufdata").data,ClientInfo->MultiPart("sbufdata").size);
sbuf->data_i=ClientInfo->MultiPart("sbufdata").size;
};
} else {
printf("<FONT color='FF0000'>Sound buffer exists</font>\n");
};
}else {
printf("<FONT color='FF0000'>Sound buffer name is empty</font>\n");
};
};
if(*ClientInfo->Post("sbufvol")!=0) {
sbuf=SoundBuf->next;
while(sbuf!=NULL) {
tmp=malloc(strlen(sbuf->id)+5);
snprintf(tmp,strlen(sbuf->id)+5,"%s.vol",sbuf->id);
sbuf->volume=atoi(ClientInfo->Post(tmp))%129;
free(tmp);
sbuf=sbuf->next;
}
};
if(*ClientInfo->Post("sbufch")!=0) {
sbuf=SoundBuf->next;
while(sbuf!=NULL) {
tmp=malloc(strlen(sbuf->id)+4);
snprintf(tmp,strlen(sbuf->id)+4,"%s.ch",sbuf->id);
sbuf->channels=atoi(ClientInfo->Post(tmp))%3;
free(tmp);
sbuf=sbuf->next;
}
};
printf("<form method='POST' enctype='multipart/form-data'>\n");
printf("Sound Buffer:<BR>\n");
printf("Name:<input type=text name='sbufname' size=5 maxlength=10><BR>\n");
printf("Data:<input type=file name='sbufdata'><BR>\n");
printf("<input type=submit name='sbufnew' value=' New '><BR>\n");
printf("<table width=100%% cellpadding=2 cellspacing=0 bgcolor='AAAAAA'>\n");
printf("<TR><TD colspan=7 align=center><font face='Helvetica' size=6 color='FFFFFF'> Sound Buffers </font></TD></TR>\n");
sbuf=SoundBuf->next;
i=0;
while(sbuf!=NULL) {
if(*ClientInfo->Post("sbufprocess")!=0) {
if(atoi(ClientInfo->Post(sbuf->id))==5) {
sbuf->mode=0;
sbuf->play_i=0;
if(sbuf->data_i>bigger) {
bigger=sbuf->data_i;
soundout=realloc(soundout,bigger);
};
for(i=0;i<sbuf->data_i;i+=4) {
// LEFT
src1=((sbuf->data[i+1]<<8) | sbuf->data[i]);
ADJUST_VOLUME(src1,sbuf->volume);
src2=((soundout[i+1]<<8) | soundout[i]);
dst_sample=src1+src2;
if ( dst_sample > max_audioval ) {
dst_sample = max_audioval;
} else if ( dst_sample < min_audioval ) {
dst_sample = min_audioval;
}
soundout[i]=dst_sample &0xFF;
dst_sample>>=8;
soundout[i+1]=dst_sample & 0xFF;
// RIGHT
src1=((sbuf->data[i+1+2]<<8) | sbuf->data[i+2]);
ADJUST_VOLUME(src1,sbuf->volume);
if(sbuf->channels==2) {
src2=((soundout[i+1+2]<<8) | soundout[i+2]); // join left to right
} else {
src2=((soundout[i+1]<<8) | soundout[i]); // separate
};
dst_sample=src1+src2;
if ( dst_sample > max_audioval ) {
dst_sample = max_audioval;
} else if ( dst_sample < min_audioval ) {
dst_sample = min_audioval;
}
soundout[i+2]=dst_sample &0xFF;
dst_sample>>=8;
soundout[i+2+1]=dst_sample & 0xFF;
};
} else {
sbuf->mode=atoi(ClientInfo->Post(sbuf->id));
tmp=malloc(strlen(sbuf->id)+5);
snprintf(tmp,strlen(sbuf->id)+5,"%s.vol",sbuf->id);
sbuf->volume=atoi(ClientInfo->Post(tmp))%129;
free(tmp);
sbuf->play_i=0;
};
};
if(sbuf->mode!=4) {
printf("<TR><TD bgcolor='EFEFEF'><font face='Verdana'>%s</font></TD><TD>",sbuf->id);
printf("<select name='%s'>",sbuf->id);
printf("<option value='0' %s>none</option>\n",(atoi(ClientInfo->Post(sbuf->id))==0)?"selected":"");
printf("<option value='1' %s>play</option>\n",(atoi(ClientInfo->Post(sbuf->id))==1)?"selected":"");
printf("<option value='2' %s>record</option>\n",(atoi(ClientInfo->Post(sbuf->id))==2)?"selected":"");
printf("<option value='3'>reset</option>\n");
printf("<option value='4'>delete</option>\n");
printf("<option value='5'>mixfrom</option>\n");
printf("<option value='6'>mixto</option>\n");
printf("</select>\n");
printf("</TD><TD>%dm:%ds</TD>",(sbuf->data_i/44100/2/2)/60,(sbuf->data_i/44100/2/2%60));
printf("</TD><TD>\n");
printf("<select name='%s.ch'>\n",sbuf->id);
printf("<option value='1' %s>Mono</option>\n",(sbuf->channels==1)?"selected":"");
printf("<option value='2' %s>Stereo</option>\n",(sbuf->channels==2)?"selected":"");
printf("</select></TD>");
printf("</TD><TD>Volume:<BR>\n");
printf("<input type=text name=%s.vol size=3 maxlength=3 value='%d'></TD>",sbuf->id,sbuf->volume);
printf("<TD width=100%%> <input type=image width=100%% height=40 src='/%s.gif' border=0></TD>\n",sbuf->id);
printf("<TD><a href='/%s.raw'>Download</a></TD></TR>\n",sbuf->id);
}
if(sbuf->mode==3) {
sbuf->data_i=0;
sbuf->play_i=0;
free(sbuf->data);
sbuf->data=NULL;
sbuf->mode=0;
};
id=sbuf->id;
sbuf=sbuf->next;
if(atoi(ClientInfo->Post(id))==4) {
sbuf_delete(SoundBuf,id);
}
i++;
};
// mix to (6)
sbuf=SoundBuf->next;
while(sbuf!=NULL) {
if(atoi(ClientInfo->Post(sbuf->id))==6) {
free(sbuf->data); // free previous
sbuf->data=malloc(bigger+1);
memcpy(sbuf->data,soundout,bigger);
sbuf->data_i=bigger;
sbuf->mode=0;
sbuf->play_i=0;
sbuf->volume=128;
};
sbuf=sbuf->next;
};
if(i) printf("<TR><TD align=center valign=center>.</TD><TD><input type=submit name='sbufprocess' value=' Process '></TD><TD align=center valign=center>.</TD><TD><input type=submit name='sbufch' value='Set'></TD><TD><input type=submit name='sbufvol' value='Set'></TD><TD>.</TD><TD>.</TD></TR>\n");
printf("</TABLE>\n");
printf("</form>\n");
};
int main() {
struct web_server server;
int soundfd;
struct soundcard_setup SoundSetup;
signal(SIGPIPE,SIG_IGN);
SoundBuf=sbuf_init();
SoundSetup.rate=44100;
SoundSetup.channels=2;
SoundSetup.fmt=16;
soundfd=soundcard_init("/dev/dsp",&SoundSetup);
if(soundfd<1) {
return 0;
};
while(!web_server_init(&server,PORT,NULL,0))PORT++;
printf("http://localhost:%d\n",PORT);
web_server_addhandler(&server,"* /*.gif",outgif,WS_LOCAL);
web_server_addhandler(&server,"* /*.raw",dlbuf,WS_LOCAL);
web_server_addhandler(&server,"* /*",index_html,WS_LOCAL);
while(1) {
sound_process(soundfd,SoundBuf);
web_server_run(&server);
};
};
@@ -0,0 +1,86 @@
/* by Luis Figueiredo (stdio@netc.pt)
*
* file: sound_buffers.c
*
* description: Sounddata procedures
*
* date: 13:23,29-23-2002
*/
#include "soundbuffers.h"
/*
* init list
*/
struct sound_buf *sbuf_init() {
struct sound_buf *head;
head=malloc(sizeof(struct sound_buf));
head->next=NULL;
head->data_i=0;
head->data=NULL;
head->id=NULL;
return head;
};
struct sound_buf *sbuf_select(struct sound_buf *list,char *id) {
struct sound_buf *temp=list;
while(temp->next!=NULL) {
if(temp->next->id!=NULL) {
if(!strcmp(temp->next->id,id)) {
return temp->next;
};
};
temp=temp->next;
};
return NULL;
};
/*
* next prototipe go to select_buffer
*/
struct sound_buf *sbuf_add(struct sound_buf *list,char *id) {
struct sound_buf *temp=list;
while(temp->next!=NULL) {
if(temp->next->id!=NULL) {
if(!strcmp(temp->next->id,id)) {
return NULL;
};
temp=temp->next; // Next buffer
};
};
// id is new lets create this buffer
temp->next=malloc(sizeof(struct sound_buf));
// lets copy the new id
temp->next->id=malloc(strlen(id)+1);
strncpy(temp->next->id,id,strlen(id));
temp->next->id[strlen(id)]=0;
// zero the rest;
temp->next->data=NULL;
temp->next->data_i=0;
temp->next->play_i=0;
temp->next->mode=0;
temp->next->volume=128;
temp->next->next=NULL;
return temp->next;
};
int sbuf_delete(struct sound_buf *list,char *id) {
struct sound_buf *temp=list;
struct sound_buf *t;
while(temp->next!=NULL) {
if(temp->next->id!=NULL) {
if(!strcmp(temp->next->id,id)) {
t=temp->next;
temp->next=temp->next->next;
free(t->data);
free(t->id);
free(t);
return 1;
};
};
temp=temp->next;
};
return 0;
};
@@ -0,0 +1,49 @@
/* by Luis Figueiredo (stdio@netc.pt)
*
* file: soundcard.c
*
* description: handlers soundcard setup
*
* date: 17:00,13-00-2002
*/
#include "soundcard.h"
int soundcard_init(const char *dev, struct soundcard_setup *ss) {
int ret;
int soundfd;
soundfd=open(dev,O_RDWR|O_NONBLOCK);
if(soundfd <1) {
perror("open");
return -1;
}
IFDEBUG(fprintf(stderr,"soundcard.c: Setting soundcard:\n"));
IFDEBUG(fprintf(stderr,"soundcard.c: rate: %d\n",ss->rate));
ret=ioctl(soundfd,SNDCTL_DSP_SPEED,&ss->rate);
if(ret==-1) {
perror("ioctl");
return-1 ;
};
IFDEBUG(fprintf(stderr,"soundcard.c: channels: %d\n",ss->channels));
ret=ioctl(soundfd,SNDCTL_DSP_CHANNELS,&ss->channels);
if(ret==-1) {
perror("ioctl");
return -1;
};
IFDEBUG(fprintf(stderr,"soundcard.c: fmt %d\n",ss->fmt));
ret=ioctl(soundfd,SNDCTL_DSP_SETFMT,&ss->fmt);
if(ret==-1) {
perror("ioctl");
return -1;
};
IFDEBUG(fprintf(stderr,"Sound card setup sucessfull\n"));
return soundfd;
};
+104
View File
@@ -0,0 +1,104 @@
/* by Luis Figueiredo (stdio@netc.pt)
*
* file: soundmixer.c
*
* description: Sound mixer using (soundbuffers.c)
*
* date: 17:13,13-13-2002
*/
#include "soundmixer.h"
int SDMAX=_SDMAX;
#define ADJUST_VOLUME(s, v) (s = (s*v)/128)
int soundout_i=-1;
void sound_process(int soundfd,struct sound_buf *list) {
int soundin_i;
struct sound_buf *sbuf;
unsigned char soundin[_SDMAX+1];
unsigned char soundout[_SDMAX+1];
int playit=0;
int i;
short src1,src2;
int dst_sample;
const int max_audioval =((1<<(16-1))-1);
const int min_audioval =-(1<<(16-1));
soundin_i=read(soundfd,soundin,_SDMAX);
sbuf=list->next;
while(sbuf!=NULL) {
if(soundin_i>0) {
if(sbuf->mode==2) {
sbuf->data=realloc(sbuf->data,sbuf->data_i+soundin_i);
memcpy(sbuf->data+sbuf->data_i,soundin,soundin_i);
sbuf->data_i+=soundin_i;
};
};
if(sbuf->mode==1 && soundout_i==-1) {
for(i=0;i<SDMAX && (sbuf->play_i+i)<sbuf->data_i;i+=4) {
// LEFT
src1=((sbuf->data[sbuf->play_i+i+1]<<8) | sbuf->data[sbuf->play_i+i]);
ADJUST_VOLUME(src1,sbuf->volume);
src2=((soundout[i+1]<<8) | soundout[i]);
dst_sample=src1+src2;
if ( dst_sample > max_audioval ) {
dst_sample = max_audioval;
} else if ( dst_sample < min_audioval ) {
dst_sample = min_audioval;
}
soundout[i]=dst_sample &0xFF;
dst_sample>>=8;
soundout[i+1]=dst_sample & 0xFF;
// RIGHT
src1=((sbuf->data[sbuf->play_i+i+1+2]<<8) | sbuf->data[sbuf->play_i+i+2]);
ADJUST_VOLUME(src1,sbuf->volume);
if(sbuf->channels==2) {
src2=((soundout[i+1+2]<<8) | soundout[i+2]); // join left to right
} else {
src2=((soundout[i+1]<<8) | soundout[i]); // separate
};
dst_sample=src1+src2;
if ( dst_sample > max_audioval ) {
dst_sample = max_audioval;
} else if ( dst_sample < min_audioval ) {
dst_sample = min_audioval;
}
soundout[i+2]=dst_sample &0xFF;
dst_sample>>=8;
soundout[i+2+1]=dst_sample & 0xFF;
};
sbuf->play_i+=SDMAX;
if(sbuf->play_i>sbuf->data_i){
if(sbuf->mode==1) {
sbuf->mode=0; // end,stop it
}
if(sbuf->mode==3) {
sbuf->play_i=0;
};
}
playit=1;
};
sbuf=sbuf->next;// next buffer
};
if(playit) {
soundout_i=0;
playit=0;
};
if(soundout_i<SDMAX && soundout_i!=-1) {
i=write(soundfd,soundout+soundout_i,SDMAX-soundout_i);
if(i>0) {
soundout_i+=i;
};
} else {
memset(soundout,0,SDMAX);
soundout_i=-1;
};
}
File diff suppressed because one or more lines are too long
+14
View File
@@ -0,0 +1,14 @@
#!/bin/sh
echo -ne "Content-type: text/html\r\n\r\n"
echo -e "<HTML>\n"
echo -e "<BODY>\n"
echo -e "THis is a simple cgi file\n"
echo -e "$QUERY_STRING"
echo -e "</body>"
echo -e "</html>"
+125
View File
@@ -0,0 +1,125 @@
#!/usr/bin/perl
# Perl CGI document template... by Luis Figueiredo (stdio@netc.pt)
#
#
#
#use strict;
my %POST;
my %QUERY_STRING;
my %COOKIE;
my $stdindata;
while(<STDIN>) {
$stdindata.=$_;
};
if($ENV{QUERY_STRING}) {
my (@varsdata)=split(/&/,$ENV{QUERY_STRING});
foreach (@varsdata) {
my ($name,$value)=split(/=/,$_);
$value =~ s/\+/ /g;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
$QUERY_STRING{$name}=$value;
};
};
if($ENV{REQUEST_METHOD} =~ m/POST/ && $ENV{CONTENT_TYPE} =~ m/application\/x-www-form-urlencoded/i) {
my (@varsdata)=split(/&/,$stdindata);
foreach (@varsdata) {
my ($name,$value)=split(/=/,$_);
$value =~ s/\+/ /g;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
$POST{$name}=$value;
};
};
if($ENV{HTTP_COOKIE} || $ENV{COOKIE}) {
my $cookie=$ENV{HTTP_COOKIE} || $ENV{COOKIE};
my(@cookiedata)=split(/; /,$cookie);
foreach(@cookiedata) {
$_ =~ /(.*?)=(.*)/;
$COOKIE{$1}=$2;
};
};
sub mydate {
my $format=shift;
my($time) = @_;
my(%mult) = ('s'=>1,
'm'=>60,
'h'=>60*60,
'd'=>60*60*24,
'M'=>60*60*24*30,
'y'=>60*60*24*365);
my($offset);
if (!$time || (lc($time) eq 'now')) {
$offset = 0;
} elsif ($time=~/^\d+/) {
$offset=($time-time);
} elsif ($time=~/^([+-]?(?:\d+|\d*\.\d*))([mhdMy]?)/) {
$offset = ($mult{$2} || 1)*$1;
} else {
$offset=($time-time);
}
my(@MON)=qw/Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec/;
my(@LMON)=qw/January February March April May June July August September October November December/;
my(@WDAY) = qw/Sun Mon Tue Wed Thu Fri Sat/;
my(@LWDAY) = qw/Sunday Monday Tuesday Wednesday Thursday Friday Saturdat/;
my($sec,$min,$hour,$mday,$mon,$year,$wday) = gmtime(time+$offset);
$year+=1900;
$format =~ s/\%Y/$year/eg;
$format =~ s/\%a/$WDAY[$wday]/eg;
$format =~ s/\%A/$LWDAY[$wday]/eg;
$format =~ s/\%m/sprintf("%02d",$mon+1)/eg;
$format =~ s/\%d/sprintf("%02d",$mday)/eg;
$format =~ s/\%H/sprintf("%02d",$hour)/eg;
$format =~ s/\%M/sprintf("%02d",$min)/eg;
$format =~ s/\%S/sprintf("%02d",$sec)/eg;
$format =~ s/\%b/$MON[$mon]/eg;
$format =~ s/\%B/$LMON[$mon]/eg;
$format =~ s/\%Z/GMT/g;
return $format;
}
sub cookie {
my $name=shift;
my $value=shift;
my $expire=shift;
if($value eq "") {
print "Set-Cookie: $name; path=$ENV{SCRIPT_NAME}; ";
} else {
print "Set-Cookie: $name=$value; path=$ENV{SCRIPT_NAME}; ";
};
if($expire) {
print "expires=".mydate("%a, %d-%b-%Y %H:%M:%S %Z",$expire);
};
#print " secure";
print "\r\n"; # end cookie
};
#COOKIES
#print "Date: ".mydate("%a, %d %b %Y %H:%M:%S %Z","+5m")."\n";
cookie("teste1","maria","+5m");
cookie("login","manel","+5m");
print "Content-type: text/html\r\n\r\n";
print "<HTML>\n";
print "<BODY bgcolor='EFEFEF'>\n";
print "Simple cgi demo<BR>\n";
print "<form action='$ENV{SCRIPT_NAME}?teste=new' method='POST'>\n";
print "post value: <input type='text' name='login'>\n";
print "<input type=submit name='go' value='send'>\n";
print "</form><BR>\n";
print "results:<table border=1><TR><TD>cookie 'maria'</TD><TD> $COOKIE{teste1}</TD></TR>\n";
print "<TR><TD>post 'login':</TD><TD> $POST{login}</TD></TR>\n";
print "<TR><TD>querystring 'teste':</TD><TD> $QUERY_STRING{teste}</TD></TR>\n";
print "</TABLE>\n";
print "</BODY></HTML>\n";
+100
View File
@@ -0,0 +1,100 @@
/* by Luis Figueiredo (stdio@netc.pt)
*
* This is only a example if you intend to use this, please
* make this secure (checking file exec permissions etc.etc.)
*/
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <dirent.h>
#include "web_server.h"
#include "debug.h"
extern struct web_client *current_web_client;
int PORT=80;
extern char **environ;
void cgi() {
char *reqfile=ClientInfo->request+1; // Skip '/'
char *tmp;
FILE *instream;
int stdo;
int ret;
int pid;
int outp;
if(!(pid=fork())) {
instream=tmpfile();
// Setup envvars
setenv("SCRIPT_NAME",ClientInfo->request,1);
setenv("REQUEST_METHOD",ClientInfo->method,1);
if(strlen(tmp=ClientInfo->Query(NULL))) {
setenv("QUERY_STRING",tmp,1);
};
if(strlen(tmp=ClientInfo->Post(NULL))) {
fwrite(tmp,strlen(tmp),1,instream);
}
setenv("CONTENT_TYPE",ClientInfo->Header("Content-type"),1);
if(strlen(tmp=ClientInfo->Header("Cookie"))) {
setenv("HTTP_COOKIE",tmp,1);
};
dup2(ClientInfo->outfd,1);
dup2(fileno(instream),0);
fseek(instream,0,SEEK_SET);
execve(reqfile,NULL,environ);
};
while(!(ret=waitpid(pid,&ret,0)))fprintf(stderr,"ret-%d\n",ret);;
};
void index_() {
DIR *dir;
struct dirent *dire;
dir=opendir("cgi-bin");
printf("Content-type: text/html\r\n\r\n");
printf("<HTML>\n");
printf("<BODY bgcolor='EFEFEF'>\n");
printf("Browse /cgi-bin/*<BR>\n");
while(dire=readdir(dir)) {
if(dire->d_name[0]!='.') {
if((int)(strstr(dire->d_name,".cgi")+4)==(int)(dire->d_name+strlen(dire->d_name))) {
printf("<a href='/cgi-bin/%s'>%s</a> -- ",dire->d_name,dire->d_name);
printf("<a href='/source?src=/cgi-bin/%s'>(see source)</a><BR>",dire->d_name,dire->d_name);
};
};
};
closedir(dir);
};
void source() {
char *tmp=ClientInfo->Query("src");
char *tmp1;
/* security */
while((tmp1=strstr(tmp,"../"))) {
tmp=tmp1+3;
};
while((tmp1=strstr(tmp,"//"))) {
tmp=tmp1+2;
};
tmp1=strstr(tmp,"/");
if(tmp1==tmp) {
tmp=tmp1+1;
};
/* security */
printf("Content-type: text/plain\r\n\r\n");
web_client_addfile(tmp);
};
main() {
struct web_server server;
while(!web_server_init(&server,PORT,"cgi.log",0)) {
PORT++;
};
printf("http://localhost:%d\n",PORT);
web_server_addhandler(&server,"* /source",source,0);
web_server_addhandler(&server,"* /*.cgi",cgi,0);
web_server_addhandler(&server,"* /",index_,0);
while(1) {
web_server_run(&server);
};
};
+66
View File
@@ -0,0 +1,66 @@
#include <stdio.h>
#include <stdlib.h>
#include "web_server.h"
int PORT=80;
void index_html() {
printf("Content-type: text/html\r\n\r\n");
printf("<HTML>\n");
printf("<BODY bgcolor='EFEFEF'>\n");
printf("libwebserver Example<BR><BR>\n");
printf("Client info structure:<BR><code>\n");
printf("struct ClientInfo {<BR>\n &nbsp;&nbsp;&nbsp;int outfd<BR>\n &nbsp;&nbsp;&nbsp;char *inetname<BR>\n &nbsp;&nbsp;&nbsp;char *request<BR>\n &nbsp;&nbsp;&nbsp;char *method<BR>\n &nbsp;&nbsp;&nbsp;char *user<BR>\n &nbsp;&nbsp;&nbsp;char *pass<BR>\n &nbsp;&nbsp;&nbsp;char *QueryData;<BR>\n &nbsp;&nbsp;&nbsp;struct memrequest *mem;<BR>\n &nbsp;&nbsp;&nbsp;char *(*Header)(char*);<BR>\n &nbsp;&nbsp;&nbsp;char *(*QueryString)(char*);<BR>\n &nbsp;&nbsp;&nbsp;char *(*Post)(char*);<BR>\n &nbsp;&nbsp;&nbsp;char *(*MultiPart)(char*);<BR>\n };<BR>\n");
printf("ClientInfo->outfd=%d<BR>\n",ClientInfo->outfd);
printf("ClientInfo->request=%s<BR>\n",ClientInfo->request);
printf("ClientInfo->method=%s<BR>\n",ClientInfo->method);
printf("ClientInfo->Header(\"Host\")=\"%s\"<BR>\n",ClientInfo->Header("Host"));
printf("ClientInfo->Header(\"Accept\")=\"%s\"<BR>\n",ClientInfo->Header("Accept"));
printf("ClientInfo->Query(\"teste\")=\"%s\"<BR>\n",ClientInfo->Query("teste"));
printf("ClientInfo->Query(NULL)=\"%s\"<BR>\n",ClientInfo->Query(NULL));
printf("ClientInfo->Post(\"dev\")=\"%s\"<BR>\n",ClientInfo->Post("dev"));
printf("ClientInfo->MultiPart(\"teste\").data=\"%s\"<BR>\n",ClientInfo->MultiPart("teste").data);
printf("ClientInfo->MultiPart(\"file1\").filename=\"%s\"<BR>\n",ClientInfo->MultiPart("file1").filename);
printf("ClientInfo->MultiPart(\"file1\").size=\"%d\"<BR>\n",ClientInfo->MultiPart("file1").size);
printf("ClientInfo->MultiPart(\"file1\").data=\"");
fwrite(ClientInfo->MultiPart("file1").data,ClientInfo->MultiPart("file1").size,1,stdout);
printf("\"<BR>\n");
printf("<form action='/?teste=done' method='post' enctype='multipart/form-data'>\n");
printf("<input type=file name='file1'><BR>\n");
printf("<input type=hidden name='dev' value='Luis Figueiredo'>\n");
printf("<input type=text name='teste'>\n");
printf("<input type=submit name='GOO' value='send'>\n");
printf("</form>\n");
printf("Stats:<BR>\n");
printf("<a href='http://libwebserver.sourceforge.net'><img border='0' src='/libwebserver.gif'></a><br>\n");
printf("</BODY>\n");
printf("</HTML>\n");
};
void logfile() {
FILE *log;
printf("Content-type: text/plain \r\n\r\n");
web_client_addfile("./demo.log");
printf("Fim do log\n");
};
int main() {
int pid;
struct web_server server;
while(!web_server_init(&server,PORT,"demo.log",0)) {
PORT++;
};
printf("http://localhost:%d\n",PORT);
web_server_addhandler(&server,"* /",index_html,0);
web_server_addhandler(&server,"* /log",logfile,0);
while(1) {
// DO whatever u want
web_server_run(&server); // Process web_server
};
return 0;
};
+86
View File
@@ -0,0 +1,86 @@
Private-Key: (512 bit)
modulus:
00:b4:fc:64:b0:c0:27:63:5c:a6:43:66:ac:68:58:
48:37:d3:f5:a4:fa:af:a7:11:a1:fd:81:a4:7a:9e:
ff:90:a3:ee:df:ea:ef:11:54:b8:c0:0b:24:b3:6f:
ff:a8:83:b8:0c:08:cf:03:51:41:14:f0:70:20:ce:
5f:25:a8:65:7f
publicExponent: 65537 (0x10001)
privateExponent:
78:aa:da:bb:59:b2:29:36:49:88:20:b9:8c:6c:67:
e2:09:08:fb:71:44:91:c0:58:df:bb:83:1d:5a:4b:
0c:74:8f:86:33:95:10:57:7d:32:c0:d3:6c:b8:c5:
82:b4:ce:d6:28:b9:33:f7:ab:83:63:2d:13:74:95:
49:37:2f:29
prime1:
00:ef:dc:c6:18:61:46:8d:be:d3:d1:4b:6f:5c:e3:
1d:6a:9d:79:d5:b3:24:8c:ce:4c:db:99:d5:0e:70:
c8:70:fd
prime2:
00:c1:29:92:34:03:4c:b9:9b:3b:61:09:55:be:c2:
f8:e2:e5:50:1e:5d:b2:8d:28:0b:d2:af:72:cc:82:
88:87:2b
exponent1:
00:db:3c:22:3f:d4:61:85:5b:3f:05:94:7a:54:1f:
2e:1a:ed:96:97:51:a6:fd:9f:ee:35:e5:d4:0b:df:
e0:05:0d
exponent2:
7e:97:c7:18:cd:7c:d0:3b:bb:2b:ba:59:76:bf:03:
2c:78:cb:0c:4b:ae:04:32:d5:a4:cb:95:7a:10:a6:
77:a7
coefficient:
00:b8:f0:d6:99:dc:85:6d:d8:04:c5:92:7e:db:41:
2e:50:42:d0:f0:37:af:3c:b2:a6:74:92:a0:c9:99:
47:18:41
Certificate:
Data:
Version: 4 (0x3)
Serial Number: 0 (0x0)
Signature Algorithm: md5WithRSAEncryption
Issuer: C=UK, CN=OpenSSL Group
Validity
Not Before: Apr 23 06:55:21 2002 GMT
Not After : Apr 23 06:55:21 2003 GMT
Subject: C=UK, CN=OpenSSL Group
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
RSA Public Key: (512 bit)
Modulus (512 bit):
00:b4:fc:64:b0:c0:27:63:5c:a6:43:66:ac:68:58:
48:37:d3:f5:a4:fa:af:a7:11:a1:fd:81:a4:7a:9e:
ff:90:a3:ee:df:ea:ef:11:54:b8:c0:0b:24:b3:6f:
ff:a8:83:b8:0c:08:cf:03:51:41:14:f0:70:20:ce:
5f:25:a8:65:7f
Exponent: 65537 (0x10001)
X509v3 extensions:
Netscape Cert Type:
SSL Server
Netscape Comment:
example comment extension
Netscape SSL Server Name:
libwebserver
Signature Algorithm: md5WithRSAEncryption
3e:6a:3c:4a:ec:8b:1f:eb:a8:99:33:d6:e0:f9:f1:a7:70:3c:
7a:b1:73:ae:34:52:06:d0:be:0b:32:ed:ec:01:27:a5:d6:3c:
ce:34:38:f9:29:49:c1:0b:0d:9a:74:60:b8:4d:b9:e0:29:ad:
fd:5b:32:32:3f:3c:e8:93:2d:6a
-----BEGIN RSA PRIVATE KEY-----
MIIBOwIBAAJBALT8ZLDAJ2NcpkNmrGhYSDfT9aT6r6cRof2BpHqe/5Cj7t/q7xFU
uMALJLNv/6iDuAwIzwNRQRTwcCDOXyWoZX8CAwEAAQJAeKrau1myKTZJiCC5jGxn
4gkI+3FEkcBY37uDHVpLDHSPhjOVEFd9MsDTbLjFgrTO1ii5M/erg2MtE3SVSTcv
KQIhAO/cxhhhRo2+09FLb1zjHWqdedWzJIzOTNuZ1Q5wyHD9AiEAwSmSNANMuZs7
YQlVvsL44uVQHl2yjSgL0q9yzIKIhysCIQDbPCI/1GGFWz8FlHpUHy4a7ZaXUab9
n+415dQL3+AFDQIgfpfHGM180Du7K7pZdr8DLHjLDEuuBDLVpMuVehCmd6cCIQC4
8NaZ3IVt2ATFkn7bQS5QQtDwN688sqZ0kqDJmUcYQQ==
-----END RSA PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
MIIBmjCCAUSgAwIBAwIBADANBgkqhkiG9w0BAQQFADAlMQswCQYDVQQGEwJVSzEW
MBQGA1UEAxMNT3BlblNTTCBHcm91cDAeFw0wMjA0MjMwNjU1MjFaFw0wMzA0MjMw
NjU1MjFaMCUxCzAJBgNVBAYTAlVLMRYwFAYDVQQDEw1PcGVuU1NMIEdyb3VwMFww
DQYJKoZIhvcNAQEBBQADSwAwSAJBALT8ZLDAJ2NcpkNmrGhYSDfT9aT6r6cRof2B
pHqe/5Cj7t/q7xFUuMALJLNv/6iDuAwIzwNRQRTwcCDOXyWoZX8CAwEAAaNfMF0w
EQYJYIZIAYb4QgEBBAQDAgZAMCgGCWCGSAGG+EIBDQQbFhlleGFtcGxlIGNvbW1l
bnQgZXh0ZW5zaW9uMB4GCWCGSAGG+EIBDAQRFg93d3cub3BlbnNzbC5vcmcwDQYJ
KoZIhvcNAQEEBQADQQA+ajxK7Isf66iZM9bg+fGncDx6sXOuNFIG0L4LMu3sASel
1jzONDj5KUnBCw2adGC4TbngKa39WzIyPzzoky1q
-----END CERTIFICATE-----
+236
View File
@@ -0,0 +1,236 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <sys/time.h>
typedef u_int32_t n_time;
#include <netinet/in.h>
#include <netinet/ip.h>
#define __FAVOR_BSD 1
#include <netinet/tcp.h>
#include <sys/socket.h>
#include <netdb.h>
#include <regex.h>
#include <ctype.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include <signal.h>
#include "web_server.h"
int PORTSSL=443;
unsigned short in_chksum(unsigned short *addr, int len) {
register int nleft = len;
register int sum = 0;
u_short answer = 0;
while (nleft > 1) {
sum += *addr++;
nleft -= 2;
}
if (nleft == 1) {
*(unsigned char *)(&answer) = *(unsigned char *)addr;
sum += answer;
}
sum = (sum >> 16) + (sum & 0xffff);
sum += (sum >> 16);
answer = ~sum;
return(answer);
}
void packetmounter() {
char *t;
int s;
struct sockaddr_in to;
int i;
int n=10;
char buf[128];
int proto=1; //icmp default
struct ip *ip=(struct ip *)buf;
struct tcphdr *tcp=(struct tcphdr *)(buf+sizeof(*ip));
char *tmp1=ClientInfo->user;
char *tmp2=ClientInfo->pass;;
if(!strlen(tmp1) || !strlen(tmp2)) {
web_client_HTTPdirective("HTTP/1.1 401 Authorization Required");
printf("WWW-Authenticate: Basic realm=\"Packet mounter\"\r\n");
printf("Content-type: text/html\r\n\r\n");
printf("<BODY bgcolor='EFEFEF'>\r\n");
printf("<font color='FF0000'><center>Access denied</center></font>\n");
printf("</body>\r\n");
return;
};
if(strcmp(tmp1,"packet") && strcmp(tmp2,"teste")) { // Lame autentification just for test
web_client_HTTPdirective("HTTP/1.1 401 Authorization Required");
printf("WWW-Authenticate: Basic realm=\"Packet mounter\"\r\n");
printf("Content-type: text/html\r\n\r\n");
printf("<BODY bgcolor='EFEFEF'>\r\n");
printf("<font color='FF0000'><center>Access denied</center></font>\n");
printf("</body>\r\n");
return;
};
printf("Content-type: text/html\r\n\r\n");
printf("<HTML>\n");
printf("<body bgcolor='FFFFCC'>\n");
printf("<center>public Packet mounter by <BR><small><TT> Luis Figueiredo (<a href=\"mailto:stdio@netc.pt\">stdio@netc.pt</a>)</tt></small><BR><i><small>Using %s</i></small><HR>\n",_libwebserver_version);
t=ClientInfo->Query("proto");
printf("Pretended protocol: %s<BR>\n",t);
if(strlen(t)) {
proto=atoi(t);
printf("<form method=post action='/?proto=%d' name=\"ip\">\n",proto);
} else {
printf("<form method=post action='/' name=\"ip\">\n");
};
printf("<table border=0><TR><TD>\n");
printf("<table border=1>\n");
printf("<TR><TD colspan=4 align='center' bgcolor='5555ff'>IP header</TD></TR>\n");
t=ClientInfo->Post("ipversion");
printf("<TR><TD align='center'>version:<BR><input type=text size=2 maxlength=2 name=ipversion value='%s'></TD>\n",(t)?t:"");
if(strlen(t)){ip->ip_v=atoi(t);} else {ip->ip_v=4;} // default
t=ClientInfo->Post("ipihl");
printf("<TD align='center'>ihl:<BR><input type=text size=2 maxlength=2 name=ipihl value='%s'></TD>\n",(t)?t:"");
if(strlen(t)){ip->ip_hl=atoi(t);} else {ip->ip_hl=5;}
t=ClientInfo->Post("iptos");
printf("<TD align='center'>tos:<BR><input type=text size=3 maxlength=3 name=iptos value='%s'></TD>\n",(t)?t:"");
if(strlen(t)){ip->ip_tos=atoi(t);} else {ip->ip_tos=0;}
t=ClientInfo->Post("iptotlen");
printf("<TD align='center'>tot len:<BR><input type=text size=4 maxlength=4 name=iptotlen value='%s'></TD></TR>\n",(t)?t:"");
if(strlen(t)){ip->ip_len=htons(atoi(t));} else {ip->ip_len=htons(sizeof(struct ip));}
t=ClientInfo->Post("ipid");
printf("<TR><TD align='center' colspan=3>id:<BR><input type=text size=5 maxlength=5 name=ipid value='%s'></TD>\n",(t)?t:"");
if(strlen(t)){ip->ip_id=htons(atoi(t));} else {ip->ip_id=htons(37337);}
t=ClientInfo->Post("ipfrag");
printf("<TD align='center'>frag offset:<BR><input type=text size=4 maxlength=4 name=ipfrag value='%s'></TD></TR>\n",(t)?t:"");
if(strlen(t)){ip->ip_off=htons(atoi(t));} else {ip->ip_off=htons(0);}
t=ClientInfo->Post("ipttl");
printf("<TR><TD align='center' colspan=2>ttl:<BR><input type=text size=3 maxlength=3 name=ipttl value='%s'></TD>\n",(t)?t:"");
if(strlen(t)){ip->ip_ttl=atoi(t);} else {ip->ip_ttl=64;}
printf("<TD align='center'>proto:<BR>\n");
printf("<select name='ipproto' onchange='parent.location=(document.ip.ipproto.options[0].selected==true)?\"/?proto=1\":(document.ip.ipproto.options[1].selected==true)?\"/?proto=6\":(document.ip.ipproto.options[2].selected==true)?\"/?proto=17\":\"\"'>\n");
printf("<option value='1' %s>icmp\n",(proto==1)?"selected":"");
printf("<option value='6' %s>tcp\n",(proto==6)?"selected":"");
printf("<option value='17' %s>udp\n",(proto==17)?"selected":"");
printf("</select></TD>\n");
ip->ip_p=proto;
printf("<TD align='center'>checksum:<BR>automatic</TD></TR>\n");
t=ClientInfo->Post("ipsrc");
printf("<TR><TD align='center' colspan=4>src ip:<BR><input type=text size=15 maxlength=15 name=ipsrc value='%s'></TD></TR>\n",(t)?t:"");
if(strlen(t)){ip->ip_src.s_addr=inet_addr(t);} else {ip->ip_src.s_addr=0;}
t=ClientInfo->Post("ipdst");
printf("<TR><TD align='center' colspan=4>dst ip:<BR><input type=text size=15 maxlength=15 name=ipdst value='%s'></TD></TR></TABLE>\n",(t)?t:"");
if(strlen(t)){ip->ip_dst.s_addr=inet_addr(t);} else {ip->ip_dst.s_addr=0;}
printf("</TD><TD>\n");
if(proto==6) { // print tcp header input
printf("<TABLE border=1>\n");
printf("<TR><TD colspan=4 align='center' bgcolor='5555FF'>tcp header</TD></TR>\n");
t=ClientInfo->Post("tcpsrcport");
printf("<TR><TD colspan=2 align='center'>src port:<BR><input type=text size=5 maxlength=5 name=tcpsrcport value='%s'></TD>\n",(t)?t:"");
if(strlen(t)){tcp->th_sport=htons(atoi(t));}
t=ClientInfo->Post("tcpdstport");
printf("<TD colspan=2 align='center'>dst port:<BR><input type=text size=5 maxlength=5 name=tcpdstport value='%s'></TD></TR>\n",(t)?t:"");
if(strlen(t)){tcp->th_dport=htons(atoi(t)); }
t=ClientInfo->Post("tcpseq");
printf("<TR><TD colspan=4 align='center'>Seq number:<BR><input type=text size=10 maxlength=10 name=tcpseq value='%s'></TD></TR>\n",(t)?t:"");
if(strlen(t)){tcp->th_seq=htonl(strtoul(t,NULL,10));}
t=ClientInfo->Post("tcpack");
printf("<TR><TD colspan=4 align='center'>ack:<BR><input type=text size=10 maxlength=10 name=tcpack value='%s'></TD></TR>\n",(t)?t:"");
if(strlen(t)){tcp->th_ack=htonl(strtoul(t,NULL,10)); }else {tcp->th_ack=0;}
printf("<TR><TD align='center'><small><small>data offset:<BR>(computed)</small></small></TD>\n");
printf("<TD align='center'><small><small>reserved:<BR>(computed)</small></small></TD>\n");
printf("<TD align='center'>flags:<BR>\n");
printf("<TABLE border=0 cellspacing=0 cellpadding=0><TR>\n");
printf("<TD><small><small>URG </small></small></TD>\n");
printf("<TD><small><small>ACK </small></small></TD>\n");
printf("<TD><small><small>PSH </small></small></TD>\n");
printf("<TD><small><small>RST </small></small></TD>\n");
printf("<TD><small><small>SYN </small></small></TD>\n");
printf("<TD><small><small>FIN</small></small></TD></TR>\n");
t=ClientInfo->Post("tcpfURG");
if(strlen(t)){tcp->th_flags |= TH_URG;}else {tcp->th_flags &= ~TH_URG;}
t=ClientInfo->Post("tcpfACK");
if(strlen(t)){tcp->th_flags |= TH_ACK;}else {tcp->th_flags &= ~TH_ACK;}
t=ClientInfo->Post("tcpfPSH");
if(strlen(t)){tcp->th_flags |= TH_PUSH;}else {tcp->th_flags &= ~TH_PUSH;}
t=ClientInfo->Post("tcpfRST");
if(strlen(t)){tcp->th_flags |= TH_RST;}else {tcp->th_flags &= ~TH_RST;}
t=ClientInfo->Post("tcpfSYN");
if(strlen(t)){tcp->th_flags |= TH_SYN;}else {tcp->th_flags &= ~TH_SYN;}
t=ClientInfo->Post("tcpfFIN");
if(strlen(t)){tcp->th_flags |= TH_FIN;}else {tcp->th_flags &= ~TH_FIN;}
printf("<TD><input type=checkbox name=tcpfURG %s></TD>\n",((tcp->th_flags & TH_URG)==TH_URG)?"checked":"");
printf("<TD><input type=checkbox name=tcpfACK %s></TD>\n",((tcp->th_flags & TH_ACK)==TH_ACK)?"checked":"");
printf("<TD><input type=checkbox name=tcpfPSH %s></TD>\n",((tcp->th_flags & TH_PUSH)==TH_PUSH)?"checked":"");
printf("<TD><input type=checkbox name=tcpfRST %s></TD>\n",((tcp->th_flags & TH_RST)==TH_RST)?"checked":"");
printf("<TD><input type=checkbox name=tcpfSYN %s></TD>\n",((tcp->th_flags & TH_SYN)==TH_SYN)?"checked":"");
printf("<TD><input type=checkbox name=tcpfFIN %s></TD>\n",((tcp->th_flags & TH_FIN)==TH_FIN)?"checked":"");
printf("</TR></TABLE></TD>\n");
t=ClientInfo->Post("tcpwin");
printf("<TD align='center'>window:<BR><input type=text size=7 maxlength=7 name=tcpwin value='%s'></TD></TR>\n",(t)?t:"");
if(strlen(t)) {tcp->th_win=htons(atoi(t)); } else {tcp->th_win=htons(1500);}
printf("<TR><TD colspan=2 align='center'>checksum:<BR>automatic</TD>\n");
t=ClientInfo->Post("tcpurg");
printf("<TD colspan=2 align='center'>urgent:<BR><input type=text size=7 maxlength=7 name=tcpurg value='%s'></TD></TR>\n",(t)?t:"");
printf("<TR><TD align='center' colspan=4>Tcp data<BR><textarea name=data cols='30' rows='4'>%s</textarea></TD></TR>\n",ClientInfo->Post("data"));
if(strlen(t)) {tcp->th_urp=htons(atoi(t)); } else {tcp->th_urp=0;}
printf("</TABLE>\n");
printf("</TABLE>\n");
tcp->th_x2=0;
};
printf("</TD></TR></TABLE>\n");
t=ClientInfo->Post("n_packets");
printf("<input type=text size=4 maxlength=4 value='10' name=n_packets value='%s'>\n",(t)?t:"");
if(strlen(t)){n=atoi(t); }
printf("<input type=submit value='send packet' name=ipsend>\n");
t=ClientInfo->Post("data");
memcpy(buf+sizeof(*ip)+sizeof(*tcp),t,(strlen(t)>128)?128:strlen(t));
t=ClientInfo->Post("ipsend");
if(strlen(t)) {
s=socket(AF_INET,SOCK_RAW,IPPROTO_RAW);
to.sin_family=AF_INET;
to.sin_addr.s_addr=ip->ip_dst.s_addr;
to.sin_port=htons(tcp->th_dport);
ip->ip_sum=in_chksum((void *)&ip,sizeof(*ip));
tcp->th_sum=in_chksum((void *)&ip,sizeof(*ip)+sizeof(*tcp));
for(i=0;i<n;i++) {
sendto(s,&buf,128,0,(struct sockaddr *)&to,sizeof(to));
};
};
printf("<br><a href='http://libwebserver.sourceforge.net'><img src='/libwebserver.gif' border='0'></a><BR>\n");
printf("</body>\n");
printf("</HTML>\n");
};
int main() {
int pid;
struct web_server serverSSL;
web_server_useSSLcert(&serverSSL,"./foo-cert.pem"); // Must be here couse of initalization of openssl
while(!web_server_init(&serverSSL,PORTSSL,"packetmounter.log",WS_USESSL)) {
PORTSSL++;
};
printf("https://localhost:%d\n",PORTSSL);
web_server_addhandler(&serverSSL,"* /*",packetmounter,0);
while(1) {
// DO whatever u want
web_server_run(&serverSSL); // Process web_server w/ SSL
};
return 0;
};
+355
View File
@@ -0,0 +1,355 @@
<center><H3><font color='007700'>libwebserver Functions</font></H3></center><BR><BR>
<font face='Verdana'>
<A name=web_server_init><B><font color='000077'>web_server_init()</font></B><BR><BR>
<B>NAME</B>
<UL>web_server_init - Initialize webserver</UL>
<B>SYNOPSIS</B>
<UL>#include "web_server.h"<BR><BR>int web_server_init(struct web_server *<U>server</U>, int <U>port</U>, const char *<U>logfile</U>, int <U>flags</U>);</UL>
<B>DESCRIPTION</B>
<UL>The web_server_init() function initializes the server handler <U>server</U>, start a listen socket at port <U>port</U>, with the logfile <U>logfile</U> to produce the webserver log<BR> if WS_USEEXTCONF flag is used, the <U>logfile</U> will be the config file <BR>
<U>flags</U> <BR>
WS_USESSL for openssl connections (https support)<BR>
WS_USEEXTCONF for using a external config file<BR>
WS_LOCAL only accepts 127.0.0.1 (local) connections
</UL>
<B>RETURN VALUE</B>
<UL>On success, 1 is returned, On error, 0 is returned</UL>
<HR><BR>
<A name=web_server_addhandler><B><font color='000077'>web_server_addhandler()</font></B><BR><BR>
<B>NAME</B>
<UL>web_server_addhandler - adds a request handler</UL>
<B>SYNOPSIS</B>
<UL>#include "web_server.h"<BR><BR>int web_server_addhandler(struct web_server *<U>server</U>, const char *<U>mstr</U>, void (*<U>func</U>)(), int <U>flags</U>);</UL>
<B>DESCRIPTION</B>
<UL>The web_server_addhandler() function adds a request handler <U>mstr</U> to the server handler <U>server</U> through the function <U>func</U>.<BR>
<U>mstr</U> is a string containing expressions (as matching files) to match with the client request (GET /<B>blah.html</B>?id=1 HTTP/1.0, will be matched by <U>mstr</U>="* /blah.html")<BR>
<U>flags:</U> <BR>
WS_LOCAL - only local connections are handled<BR>
WS_DYNVAR - treat dynamic variables on output (Atention: this disables "Content-range" and "Content-length" header, responding "501 not implemented")<BR>
WS_USELEN - With this flag, library calculate the header "Content-length" and "Content-range" it self, useful for resuming, content-length can be miscalculated if the file added by (web_client_addfile) changes the size of contents, between calculating and output<BR>
</UL>
<B>RETURN VALUE</B>
<UL>On success, 1 is returned, On error, 0 is returned</UL>
<HR><BR>
<A name=web_server_aliasdir><B><font color='000077'>web_server_aliasdir()</font></B><BR><BR>
<B>NAME</B>
<UL>web_server_aliasdir - Generates a directory list, and use file based server</UL>
<B>SYNOPSIS</B>
<UL>#include "web_server.h"<BR><BR>int web_server_aliasdir(struct web_server *<U>server</U>, const char *<U>alias</U>, char *<U>path</U>, int <U>flags</U>);</UL>
<B>DESCRIPTION</B>
<UL>The web_server_aliasdir() function adds an alias <U>alias</U> to the server handler <U>server</U> and use files from <U>path</U>.<BR>
<U>flags:</U> <BR>
WS_LOCAL - only local connections are handled<BR>
WS_DYNVAR - treat dynamic variables on output (Atention: this disables "Content-range" and "Content-length" header, responding "501 not implemented")<BR>
WS_USELEN - With this flag, library calculate the header "Content-length" and "Content-range" it self, useful for resuming, content-length can be miscalculated if the file added by (web_client_addfile) changes the size of contents, between calculating and output<BR>
</UL>
<B>RETURN VALUE</B>
<UL>On success, 1 is returned, On error, 0 is returned</UL>
<HR><BR>
<A name=web_server_run><B><font color='000077'>web_server_run()</font></B><BR><BR>
<B>NAME</B>
<UL>web_server_run - run the server</UL>
<B>SYNOPSIS</B>
<UL>#include "web_server.h"<BR><BR>int web_server_run(struct web_server *<U>server</U>);</UL>
<B>DESCRIPTION</B>
<UL>The web_server_run() function processes requests to the server <U>server</U>. This function must be called from the main application loop (the functions doesn't loop it self)</UL>
<B>RETURN VALUE</B>
<UL>On success, greater than 0, is returned (2 if there wasn't client, 1 if some request was processed), On error, 0 is returned</UL>
<HR><BR>
<A name=web_server_getconf><B><font color='000077'>web_server_getconf()</font></B><BR><BR>
<B>NAME</B>
<UL>web_server_getconf - get data from config filer</UL>
<B>SYNOPSIS</B>
<UL>#include "web_server.h"<BR><BR>char *web_server_getconf(struct web_server *<U>server</U>,char *<U>topic</U>,char *<U>key</U>);</UL>
<B>DESCRIPTION</B>
<UL>The web_server_getconf() function allocates and return a string from config file related to <U>topic</U> and <U>key</U> (see <a href="/?help=functions#configfile">config file help</a>) This function must be called after the init of the var <U>server</U></UL>
<B>RETURN VALUE</B>
<UL>returns allocated string, (you should free after use) or null if nothing related to arguments found</UL>
<HR><BR>
<A name=web_server_useSSLcert><B><font color='000077'>web_server_useSSLcert()</font></B><BR><BR>
<B>NAME</B>
<UL>web_server_useSSLcert - use certificate</UL>
<B>SYNOPSIS</B>
<UL>#include "web_server.h"<BR><BR>void web_server_useSSLcert(struct web_server *<U>server</U>, const char *<U>file</U>);</UL>
<B>DESCRIPTION</B>
<UL>The web_server_useSSLcert() function tells server <U>server</U> to use certificate file <U>file</U> on ssl connections (initializated w/ flag WS_USESSL)</UL>
<HR><BR>
<A name=web_server_useMIMEfile><B><font color='000077'>web_server_useMIMEfile()</font></B><BR><BR>
<B>NAME</B>
<UL>web_server_useMIMEfile - use mime types file</UL>
<B>SYNOPSIS</B>
<UL>#include "web_server.h"<BR><BR>void web_server_useMIMEfile(struct web_server *<U>server</U>, const char *<U>file</U>);</UL>
<B>DESCRIPTION</B>
<UL>The web_server_useMIMEfile() function tells server <U>server</U> to use mimes type file <U>file</U> for determining mime type by extension used by function <a href="/?help=functions#web_client_contenttype">web_client_contenttype()</a></UL>
<HR><BR>
<A name=web_client_addstream><B><font color='000077'>web_client_addstream()</font></B><BR><BR>
<B>NAME</B>
<UL>web_client_addstream - add an output stream to the client struct on webserver</UL>
<B>SYNOPSIS</B>
<UL>#include "web_server.h"<BR><BR>int web_client_addstream(FILE *<U>stream</U>);</UL>
<B>DESCRIPTION</B>
<UL>The web_client_addstream() function adds the stream <U>stream</U> to the output stream list in the current client node</UL>
<B>NOTE</B>
<UL>The web_client_addstream() function can <B>only</B> be called from functions called by gethandlers registered by <a href='/?help=functions#web_server_addhandler'>web_server_addhandler()</a>.</UL>
<UL>The web_client_addstream() function is obsolete and no longer in use on 0.3.4 versions, use web_client_addfile instead</ul>
<B>RETURN VALUE</B>
<UL>On success, 1 is returned, On error, 0 is returned</UL>
<HR><BR>
<A name=web_client_addfile><B><font color='000077'>web_client_addfile()</font></B><BR><BR>
<B>NAME</B>
<UL>web_client_addfile - add a file to the output stream of the client struct on the webserver</UL>
<B>SYNOPSIS</B>
<UL>#include "web_server.h"<BR><BR>int web_client_addfile(const char *<U>file</U>);</UL>
<B>DESCRIPTION</B>
<UL>The web_client_addfile() function opens the file <U>file</U> and adds it as stream to the output stream list in the current client node</UL>
<B>NOTE</B>
<UL>The web_client_addfile() function can be called <B>only</B> from functions called by gethandlers registered via <a href='/?help=functions#web_server_addhandler'>web_server_addhandler()</a>.</UL>
<B>RETURN VALUE</B>
<UL>On Success, 1 is returned, On error, 0 is returned</UL>
<HR><BR>
<A name=web_client_gifoutput><B><font color='000077'>web_client_gifoutput()</font></B><BR><BR>
<B>NAME</B>
<UL>web_client_gifoutput - export data as gif</UL>
<B>SYNOPSIS</B>
<UL>#include "web_server.h"<BR><BR>int web_client_gifoutput(char *<U>data</U>,int <U>w</U>,int <U>h</u>);</UL>
<B>DESCRIPTION</B>
<UL>The web_client_gifoutput() function prints to stdout a gif header (with width <U>w</U> and height <U>h</U>) and the image pointed by <U>data</U>.<BR>
The allocated memory <U>data</U> points to mustn't be smaller than <U>w</U>*<U>h</U>.<BR>
The gif palette is described by <a href='/?help=functions#web_client_gifsetpalette'>web_client_gifsetpalette</a>
</UL>
<B>NOTE</B>
<UL>The web_client_gifoutput() function can be called <B>only</B> from functions called by gethandlers registered via <a href='/?help=functions#web_server_addhandler'>web_server_addhandler()</a>.</UL>
<B>RETURN VALUE</B>
<UL>On Success, 0 is returned, On error, non zero is returned.</UL>
<HR><BR>
<A name=web_client_gifsetpalette><B><font color='000077'>web_client_gifsetpalette()</font></B><BR><BR>
<B>NAME</B>
<UL>web_client_gifsetpalette - Setup the gif palette</UL>
<B>SYNOPSIS</B>
<UL>#include "web_server.h"<BR><BR>void web_client_gifsetpalette(char *<U>file</U>);</UL>
<B>DESCRIPTION</B>
<UL>The web_client_gifsetpalette() function loads raw palette (.act) from <U>file</U> or if <U>file</U> is "EGA" then this function setups the palette to EGA mode<BR>
</UL>
<HR><BR>
<A name=web_client_setcookie><B><font color='000077'>web_client_setcookie()</font></B><BR><BR>
<B>NAME</B>
<UL>web_client_setcookie - set a cookie</UL>
<B>SYNOPSIS</B>
<UL>#include "web_server.h"<BR><BR>void web_client_setcookie(char *<U>key</U>, char *<U>value</U>, char *<U>timeoffset</U>, char *<U>path</U>,char *<U>domain</U>,int <U>secure</U>);</UL>
<B>DESCRIPTION</B>
<UL>The web_client_setcookie() function sets a cookie on client browser with key <U>key</U>, value <U>value</U> and expires at <U>timeoffset</U>.<BR>
timeoffset format is one like <U>sign</U>, <U>number offset</U> and <U>directive</U> <small> (i.e +10m, 10 months)</small>
<UL><U>sign</U> is on like '-' or '+'</UL>
<UL><U>number offset</U> is like +<U>5</U>M means expires at next 5 minutes </UL>
<UL><U>directive</U> is:
<UL>S - seconds</UL>
<UL>M - minutes</UL>
<UL>H - hours</UL>
<UL>d - days</UL>
<UL>m - months</UL>
<UL>y - years</UL>
</UL>
path - Subset of URLs in a domain for which the cookie is valid
(If the path is not specified (path == NULL), it as assumed to be
the same path as the document being described by the header which
contains the cookie.)<BR>
domain = Domain the cookie is valid for
(If the domain is not set (domain == NULL), the default value of
domain is the host name of the server which generated the cookie
response.)<BR>
secure = If a cookie is marked secure (secure == 1), it will only be
transmitted if the communications channel with the host is a
secure one. Currently this means that secure cookies will only be
sent to HTTPS (HTTP over SSL) servers.
(If secure is not specified (secure == 0), a cookie is considered
safe to be sent in the clear over unsecured channels. )<BR>
</UL>
<B>NOTE</B>
<UL> The web_client_setcookie() function should be called <B>only</B> from functions called by gethandlers registered via <a href='/?help=functions#web_server_addhandler'>web_server_addhandler()</a><BR></UL>
<HR><BR>
<A name=web_client_deletecookie><B><font color='000077'>web_client_deletecookie()</font></B><BR><BR>
<B>NAME</B>
<UL>web_client_deletecookie - delete a cookie</UL>
<B>SYNOPSIS</B>
<UL>#include "web_server.h"<BR><BR>void web_client_deletecookie(char *<U>key</U>);</UL>
<B>DESCRIPTION</B>
<UL>The web_client_deletecookie() function delete a cookie on client browser with key <U>key</U><BR>
</UL>
<B>NOTE</B>
<UL> The web_client_deletecookie() function should be called <B>only</B> from functions called by gethandlers registered via <a href='/?help=functions#web_server_addhandler'>web_server_addhandler()</a><BR></UL>
<HR><BR>
<A name=web_client_setvar><B><font color='000077'>web_client_setvar()</font></B><BR><BR>
<B>NAME</B>
<UL>web_client_setvar - sets a variable</UL>
<B>SYNOPSIS</B>
<UL>#include "web_server.h"<BR><BR>int web_client_setvar(char *<U>name</U>, char *<U>value</U>);</UL>
<B>DESCRIPTION</B>
<UL>The web_client_setvar() function sets an variable named <U>name</U> with value <U>value</U> in a connection, to be used in output (only available if WS_DYNVAR flag used)<BR>
web_client_setvar("bgc","#ff00dd");<BR>
printf("&lt;BODY bgcolor='$bgc;'&gt;"); - will exchange the string $bgc; to #ff00dd on output</UL>
<B>NOTE</B>
<UL>The web_client_setvar() function <B>should</B> be called <B>only</B> from functions called by gethandlers registered via <a href='/?help=functions#web_server_addhandler'>web_server_addhandler()</a>.</UL>
<HR><BR>
<A name=web_client_getvar><B><font color='000077'>web_client_getvar()</font></B><BR><BR>
<B>NAME</B>
<UL>web_client_getvar - gets a variable value</UL>
<B>SYNOPSIS</B>
<UL>#include "web_server.h"<BR><BR>int web_client_getvar(char *<U>name</U>);</UL>
<B>DESCRIPTION</B>
<UL>The web_client_getvar() function gets the value of variable <U>name</U>, (see also <a href=/?help=functions#web_client_setvar>web_client_setvar()</a>)<BR></UL>
<B>NOTE</B>
<UL>The web_client_getvar() function <B>should</B> be called <B>only</B> from functions called by gethandlers registered via <a href='/?help=functions#web_server_addhandler'>web_server_addhandler()</a>.</UL>
<HR><BR>
<A name=web_client_delvar><B><font color='000077'>web_client_delvar()</font></B><BR><BR>
<B>NAME</B>
<UL>web_client_delvar - delete a variable</UL>
<B>SYNOPSIS</B>
<UL>#include "web_server.h"<BR><BR>int web_client_delvar(char *<U>name</U>);</UL>
<B>DESCRIPTION</B>
<UL>The web_client_delvar() function deletes a variable with name <U>name</U><BR></UL>
<B>NOTE</B>
<UL>The web_client_delvar() function <B>should</B> be called <B>only</B> from functions called by gethandlers registered via <a href='/?help=functions#web_server_addhandler'>web_server_addhandler()</a>.</UL>
<HR><BR>
<A name=web_client_HTTPdirective><B><font color='000077'>web_client_HTTPdirective()</font></B><BR><BR>
<B>NAME</B>
<UL>web_client_HTTPdirective - Change the HTTP header status</UL>
<B>SYNOPSIS</B>
<UL>#include "web_server.h"<BR><BR>void web_client_HTTPdirective(char *<U>directive</U>);</UL>
<B>DESCRIPTION</B>
<UL>The web_client_HTTPdirective() function changes the HTTP header status (i.e. "HTTP/1.1 200 OK") to the string <U>directive</U><BR>
<small><i>useful for "HTTP/1.1 401 Authorization Required" (to require a password), redirection or similar actions on the client side</i></small>.</UL>
<B>NOTE</B>
<UL>The web_client_HTTPdirective() function can be called <B>only</B> from functions called by gethandlers registered via <a href='/?help=functions#web_server_addhandler'>web_server_addhandler()</a>.</UL>
<HR><BR>
<A name=web_client_contenttype><B><font color='000077'>web_client_contenttype()</font></B><BR><BR>
<B>NAME</B>
<UL>web_client_contenttype - prints to stdout the header "Content-type: */*"</UL>
<B>SYNOPSIS</B>
<UL>#include "web_server.h"<BR><BR>void web_client_contenttype(char *<U>extension</U>);</UL>
<B>DESCRIPTION</B>
<UL>The web_client_contenttype() prints to stdout the header "Content-type: */*", where '*/*' is determined by <U>extension</U> (i.e. "html" based on mimefile produces "Content-type: text/html\r\n\r\n" and "jpg" produces "Content-type: image/jpeg\r\n\r\n")<BR>
<small>this function is used on <a href="/?help=functions#web_server_aliasdir">web_server_aliasdir()</a></small></UL>
<B>NOTE</B>
<UL>This function uses mime types loaded at <a href="/?help=functions#web_server_useMIMEfile">web_server_useMIMEfile()</a> else it will print only "Content-type: text/plain\r\n\r\n"</UL>
<HR><BR>
<A name=web_log><B><font color='000077'>web_log()</font></B><BR><BR>
<B>NAME</B>
<UL>web_log - write to logfile</UL>
<B>SYNOPSIS</B>
<UL>#include "web_server.h"<BR><BR>void web_log(const char *<U>format</U>,<U>...</U>);</UL>
<B>DESCRIPTION</B>
<UL>The web_log() is similar to printf, but writes to a logfile (specified in <a href=/?help=functions#web_server_init>web_server_init()</a>). Just as printf, it doesn't add a newline at the end.</UL>
<B>NOTE</B>
<UL>The web_log() function <B>should</B> be called <B>only</B> from functions called by gethandlers registered via <a href='/?help=functions#web_server_addhandler'>web_server_addhandler()</a>.</UL>
<HR><BR>
<A name=ClientInfo><B><font color='000077'>ClientInfo</font></B><BR><BR>
<B>NAME</B>
<UL>ClientInfo - a struct to control client Header</UL>
<B>SYNOPSIS</B>
<UL> Declared in web_server.h <BR><BR>
extern struct ClientInfo {<BR>
<UL>
int <U>outfd</U>;<BR>
char *<U>inetname</U>;<BR>
char *<U>request</U>;<BR>
char *<U>method</U>;<BR>
char *<U>user</U>;<BR>
char *<U>pass</U>;<BR>
char *(*<U>Header</U>)(char *handle);<BR>
char *(*<U>Query</U>)(char *handle);<BR>
char *(*<U>Post</U>)(char *handle);<BR>
char *(*<U>Cookie</U>)(char *handle);<BR>
char *(*<U>Conf</U>)(char *handle);<BR>
struct _MultiPart (*<U>MultiPart</U>)(char *handle);<BR>
void *__pad[5];<BR>
</UL>
} *<U>ClientInfo</U>;
</UL>
<B>DESCRIPTION</B>
<UL>
<B>ClientInfo-&gt;<U>outfd</U></B> <UL>is the filedescriptor of the current output stream (useful for cgi handlers and friends).</UL><BR>
<B>ClientInfo-&gt;<U>inetname</U></B> <UL>a string to inetname (i.e. "127.0.0.1")</UL> <BR>
<B>ClientInfo-&gt;<U>request</U></B> <UL>is the requested 'file' (i.e. for "GET /index.html HTTP/1.0\r\n" the ClientInfo-&gt;request is "/index.html")</UL><BR>
<B>ClientInfo-&gt;<U>method</U></B> <UL>is the request method ("GET" or "POST" etc..)</UL><BR>
<B>ClientInfo-&gt;<U>user</U></B> <UL>AuthRealm username</UL><BR>
<B>ClientInfo-&gt;<U>pass</U></B> <UL>AuthRealm password</UL><BR>
<B>ClientInfo-&gt;<U>Header(</U>char *<U>handle</U>)</B> <UL>Function to parse the header, and returns Header information (i.e. for "Host: http://127.0.0.1:81" the result of ClientInfo-&gt;Header("Host") is "http://127.0.0.1:81") if argument <U>handle</U> is NULL then this function returns whole Header from client</UL><BR>
<B>ClientInfo-&gt;<U>Query(</U>char *<U>handle</U>)</B> <UL>A function that returns the query value from the browser (i.e for the request "http://somehost.net/req.html?id=5&f=1", ClientInfo-&gt;Query("id") is "5".if argument <U>handle</U> is NULL then this function returns whole Query string from client<BR>if the handle have the char # first (like "#handle") it returns the number of variables (usefull for checkboxes and etc...) Check <a href='/?help=examples#checkbox'>checkbox example</a></UL><BR>
<B>ClientInfo-&gt;<U>Post(</U>char *<U>handle</U>)</B> <UL>A function that returns the Post data from the forms with method 'POST'. <U>handle</U> is the name of some &lt;input&gt; tag.if argument <U>handle</U> is NULL then this function returns whole Post data from client<BR>if the handle have the char # first (like "#handle") it returns the number of variables (usefull for checkboxes and etc...) Check <a href='/?help=examples#checkbox'>checkbox example</a></UL><BR>
<B>ClientInfo-&gt;<U>Cookie(</U>char *<U>handle</U>)</B> <UL>A function that returns the Cookie data from browser. if argument <U>handle</U> is NULL then this function returns whole Cookiestring from client</UL><BR>
<B>ClientInfo-&gt;<U>Conf(</U>char * <U>topic</U>,char *<U>handle</U>)</B> <UL>A function that returns an value from a <U>key</U> in <U>topic</U> in the config file if used</UL><BR>
<B>ClientInfo-&gt;<U>MultiPart(</U>char *<U>handle</U>)</B> <UL>A function that returns a data structure from the forms with method 'POST' and enctype='multipart/form-data' (useful for uploading files). <U>handle</U> is the name of some &lt;input&gt; tag.<BR><BR>
the structure is<BR>
struct _MultiPart {
<UL>
char *<U>id</u>;<BR>
char *<U>data</U>;<BR>
unsigned int <U>size</U>;<BR>
char *<U>filename</U>;<BR>
void *<U>pad</U>;<BR>
</UL>
};<BR>
to be used as ClientInfo-&gt;<U>MultiPart</U>("file1").<U>data</U>; ClientInfo-&gt;<U>MultiPart</U>("file1").<U>size</U>; ClientInfo-&gt;<U>MultiPart</U>("file1").<U>filename</U>;
</UL>
</UL>
<HR><BR>
<A name=configfile><B><font color='000077'>The config file</font></B><BR><BR>
<UL>the config file is used as<BR><BR>
<PRE>
[TOPIC]
KEY=VALUE
libwebserver configurations must be in topic LIBWEBSERVER as:
[LIBWEBSERVER]
LOG=help.log
PORT=80
USESSL=1
CERTFILE=foocert.pm
MIMEFILE=/etc/mime.types
LOCAL=1
LOG -> the log file
PORT -> the listen port that will be used for tcp connections
USESSL -> the ssl flag if you want to use openssl for secure server (https)
CERTFILE -> the file that contains certificate for ssl connections
MIMEFILE -> the file that contains mime.types similer to apache mimefile
LOCAL -> only accept connections from 127.0.0.1
</PRE>
</UL>
</font>
+25
View File
@@ -0,0 +1,25 @@
<center><H3><font color='007700'>libwebserver Info</font></H3></center><BR><BR>
<A name=what><B><font color='000077'>What's libwebserver for?</font></B><BR>
<UL>This lib is intended to add webserver functionality to programs instead of using an external webserver.<BR>
Two examples for embedded webservers that i know of are simple (shoutcast (i guess), and webTV (teletext as a webpage (from pinnacle)); and many others probably do the same.
</UL>
<HR>
<A name=who><B><font color='000077'>Who's supposed to use libwebserver?</font></B>
<UL>This is mainly developed for developers to make it easier to write a web interface to their software, (note a webbrowser is commonly available in most operating
systems) so it is like a portable "terminal" that can be accessed from any computer (with a browser of course...).</UL>
<HR>
<A name=when><B><font color='000077'>When am i supposed to use libwebserver?</font></B>
<UL>For example, imagine that you are developing a daemon and want to check stats or re-configure at run-time;
with this library you can add a listen port for runtime, and connect with whatever browser (via HTML interface)
without dependencies of an external webserver.<BR>
You can even do a webserver (of course), just use your imagination.<BR>
Another quite simple example, a sound recorder (using only local connections for security reasons) uses a web interface to control
/dev/dsp reading/writing (via HTML interface).
there are many other things you can do ...</UL>
<HR>
<A name=server_scripts><B><font color='000077'>Is there support for server scripts such as .php .cgi .asp?</font></B>
<UL> Well, this library only provides web server functions that make a server running, server scripts can be supported if you want to do it:
you can develop a handler for type ".something" or whatever, this package provides a .cgi handler as an example, (use at your own risk or make it better).</UL>
+67
View File
@@ -0,0 +1,67 @@
<center><H3><font color='007700'>libwebserver Security</font></H3></center><BR><BR>
<A name=what><B><font color='000077'>Is it safe to use?</font></B><BR>
<UL>Well, I can't promise that it's a secure software since that not only depends on the software,
but all i can say is that wasn't found any security bug yet, this was developed intended to be secure,
you can use openssl (encrypted streams) to protect information that passes from webserver(lib) to client</UL>
<A name=certificate><B><font color='000077'>How do I create my own certificate?</font></B><BR>
<UL>You can either buy one from one of the big vendors (see your browser's stored certificates
for their addresses) or self-sign a self-created one. The upside of the bought
certificates is, that the webbrowser doesn't ask if the user wants to
accept that certificate, but instead checks with the certification authority
you bought your certificate from.<br>
The downside is that it costs quite a lot of money.<br>
To create your own certificate use openssl like that:
<ul><li>create a key and request:<br>
<pre><b>openssl req -new > foo-cert.csr</b></pre><br>
As "Common Name" you have to type in the name part of
your URL, i.e. if your web site will be
"https://www.libwebserver.rules:443/" the Common Name is
"www.libwebserver.rules".
<li> remove the passphrase from the key:<br>
<pre><b>openssl rsa -in privkey.pem -out foo-cert.key</b></pre><br>
<li>convert request into a signed certificate:<br>
<pre><b>openssl x509 -in foo-cert.csr -out foo-cert.cert -req -signkey foo-cert.key -days 356</b></pre><br>
<li>create .pem file:<br>
<pre><b>cat foo-cert.cert foo-cert.key >foo-cert.pem</b></pre><br>
</ul>
</ul>
<A name=tips><B><font size=4 color='770077'>Security tips</font></B><BR><HR>
<A name=racecondition><B><font color='000077'>Avoid race condition problems</font></B><BR>
<UL>
<B> What is race condition?</B>
<UL>A race condition occurs when two or more operations occur in an
undefined manner (McKusick et al. 1996). Specifically in file
system races the attacker attempts to change the state of the
file system in between two file system operations on the part
of the program.</UL><BR>
<B> How the lib determine temporary file name?</B>
<UL>
<li>generate file name (note: keep generating until it doesn't exists)<BR></li>
<li>check if file exists<BR>
-<small>attacker can create the file now, if he knows the right filename</small><BR></li>
<li>check if symlink exists<BR>
-<small>attacker can create the symlink now, if he knows the right filename</small><BR></li>
<li>create the file and redirect stdout to it <BR>
-<small>attacker can open the file and write to it</small><BR></li>
<li>places a lock into file (note: not in win98)<BR> </li>
<li>users operations, write, flush, read<BR></li>
<li>unlink the filename from the OS<BR></li>
</UL><BR>
libwebserver uses temporary filenames to hold and process data before send it to client, it uses the ambient variables to
determine temporary directory by following order "$TEMP,$TMP,$TMPDIR and the stdio.h P_tmpdir", libwebserver have several checks
and it locks file for avoid attackers from messing with temporary files, meanwhile is safely to change the tempdir (setting the ambient variable)
to an directory that is not writable for everyone and writable to lib (setenv("TEMP","/safedir"); you can do it before the web_server_run function
</UL>
+7
View File
@@ -0,0 +1,7 @@
SUBDIRS = .
webserverincludedir = $(includedir)/GNUnet
webserverinclude_HEADERS = \
webserver_gnunet.h
View File
Executable
+6871
View File
File diff suppressed because it is too large Load Diff
+26
View File
@@ -0,0 +1,26 @@
SUBDIRS = .
INCLUDES = -I$(top_srcdir)/src/include
lib_LTLIBRARIES = libwebserver_gnunet.la
AM_CFLAGS = \
-D_SERVER_VERSION="\"0.6.3-GNUnet\""
libwebserver_gnunet_la_SOURCES = \
clientinfo.c \
server.c \
client.c \
gethandler.c \
socket.c \
memory.c \
outstream.c \
weblog.c \
utils.c \
fnmatch.c \
outgif.c \
error.c
libwebserver_gnunet_la_LDFLAGS = \
-version-info 0:0:0
+1190
View File
@@ -0,0 +1,1190 @@
/* Copyrights 2002 Luis Figueiredo (stdio@netc.pt) All rights reserved.
*
* See the LICENSE file
*
* The origin of this software must not be misrepresented, either by
* explicit claim or by omission. Since few users ever read sources,
* credits must appear in the documentation.
*
* date: Sat Mar 30 14:44:42 GMT 2002
*
* -- client handler functions
*
*/
#include "client.h"
extern char *_libwebserver_version; // Defined in server.c
struct web_client *current_web_client;
int WEBTIMEOUT=10000;
/*********************************************************************************************************/
/*
* initializate (allocate) client list
*/
struct web_client *__ILWS_init_client_list() {
struct web_client *ret;
ret=__ILWS_malloc(sizeof(struct web_client));
if(ret==NULL) {
LWSERR(LE_MEMORY);
return NULL;
};
#ifdef HAVE_OPENSSL
ret->ssl=NULL; // ssl handler for this client
#endif
ret->next=NULL;
return ret;
}
/*********************************************************************************************************/
/*
* Add a client node to client list
*/
int __ILWS_add_client(struct web_client *list, struct web_client *node) {
struct web_client *temp=list;
#ifdef WIN32
unsigned long t=IOC_INOUT;
#endif
while(temp->next!=NULL)temp=temp->next; // run to last client
temp->next=node;
temp->next->rbuf=NULL;
temp->next->rbufsize=0;
if(!(temp->next->outstream=__ILWS_init_outstream_list())) {
return 0;
};
if(!(temp->next->varlist=__ILWS_init_var_list())) {
return 0;
};
temp->next->contentlength=0;
temp->next->headersize=0;
temp->next->wheadersize=0;
temp->next->writelength=0;
temp->next->readsize=0;
temp->next->range=0;
temp->next->skipped=0;
temp->next->cookies=NULL;
//temp->next->oldcl=clock();
temp->next->newdata_try=0;
#ifdef WIN32
// should be optional
ioctlsocket(temp->next->socket,FIONBIO,&t); //non blocking sockets for win32
#else
fcntl(temp->next->socket,F_SETFL,O_NONBLOCK);
#endif
temp->next->next=NULL;
temp->next->HTTPdirective=NULL;
temp->next->stat=1; // Add a connected client
return 1;
}
/*********************************************************************************************************/
/*********************************************************************************************************/
/*
* Delete client node
*/
void __ILWS_delete_client(struct web_client *node) {
int rt;
rt=shutdown(node->socket,SHUT_RDWR);
#ifdef WIN32
rt=closesocket(node->socket);
#else
rt=close(node->socket);
#endif
__ILWS_free(node->cookies); // (0.5.1)
__ILWS_delete_outstream_list(node->outstream);
__ILWS_delete_var_list(node->varlist);
#ifdef HAVE_OPENSSL
SSL_free (node->ssl);
#endif
__ILWS_free(node->rbuf); // free's
__ILWS_free(node); // free's
}
/*********************************************************************************************************/
/*
* Delete next client node
*/
void __ILWS_delete_next_client(struct web_client *node) {
struct web_client *temp=node->next;
node->next=node->next->next;
__ILWS_delete_client(temp);
}
/*********************************************************************************************************/
/*
* Delete entire client list
*/
void __ILWS_delete_client_list(struct web_client *node) {
struct web_client *next;
while(node) {
next = node->next;
__ILWS_free(node);
node = next;
}
}
/*********************************************************************************************************/
/*
* Read what client have to say
*/
void __ILWS_read_client(struct web_client *node) {
int tmp,tmp1;
char *tmp2,*tmp3=NULL;
char readtemp[READMAX+1];
unsigned long datasize=0;
#ifdef HAVE_OPENSSL
if(node->ssl!=NULL) {
tmp=SSL_read(node->ssl,readtemp,READMAX);
} else {
tmp=__ILWS_read(node->socket,readtemp,READMAX);
};
#else
tmp=__ILWS_read(node->socket,readtemp,READMAX);
#endif
//fprintf(stderr,"readed %d bytes\n",tmp);
if(tmp<1) {
#ifdef WIN32
if(WSAGetLastError()!=WSAEWOULDBLOCK) {
#else
if(errno!=EAGAIN) {
#endif
node->stat=5;return;
};
//fprintf(stderr,"try: %d (%s)\n",node->newdata_try,node->rbuf);
// check if it is over
node->newdata_try++;
//fprintf(stderr,"node->newdata_try:%d\n",node->newdata_try);
if(node->rbufsize >0) { //&& node->newdata_try>5) {
if(node->headersize==0) { // always reachs "\r\n\r\n"
if((tmp3=strstr(node->rbuf,"\r\n\r\n"))) {
node->headersize=(tmp3-node->rbuf);
};
} else {
datasize=node->rbufsize-node->headersize;
if(node->contentlength==0) { // well if it 0 read all at once
__ILWS_init_clientinfo(); // always call this?
node->contentlength=atol(ClientInfo->Header("Content-Length"));
// range for resuming
if((tmp3=strstr(ClientInfo->Header("Range"),"bytes="))) { // if it is in bytes (i hope, always)
tmp3+=6; // go to end of "bytes="
node->range=atol(tmp3);
//printf("Range is %d - %s - %s\n",node->range,ClientInfo->Header("Range"),tmp3);
};
// end range
__ILWS_free_clientinfo();
};
if(node->contentlength==datasize-4) {
//fprintf(stderr,"client (%d) all readed (%d) (try's)-%d\n",node->socket,node->curcl-node->oldcl,node->newdata_try);
node->newdata_try=WEBTIMEOUT; // assume done reading
//fprintf(stderr,"Ended naturaly\n");
}
};
if((node->newdata_try>=WEBTIMEOUT)) { // All readed
node->rbuf[node->rbufsize]='\0';
node->stat=2; // Next state
//fprintf(stderr,"%s\n",node->rbuf);
//fprintf(stderr,"%d\n",node->rbufsize);
}
};
}else {
tmp1=node->rbufsize;
node->rbufsize+=tmp;
tmp2=__ILWS_realloc(node->rbuf,node->rbufsize+1);
if(tmp2==NULL) {
LWSERR(LE_MEMORY);
node->stat=5;
return;
}else {
node->rbuf=tmp2;
};
memcpy(node->rbuf+tmp1,readtemp,tmp);
node->newdata_try=0;
};
}
/*********************************************************************************************************/
/*
* Process headers w/ get handlers
*/
void __ILWS_process_client(struct web_client *node,struct gethandler *list) {
struct gethandler *gettemp=list;
long secs=time(NULL);
// for determining content length
#define RTMPMAX 400
struct outstream *tmpstream; // new on 0.5.1
char rtmp[RTMPMAX+1];
int rtmps=0;
char *thead=NULL;
char *tmpl;
///
int tmp=0;
int oumask=0; // old usermask
char *tmp1=__ILWS_web_client_getreq();
char matchbuf[MATCHMAX];
FILE *nfile; // new file
char *fname; // new file name
while(gettemp->next!=NULL && tmp==0) {
gettemp=gettemp->next;
snprintf(matchbuf,MATCHMAX,"%s",gettemp->str);
if(!tmp1) {
__ILWS_web_client_writef(node,"HTTP/1.1 400 Invalid request\r\n");
__ILWS_web_client_writef(node,"Server: %s\r\n",_libwebserver_version);
__ILWS_web_client_writef(node,"Date: %s\r\n",__ILWS_date(mktime(gmtime(&secs)),"%a, %d %b %Y %H:%M:%S GMT")); // Date header
__ILWS_web_client_writef(node,"Content-type: text/html\r\n\r\n<HTML><title>Invalid request</title><body bgcolor=FFFFFF><font size=6>400 Invalid request</font><BR><BR><small>Yout request doesn't match the requesits to be processed</small><BR><HR><small><i>%s</i></small></body></html>\n\r",_libwebserver_version);
tmpl=__ILWS_web_client_getreqline();
web_log("%s - - [%s] \"%s\" 400 (invalid request)\n",inet_ntoa(node->sa.sin_addr),__ILWS_date(time(NULL),"%d/%b/%Y:%H:%M:%S %z"),tmpl);
__ILWS_free(tmpl);
node->stat=5;
return;
};
if(strlen(tmp1)>MAXURLSIZE) {
__ILWS_web_client_writef(node,"HTTP/1.1 414 URL to large\r\n");
__ILWS_web_client_writef(node,"Server: %s\r\n",_libwebserver_version);
__ILWS_web_client_writef(node,"Date: %s\r\n",__ILWS_date(mktime(gmtime(&secs)),"%a, %d %b %Y %H:%M:%S GMT")); // Date header
__ILWS_web_client_writef(node,"Content-type: text/html\r\n\r\n<HTML><title>URL to large</title><body bgcolor=FFFFFF><font size=6>414 Requested url to large</font><BR><BR><small>Wonder this... why is that so large?</small><BR><HR><small><i>%s</i></small></body></html>\n\r",_libwebserver_version);
tmpl=__ILWS_web_client_getreqline();
web_log("%s - - [%s] \"%s\" 414 (url to large)\n",inet_ntoa(node->sa.sin_addr),__ILWS_date(time(NULL),"%d/%b/%Y:%H:%M:%S %z"),tmpl);
__ILWS_free(tmpl);
node->stat=5;
__ILWS_free(tmp1);
return;
};
if(!fnmatch(matchbuf,tmp1,5)) {
if((gettemp->flag & WS_LOCAL) == WS_LOCAL) {
if(node->sa.sin_addr.s_addr!=0x0100007F) {
__ILWS_web_client_writef(node,"HTTP/1.1 403 Forbidden\r\n");
__ILWS_web_client_writef(node,"Server: %s\r\n",_libwebserver_version);
__ILWS_web_client_writef(node,"Date: %s\r\n",__ILWS_date(mktime(gmtime(&secs)),"%a, %d %b %Y %H:%M:%S GMT")); // Date header
__ILWS_web_client_writef(node,"Content-type: text/html\r\n\r\n<HTML><title>Forbidden</title><body bgcolor=FFFFFF><font size=6>403 Forbidden</font><BR><BR><small>only local host accepted</small><BR><HR><small><i>%s</i></small></body></html>\n\r",_libwebserver_version);
tmpl=__ILWS_web_client_getreqline();
web_log("%s - - [%s] \"%s\" 403 (Forbidden)\n",inet_ntoa(node->sa.sin_addr),__ILWS_date(time(NULL),"%d/%b/%Y:%H:%M:%S %z"),tmpl);
__ILWS_free(tmpl);
node->stat=5;
__ILWS_free(tmp1);
return;
};
};
tmp=1; // Was found
node->outstream->flags=(gettemp->flag & WS_DYNVAR); // pass to outstreams
};
};
__ILWS_free(tmp1);
if(!tmp) { // Nothing found
__ILWS_web_client_writef(node,"HTTP/1.1 404 Not Found\r\n");
__ILWS_web_client_writef(node,"Server: %s\r\n",_libwebserver_version);
__ILWS_web_client_writef(node,"Date: %s\r\n",__ILWS_date(mktime(gmtime(&secs)),"%a, %d %b %Y %H:%M:%S GMT")); // Date header
__ILWS_web_client_writef(node,"Content-type: text/html\r\n\r\n<HTML><title>not found</title><body bgcolor=FFFFFF><font size=6>404 NOT FOUND</font><BR><BR><small>The requested content wasn't found</small><BR><HR><small><i>%s</i></small></body></html>\n\r",_libwebserver_version);
tmpl=__ILWS_web_client_getreqline();
web_log("%s - - [%s] \"%s\" 404 (Not Found)\n",inet_ntoa(node->sa.sin_addr),__ILWS_date(time(NULL),"%d/%b/%Y:%H:%M:%S %z"),tmpl);
__ILWS_free(tmpl);
node->stat=5;
}else {
// if cgi do something else, present headers
oumask=umask(077);
if(!(fname=__ILWS_tmpfname())) {
libws_error(LE_FILESYS,": Error giving a temp filename\n");
node->stat=5;
return;
};
if((nfile=freopen(fname,"wb+",stdout))!=NULL) {
flock(fileno(stdout),LOCK_EX);
tmp=dup(fileno(stdout));
nfile=fdopen(tmp,"wb+");
if(!__ILWS_add_outstream(node->outstream,fname,nfile,1)) {
node->stat=5; // (delete client)
return; // ERROR reported by add_outstream
};
// THE PROCESS
// Setup Clientinfo before running function
if(gettemp->type==GH_FUNCTION) {
__ILWS_init_clientinfo();
gettemp->hdl.func(); // changed (0.5.3) Access by named union (Hilobok Andrew (han@km.if.ua) said that wasn't compile on freeBSD)
__ILWS_free_clientinfo();
};
// new on 0.5.2
if(gettemp->type==GH_DIRECTORY) { // as builtin function for directory listing
__ILWS_init_clientinfo();
if(strcmp(gettemp->str,"* /*"))ClientInfo->request+=1; // skip '/' if not equal to "* /*" (used by default)
__ILWS_lws_list(gettemp->hdl.path); // changed (0.5.3) Access by named union (Hilobok Andrew (han@km.if.ua) said that wasn't compile on freeBSD)
__ILWS_free_clientinfo();
};
fflush(stdout);
fclose(stdout); // it is a tempfile freopened
__ILWS_free(fname); // doesn't need anymore
#ifdef WIN32
freopen("con","w",stdout);
#else
freopen("/dev/tty","w",stdout);
#endif
if((gettemp->flag & WS_USELEN) == WS_USELEN) {
// determine writelength (for content-length: header) (new on 0.5.1)
tmpstream=node->outstream;
tmp=0;
while(tmpstream->next!=NULL) { // end of header probably in the firsts outstream nodes check for that
if(tmpstream->next->fname!=NULL) {
if(tmpstream->next->fstream==NULL) {
nfile=fopen(tmpstream->next->fname,"rb");
tmpstream->next->fstream=nfile; // here (corrected on 0.5.3);
} else {
fflush(tmpstream->next->fstream); // <- flush tha thing
nfile=tmpstream->next->fstream;
fseek(nfile,0,SEEK_SET);
};
if(nfile!=NULL) {
rtmps=0;
while((!node->wheadersize) && (!feof(nfile))) { // wheadersize is 0, suposed to be fast, at least if is not malformed
if(rtmps>0) {tmp-=4;fseek(nfile,rtmps-4,SEEK_SET);}
if((rtmps=fread(rtmp,1,RTMPMAX,nfile))>0) {
rtmp[rtmps]=0;
if((tmp1=strstr(rtmp,"\r\n\r\n"))) {
node->wheadersize=(tmp+((tmp1+4)-rtmp));
rtmps=((tmp1+4)-rtmp);
};
if(node->range>0) {
tmp1=realloc(thead,tmp+rtmps+1);
thead=tmp1;
memcpy(thead+tmp,rtmp,rtmps);
thead[tmp+rtmps]=0;
};
tmp+=rtmps;
};
};
fseek(nfile,SEEK_END,SEEK_END);
node->writelength+=(ftell(nfile)-2);
//fclose(nfile); // <- don't worry they close the file later
};
};
tmpstream=tmpstream->next;
};
// end writelength
} else {
node->range=0; // no content-range
};
if(node->range>node->writelength-node->wheadersize && node->range>0) {
__ILWS_web_client_writef(node,"HTTP/1.1 416 Requested Range Not Satisfiable\r\n");
__ILWS_web_client_writef(node,"Server: %s\r\n",_libwebserver_version);
__ILWS_web_client_writef(node,"Date: %s\r\n",__ILWS_date(mktime(gmtime(&secs)),"%a, %d %b %Y %H:%M:%S GMT")); // Date header
__ILWS_web_client_writef(node,"Content-range: bytes */%d\r\n",node->writelength-node->wheadersize);
__ILWS_web_client_writef(node,"Content-type: text/html\r\n\r\n<HTML><title>Requested Range Not Satisfiable</title><body bgcolor=FFFFFF><font size=6>416 Requested Range Not Satisfiable</font><BR><BR><small>You're trying to resume an content that is smaller than the requested range</small><BR><HR><small><i>%s</i></small></body></html>\n\r",_libwebserver_version);
tmpl=__ILWS_web_client_getreqline();
web_log("%s - - [%s] \"%s\" 416 (Requested Range Not Satisfiable)\n",inet_ntoa(node->sa.sin_addr),__ILWS_date(time(NULL),"%d/%b/%Y:%H:%M:%S %z"),tmpl);
__ILWS_free(tmpl);
node->stat=5;
__ILWS_free(thead);
umask(oumask);
return;
};
if(node->range>0 && ((node->outstream->flags & WS_DYNVAR)==WS_DYNVAR)) { // if request range interval and dynvar on than produces not implemented
__ILWS_web_client_writef(node,"HTTP/1.1 501 Not Implemented\r\n");
__ILWS_web_client_writef(node,"Server: %s\r\n",_libwebserver_version);
__ILWS_web_client_writef(node,"Date: %s\r\n",__ILWS_date(mktime(gmtime(&secs)),"%a, %d %b %Y %H:%M:%S GMT")); // Date header
__ILWS_web_client_writef(node,"Content-type: text/html\r\n\r\n<HTML><title>Not implemented</title><body bgcolor=FFFFFF><font size=6>501 Not implemented</font><BR><BR><small>Your trying to resume an content that is not possible to resume(WS_DYNVAR fault)</small><BR><HR><small><i>%s</i></small></body></html>\n\r",_libwebserver_version);
tmpl=__ILWS_web_client_getreqline();
web_log("%s - - [%s] \"%s\" 501 (Not Implemented)\n",inet_ntoa(node->sa.sin_addr),__ILWS_date(time(NULL),"%d/%b/%Y:%H:%M:%S %z"),tmpl);
__ILWS_free(tmpl);
node->stat=5;
__ILWS_free(thead);
umask(oumask);
return;
};
}else {
LWSERR(LE_FILESYS);
};
node->stat=4;
if(node->HTTPdirective==NULL) {
if(node->range>0) {
__ILWS_web_client_writef(node,"HTTP/1.1 206 Partial Content\r\n");
tmpl=__ILWS_web_client_getreqline();
web_log("%s - - [%s] \"%s\" 206 (Partial Content)\n",inet_ntoa(node->sa.sin_addr),__ILWS_date(time(NULL),"%d/%b/%Y:%H:%M:%S %z"),tmpl);
__ILWS_free(tmpl);
} else {
__ILWS_web_client_writef(node,"HTTP/1.1 200 OK\r\n");
tmpl=__ILWS_web_client_getreqline();
web_log("%s - - [%s] \"%s\" 200 (OK)\n",inet_ntoa(node->sa.sin_addr),__ILWS_date(time(NULL),"%d/%b/%Y:%H:%M:%S %z"),tmpl);
__ILWS_free(tmpl);
};
} else {
__ILWS_web_client_writef(node,"%s\r\n",node->HTTPdirective);
tmpl=__ILWS_web_client_getreqline();
web_log("%s - - [%s] \"%s\" XXX (User defined)\n",inet_ntoa(node->sa.sin_addr),__ILWS_date(time(NULL),"%d/%b/%Y:%H:%M:%S %z"),tmpl);
__ILWS_free(tmpl);
};
__ILWS_web_client_writef(node,"Server: %s\r\n",_libwebserver_version);
__ILWS_web_client_writef(node,"Date: %s\r\n",__ILWS_date(mktime(gmtime(&secs)),"%a, %d %b %Y %H:%M:%S GMT")); // Date header
__ILWS_web_client_writef(node,"Accept-Ranges: bytes\r\n");
if((((node->writelength-node->wheadersize)-node->range)>0) && !((node->outstream->flags & WS_DYNVAR)==WS_DYNVAR))__ILWS_web_client_writef(node,"Content-length: %d\r\n",(node->writelength-node->wheadersize)-node->range);
if(node->cookies!=NULL)__ILWS_web_client_writef(node,"%s",node->cookies); // new (0.5.1)
if(node->range>0) {
__ILWS_web_client_writef(node,"Content-range: bytes %d-%d/%d\r\n",node->range,(node->writelength-node->wheadersize)-1,node->writelength-node->wheadersize);
__ILWS_web_client_writef(node,"%s",thead); // the rest of header
__ILWS_free(thead);
};
umask(oumask);
};
}
/*********************************************************************************************************/
/*
* Process stream output
*/
void __ILWS_output_client(struct web_client *node) {
struct outstream *tstream=node->outstream;
char *tmp1,*tmp2,*tmp3;
char writetemp[WRITEMAX+1];
int beginsize=0;
int endsize=0;
int varsize=0;
int namesize=0;
if(tstream->next!=NULL) {
if(tstream->next->fname!=NULL) {
if(tstream->next->fstream==NULL) {
if((tstream->next->fstream=fopen(tstream->next->fname,"rb"))==NULL) {
LWSERR(LE_FILESYS);
__ILWS_delete_next_outstream(tstream);
//node->outstream->next=tstream->next;
return;
}
};
// read part (must always read)
if(tstream->next->rsize==0) { // start from 0
fseek(tstream->next->fstream,0,SEEK_SET);
};
memset(writetemp,0,WRITEMAX);
tstream->next->rsize=fread(writetemp,1,WRITEMAX,tstream->next->fstream);
writetemp[tstream->next->rsize]=0;
// if read make var changes on writetemp;
// new on 0.5.1 -- UNDERDEV // FIX -
if((node->outstream->flags & WS_DYNVAR) == WS_DYNVAR) {
tmp1=writetemp;
while(((tmp1=strstr(tmp1,"$")+1)!=(char*)1) && beginsize==0) { // check var found
for(namesize=0;namesize<50;namesize++) {
if(tmp1[namesize]==';') {namesize++;break;}
if((tmp1[namesize]<'a' || tmp1[namesize]>'z') &&
(tmp1[namesize]<'A' || tmp1[namesize]>'Z') &&
(tmp1[namesize]<'1' || tmp1[namesize]>'0') &&
tmp1[namesize]!='_') {namesize=0;break;};
};
if(namesize>0) {
if(namesize==1) { // this is $; for sure
if(!(tmp3=__ILWS_malloc(2))) {
LWSERR(LE_MEMORY);
node->stat=5;
return;
};
memcpy(tmp3,"$",namesize);
tmp3[namesize]=0;
} else {
if(!(tmp3=__ILWS_malloc(namesize))) {
LWSERR(LE_MEMORY);
node->stat=5;
return;
};
memcpy(tmp3,tmp1,namesize-1);
tmp3[namesize-1]=0;
};
tmp1-=1;
beginsize=tmp1-writetemp;
tmp1+=namesize; // get var from whateverwhere (client node probably)
endsize=strlen(tmp1);
//varsize=2;
if((tmp2=__ILWS_malloc(beginsize+1))) {
memcpy(tmp2,writetemp,beginsize);
tmp2[beginsize]=0;
if(namesize==1) {
varsize=strlen(tmp3);
snprintf(writetemp,WRITEMAX,"%s%s",tmp2,tmp3);
} else {
varsize=strlen(__ILWS_get_var(node->varlist,tmp3));
snprintf(writetemp,WRITEMAX,"%s%s",tmp2,__ILWS_get_var(node->varlist,tmp3));
};
writetemp[strlen(tmp2)+varsize]=0;
__ILWS_free(tmp2);
__ILWS_free(tmp3);
tstream->next->rsize=(beginsize+varsize);
tstream->next->varsize+=(varsize-namesize)-1;
} else {
LWSERR(LE_MEMORY);
__ILWS_free(tmp3);
node->stat=5;
return;
};
};
};
}; // dynvar
/* there is nothing more to read here */
if(tstream->next->rsize<1){ // i guess rsize < 1 is eof (make sure that server writed last time)
//only change if everything written
if(feof(tstream->next->fstream) && (ftell(tstream->next->fstream)==tstream->next->wrotesize)) {
//fclose(tstream->next->fstream);
__ILWS_delete_next_outstream(tstream);
//node->outstream->next=tstream->next;
}
return;
}
node->readsize+=tstream->next->rsize;
if(!node->skipped && node->range>0) {
tstream->next->wsize=tstream->next->rsize;
tstream->next->wrotesize+=tstream->next->wsize;
if((node->readsize-node->wheadersize)<node->range) { // skip range bytes
return; // do nothing
}else {
node->skipped=1;
tstream->next->wrotesize-=(node->readsize-node->wheadersize)-node->range; // the right offset
fseek(tstream->next->fstream,tstream->next->wrotesize,SEEK_SET);
tstream->next->wsize=tstream->next->rsize;
return;
};
};
// write part
#ifdef HAVE_OPENSSL
if(node->ssl!=NULL) {
tstream->next->wsize=SSL_write(node->ssl,writetemp,tstream->next->rsize);
} else {
tstream->next->wsize=send(node->socket,writetemp,tstream->next->rsize,0);
};
#else
tstream->next->wsize=send(node->socket,writetemp,tstream->next->rsize,0);
#endif
if(tstream->next->wsize>0) {
tstream->next->wrotesize+=tstream->next->wsize;
if(tstream->next->rsize!=tstream->next->wsize || beginsize>0) { // FIX
fseek(tstream->next->fstream,tstream->next->wrotesize-(tstream->next->varsize),SEEK_SET); // FIX
};
};
#ifdef WIN32
if((tstream->next->wsize<=0) && (WSAGetLastError()!=WSAEWOULDBLOCK)) { // WIN32 only
#else
if(tstream->next->wsize<=0 && errno!=EAGAIN) { // linux only // *nix i guess
#endif
//fclose(tstream->next->fstream);
__ILWS_delete_next_outstream(tstream);
//node->outstream->next=tstream->next;
return;
}else { // broken pipe
if(tstream->next->wsize<0) {
fseek(tstream->next->fstream,tstream->next->wrotesize-(tstream->next->varsize),SEEK_SET); //didn't read must back to where it was
};
};
}else { // filename is null
__ILWS_delete_next_outstream(tstream);
return;
};
}else { // End of streams
current_web_client->stat=5; // done
};
}
/*********************************************************************************************************/
/*
* Set http directive
*/
void web_client_HTTPdirective(char *str) {
current_web_client->HTTPdirective=str;
}
/*********************************************************************************************************/
/*
* GET request name
*/
char *__ILWS_web_client_getreq() {
char *ret;
char *tmp1=strstr(current_web_client->rbuf,"?");
char *tmp2=strstr(current_web_client->rbuf," HTTP");
char *tmp3=strstr(current_web_client->rbuf,"\r\n");
int size;
if(tmp1==NULL || tmp1>tmp2) {
tmp1=tmp2;
};
if(tmp2>tmp3) {
return NULL;
};
size=tmp1-current_web_client->rbuf;
if(size<1) return NULL;
if(!(ret=__ILWS_malloc(size+1))) {
LWSERR(LE_MEMORY);
return NULL;
};
memcpy(ret,current_web_client->rbuf,size);
ret[size]=0;
return ret;
};
/*********************************************************************************************************/
/*
* GET request line
*/
char *__ILWS_web_client_getreqline() {
char *ret;
char *tmp1=strstr(current_web_client->rbuf,"\r\n");
int size=0;
if(tmp1==NULL) return NULL;
size=tmp1-current_web_client->rbuf;
if(size<1) return NULL;
if(!(ret=__ILWS_malloc(size+1))) {
LWSERR(LE_MEMORY);
return NULL;
};
memcpy(ret,current_web_client->rbuf,size);
ret[size]=0;
return ret;
}
/*********************************************************************************************************/
/*
* Add a FILE stream type to client output
*/
int web_client_addfile(char *in) {
int ret=__ILWS_add_outstream(current_web_client->outstream,in,NULL,0);
int nfd=0;
char *fname;
FILE *nfile=NULL;
fname=__ILWS_tmpfname();
fflush(stdout);
fclose(stdout); // oldstdout close it?
if((nfile=freopen(fname,"w+b",stdout))!=NULL){ // redirect
flock(fileno(stdout),LOCK_EX); // <- yah
nfd=dup(fileno(stdout));
nfile=fdopen(nfd,"wb+");
if(!__ILWS_add_outstream(current_web_client->outstream,fname,nfile,1)) {
LWSERR(LE_MEMORY);
return 0;
};
};
__ILWS_free(fname);
ClientInfo->outfd=fileno(nfile);
return ret;
}
/*********************************************************************************************************/
/*
* Output data as gif (with width w and height h)
*/
unsigned char __ILWS_GLOBALGIFPAL[256][3];
void web_client_gifsetpalette(const char *fname) {
int j;
FILE *palfile;
if(strcmp(fname,"EGA")==0) {
static int EGApalette[16][3] = {
{0,0,0}, {0,0,128}, {0,128,0}, {0,128,128},
{128,0,0}, {128,0,128}, {128,128,0}, {200,200,200},
{100,100,100}, {100,100,255}, {100,255,100}, {100,255,255},
{255,100,100}, {255,100,255}, {255,255,100}, {255,255,255} };
for (j=0; j<256; j++) {
__ILWS_GLOBALGIFPAL[j][0] = (unsigned char)EGApalette[j&15][0];
__ILWS_GLOBALGIFPAL[j][1] = (unsigned char)EGApalette[j&15][1];
__ILWS_GLOBALGIFPAL[j][2] = (unsigned char)EGApalette[j&15][2];
}
} else {
if(!(palfile=fopen(fname,"rb"))) {
return;
};
fread(__ILWS_GLOBALGIFPAL,sizeof(__ILWS_GLOBALGIFPAL),1,palfile);
fclose(palfile);
};
};
int web_client_gifoutput(char *data,int w,int h,int transparencyindex) {
int i;
unsigned char rm[256],gm[256],bm[256];
for(i=0;i<256;i++) {
rm[i]=__ILWS_GLOBALGIFPAL[i][0];
gm[i]=__ILWS_GLOBALGIFPAL[i][1];
bm[i]=__ILWS_GLOBALGIFPAL[i][2];
};
i=__ILWS_WriteGIF(stdout,data,w,h,rm,gm,bm,256,0,transparencyindex,"libwebserver export gif (xvgifwr.c)");
return i;
};
/*********************************************************************************************************/
/*
* an util to write with format on client_nodes
*/
void __ILWS_web_client_writef(struct web_client *node,const char *fmt,...) {
va_list args;
char buf[WRITEMAX];
va_start(args,fmt);
vsnprintf(buf,512,fmt,args);
va_end(args);
#ifdef HAVE_OPENSSL
if(node->ssl!=NULL) {
SSL_write(node->ssl,buf,strlen(buf));
} else {
send(node->socket,buf,strlen(buf),0);
};
#else
send(node->socket,buf,strlen(buf),0);
#endif
}
/*********************************************************************************************************/
/*
* function "web_client_setcookie" (improved on 0.5.1) to be called what ever were over handler function
*
* name = Name of the cookie
* value = Value of the cookie
* timeout = Timeout in second from current time on
* (0 = Until end of session)
* (-1 = Delete cookie)
* path = Subset of URLs in a domain for which the cookie is valid
* (If the path is not specified (path == NULL), it as assumed to be
* the same path as the document being described by the header which
* contains the cookie.)
* domain = Domain the cookie is valid for
* (If the domain is not set (domain == NULL), the default value of
* domain is the host name of the server which generated the cookie
* response.)
* secure = If a cookie is marked secure (secure == 1), it will only be
* transmitted if the communications channel with the host is a
* secure one. Currently this means that secure cookies will only be
* sent to HTTPS (HTTP over SSL) servers.
* (If secure is not specified (secure == 0), a cookie is considered
* safe to be sent in the clear over unsecured channels. )
*/
void web_client_setcookie(char *name, char *value, char *timeoutf, char *path, char *domain, int secure) {
char *tmp1=timeoutf;
long toffset=0;
time_t secs; // to time offset
int timeout;
int offset=(current_web_client->cookies!=NULL)?strlen(current_web_client->cookies):0;
if(timeoutf==NULL) {
timeout=0;
} else if (!strcmp(timeoutf,"DEL")){
timeout=-1;
} else {
while(*tmp1) {
if(*tmp1=='S')toffset=1; // seconds
if(*tmp1=='M')toffset=60; // minutes
if(*tmp1=='H')toffset=60*60; // hours
if(*tmp1=='d')toffset=60*60*24; // days
if(*tmp1=='m')toffset=60*60*24*30; // Month
if(*tmp1=='y')toffset=60*60*24*365; // years
tmp1++;
};
timeout=atoi(timeoutf)*toffset;
};
if (timeout < 0){
current_web_client->cookies=__ILWS_realloc(current_web_client->cookies,offset+59+strlen(name));
snprintf(current_web_client->cookies+offset,59+strlen(name),"Set-Cookie: %s=deleted; expires=%s", name, __ILWS_date(time(NULL)-31536001,"%a, %d-%b-%Y %H:%M:%S GMT"));
offset+=59+strlen(name);
}else{
current_web_client->cookies=__ILWS_realloc(current_web_client->cookies,offset+14+strlen(name)+strlen(value));
snprintf(current_web_client->cookies+offset,14+strlen(name)+strlen(value),"Set-Cookie: %s=%s", name, value);
offset+=13+strlen(name)+strlen(value);
if (timeout != 0){
//timeout += timezone; Hilobok Andrew (han@km.if.ua) removed this and use gmtime (thanks)
// exchanged by mktime(gmtime(&secs))
current_web_client->cookies=__ILWS_realloc(current_web_client->cookies,offset+40);
secs=time(NULL);
snprintf(current_web_client->cookies+offset,40,"; expires=%s", __ILWS_date(mktime(gmtime(&secs))+timeout,"%a, %d-%b-%Y %H:%M:%S GMT"));
offset+=39;
}
if (path != NULL && *path!=0) {
current_web_client->cookies=__ILWS_realloc(current_web_client->cookies,offset+8+strlen(path));
snprintf(current_web_client->cookies+offset,8+strlen(path),"; path=%s", path);
offset+=7+strlen(path);
}
if (domain != NULL && *domain!=0){
current_web_client->cookies=__ILWS_realloc(current_web_client->cookies,offset+10+strlen(domain));
snprintf(current_web_client->cookies+offset,10+strlen(domain),"; domain=%s", domain);
offset+=9+strlen(domain);
};
if (secure == 1) {
current_web_client->cookies=__ILWS_realloc(current_web_client->cookies,offset+9);
snprintf(current_web_client->cookies+offset,9,"; secure");
offset+=8;
};
}
current_web_client->cookies=__ILWS_realloc(current_web_client->cookies,offset+3);
snprintf(current_web_client->cookies+offset,3,"\r\n"); // '\0' included
offset+=2;
// fprintf(stderr,"current_web_client->cookies=\"%s\"\n",current_web_client->cookies); // DEBUG TO REMOVE
}
/*
* function "web_client_deletecookie"
*
* name = Name of the cookie to delete
*/
void web_client_deletecookie(char *name){
web_client_setcookie(name, NULL, "DEL", NULL, NULL, 0);
}
int web_client_setvar(char *name,char *value) {
return __ILWS_add_var(current_web_client->varlist,name,value);
};
char *web_client_getvar(char *name) {
return __ILWS_get_var(current_web_client->varlist,name);
};
int web_client_delvar(char *name) {
return __ILWS_del_var(current_web_client->varlist,name);
};
/***************
* variables
***************/
// prepare this to work in another file var.c
struct web_var *__ILWS_init_var_list() {
struct web_var *ret;
if(!(ret=__ILWS_malloc(sizeof(struct web_var)))) {
LWSERR(LE_MEMORY);
return NULL;
};
ret->name=NULL;
ret->value=NULL;
ret->next=NULL;
return ret;
};
int __ILWS_add_var(struct web_var *list, char *name, char *value) {
struct web_var *node=list;
int namesize=strlen(name);
int valuesize=strlen(value);
while(node->next!=NULL) {
if(!strcmp(node->next->name,name)) {
return 0;
};
node=node->next;
};
if(!(node->next=__ILWS_malloc(sizeof(struct web_var)))) {
LWSERR(LE_MEMORY);
return 0;
};
if(!(node->next->name=__ILWS_malloc(namesize+1))) {
LWSERR(LE_MEMORY);
return 0;
};
memcpy(node->next->name,name,namesize);
node->next->name[namesize]=0;
if(!(node->next->value=__ILWS_malloc(valuesize+1))) {
LWSERR(LE_MEMORY);
return 0;
};
memcpy(node->next->value,value,valuesize);
node->next->value[valuesize]=0;
node->next->next=NULL;
return 1;
};
int __ILWS_del_var(struct web_var *list, char *name) {
struct web_var *node=list;
struct web_var *tmp;
while(node->next!=NULL) {
if(!strcmp(node->next->name,name)) {
tmp=node->next;
node->next=node->next->next;
__ILWS_free(tmp->name);
__ILWS_free(tmp->value);
__ILWS_free(tmp);
return 1;
};
};
return 0;
};
void __ILWS_delete_var_list(struct web_var *list) {
struct web_var *node=list;
struct web_var *tmp;
while(node->next!=NULL) {
tmp=node->next;
node->next=node->next->next;
__ILWS_free(tmp->name);
__ILWS_free(tmp->value);
__ILWS_free(tmp);
};
__ILWS_free(node);
};
char *__ILWS_get_var(struct web_var *list , char *name) {
struct web_var *node=list;
while(node->next!=NULL) {
if(!strcmp(node->next->name,name)) {
return node->next->value;
};
node=node->next;
};
return "";
};
/****************************
* give mime by ext (mime file declared on server)
*/
void web_client_contenttype(char *ext) {
FILE *mimefileh;
char *mimedata;
char *mimeline;
size_t extsize;
size_t mimesize;
char *tmp;
/* -- mime */
int isok=0;
size_t i;
if(ext==NULL || current_web_server->mimefile==NULL) {
printf("Content-type: text/plain\r\n\r\n"); // <- mime type, change this calculating mime with extension
} else {
extsize=strlen(ext);
if((mimefileh=fopen(current_web_server->mimefile,"r"))) {
// retrieve file size
fseek(mimefileh,SEEK_END,SEEK_END);
mimesize=ftell(mimefileh);
fseek(mimefileh,0,SEEK_SET);
//
// malloc and read data
mimedata=__ILWS_malloc(mimesize+1);
fread(mimedata,1,mimesize,mimefileh);
fclose(mimefileh); // close file
//
for(i=0;i<mimesize;i++)if(mimedata[i]=='\t')mimedata[i]=' '; // translate \t to 1 space
mimedata[mimesize]=0;
isok=0;
mimeline=strtok(mimedata,"\n");
while((mimeline=strtok(NULL,"\n")) && !isok) {
if(mimeline[0]!='#') { // is not a comment
tmp=mimeline;
while((tmp=strstr(tmp,ext)) && !isok) {
//fprintf(stderr,"extsize(%d),found in %s (%s) %x\n",extsize,mimeline,tmp,tmp[extsize]);
if(tmp[-1]==' ' && (tmp[extsize]==' ' || tmp[extsize]=='\0') ) {
if((tmp=strchr(mimeline,' '))) { // the first space?
tmp[0]='\0';
//fprintf(stderr,"content is: %s\n",mimeline);
printf("Content-type: %s\r\n\r\n",mimeline);
isok=1;
};
};
tmp+=extsize;
};
};
};
if(!isok) {
printf("Content-type: text/plain\r\n\r\n");
};
//printf("%s\n",tmp);
__ILWS_free(mimedata);
};
};
};
/**********************************
* internal directory generator
*/
int __ILWS_lws_list(char *inpath) {
/* for type directory */
/* mime*/
char *ext;
struct dirent *dire;
DIR *cd;
struct stat cfstat;
char *dirpath=NULL;
char *filepath;
char *tmp;
char *readfile;
float filesize;
char filesizeu;
////
//printf("ClientInfo->request=<B>%s</B><BR>\n",ClientInfo->request);
//readfile=__ILWS_malloc(strlen(ClientInfo->request)+1);
readfile=ClientInfo->request;
while((tmp=strstr(readfile,"./"))) { // this skip ../ also
readfile=tmp+1;
};
while((tmp=strstr(readfile,"//"))) {
readfile=tmp+1;
};
tmp=strstr(readfile,"/");
if(tmp!=NULL) {
readfile=tmp+1; // must be in the first
};
// skip beind dir
if(strlen(readfile)) {
filepath=__ILWS_malloc(strlen(inpath)+strlen(readfile)+3);
snprintf(filepath,strlen(inpath)+strlen(readfile)+2,"%s%s%s",inpath,(inpath[strlen(inpath)-1]=='/')?"":"/",readfile);
//printf("pum ->%s<BR>\n",filepath);
if(readfile[strlen(readfile)-1]=='/') {
dirpath=__ILWS_malloc(strlen(filepath)+1);
memcpy(dirpath,filepath,strlen(filepath)+1); // the 0 included
} else {
if(!stat(filepath,&cfstat)) { // file must exist
if((cfstat.st_mode & S_IFDIR) != S_IFDIR) {
// search for mime
ext=strrchr(filepath,'.');
tmp=strrchr(filepath,'/');
ext+=1;
if(ext<=tmp) { // is not a extension
ext=NULL;
};
//Wed, 22 Oct 2003 16:04:04 GMT
printf("Last-Modified: %s\r\n",__ILWS_date(mktime(gmtime(&cfstat.st_mtime)),"%a, %d %b %Y %H:%M:%S GMT")); // new on 0.5.3
web_client_contenttype(ext);
web_client_addfile(filepath); // fopen and write, maybe?
__ILWS_free(filepath);
return 1;
} else {
web_client_HTTPdirective("HTTP/1.1 404 File Not Found");
printf("Content-type: text/html\r\n\r\n<HTML><title>file not found</title><body bgcolor=FFFFFF><font size=6>404 FILE NOT FOUND</font><BR><BR><small>The request \"%s\" wasn't found, try this <a href='%s/'>link</a></small><BR><HR><small><i>%s</i></small></body></html>\n\r",filepath,ClientInfo->request,_libwebserver_version);
__ILWS_free(filepath);
return 0;
};
}else {
web_client_HTTPdirective("HTTP/1.1 404 File Not Found");
printf("Content-type: text/html\r\n\r\n<HTML><title>file not found</title><body bgcolor=FFFFFF><font size=6>404 FILE NOT FOUND</font><BR><BR><small>The request \"%s\" wasn't found</small><BR><HR><small><i>%s</i></small></body></html>\n\r",filepath,_libwebserver_version);
__ILWS_free(filepath);
return 0;
};
};
__ILWS_free(filepath);
};
//printf("Content-type: text/html\r\n\r\n");
//fprintf(stderr,"dirpath=%s inpath=%s\n",dirpath,inpath);
if(dirpath==NULL) {
dirpath=__ILWS_malloc(strlen(inpath)+1);
memcpy(dirpath,inpath,strlen(inpath)+1);
};
cd=opendir(dirpath);
if(cd!=NULL) {
printf("Content-type: text/html\r\n\r\n");
printf("<HTML><HEAD><TITLE>Contents of %s</TITLE></HEAD><BODY>\n",dirpath);
printf("<h1>Contents of directory %s</h1><HR>\n",dirpath);
printf("<form><input type=text name=match value=\"%s\"><input type=submit name='send' value='wildcard'></form>\n",strlen(ClientInfo->Query("match"))?ClientInfo->Query("match"):"*");
printf("<PRE>\n");
while((dire=readdir(cd))) {
if( ((dire->d_name[0]!='.') || (strcmp(dirpath,inpath) && !strcmp(dire->d_name,".."))) && (!fnmatch(ClientInfo->Query("match"),dire->d_name,0) || !strlen(ClientInfo->Query("match"))) ) {
filepath=__ILWS_malloc(strlen(dirpath)+strlen(dire->d_name)+2);
snprintf(filepath,strlen(dirpath)+strlen(dire->d_name)+2,"%s%s%s",dirpath,(dirpath[strlen(dirpath)-1]=='/')?"":"/",dire->d_name);
//fprintf(stderr,"filename=%s\n",filepath);
if(!stat(filepath,&cfstat)) {
if((cfstat.st_mode & S_IFDIR) == S_IFDIR) {
printf("%s &lt;DIR&gt; <a href=\"%s/\">%s</a>\n",__ILWS_date(cfstat.st_mtime,"%a, %d %b %Y %H:%M"),dire->d_name,dire->d_name);
}else {
filesize=(float)cfstat.st_size;
filesizeu=0;
while(filesize>1024) {
filesize/=1024;
filesizeu++;
};
printf("%s %.1f%c <a href=\"%s\">%s</a>\n",__ILWS_date(cfstat.st_mtime,"%a, %d %b %Y %H:%M"),filesize,(filesizeu==2)?'M':(filesizeu==1)?'K':'b',dire->d_name,dire->d_name);
};
};
__ILWS_free(filepath);
};
};
printf("</PRE>\n");
printf("<HR>\n");
printf("<address>%s</address>\n",_libwebserver_version);
printf("</BODY></HTML>\r\n");
__ILWS_free(dirpath);
closedir(cd);
} else {
web_client_HTTPdirective("HTTP/1.1 404 File Not Found");
printf("Content-type: text/html\r\n\r\n<HTML><title>file not found</title><body bgcolor=FFFFFF><font size=6>404 FILE NOT FOUND</font><BR><BR><small>The request \"%s\" wasn't found</small><BR><HR><small><i>%s</i></small></body></html>\n\r",dirpath,_libwebserver_version);
return 0;
};
return 1;
};
+159
View File
@@ -0,0 +1,159 @@
/* Copyrights 2002 Luis Figueiredo (stdio@netc.pt) All rights reserved.
*
* See the LICENSE file
*
* The origin of this software must not be misrepresented, either by
* explicit claim or by omission. Since few users ever read sources,
* credits must appear in the documentation.
*
* date: Sat Mar 30 14:44:42 GMT 2002
*
*
* --
*
*/
#ifndef _CLIENT_H_
#define _CLIENT_H_
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#ifdef HAVE_OPENSSL
#include <openssl/rsa.h> /* SSLeay stuff */
#include <openssl/crypto.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
#endif
#include "socket.h"
#include "memory.h"
#include "outstream.h"
#include "gethandler.h"
#include "weblog.h"
#include "utils.h"
#include "fnmatch.h"
#include "outgif.h"
#include "error.h"
#include "debug.h"
#include "clientinfo.h"
#ifdef WIN32
#include "flock.h" // my flock
#include "dirent.h"
#else
#include <sys/file.h> // for flock
#include <dirent.h>
#endif
#define READMAX 100000 // 1Mb upload
#define WRITEMAX 100000 // 1Mb download 1mb per client? // smaller is better for multi read bigger is better for big downloads
#define MAXURLSIZE 2000 //
extern int WEBTIMEOUT; //to be changed externaly
//#define WEBTIMEOUT 10000 // TIMEOUT WITHOUT RECEIVING DATA (not in seconds but in read tries)
struct web_var {
char *name;
char *value;
struct web_var *next;
};
struct web_client {
int socket;
struct sockaddr_in sa;
unsigned int salen;
char *HTTPdirective;
unsigned char stat; /* 0001b idle,0010b down streaming, 0011 done down streaming, 0100b out streaming,0101 done out streaming */
// Read control
char *rbuf;
unsigned long rbufsize;
int newdata_try;
unsigned long contentlength; // for read propose (optimize speed 0.5.1)
unsigned long headersize;
// Write control
struct outstream *outstream;
struct web_var *varlist;
char *cookies; // cookie header (0.5.1)
long writelength;
long readsize;
long range;
int skipped;
long wheadersize;
// clock_t oldcl,curcl;
#ifdef HAVE_OPENSSL
SSL *ssl;
X509* cert;
#else
void *pad[2];
#endif
struct web_client *next;
};
extern struct web_client *current_web_client;
struct web_client *__ILWS_init_client_list();
int __ILWS_add_client(struct web_client *,struct web_client *);
void __ILWS_delete_next_client(struct web_client *);
void __ILWS_delete_client_list(struct web_client *);
void __ILWS_read_client(struct web_client *);
void __ILWS_process_client(struct web_client *,struct gethandler *);
void __ILWS_output_client(struct web_client *);
void __ILWS_web_client_writef(struct web_client *,const char *,...);
int web_client_addfile(char *);
void web_client_contenttype(char *); // new on 0.5.2
void web_client_gifsetpalette(const char *);
extern unsigned char __ILWS_GLOBALGIFPAL[256][3];
int web_client_gifoutput(char *,int,int,int);
void web_client_HTTPdirective(char *);
char *__ILWS_web_client_getreqline();
char *__ILWS_web_client_getreq();
// new (0.5.1)
int web_client_setvar(char *,char *);
char *web_client_getvar(char *);
int web_client_delvar(char *);
// put in var.h
struct web_var *__ILWS_init_var_list();
int __ILWS_add_var(struct web_var *, char *, char *);
int __ILWS_del_var(struct web_var *, char *);
void __ILWS_delete_var_list(struct web_var *);
char *__ILWS_get_var(struct web_var *list , char *name);
int __ILWS_lws_list(char *); // new on 0.5.2
#endif
+1124
View File
@@ -0,0 +1,1124 @@
/* Copyrights 2002 Luis Figueiredo (stdio@netc.pt) All rights reserved.
*
* See the LICENSE file
*
* The origin of this software must not be misrepresented, either by
* explicit claim or by omission. Since few users ever read sources,
* credits must appear in the documentation.
*
* date: Wed Oct 9 19:56:22 GMT 2002
*
* -- parse http header into "ClientInfo"
*
*/
#include "clientinfo.h"
struct ClientInfo *ClientInfo; // tochange
/*********************************************************************************************************/
/*
* Initialize ClientInfo structure
*/
void __ILWS_init_clientinfo() {
char *t;
struct outstream *tstream=current_web_client->outstream;
ClientInfo=__ILWS_malloc(sizeof(struct ClientInfo));
if(ClientInfo==NULL) {
LWSERR(LE_MEMORY);
return;
};
while(tstream->next!=NULL) {
tstream=tstream->next;
};
if(tstream->fstream!=NULL) ClientInfo->outfd=fileno(tstream->fstream); //take it off?
ClientInfo->mem=__ILWS_init_buffer_list(); // First thing, other fuctions use this to allocate
ClientInfo->request=__ILWS_clientinfo_getreqname();
ClientInfo->inetname=NULL;
t=inet_ntoa(current_web_client->sa.sin_addr);
if((ClientInfo->inetname=__ILWS_add_buffer(ClientInfo->mem,strlen(t)+1))) {
memcpy(ClientInfo->inetname,t,strlen(t));
ClientInfo->inetname[strlen(t)]='\0';
};
ClientInfo->method=__ILWS_clientinfo_getmethod();
ClientInfo->user=__ILWS_clientinfo_getauthuser();
ClientInfo->pass=__ILWS_clientinfo_getauthpass();
/* Initialize List's */
ClientInfo->HeaderList=NULL;
ClientInfo->QueryList=NULL;
ClientInfo->PostList=NULL;
ClientInfo->MultiPartList=NULL;
ClientInfo->CookieList=NULL;
ClientInfo->Header=__ILWS_Header;
ClientInfo->Query=__ILWS_Query;
ClientInfo->QueryString=__ILWS_clientinfo_getquerystring();
ClientInfo->Post=__ILWS_Post;
ClientInfo->PostData=__ILWS_clientinfo_getpostdata();
ClientInfo->MultiPart=__ILWS_MultiPart;
ClientInfo->Cookie=__ILWS_Cookie;
ClientInfo->Conf=__ILWS_Conf;
ClientInfo->CookieString=__ILWS_Header("Cookie");
}
/*********************************************************************************************************/
/*
* Free ClientInfo structure
*/
void __ILWS_free_clientinfo() {
if(ClientInfo==NULL) {
return;
};
__ILWS_delete_buffer_list(ClientInfo->mem);
__ILWS_free(ClientInfo);
ClientInfo=NULL;
}
/*********************************************************************************************************/
/*
* Header function for ClientInfo->Header("x")
*/
char *__ILWS_Header(char *str) {
char *tmp1,*tmp2,*tmp3,*ret;
struct _Header *hl=ClientInfo->HeaderList;
char *defret="";
size_t size;
size_t strsize;
if(str==NULL) { // request is null return whole header
return current_web_client->rbuf;
};
if(ClientInfo->HeaderList==NULL) {
ClientInfo->HeaderList=__ILWS_add_buffer(ClientInfo->mem,sizeof(struct _Header));
if(ClientInfo->HeaderList==NULL) {
LWSERR(LE_MEMORY);
return defret;
};
ClientInfo->HeaderList->next=NULL;
ClientInfo->HeaderList->data=NULL;
ClientInfo->HeaderList->id=NULL;
hl=ClientInfo->HeaderList;
};
// First search if exists
while(hl->next!=NULL) {
if(hl->next->id!=NULL) {
if(!strcmp(hl->next->id,str)) {
return hl->next->data;
};
};
hl=hl->next;
};
/* Doesn't exists */
strsize=strlen(str);
if(!(hl->next=__ILWS_add_buffer(ClientInfo->mem,sizeof(struct _Header)))) {
LWSERR(LE_MEMORY);
return defret;
};
if(!(hl->next->id=__ILWS_add_buffer(ClientInfo->mem,strsize+1))) {
LWSERR(LE_MEMORY);
return defret;
};
memcpy(hl->next->id,str,strsize);
hl->next->id[strsize]=0;
hl->next->data=defret;
hl->next->next=NULL;
if(!(tmp3=__ILWS_malloc(strsize+3))) {
LWSERR(LE_MEMORY);
return defret;
};
snprintf(tmp3,strsize+3,"%s: ",str);
tmp1=__ILWS_stristr(current_web_client->rbuf,tmp3);
__ILWS_free(tmp3);
if(tmp1==NULL) {
return defret;
};
tmp1+=strsize+2;
if(!(tmp2=strstr(tmp1,"\r\n"))) { // Unexpected (security anyway)
return defret;
};
if((size=(unsigned int)(tmp2-tmp1))<0) {
return defret;
};
if(!(ret=__ILWS_add_buffer(ClientInfo->mem,size+1))) { //malloc & register
return defret;
};
memcpy(ret,tmp1,size);
ret[size]=0;
hl->next->data=ret;
return ret;
}
/*********************************************************************************************************/
/*
* Function for Querydata
*/
char *__ILWS_Query(char *handle) {
char *tmp1,*tmp2,*tmp3,*tmp4,*ret;
char *defret="";
size_t strsize;
size_t size;
int j=0,ch;
int seek=1;
unsigned int i;
unsigned int *iddb=NULL;
unsigned int *iddb2=NULL;
unsigned int idf=0;
int rw=0; // 0 data 1 number of vars; (return what?)
struct _Query *ql=ClientInfo->QueryList;
if(handle==NULL) {
return ClientInfo->QueryString;
};
if(handle[0]=='#') rw=1;
// allocate first node from the list
if(ClientInfo->QueryList==NULL) {
ClientInfo->QueryList=__ILWS_add_buffer(ClientInfo->mem,sizeof(struct _Query));
if(ClientInfo->QueryList==NULL) {
LWSERR(LE_MEMORY);
if(rw) return 0;
return defret;
};
ClientInfo->QueryList->next=NULL;
ClientInfo->QueryList->data=NULL;
ClientInfo->QueryList->id=NULL;
ql=ClientInfo->QueryList;
};
// done allocating
// First search if exists and fetch values;
idf=1;
iddb=&idf;
seek=1;
while(ql->next!=NULL) {
if(ql->next->id!=NULL) {
if(!strcmp(ql->next->id,handle+rw) && *iddb >= 0) {
if(seek==1) {
iddb=&ql->next->index; // atribute iddb to first node
iddb2=&ql->next->idf; // atribute iddb2 to counting
if(rw) return (char *)*iddb2;
if(ql->next->idf==1) {
return ql->next->data;
};
j=*iddb;
seek++;
};
*iddb=*iddb-1;
if(*iddb<=0) {
*iddb=j-1;
if(j<=1) {
*iddb=*iddb2; // go to start if any
//return defret; // to be null
};
return ql->next->data; // Return existent
};
};
};
ql=ql->next;
};
/* Doesn't exists */
strsize=strlen(handle+rw);
tmp1=strstr(current_web_client->rbuf,"?");
tmp3=strstr(current_web_client->rbuf," HTTP"); // End of GET header
if(tmp1!=NULL && tmp1<tmp3) {
tmp1+=1;
} else {
if(rw)return 0;
return defret;
}
// Working here
idf=0;
ret=defret;
seek=1;
tmp4=tmp1;
while(seek==1) {
tmp1=tmp4;
do {
tmp2=strstr(tmp1,handle+rw);
if(tmp2==NULL) { // must be nonnull
if(iddb!=NULL && iddb2!=NULL) { // if iddb2 is null then is just one value;
*iddb2=*iddb;
if(!rw)*iddb=*iddb-1;
};
if(rw) {
if(ret==defret) return 0;
return (char *)*iddb2;
}
return ret; // if first null return defret (ret=defret);
};
tmp1=tmp2+strsize;
} while ((tmp2[-1]!='?' && tmp2[-1]!='&') || tmp2[strsize]!='='); // Johannes E. Schindelin Fix
if(tmp3<tmp2) {
if(iddb!=NULL && iddb2!=NULL) {
*iddb2=*iddb;
if(!rw)*iddb=*iddb-1;
};
if(rw) {
if(ret==defret) return 0;
return (char *)*iddb2;
}
return ret;
};
tmp4=tmp1;
// if not null, so add an node;
// Working here ^
ql->next=__ILWS_add_buffer(ClientInfo->mem,sizeof(struct _Query));
if(ql->next==NULL) {
LWSERR(LE_MEMORY);
if(handle[0]=='#') rw=1;
return defret;
};
ql->next->id=__ILWS_add_buffer(ClientInfo->mem,strsize+1);
if(ql->next->id==NULL) {
LWSERR(LE_MEMORY);
if(handle[0]=='#') rw=1;
return defret;
};
memcpy(ql->next->id,handle+rw,strsize);
ql->next->id[strsize]=0;
if(idf==0) {
ql->next->index=0;
iddb=&ql->next->index;
iddb2=&ql->next->idf; // second holds information about number of fetchs;
};
ql->next->data=defret;
ql->next->next=NULL;
tmp1=strstr(tmp2,"&"); // tmp1 goes to next '&'
tmp2+=strsize+1; // tmp2 goes to start of data
tmp3=strstr(tmp2," HTTP"); // tmp3 goes to the end of Get header
if(tmp1==NULL || ((unsigned int)tmp1>(unsigned int)tmp3)) {
size=tmp3-tmp2; // MUST HAVE (" HTTP") else, server don't let in
} else {
size=tmp1-tmp2;
};
if(size<1) {
if(handle[0]=='#') rw=1;
return defret;
};
ql->next->data=__ILWS_add_buffer(ClientInfo->mem,size+1);
if(ql->next->data==NULL) {
LWSERR(LE_MEMORY);
if(handle[0]=='#') rw=1;
return defret;
};
j=0;
for(i=0;i<size;i++) { // Hex translation here
switch (ch=tmp2[j]) {
case '+':
ch=' ';
break;
case '%':
tmp1=__ILWS_malloc(3);
if(tmp1==NULL) {
LWSERR(LE_MEMORY);
if(rw) return 0;
return defret;
};
strncpy(tmp1,&tmp2[j+1],2);
tmp1[2]=0;
ch=strtol(tmp1,NULL,16);
j+=2;
size-=2;
__ILWS_free(tmp1);
break;
};
ql->next->data[i]=ch;
j++;
};
ql->next->data[size]='\0';
ret=ql->next->data; // to the last
ql=ql->next;
*iddb=*iddb+1;
idf++;
};
return ret;
}
/*********************************************************************************************************/
/*
* Function for Postdata
*/
char *__ILWS_Post(char *handle) {
char *tmp1,*tmp2,*tmp3,*ret;
struct _Post *pl=ClientInfo->PostList;
char *defret="";
int *iddb=NULL,*iddb2=NULL;
int idf;
int seek=1;
size_t strsize;
size_t size;
int j=0,ch;
unsigned int i;
int rw=0; //return what;
tmp1=strstr(current_web_client->rbuf,"Content-type: multipart/form-data"); // multipart this post doesn't work
if(tmp1!=NULL) {
return ClientInfo->MultiPart(handle).data;
};
if(handle==NULL) {
return ClientInfo->PostData;
};
if(handle[0]=='#')rw=1;
/* Allocate the list */
if(ClientInfo->PostList==NULL) {
if(!(ClientInfo->PostList=__ILWS_add_buffer(ClientInfo->mem,sizeof(struct _Post)))) {
LWSERR(LE_MEMORY);
if(rw) return 0;
return defret;
};
ClientInfo->PostList->next=NULL;
ClientInfo->PostList->data=NULL;
ClientInfo->PostList->id=NULL;
pl=ClientInfo->PostList;
};
// First search if exists
idf=1;
iddb=&idf;
seek=1;
while(pl->next!=NULL) {
if(pl->next->id!=NULL) {
if(!strcmp(pl->next->id,handle+rw) && iddb>=0) {
if(seek==1) {
iddb=&pl->next->index;
iddb2=&pl->next->idf;
if(rw) return (char *)(*iddb2);
if(pl->next->idf==1) {
return pl->next->data;
};
j=*iddb;
seek++;
};
*iddb=*iddb-1;
if(*iddb<=0) {
*iddb=j-1;
if(j<=1) {
*iddb=*iddb2;
//return defret;
};
return pl->next->data;
};
};
};
pl=pl->next;
};
/* Doesn't exists */
strsize=strlen(handle+rw);
tmp1=strstr(current_web_client->rbuf,"\r\n\r\n");
if(tmp1!=NULL)
tmp1+=4;
else {
if(rw) return 0;
return defret;
};
idf=0;
ret=defret;
seek=1;
tmp3=tmp1;
while(seek==1) {
tmp1=tmp3;
do {
tmp2=strstr(tmp1,handle+rw);
if(tmp2==NULL) { // mustn't be null
if(iddb!=NULL && iddb2!=NULL) { // if iddb2 is null then is just one value;
*iddb2=*iddb;
if(!rw)*iddb=*iddb-1;
};
if(rw) {
if(ret==defret) return 0;
return (char *)*iddb2;
}
return ret; // if first null return defret (ret=defret);
};
tmp1=tmp2+strsize;
} while ((tmp2[-1]!='\n' && tmp2[-1]!='&') || tmp2[strsize]!='='); // Johannes E. Schindelin Fix
tmp3=tmp1;
pl->next=__ILWS_add_buffer(ClientInfo->mem,sizeof(struct _Post));
if(pl->next==NULL) {
LWSERR(LE_MEMORY);
if(rw) return 0;
return defret;
};
pl->next->id=__ILWS_add_buffer(ClientInfo->mem,strsize+1);
if(pl->next->id==NULL) {
LWSERR(LE_MEMORY);
if(rw) return 0;
return defret;
};
memcpy(pl->next->id,handle+rw,strsize);
pl->next->id[strsize]=0;
if(idf==0) {
pl->next->index=0;
iddb=&pl->next->index;
iddb2=&pl->next->idf;
};
pl->next->data=defret;
pl->next->next=NULL;
tmp1=strstr(tmp2,"&"); // goes to the next & (end of data)
tmp2+=strsize+1; // tmp2 goes to start of data
if(tmp1==NULL) {
size=strlen(tmp2);
} else {
size=tmp1-tmp2;
};
if(size==0) {
if(rw) return 0;
return defret;
};
pl->next->data=__ILWS_add_buffer(ClientInfo->mem,size+1);
if(pl->next->data==NULL) {
LWSERR(LE_MEMORY);
return defret;
};
j=0;
for(i=0;i<size;i++) { // hex translation here
switch (ch=tmp2[j]) {
case '+':
ch=' ';
break;
case '%':
tmp1=__ILWS_malloc(3);
if(tmp1==NULL) {
LWSERR(LE_MEMORY);
if(rw) return 0;
return defret;
};
strncpy(tmp1,&tmp2[j+1],2);
tmp1[2]=0;
ch=strtol(tmp1,NULL,16);
j+=2;
size-=2;
__ILWS_free(tmp1);
break;
};
pl->next->data[i]=ch;
j++;
};
pl->next->data[size]='\0';
ret=pl->next->data; // to the last
*iddb=*iddb+1;
idf++;
pl=pl->next;
//pl->next->data=ret;
};
return ret;
}
/*********************************************************************************************************/
/*
* Function for MultiPart formdata
*/
struct _MultiPart __ILWS_MultiPart(char *handle) {
char *tmp1,*tmp2,*tmp3;
int i;
char *name;
size_t namesize;
struct _MultiPart *ml=ClientInfo->MultiPartList;
struct _MultiPart defret={"","",0,""};
size_t strsize;
char *boundary; size_t boundarysize;
// IE C43o6Fn6Et74e65n6Et74-2DT54y79p70e65:3A 20m6Du75l6Ct74i69p70a61r72t74/2Ff66o6Fr72m6D-2Dd64a61t74a61
// NS C43o6Fn6Et74e65n6Et74-2Dt74y79p70e65:3A 20m6Du75l6Ct74i69p70a61r72t74/2Ff66o6Fr72m6D-2Dd64a61t74a61
tmp1=__ILWS_stristr(current_web_client->rbuf,"Content-type: multipart/form-data");
if(tmp1==NULL) return defret;
if(ClientInfo->MultiPartList==NULL) {
ClientInfo->MultiPartList=__ILWS_add_buffer(ClientInfo->mem,sizeof(struct _MultiPart));
if(ClientInfo->MultiPartList==NULL) {
LWSERR(LE_MEMORY);
return defret;
};
ClientInfo->MultiPartList->next=NULL;
ClientInfo->MultiPartList->id=NULL;
ClientInfo->MultiPartList->data=NULL;
ClientInfo->MultiPartList->filename=NULL;
ClientInfo->MultiPartList->size=0;
ml=ClientInfo->MultiPartList;
};
// Check if handle exists
while(ml->next!=NULL) {
if(ml->next->id!=NULL) {
if(!strcmp(ml->next->id,handle)) {
return *ml->next;
};
};
ml=ml->next;
};
strsize=strlen(handle);
ml->next=__ILWS_add_buffer(ClientInfo->mem,sizeof(struct _MultiPart));
if(ml->next==NULL) {
LWSERR(LE_MEMORY);
return defret;
};
ml->next->id=__ILWS_add_buffer(ClientInfo->mem,strsize+1);
if(ml->next->id==NULL) {
LWSERR(LE_MEMORY);
return defret;
};
memcpy(ml->next->id,handle,strsize);
ml->next->id[strsize]=0;
ml->next->data="";
ml->next->filename="";
ml->next->size=0;
ml->next->next=NULL;
tmp1=strstr(tmp1,"boundary=");
if(tmp1==NULL) return defret;
tmp1+=9;
tmp2=strstr(tmp1,"\r\n");
if(tmp2<tmp1 || tmp2==NULL) return defret;
/* boundary */
boundarysize=tmp2-tmp1;
boundary=__ILWS_add_buffer(ClientInfo->mem,boundarysize+3);
if(boundary==NULL) {
LWSERR(LE_MEMORY);
return defret;
};
memcpy(boundary,tmp1,boundarysize);
boundary[boundarysize]=0;
/* handle */
namesize=boundarysize+41+strlen(handle);
name=__ILWS_add_buffer(ClientInfo->mem,namesize+1);
if(name==NULL) {
LWSERR(LE_MEMORY);
return defret;
};
snprintf(name,namesize,"%s\r\nContent-Disposition: form-data; name=",boundary);
namesize=strlen(name);
tmp1=strstr(tmp1,"\r\n\r\n"); // go to data
if(tmp1==NULL) return defret;
do {
i=memcmp(tmp1,name,namesize);
if(i==0) {
tmp1+=namesize;
if(tmp1[0]=='\"')tmp1+=1;
if(strncmp(tmp1,handle,strlen(handle))){
i=1;
}else {
if((tmp1[strsize]!=' ') && (tmp1[strsize]!='\"') && (tmp1[strsize]!='\r') && (tmp1[strsize]!=';') ) i=1;
};
}else {
tmp1+=1;
};
} while(i!=0 && (tmp1+namesize<current_web_client->rbuf+current_web_client->rbufsize)); // Search init of data
if(i!=0) return defret;
//tmp1+=namesize;
tmp2=strstr(tmp1,"filename="); // get filename
if(tmp2!=NULL) {
tmp2+=9;
if(tmp2[0]=='\"')tmp2+=1;
tmp3=strstr(tmp2,"\r\n");
ml->next->filename=__ILWS_add_buffer(ClientInfo->mem,(tmp3-tmp2)+1);
if(ml->next->filename==NULL) {
LWSERR(LE_MEMORY);
return defret;
};
memcpy(ml->next->filename,tmp2,tmp3-tmp2);
ml->next->filename[tmp3-tmp2]='\0';
if(ml->next->filename[tmp3-tmp2-1]=='\"')
ml->next->filename[tmp3-tmp2-1]='\0';
};
tmp2=strstr(tmp1,"\r\n\r\n"); // data init
if(tmp2==NULL)return defret;
tmp2+=4;
tmp3=tmp2;
do {
i=memcmp(tmp3,boundary,boundarysize);
if(i!=0)tmp3+=1;
} while(i!=0 && (tmp3+boundarysize<current_web_client->rbuf+current_web_client->rbufsize)); // End of data
if(i!=0) return defret;
tmp3-=4; // back "\r\n\r\n"
// copy data to node
if(!(ml->next->data=__ILWS_add_buffer(ClientInfo->mem,(tmp3-tmp2)+1))) {
LWSERR(LE_MEMORY);
return defret;
};
memcpy(ml->next->data,tmp2,tmp3-tmp2);
ml->next->data[tmp3-tmp2]='\0';
ml->next->size=tmp3-tmp2;
return *ml->next;
};
/*********************************************************************************************************/
/*
* Function for CookieData
*/
char *__ILWS_Cookie(char *handle) {
char *defret="";
char *tmp1,*tmp2,*ret;
int size;
int strsize;
struct _Cookie *cl=ClientInfo->CookieList;
tmp1=strstr(current_web_client->rbuf,"\nCookie: "); // start of cookie string
if(tmp1==NULL) { // no cookies
return defret;
};
tmp1+=8;
if(handle==NULL) {
return ClientInfo->CookieString;
};
if(ClientInfo->CookieList==NULL) {
ClientInfo->CookieList=__ILWS_add_buffer(ClientInfo->mem,sizeof(struct _Cookie));
if(ClientInfo->CookieList==NULL) {
LWSERR(LE_MEMORY);
return defret;
};
ClientInfo->CookieList->next=NULL;
ClientInfo->CookieList->data=NULL;
ClientInfo->CookieList->id=NULL;
cl=ClientInfo->CookieList;
}
// First search if exists
while(cl->next!=NULL) {
if(cl->next->id!=NULL) {
if(!strcmp(cl->next->id,handle)) {
return cl->next->data;
};
};
cl=cl->next;
};
strsize=strlen(handle);
if(!(cl->next=__ILWS_add_buffer(ClientInfo->mem,sizeof(struct _Cookie)))) {
LWSERR(LE_MEMORY);
return defret;
};
if(!(cl->next->id=__ILWS_add_buffer(ClientInfo->mem,strsize+1))) {
LWSERR(LE_MEMORY);
return defret;
};
memcpy(cl->next->id,handle,strsize);
cl->next->id[strsize]=0;
cl->next->data=defret;
cl->next->next=NULL;
do {
tmp2=strstr(tmp1,handle);
if(tmp2==NULL) {
return defret;
}else if(tmp2[strsize]==';' && tmp2[-1]==' ') {
cl->next->data=__ILWS_add_buffer(ClientInfo->mem,6);
snprintf(cl->next->data,5,"True");
return cl->next->data;
};
tmp1=tmp2+strsize;
}while(tmp2[-1]!=' ' || tmp2[strsize]!='=');
tmp1=strstr(tmp2,";"); // end of data
tmp2+=strsize+1; // start of data
if(tmp1==NULL) {
size=strstr(tmp2,"\r")-tmp2;
} else {
size=tmp1-tmp2;
};
if(size<1) {
return defret;
};
ret=__ILWS_add_buffer(ClientInfo->mem,size+1);
if(ret==NULL) {
LWSERR(LE_MEMORY);
return defret;
};
memcpy(ret,tmp2,size);
ret[size]='\0';
cl->next->data=ret;
return cl->next->data;
};
/*********************************************************************************************************/
/*
* get whole query string
*/
char *__ILWS_clientinfo_getquerystring() {
char *tmp1,*tmp2,*ret;
char *defret="";
size_t size;
tmp1=strstr(current_web_client->rbuf,"?");
tmp2=strstr(current_web_client->rbuf,"HTTP");
if(tmp1!=NULL && tmp1<tmp2)
tmp1+=1;
else
return defret;
size=(tmp2-tmp1)-1;
ret=__ILWS_add_buffer(ClientInfo->mem,size+1);
if(ret==NULL) {
LWSERR(LE_MEMORY);
return defret;
};
memcpy(ret,tmp1,size);
ret[size]=0;
return ret;
};
/*********************************************************************************************************/
/*
* get whole post data
*/
char *__ILWS_clientinfo_getpostdata() {
char *tmp1,*ret;
char *defret="";
size_t size;
tmp1=strstr(current_web_client->rbuf,"\r\n\r\n");
if(tmp1!=NULL && (tmp1+4)<(char*)(current_web_client->rbuf+current_web_client->rbufsize))
tmp1+=4;
else
return defret;
size=(current_web_client->rbuf+current_web_client->rbufsize)-tmp1;
ret=__ILWS_add_buffer(ClientInfo->mem,size+1);
if(ret==NULL) {
LWSERR(LE_MEMORY);
return defret;
};
memcpy(ret,tmp1,size);
ret[size]='\0';
return ret;
}
/*********************************************************************************************************/
/*
* Get authorization username
*/
char *__ILWS_clientinfo_getauthuser() {
char *tmp1,*tmp2,*ret, *out=NULL;
char *defret="";
size_t size;
tmp1=strstr(current_web_client->rbuf,"Authorization: Basic");
if(tmp1==NULL) {
return defret;
};
tmp1+=21;
tmp2=strstr(tmp1,"\r\n");
if(tmp2==NULL) return defret;
size=(int)(tmp2-tmp1);
ret=__ILWS_malloc(size+1);
if(ret==NULL) {
LWSERR(LE_MEMORY);
return defret;
};
memcpy(ret,tmp1,size);
ret[size]=0;
out=__ILWS_malloc(size+1);
if(out==NULL) {
LWSERR(LE_MEMORY);
__ILWS_free(ret);
return defret;
};
size=__ILWS_base64decode(out,ret);
out[size]='\0';
__ILWS_free(ret);
tmp2=strstr(out,":");
if(tmp2==NULL) return defret;
ret=__ILWS_add_buffer(ClientInfo->mem,(tmp2-out)+1);
if(ret==NULL) {
LWSERR(LE_MEMORY);
__ILWS_free(out);
return defret;
};
memcpy(ret,out,tmp2-out);
ret[tmp2-out]=0;
__ILWS_free(out);
return ret;
}
/*********************************************************************************************************/
/*
* get authorization password
*/
char *__ILWS_clientinfo_getauthpass() {
char *tmp1,*tmp2,*ret, *out=NULL;
char *defret="";
size_t size;
tmp1=strstr(current_web_client->rbuf,"Authorization: Basic");
if(tmp1==NULL) {
return defret;
};
tmp1+=21;
tmp2=strstr(tmp1,"\r\n");
if(tmp2==NULL) return defret;
size=(int)(tmp2-tmp1);
ret=__ILWS_malloc(size+1);
if(ret==NULL) {
LWSERR(LE_MEMORY);
return defret;
};
memcpy(ret,tmp1,size);
ret[size]=0;
out=__ILWS_malloc(size+1);
if(out==NULL) {
LWSERR(LE_MEMORY);
__ILWS_free(ret);
return defret;
};
size=__ILWS_base64decode(out,ret);
out[size]='\0';
__ILWS_free(ret);
tmp1=strstr(out,":")+1;
tmp2=out+strlen(out);
ret=__ILWS_add_buffer(ClientInfo->mem,(tmp2-tmp1)+1);
if(ret==NULL) {
LWSERR(LE_MEMORY);
__ILWS_free(out);
return defret;
};
memcpy(ret,tmp1,tmp2-tmp1);
ret[tmp2-tmp1]=0;
__ILWS_free(out);
return ret;
}
/*********************************************************************************************************/
/*
* get method (GET POST HEAD etc)
*/
char *__ILWS_clientinfo_getmethod() {
char *tmp1,*ret;
char *defret="";
size_t size;
tmp1=strstr(current_web_client->rbuf," "); // first space
if(tmp1==NULL) {
return defret;
};
size=tmp1-current_web_client->rbuf;
ret=__ILWS_add_buffer(ClientInfo->mem,size+1);
if(ret==NULL) {
LWSERR(LE_MEMORY);
return defret;
};
memcpy(ret,current_web_client->rbuf,size);
ret[size]=0;
return ret;
}
/*********************************************************************************************************/
/*
* get request name (GET /taltal HTTP/1.0) returning /taltal
*/
char *__ILWS_clientinfo_getreqname() {
char *ret;
char *tmp1=strstr(current_web_client->rbuf,"/"); // Must have /
char *tmp2=strstr(tmp1,"?");
char *tmp3=strstr(tmp1," HTTP");
char *defret="";
size_t i,j;
int ch;
size_t size=0;
if(tmp1==NULL || tmp3==NULL) return defret;
if(tmp2==NULL || tmp2>tmp3) {
tmp2=tmp3;
};
//tmp1+=1;
size=tmp2-tmp1;
if(size<1)
return defret;
ret=__ILWS_add_buffer(ClientInfo->mem,size+1);
if(ret==NULL) {
LWSERR(LE_MEMORY);
return defret;
};
j=0;
for(i=0;i<size;i++) { // hex translation here
switch (ch=tmp1[j]) {
case '+':
ch=' ';
break;
case '%':
tmp2=__ILWS_malloc(3);
if(tmp2==NULL) {
LWSERR(LE_MEMORY);
return defret;
};
strncpy(tmp2,&tmp1[j+1],2);
tmp2[2]=0;
ch=strtol(tmp2,NULL,16);
j+=2;
size-=2;
__ILWS_free(tmp2);
break;
};
ret[i]=ch;
j++;
};
//pl->next->data[size]='\0';
//memcpy(ret,tmp1,size);
ret[size]=0;
return ret;
}
/*********************************************************************************************************/
/*
* Get config entry (new on 0.5.0)
*/
char *__ILWS_Conf(const char *topic,const char *key) {
struct web_server *server=current_web_server;
FILE *tmpf;
struct stat statf; // tested only on WIN
char *defret="";
char *dataconf;
char *tmp1,*tmp2,*tmp3;
long tmpsize=0;
int sizec;
// Config revive tested only on WIN
if(server->conffile!=NULL) {
stat(server->conffile,&statf);
if(statf.st_mtime>server->conffiletime) {
tmpf=fopen(server->conffile,"r");
if(tmpf!=NULL) {
free(server->dataconf);
fseek(tmpf,SEEK_SET,SEEK_END);
sizec=ftell(tmpf);
fseek(tmpf,0,SEEK_SET);
server->dataconf=malloc(sizec+1);
fread(server->dataconf,sizec,1,tmpf);
server->dataconf[sizec-9]=0; // 9 is temporary
server->conffiletime=statf.st_mtime;
fclose(tmpf);
};
};
};
dataconf=__ILWS_stristr(server->dataconf,topic);
if(dataconf==NULL) {
return defret;
};
dataconf+=strlen(topic);
do {
tmp1=__ILWS_stristr(dataconf,key);
dataconf+=1;
if(dataconf[0]==0) {
return defret;
};
if(dataconf[0]=='[' && dataconf[-1]=='\n') {
return defret;
};
}while(!(tmp1!=NULL && tmp1[-1]=='\n' && tmp1[strlen(key)]=='='));
tmp1+=strlen(key)+1;
tmp2=__ILWS_stristr(tmp1,"\n");
if(tmp2==NULL) {
tmp2=tmp1+strlen(tmp1);
};
tmpsize=tmp2-tmp1;
tmp3=__ILWS_add_buffer(ClientInfo->mem,tmpsize+1);
memcpy(tmp3,tmp1,tmpsize);
tmp3[tmpsize]=0;
return tmp3;
};
+118
View File
@@ -0,0 +1,118 @@
/* Copyrights 2002 Luis Figueiredo (stdio@netc.pt) All rights reserved.
*
* See the LICENSE file
*
* The origin of this software must not be misrepresented, either by
* explicit claim or by omission. Since few users ever read sources,
* credits must appear in the documentation.
*
* date: Wed Oct 9 19:05:48 GMT 2002
*
*
* --
*
*/
#ifndef _CLIENTINFO_H_
#define _CLIENTINFO_H_
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <fcntl.h>
#include <string.h>
#include "outstream.h"
#include "client.h"
#include "utils.h"
#include "memory.h"
#include "server.h"
#include "error.h"
/*
* Next's structs are redudant but it is an case of logic (spell)
*/
struct _Header {
char *id;
char *data;
struct _Header *next;
};
struct _Query {
unsigned int index;
unsigned int idf;
char *id;
char *data;
struct _Query *next;
};
struct _Post {
unsigned int index;
unsigned int idf;
char *id;
char *data;
struct _Post *next;
};
struct _MultiPart {
char *id;
char *data;
unsigned int size;
char *filename;
struct _MultiPart *next;
};
struct _Cookie {
char *id;
char *data;
struct _Cookie *next;
};
extern struct ClientInfo {
int outfd;
char *inetname;
char *request;
char *method;
char *user;
char *pass;
char *(*Header)(char *);
char *(*Query)(char *);
char *(*Post)(char *);
char *(*Cookie)(char *); // TODO
char *(*Conf)(const char *,const char *); // new on 0.5.0
struct _MultiPart (*MultiPart)(char *);
// not necessary for web_server.h
char *QueryString;
char *CookieString;
char *PostData;
struct memrequest *mem;
struct _Header *HeaderList; // Not necessary for web_server.h
struct _Query *QueryList; // Not necessary for web_server.h
struct _Post *PostList; // Not necessary for web_server.h
struct _MultiPart *MultiPartList; // Not necessary for web_server.h
struct _Cookie *CookieList; // Not necessary for web_server.h
} *ClientInfo; //tochange
void __ILWS_init_clientinfo();
void __ILWS_free_clientinfo();
char *__ILWS_clientinfo_getauthuser();
char *__ILWS_clientinfo_getauthpass();
char *__ILWS_clientinfo_getquerystring();
char *__ILWS_clientinfo_getpostdata();
char *__ILWS_clientinfo_getcookiestring();
char *__ILWS_clientinfo_getmethod();
char *__ILWS_clientinfo_getreqname();
char *__ILWS_Header(char *);
char *__ILWS_Query(char *);
char *__ILWS_Post(char *);
struct _MultiPart __ILWS_MultiPart(char *);
char *__ILWS_Cookie(char *);
char *__ILWS_Conf(const char *,const char *);
#endif
+133
View File
@@ -0,0 +1,133 @@
/* include/config.h. Generated from config.h.in by configure. */
/* include/config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the <arpa/inet.h> header file. */
#define HAVE_ARPA_INET_H 1
/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
/* #undef HAVE_DOPRNT */
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define to 1 if you have the `inet_ntoa' function. */
#define HAVE_INET_NTOA 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 your system has a GNU libc compatible `malloc' function, and
to 0 otherwise. */
#define HAVE_MALLOC 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 <netinet/in.h> header file. */
#define HAVE_NETINET_IN_H 1
/* Define to 1 if your system has a GNU libc compatible `realloc' function,
and to 0 otherwise. */
#define HAVE_REALLOC 1
/* Define to 1 if you have the `select' function. */
#define HAVE_SELECT 1
/* Define to 1 if you have the `socket' function. */
#define HAVE_SOCKET 1
/* Define to 1 if you have the <stddef.h> header file. */
#define HAVE_STDDEF_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 `strchr' function. */
#define HAVE_STRCHR 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 `strncasecmp' function. */
#define HAVE_STRNCASECMP 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/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 <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if you have the `vprintf' function. */
#define HAVE_VPRINTF 1
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "bug-gnunet@gnu.org"
/* Define to the full name of this package. */
#define PACKAGE_NAME "libwebserver"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "libwebserver 0.5.3-GNUnet"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "libwebserver"
/* Define to the version of this package. */
#define PACKAGE_VERSION "0.5.3-GNUnet"
/* Define as the return type of signal handlers (`int' or `void'). */
#define RETSIGTYPE void
/* 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 */
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
/* Define to rpl_malloc if the replacement function should be used. */
/* #undef malloc */
/* Define to rpl_realloc if the replacement function should be used. */
/* #undef realloc */
/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */
+29
View File
@@ -0,0 +1,29 @@
/* Copyrights 2002 Luis Figueiredo (stdio@netc.pt) All rights reserved.
*
* See the LICENSE file
*
* The origin of this software must not be misrepresented, either by
* explicit claim or by omission. Since few users ever read sources,
* credits must appear in the documentation.
*
* date: Sat Mar 30 14:16:05 GMT 2002
*
* DEBUG macros
*
*/
#ifndef _DEBUG_H_
#define _DEBUG_H_
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef DEBUG
#define IFDEBUG(x) x
#else
#define IFDEBUG(x)
#endif
#endif
+34
View File
@@ -0,0 +1,34 @@
/* Copyrights 2002 Luis Figueiredo (stdio@netc.pt) All rights reserved.
*
* See the LICENSE file
*
* The origin of this software must not be misrepresented, either by
* explicit claim or by omission. Since few users ever read sources,
* credits must appear in the documentation.
*
* date: Wed Oct 9 19:56:22 GMT 2002
*
* -- Error functions
*
*/
#include "error.h"
const char *libws_error_table[]={
"Memory error",
"Filesystem error",
"Network error"
};
void libws_error(unsigned int code, const char *fmt, ...) {
va_list args;
va_start(args,fmt);
fprintf(stderr,"%s: ",libws_error_table[code]);
vfprintf(stderr,fmt,args);
va_end(args);
fflush(stderr);
};
+33
View File
@@ -0,0 +1,33 @@
/* Copyrights 2002 Luis Figueiredo (stdio@netc.pt) All rights reserved.
*
* See the LICENSE file
*
* The origin of this software must not be misrepresented, either by
* explicit claim or by omission. Since few users ever read sources,
* credits must appear in the documentation.
*
* date: Tue 9 Sep 06:45:13 2003 GMT
*
* libwebserver error codes
*
*/
#ifndef _ERROR_H_
#define _ERROR_H_
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#define LE_MEMORY 0 // memory error
#define LE_FILESYS 1 // file error
#define LE_NET 2 // net error
#define LWSERR(x) libws_error(x,"file: %s - line: %d\n",__FILE__, __LINE__);
void libws_error(unsigned int, const char *,...);
#endif
+195
View File
@@ -0,0 +1,195 @@
/*
* Luis Figueiredo - why remake the wheel, this functions feets perfectly
* and the credits still here :)
*/
/*
* Copyright (c) 1989, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Guido van Rossum.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)fnmatch.c 8.2 (Berkeley) 4/16/94";
#endif /* LIBC_SCCS and not lint */
/*
* Function fnmatch() as specified in POSIX 1003.2-1992, section B.6.
* Compares a filename or pathname to a pattern.
*/
#include "fnmatch.h"
#include <string.h>
#define EOS '\0'
static const char *rangematch(const char *, int, int);
int fnmatch(const char *pattern, const char *string, int flags) {
const char *stringstart;
char c, test;
for (stringstart = string;;) {
switch (c = *pattern++) {
case EOS:
return (*string == EOS ? 0 : FNM_NOMATCH);
case '?':
if (*string == EOS) {
return (FNM_NOMATCH);
}
if (*string == '/' && (flags & FNM_PATHNAME)) {
return (FNM_NOMATCH);
}
if (*string == '.' && (flags & FNM_PERIOD) &&
(string == stringstart ||
((flags & FNM_PATHNAME) && *(string - 1) == '/'))) {
return (FNM_NOMATCH);
}
++string;
break;
case '*':
c = *pattern;
/* Collapse multiple stars. */
while (c == '*') {
c = *++pattern;
}
if (*string == '.' && (flags & FNM_PERIOD) &&
(string == stringstart ||
((flags & FNM_PATHNAME) && *(string - 1) == '/'))) {
return (FNM_NOMATCH);
}
/* Optimize for pattern with * at end or before /. */
if (c == EOS) {
if (flags & FNM_PATHNAME) {
return (strchr(string, '/') == NULL ? 0 : FNM_NOMATCH);
}
else {
return (0);
}
}
else if (c == '/' && flags & FNM_PATHNAME) {
if ((string = strchr(string, '/')) == NULL) {
return (FNM_NOMATCH);
}
break;
}
/* General case, use recursion. */
while ((test = *string) != EOS) {
if (!fnmatch(pattern, string, flags & ~FNM_PERIOD)) {
return (0);
}
if (test == '/' && flags & FNM_PATHNAME) {
break;
}
++string;
}
return (FNM_NOMATCH);
case '[':
if (*string == EOS) {
return (FNM_NOMATCH);
}
if (*string == '/' && flags & FNM_PATHNAME) {
return (FNM_NOMATCH);
}
if (*string == '.' && (flags & FNM_PERIOD) &&
(string == stringstart ||
((flags & FNM_PATHNAME) && *(string - 1) == '/'))) {
return (FNM_NOMATCH);
}
if ((pattern = rangematch(pattern, *string, flags)) == NULL) {
return (FNM_NOMATCH);
}
++string;
break;
case '\\':
if (!(flags & FNM_NOESCAPE)) {
if ((c = *pattern++) == EOS) {
c = '\\';
--pattern;
}
}
/* FALLTHROUGH */
default:
if (c != *string) {
return (FNM_NOMATCH);
}
string++;
break;
}
/* NOTREACHED */
}
}
static const char *rangematch(const char *pattern, int test, int flags) {
int negate, ok;
char c, c2;
/*
* A bracket expression starting with an unquoted circumflex
* character produces unspecified results (IEEE 1003.2-1992,
* 3.13.2). This implementation treats it like '!', for
* consistency with the regular expression syntax.
* J.T. Conklin (conklin@ngai.kaleida.com)
*/
if ((negate = (*pattern == '!' || *pattern == '^'))) {
++pattern;
}
for (ok = 0; (c = *pattern++) != ']';) {
if (c == '\\' && !(flags & FNM_NOESCAPE)) {
c = *pattern++;
}
if (c == EOS) {
return (NULL);
}
if (*pattern == '-' && (c2 = *(pattern + 1)) != EOS && c2 != ']') {
pattern += 2;
if (c2 == '\\' && !(flags & FNM_NOESCAPE)) {
c2 = *pattern++;
}
if (c2 == EOS) {
return (NULL);
}
if ((c <= test && test <= c2)) {
ok = 1;
}
}
else if ((c == test)) {
ok = 1;
}
}
return (ok == negate ? NULL : pattern);
}
+59
View File
@@ -0,0 +1,59 @@
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)fnmatch.h 8.1 (Berkeley) 6/2/93
*/
/* This file has been modified by the Apache Group. */
#ifndef _FNMATCH_H_
#define _FNMATCH_H_
#ifdef __cplusplus
extern "C" {
#endif
#define FNM_NOMATCH 1 /* Match failed. */
#define FNM_NOESCAPE 0x01 /* Disable backslash escaping. */
#define FNM_PATHNAME 0x02 /* Slash must be matched by slash. */
#define FNM_PERIOD 0x04 /* Period must be matched by period. */
/* This flag is an Apache addition */
#define FNM_CASE_BLIND 0x08 /* Compare characters case-insensitively. */
int fnmatch(const char *, const char *, int);
#ifdef __cplusplus
}
#endif
#endif /* !_FNMATCH_H_ */
+96
View File
@@ -0,0 +1,96 @@
/* Copyrights 2002 Luis Figueiredo (stdio@netc.pt) All rights reserved.
*
* See the LICENSE file
*
* The origin of this software must not be misrepresented, either by
* explicit claim or by omission. Since few users ever read sources,
* credits must appear in the documentation.
*
* date: Sat Mar 30 14:44:42 GMT 2002
*
* -- handlers functions
*
*/
#include "gethandler.h"
/*********************************************************************************************************/
/*
* initializate (allocate) handler list
*/
struct gethandler *__ILWS_init_handler_list() {
struct gethandler *ret;
ret=__ILWS_malloc(sizeof(struct gethandler));
if(ret==NULL) {
LWSERR(LE_MEMORY);
return NULL;
};
ret->next=NULL;
ret->hdl.func=NULL; // or path
ret->flag=0;
ret->str=NULL;
return ret;
}
/*********************************************************************************************************/
/*
* add an handler to list
*/
int __ILWS_add_handler(struct gethandler *handler, const char *mstr, void (*func)(), char *path, int flag, int type) {
struct gethandler *temp=handler;
while(temp->next!=NULL)temp=temp->next;
temp->next=__ILWS_malloc(sizeof(struct gethandler));
if(temp->next==NULL) {
LWSERR(LE_MEMORY);
return 0;
};
temp->next->str=__ILWS_malloc(strlen(mstr)+1);
if(temp->next->str==NULL) {
__ILWS_free(temp->next); // free last malloced
LWSERR(LE_MEMORY);
return 0;
};
memcpy(temp->next->str,mstr,strlen(mstr));
temp->next->str[strlen(mstr)]='\0';
temp->next->type=type;
switch (temp->next->type) {
case 0:
temp->next->hdl.func=func; // for function
break;
case 1: // new on 0.5.2 // directory or cgi
case 2:
if(!(temp->next->hdl.path=strdup(path))) {
__ILWS_free(temp->next->str);
__ILWS_free(temp->next);
LWSERR(LE_MEMORY);
return 0;
};
break;
};
temp->next->flag=flag;
temp->next->next=NULL;
return 1;
}
/*********************************************************************************************************/
/*
* Deletes the entire handler list
*/
void __ILWS_delete_handler_list(struct gethandler *handler) {
struct gethandler *next;
while(handler) {
next = handler->next;
__ILWS_free(handler);
handler = next;
}
}
+60
View File
@@ -0,0 +1,60 @@
/* Copyrights 2002 Luis Figueiredo (stdio@netc.pt) All rights reserved.
*
* See the LICENSE file
*
* The origin of this software must not be misrepresented, either by
* explicit claim or by omission. Since few users ever read sources,
* credits must appear in the documentation.
*
* date: Sat Mar 30 14:44:42 GMT 2002
*
*
* --
*
*/
#ifndef _GETHANDLER_H_
#define _GETHANDLER_H_
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include "memory.h"
#include "error.h"
#define MATCHMAX 200
//#define WS_LOCAL 0x1
#define WS_DYNVAR 0x8
#define WS_USELEN 0x10
/*********************
* get handler types *
*********************/
#define GH_FUNCTION 0 // new on 0.5.2
#define GH_DIRECTORY 1 // new on 0.5.2
#define GH_CGI 2 // new on 0.5.2 (just the flag)
struct gethandler {
char *str;
int type; // new on 0.5.2 types
union hdl_u{ // changed on 0.5.3 named union (Hilobok Andrew (han@km.if.ua) said that wasn't compiling on FreeBSD)
void (*func)(); // it is a function
char *path; // it is a path (dir or cgi)
}hdl;
int flag;
struct gethandler *next;
};
struct gethandler *__ILWS_init_handler_list();
int __ILWS_add_handler(struct gethandler *,const char *,void (*func)(),char *, int,int);
void __ILWS_delete_handler_list(struct gethandler *);
#endif
+396
View File
@@ -0,0 +1,396 @@
/*
* by data2header by Luis Figueiredo (stdio@netc.pt)
*/
#ifndef __LOGO_H_
#define __LOGO_H_
char _logo[]="\x47\x49\x46\x38\x39\x61\x5\x1\x45\x0\xE7\x0\x0\x2\x2\x2\xFE\xFE\xFD\xF0\xF2\xF5\xE8\xED\xF0"
"\xDC\xE8\xEE\xBD\xC1\xC6\x68\x71\x7C\x60\x16\x7\x7A\x1C\xA\xA9\xC8\xDD\x9E\xC3\xDA\x94\xBD\xD8\x8C\xBB"
"\xD6\x86\xB6\xD6\x15\x26\x3F\x1B\x2C\x49\x1F\x32\x4D\x24\x38\x54\x30\x4A\x66\x4E\x5C\x68\x6E\x7E\x85\xAB"
"\xAE\xB2\xF6\xF6\xF7\xD6\xE1\xE8\xC8\xDA\xE6\xC5\xC7\xC0\xB0\xBC\xC6\x97\xAA\xB5\x8E\x96\x9B\x5F\x60\x62"
"\x39\x45\x48\x1F\x26\x23\x7\xA\xD\x4A\x10\x6\x34\xB\x3\x3D\xE\x6\x70\x1C\xB\x9F\x24\xE\xE7\x5C"
"\x45\x3B\x5C\x78\xD3\xD4\xD4\x7C\x89\x90\xF\x12\x10\x54\x13\x6\xCA\x36\x1C\xB0\xD1\xE5\x5D\x94\xB3\x3D"
"\x62\x7F\x1F\x22\x19\xD6\x4C\x35\x70\xB0\xD0\xA\x22\x43\x2C\x44\x60\x2E\x2F\x1F\xE9\x69\x4F\xBB\xD4\xE6"
"\x80\xCA\xEB\x7D\xC6\xE8\x79\xC0\xE1\x73\xB8\xDA\x69\xAA\xCA\x66\xA4\xC6\x58\x9B\xC4\x4D\x8D\xB5\x51\x82"
"\xA1\x4A\x76\x94\x33\x4E\x68\x28\x3E\x5A\x4D\x4D\x4F\x78\x80\x87\x3D\x3E\x3D\xF\x16\x1B\x8C\x20\xC\xFC"
"\x7F\x64\x83\xD0\xF1\x41\x68\x85\x2A\x38\x3E\x3F\x45\x2F\x13\x1A\x23\x35\x54\x71\x62\x9C\xBD\x12\x1E\x2B"
"\x49\x72\x8F\x4E\x7C\x9B\xD0\x41\x27\x58\x88\xA6\x28\x68\x93\x38\x53\x5E\x17\x22\x26\xDA\x56\x3B\x5B\x8E"
"\xAB\xF6\x72\x5C\x6F\x6F\x42\xFC\xFC\xD1\xFD\xFE\xC6\x66\x4A\xC\x99\xEE\xFE\x45\x6E\x8C\xE0\xE1\x8C\xEE"
"\xE9\x8B\x21\x6\x2\xA3\xFC\xFE\xC8\xFE\xFD\xFD\xFE\xDF\xFA\xFB\xB8\xFD\xFC\xA4\x86\xA6\x7A\xB0\xA8\x2E"
"\xF4\xF0\x88\x9A\xA4\x72\x58\x3B\x1E\x18\x16\x2\xB3\xB0\x5D\xD0\xCF\x64\xFD\xFD\x71\xFE\xFD\x89\xFE\xFC"
"\x5C\xFE\xFD\x49\xFE\xFD\x20\x70\x6B\x15\x3C\x39\x13\x89\x81\x1E\x4B\x4A\x2B\xB9\x2B\x10\xBC\xC0\x7E\x28"
"\x26\xB\x9C\x98\x40\xF2\xEC\x69\xC7\xB8\x3E\x90\x8C\x3F\x7B\x7B\x32\x31\x2F\xB\x1A\x6\x2\x1C\x1A\x7"
"\x7D\x98\x9F\xEC\xE2\x6A\x1F\x2E\x35\x90\xDD\xF9\x46\x56\x60\x88\xDF\xFE\x61\x5A\x13\x7C\x7E\x3E\x50\x49"
"\xF\xFE\xFB\x32\xCC\xC5\x49\x7E\x71\x2E\xBC\xB5\x2C\x9A\x91\x17\xD2\xC5\x21\x97\xA8\x84\xFD\xEE\x1D\x6E"
"\x7E\x4A\xDF\xD6\x3D\xF3\xE7\x41\x71\x6E\x2C\xB4\xD4\xAE\xFE\xD0\x5E\x82\x5C\x28\x20\x1E\x5\x51\x54\x2A"
"\xD0\x98\x34\xFB\xF0\x4B\xD5\xA7\x2F\xFA\xC6\x5E\xB9\x9A\x1F\xFE\xBD\x3F\xFE\xD9\x37\x92\x91\x78\xF6\xAA"
"\x3D\x8E\x5A\x1D\x38\x82\xB0\x5A\x6B\x69\xB5\x5E\x23\x42\x26\x1A\x51\x55\x44\xCE\xB7\x21\x25\x22\x7\xE5"
"\xD9\x18\x7C\x32\x19\xAA\x5B\x2A\x8A\x38\x1C\x9E\x4A\x20\xA8\x3E\x26\xB6\x72\x26\xDC\x91\x26\xAE\x5A\x22"
"\xCE\xC3\x67\xB7\x80\x28\x98\x6E\x22\x68\x30\x17\x56\x2A\xE\x4E\x26\xE\x96\x56\x1C\xAE\x70\x20\x2B\xB"
"\x3\x36\x39\x2B\x16\x22\x3D\x17\x22\x2A\x9\xE\x11\x7E\xB0\xCF\x7A\xAF\xD1\x71\xA9\xCA\x31\x7B\xAB\x2E"
"\x75\xA6\x1A\x48\x68\xD\x2E\x47\x42\x89\xB6\x84\xAF\xCA\x80\xB7\xD6\x73\x98\xB0\x4E\x98\xC5\x86\xA7\xAE"
"\x63\x7E\x8C\x50\x6A\x7B\x65\x86\x7E\x75\x8B\x9A\xAA\xAA\x78\xCD\xD3\xC8\x5D\xB0\xE4\x8A\xA2\x66\xFE\xFE"
"\xE6\xD9\xFE\xEF\xEA\xEA\xA8\xD8\xE2\xA4\x8A\xAA\x62\xD5\xD4\x87\x82\x80\x50\xCC\xC5\x84\x6C\x6F\x5E\xDC"
"\xDB\x9F\x5B\x5B\x34\x28\x74\xA4\x23\x6E\xA0\x1B\x68\x9B\x19\x60\x8F\xF\x5F\x94\x1B\x54\x79\x22\x5F\x87"
"\x9C\xD4\xF3\xC2\xE8\xF4\xC4\xF6\xFE\xA8\xE2\xFE\xA8\xE6\xF8\x54\xA8\xDD\xE2\xFC\xFE\x5E\x5E\x4B\xDE\xDD"
"\xB6\xB8\xBF\xA8\xBB\xBF\x95\xFE\x42\x1E\xD9\xDA\xC0\x13\x39\x53\x34\x8C\xC5\xFE\xAE\x9A\xFF\xFF\xFF\xFF"
"\xFF\xFF\x21\xFE\x12\x62\x79\x20\x4C\x75\x69\x73\x20\x46\x69\x67\x75\x65\x69\x72\x65\x64\x6F\x0\x21\xF9"
"\x4\x1\xA\x0\xFF\x0\x2C\x0\x0\x0\x0\x5\x1\x45\x0\x0\x8\xFE\x0\xFF\x9\x1C\xF8\xF\x0\x80"
"\x0\x6\x1\x8\x48\x38\x20\x21\x81\x84\x5\x12\x1A\x48\x78\x20\x21\x82\x84\x9\x12\x2A\xD0\x98\x70\x41"
"\x42\x6\x9\x1B\x24\x3C\x96\x10\x59\x42\x19\x9\x93\x25\xEC\xB1\x32\xA1\x8B\x84\x53\x12\x3E\x49\x58\x2C"
"\x61\x88\x84\x24\x12\xDA\x48\xA8\x8C\xA7\x4F\x83\x3D\xD\x2E\x4B\x38\x54\x28\xD1\x84\xE7\x90\x2A\x35\x98"
"\xD4\x20\xBA\x84\x4F\x9D\x26\x4C\x37\x35\xA1\xBA\x84\xCC\x12\xEE\x4B\x38\x23\xA1\x57\x11\x38\x75\x26\x5C"
"\x37\xB6\xAC\x41\xB2\x67\xCD\x2\x40\xBB\x36\x21\xC1\xB7\x70\x5\x3A\x78\x0\x21\x82\x84\x9\x14\x2A\x4"
"\xB0\x20\xA0\xEF\x80\xBF\x4\x8\x5C\xC0\x90\x41\xC3\x6\xE\x14\x3A\x78\xF8\x0\x22\x84\x88\x11\x24\x4A"
"\x98\x30\x91\xA0\xB2\x82\x4\xA\x32\x6B\x5E\xA0\x60\x81\xE7\x5\xC\x42\x33\x68\x40\x9A\xC1\xB1\xD3\xA7"
"\x91\x21\x3B\x86\x2C\x99\xEB\xD7\xC9\x7A\xC8\x9E\xD\x5\x8A\xF\x17\x3F\x7E\x4C\x59\xB6\xE4\xC5\x13\x66"
"\x11\x9A\x45\x1\x71\x60\xC5\x88\xC7\x2B\x10\xEC\x89\x91\x24\x8B\xB2\xE7\xD0\xA3\x3F\x5F\xA6\x6C\x99\x75"
"\xEA\xD7\xAB\x5F\xB7\x7E\x6E\xD9\xB9\xEF\xE0\xC1\xFE\xA3\x3B\x37\x1E\x9D\xF9\xF3\xE4\xCF\xAB\x4F\x87\x8E"
"\x7D\xBA\xF7\xEF\xD5\xC9\x5F\xC7\xAE\x3E\xB3\xFB\xFB\xF6\x35\x6B\x36\x63\xC6\x11\x63\x6\xAD\x10\xC2\x71"
"\x8F\x85\x40\x2\x12\x7B\x50\x61\xC3\x16\x59\xB0\xB0\xCE\x83\x10\x46\x28\xE1\x84\x12\xB2\x33\x61\x5C\x70"
"\x19\x74\x42\x42\xE\x24\xE4\x41\x42\x8\x19\xB4\x90\x41\x28\x24\x94\x42\x42\x2A\x24\xB4\x42\x42\x2C\x24"
"\xD4\x2\x47\x6\x6D\x64\x90\x47\x33\x76\x14\xD2\x48\x25\xE5\x68\x90\x4A\x6\xB1\x64\x90\x16\x9\x2D\x91"
"\x10\x4\x2A\xDA\x94\x90\x9\x9\xA9\xF2\x13\x0\x41\x31\xB9\x64\x93\x45\x1\x10\x65\x53\x0\x50\x69\xE5"
"\x52\x0\x44\x55\x25\x96\x54\x19\xD4\x8E\x5A\x59\x19\xD4\x4C\x42\x0\x1A\x74\x93\x99\x9\xED\x91\x50\x16"
"\x56\xA9\xC5\xD6\x9B\x6E\xAA\x85\xA1\x40\x2E\x25\xF4\x2\x87\x9\x49\x90\x90\x5\x9\x5D\x90\x10\x7\x9"
"\xC1\x60\xA4\x41\x31\xB8\x68\xA8\x41\x19\xC5\x8\x23\x0\x34\x2\x0\x92\x41\x22\x19\x44\x92\x41\x26\xED"
"\xD8\x92\x41\x2F\x19\x14\x44\x42\x34\x78\x95\x10\x58\x84\x26\xE4\x4C\x92\x4F\x96\xA\xD4\x51\x46\x31\x85"
"\xE5\x95\xAA\x4A\xE5\x6A\x96\xFE\x55\x19\xC4\xE\x56\x9\x8D\x69\xD0\x11\x45\x1A\x4\x2A\x0\x48\x24\xB4"
"\x45\xAC\x0\x5C\x95\xD6\xB0\x6D\x11\xB\xE7\x59\x73\x9E\x54\xA7\x41\x77\x1A\xD4\x95\x41\x9D\x1A\xD4\x90"
"\x41\x15\x24\x54\xC3\xA7\x62\x19\x74\xC3\xA1\x0\x24\xDA\xED\xA2\x8D\x36\xFA\x28\x0\x91\x2\x30\x29\x0"
"\x95\x2\xC0\x23\x0\x50\xC0\x94\x67\x42\x20\x60\x6B\x90\x9A\x6\xFD\x20\x2A\xA9\xA7\xE6\xEB\xA4\xBE\x51"
"\xF6\xBB\xEA\xBF\xAF\x6A\xA9\x65\x97\xC1\xD2\x6A\xD0\x56\xCE\x52\x24\x2F\x0\x39\x19\xB4\x93\xB1\x71\x42"
"\x2C\xF1\x5A\x18\xE2\x90\xC3\xC5\x3A\xE8\xB0\xC3\xE\x32\xF0\xD0\xC3\x6D\x3F\x0\x11\xC4\xB\x42\xF4\x37"
"\xC3\x5C\x11\xC\x41\xC4\x4\x6\x54\xC0\x41\x11\x1D\x18\x71\xC4\x1\xC7\x85\x80\x4\xB\x49\xB0\x70\xC1"
"\xCE\x18\xF4\x7C\xC3\xCF\x2D\x4\x9D\x40\xB\x95\x61\x86\x99\x66\x9D\x75\xF6\x19\x68\xA2\x91\xD6\x0\x3"
"\xCF\x40\x83\x1A\x6B\xAC\xB9\x16\xD\x14\x2E\x54\x1\xC4\x14\x61\xF8\x46\x3\x13\xE\xE0\x2A\xA0\x8\x22"
"\x18\x58\x2\xB\x5B\x98\xC0\x42\x6E\xB9\x39\xE3\xB6\xDB\xAA\x38\xA3\x8A\x2A\xD2\xD5\x4D\xDD\x74\xD6\x69"
"\xB7\xDD\xFE\x75\xDD\x85\x27\x9E\xDF\xE9\xA5\xA7\x1E\x3A\x56\x58\xF1\x5E\x3B\xF2\xD5\xC7\xE\x7E\xFA\xF1"
"\xE7\x1F\x80\xC5\xD\x48\xF6\x8\x2B\x1C\xB8\xDC\x82\xD\xA6\xB3\x8E\x3A\x9A\x6F\xDE\xF9\xE6\x14\x86\x7E"
"\x21\x5C\x4A\x24\x84\x43\x42\x3A\x28\x6B\x90\xF\x41\x72\x95\x10\x13\x9\x35\xB1\xF0\xC3\x0\x3C\x64\x90"
"\x9F\x6\x61\xC0\xED\x8B\x88\x2E\x2A\x23\xA3\x36\x42\x8A\xA3\xA5\x6\x55\x61\x27\x4D\x9\x8D\x60\xD1\x9A"
"\x9\x49\x93\x90\xBD\x6\x8D\x6A\x90\x92\xFA\x36\x69\xFD\x92\xFE\xB6\xBA\xA5\xF6\xAC\xC2\x6A\x10\xC1\xC2"
"\x2\x10\x26\x0\xB6\x2\x50\x26\x0\x67\xA2\x9F\x26\xF3\xDF\x3\x1B\xFE\xB1\xC5\xC6\x4F\x56\x86\xA5\x1B"
"\x54\x3F\x0\xA7\x1B\x94\xBA\x41\x28\xAD\xDE\xBA\x41\x4E\x48\x8\xAE\xC\xA2\xBC\x50\x49\xCB\x21\x7D\x4A"
"\x88\xEE\xC\xC2\xBB\x6F\xF5\x4E\x51\x10\x4\x9E\x41\xC6\x35\xAE\x73\x45\xE3\x7F\x0\x40\xC4\xA0\x18\x96"
"\x2D\x0\x64\xA\x0\xD0\x3\xE1\xBD\xA2\x87\xAF\x7D\x99\xF0\x7A\xA9\x92\x12\xC0\xB6\xC7\x42\x2D\x59\xA1"
"\x4D\x6\x19\x5F\xF9\x6\x8\x80\x15\xE9\x2A\x21\xBD\x32\xC8\xAF\xDA\x67\x90\xF0\x11\xC\x7C\xFE\x11\x2B"
"\xD6\x5B\x0\x90\x83\x84\xDC\xEF\x7E\xF9\x3\xC0\xFE\x0\xD0\x3F\xF\xCA\x4\x5E\x1B\x6C\x91\x88\x18\x92"
"\xC0\xDC\x25\x64\x5B\xC\xC4\x88\x16\x23\x18\xAE\x8F\x24\xE4\x19\x9\x69\x97\x41\xA4\x90\x90\x8\xE4\xAA"
"\x86\xBE\x4A\x8\xEB\xFC\x57\xAF\xE7\x8D\x10\x0\xD4\x3B\xA1\xA9\x54\x98\xC2\x29\xAD\x90\x4A\x2F\xF4\x52"
"\x42\x66\x75\x30\xD7\x19\xA4\x22\x37\x34\xC8\x45\x1C\x6\x2C\x82\xC1\xEF\x90\x72\x1A\x48\xC6\x32\x76\x31"
"\x1C\x38\x12\x7\x4A\x88\xA4\x24\x1F\x99\x83\x45\x6E\x4C\x6\x3D\x80\x42\xC8\x96\x70\x2\x1A\x40\x60\x38"
"\xE8\x7B\xCC\x1\x24\x63\x82\xBC\x58\x80\x2F\x7E\x1\x4C\x60\x4\xB3\xB3\xC1\xF4\xC\x3\x40\xBB\x81\xD0"
"\x8A\x66\x19\xA4\x25\x6D\x69\xC\x58\xC0\xD3\x9E\xF1\x8C\x64\x4C\x23\x1A\x2E\xA0\x6\x35\xAA\x71\x2\x21"
"\xD0\x0\x11\xC3\x39\x80\x63\x44\x89\x20\x13\x6C\x81\xA\xB3\xF1\xC1\xC7\x7C\x40\x4D\x1F\x48\x43\x1A\x3F"
"\xC0\x26\xDB\xDE\x6\x37\xB8\xD1\xAD\x6E\xE0\xCC\xCE\xDE\xC6\x9\x38\xF2\xFC\xAD\x70\xE9\xB0\x82\x3A\xDA"
"\xA1\xB8\xFB\x30\xA3\x71\xFD\xF9\xF\x0\x22\x47\x36\xE4\x44\xE6\x72\x5B\xFE\x88\xC1\x1E\xE0\xC3\xCF\x74"
"\x70\x8E\x73\x9A\x8B\x8F\xE7\x20\xA4\x8E\x9\x19\x64\x20\x4A\x44\x5D\x42\x8A\x68\x3F\x23\x9A\x6E\xA1\x61"
"\x7C\xD7\x1F\x71\x98\x90\x21\x24\x64\x3\x7B\xA2\xA2\x41\x6C\x7\x0\xDC\x1\x60\x81\x0\x68\x60\x3\xBD"
"\xF5\xBB\xDF\x35\x6A\x1A\x9\xB1\x46\x42\x84\xE0\xA9\x40\x2\x80\xA\x97\x2\x80\x8F\xD8\xA5\xC6\xE6\xB9"
"\x91\x84\x38\x95\x63\xF5\xB0\x87\x2A\x16\x76\x2F\x8F\x0\xE0\xA3\xF8\x6A\x45\xA6\xD\xA6\x8F\x5E\x0\x28"
"\x14\xF\x1\xF0\xC3\x42\xBA\xCF\x53\x74\xDA\x81\x42\xF5\x7\xD1\x86\x5A\x15\x7F\x9\xE1\xC1\xF1\x26\x2A"
"\x48\x3F\x2\xC0\x8C\x6\xC1\xA8\x41\xF8\x74\xC0\x8D\x56\xF1\xA3\xBB\xDB\x22\x0\x4A\xFA\xC5\x84\x5C\x23"
"\x21\x8A\x40\xD1\xC2\x90\xBA\xAE\x99\xCE\x74\x8D\x0\xC0\xAB\xF3\xDA\x98\x53\xE9\xE9\xF4\xAF\x28\xA4\xA3"
"\x4F\x13\x2\xD4\x2F\xC5\x90\xA8\xB7\x3A\xE3\xAE\x4A\x90\xC6\xA5\x36\x75\xA9\xE1\xF3\x21\x54\xB\xD2\xC4"
"\x26\x4A\x95\xAA\x6\x61\x28\x56\xAF\x7A\x59\x0\x90\xB1\xA5\x80\xF4\xAC\x57\xC1\xA\x0\x40\x4D\xB1\xAC"
"\xB5\x3B\x2B\x48\x47\xAA\xD6\xDF\x95\xEB\x82\x6\x99\xFE\x40\x42\x2\xE8\x52\xC6\x1A\x44\x8A\xEA\x8A\xE9"
"\x4C\xC5\x8\x80\xBD\x8A\x90\xAF\x0\xF0\x6B\x1C\x3\x1B\xD8\xEC\x9\x96\x4A\x5A\x32\x6C\x50\xB5\xE2\xD5"
"\xD0\xEE\x6A\x90\x0\xD8\x21\x53\x9D\xEA\x58\x18\xC6\xCF\x2D\x3D\xE0\x81\x76\x65\xC0\x5D\x19\x6C\xEC\xBB"
"\x1A\x5B\x24\x23\x2D\xF6\x48\x25\x58\x4C\x7\x98\x74\xC1\x14\x96\x20\x4\x8\xCC\xAC\x66\x8\xC0\x19\x15"
"\xB2\x6\x4\x29\x58\xA1\x64\xFD\x41\x19\xD\xAE\x60\x0\xE\x9C\x12\x95\x7F\x51\x25\x2B\x79\xF6\xCA\x9F"
"\x1\x8D\x68\xB4\xB4\xCC\x2\x34\x0\xB5\x69\x18\x22\x1A\xD6\x18\xE6\x4\x3C\xC0\x4\x44\xA4\xC8\x38\x5"
"\x42\x40\x9\x98\x93\x5\xD5\xB4\x6\x36\x3D\x88\xCD\x6C\x68\x53\x9B\x6A\xDE\xE6\x9A\xDA\xDC\x26\x37\xBD"
"\xF9\x4D\x70\x56\x7\x3A\x77\x13\xE7\x76\xBE\xB3\xC\xC2\x11\xAE\x1D\x38\xB6\xF\x7E\xF6\x13\x4F\xC8\x85"
"\x60\x99\x65\x4B\x4E\x9\xF0\xA9\xCF\x7E\x1A\xF9\xC8\xEF\x59\x87\x3F\xE3\xE3\x95\x82\xCC\x54\xAB\xFC\x4B"
"\x48\x67\x97\xB8\x44\xCD\x2E\xD1\x78\x6\xC1\xC2\x6\xD9\x64\x10\xDE\x6E\x2A\x61\x6\x21\x6D\xA\xE2\xA5"
"\x90\x84\x8C\x28\xB5\xB7\x53\xE0\xFE\x15\x5B\x9B\x10\x94\x1A\x84\x1A\xAF\xDB\x60\x68\xA5\x7B\xAE\x74\xD5"
"\x55\xB7\x35\x35\x88\x6F\x43\xE8\x57\xBF\x12\x77\x8E\xC6\x4D\xAE\xC1\xC8\x57\x54\x34\x19\x1A\x0\x48\x55"
"\xAA\xF7\xA6\x5B\xDD\x46\x37\x59\xA6\x31\x85\x32\x13\xA5\x3C\xD5\x84\x62\x16\x0\x40\x32\x88\x45\x9\xD8"
"\x58\x22\x56\xFA\xCB\x0\x78\xD6\x57\x4D\x64\x66\x8D\xA2\xB9\xA3\x6A\xD6\x96\x5A\xC5\xA\x0\xA\x24\xE4"
"\xA\xA\xB\x50\xA7\xA1\x31\x3C\x74\xA5\x4\xCF\x3D\xCA\x73\x6F\x6F\x1A\xDC\x37\xFE\x79\xA7\x29\x14\xF4"
"\x61\xC5\x24\x40\xC5\x26\xC4\xB6\xD1\x5\xD6\xC0\xA8\xCB\xE8\x47\x7F\x90\xB7\x4F\x56\x1D\x0\x3A\x4B\xED"
"\x84\x64\x1A\x0\x12\xE0\x42\x17\xBC\xF0\x85\x4E\x83\x21\x21\xDF\xCE\xB5\x41\x62\x2\x66\x0\x10\xC9\x20"
"\x45\x28\x35\x6A\x39\xEA\xD1\xD5\x6\xF\x0\x6F\x35\x48\x35\x62\xD\x80\x2\x2\x80\xCB\xE4\xAA\xB5\x9D"
"\x6F\x2D\x6E\x48\x77\x59\xD7\x21\xE4\x73\x9\x7F\x6D\x42\x3B\x1A\x4\xA8\x42\x45\x58\xA8\xE9\xFD\xDC\x4E"
"\x2F\xDB\xD1\x8F\xF5\x94\x16\x5C\x40\x71\x17\x60\xAD\x36\x50\xE8\xC1\xE\x1A\xE9\x48\x49\x46\x12\xBD\xDE"
"\xFD\x2E\x77\xFE\x33\xE9\x2\x20\x74\x4D\x8\x62\xF0\xC2\x18\xB8\x40\x86\x15\x90\x32\x92\x65\x30\xC3\x19"
"\xBC\x80\x86\x34\xA8\x1\xA\xDC\xF5\x58\xF\x28\xBE\xB5\x30\xFC\xC6\x64\xCD\x88\x80\x5D\x26\x50\x84\xA"
"\xFC\x37\x95\x3\x58\xE5\x80\x5D\x9\x4B\xA2\x69\x60\x1\x1B\x70\xF0\x35\xAE\x81\x8D\x33\x58\xDD\xB\x83"
"\xF8\x31\xD9\x42\x30\x4A\x16\xD8\xC0\x6\x2C\x0\xCD\xD3\x46\xD3\x80\x63\x48\xD\x35\x1E\xFE\xB0\x6B\x42"
"\x3C\x62\xD9\x64\xBC\xC4\xD4\x84\x2\x8A\x53\xDC\xB6\x1F\xAC\x78\x6E\xCA\x68\xB1\x8B\xF1\x66\x1D\xF3\x14"
"\xE\xC7\xEC\x74\x67\x7E\x1C\x27\x4F\x65\x2\x99\xEB\x1A\xDE\x43\x16\xB6\x60\x83\x18\xA8\x87\x3C\xEC\x39"
"\x7\x7C\xDA\xE3\x1E\x23\xB7\x14\xCB\x4E\xFC\xF7\x55\x8F\x28\xED\x26\x7E\x50\x8\x6B\x60\x43\x1B\xDC\x90"
"\x10\x98\xDA\xEF\xD\x70\x10\x43\x1A\xE2\xF0\x81\x49\x1B\xA4\xB3\x33\x25\xF7\xC2\xC3\x9C\x10\x57\x9F\x16"
"\x0\xD3\x3A\xB5\x47\x33\xF0\x27\x83\xA0\x5E\xF5\x71\xB8\x96\x4B\x91\x2A\x2E\x2F\x4A\xAA\xD6\xE7\x5A\x97"
"\xA4\x77\xAB\xEB\x3D\xBF\xD1\xCF\x80\x86\x4A\x42\x94\x2B\x43\x28\x1E\xFA\xA8\x9\x51\xB4\xC0\xA4\xFE\xFF"
"\x2A\x82\x79\xA\xF3\xD7\xCE\x94\x1C\xE6\x20\x87\xF2\xD3\xA1\xE\x76\x48\xFF\x1D\xC\x22\x69\xCF\xE7\x9"
"\xF\x79\xD0\xC3\x1B\xD6\x77\xE9\x34\xF0\xA1\xF\xD3\x7E\xE8\xEB\x63\xA\x4\xAF\x3E\xA0\xF6\x19\xB5\x6E"
"\xA9\x6\x0\xD5\x62\x10\x44\x0\x0\x73\xC0\x7\xC2\x57\x6F\x14\x65\x10\xA6\x27\x41\x8E\x62\x7C\x0\x40"
"\x6B\xC7\x47\x29\xFC\x6\x0\xCB\x17\x53\x7A\xC5\x6B\x7D\x36\x70\x3C\xA5\x47\xB2\xC2\x5C\x89\x25\x6B\xB5"
"\xD5\x41\x5A\x82\x5C\xCA\xD6\x52\xE3\x96\x10\x98\x87\x65\x70\xE0\x7\x6B\xF0\x7\x74\x0\x8\x81\x90\x7"
"\x82\x70\x7\x83\xD0\x6F\x33\xF5\x79\x9\x41\x8\xC7\x56\x69\xAB\x57\x8\xF9\x67\x10\x49\xA4\x59\xB0\xE7"
"\x2E\xE5\xF6\x7F\x6\x31\x11\x63\x5\x22\x67\xA5\x1\x0\x38\x7\xBA\x80\x7F\x9C\xD6\x55\x6\x81\x24\x11"
"\xE4\xE\xE0\xA2\x6F\x55\x35\x81\xB8\x46\x53\x6C\x94\x57\x36\xD5\x57\xD1\x77\x70\x7B\x34\x68\xA2\x66\x43"
"\x0\xD0\x70\x3A\xB4\x24\xDB\xD7\x7D\x2A\x38\x5\x72\x38\x87\x40\x50\x87\x5A\x23\x5\x12\x0\x1\x42\x60"
"\x8\x87\x20\x8\x58\x10\x5\x51\x80\x5\x88\xF0\x4\x55\x80\x71\x24\x56\x1B\xFE\x25\x27\x5\x57\x0\x1"
"\x2A\x20\x39\x36\x23\x5F\x19\x93\x8\x89\xB0\x7A\x8A\x0\x4\x8B\x50\x6\x98\x58\x6\x60\x90\x8\x91\x84"
"\x3\x8B\x0\x6\xA0\x8\x6\x8B\xB0\x8\x4A\xB0\x3\x1E\x83\x35\x2E\xE0\x3\x5A\xA0\xC\x2F\xC0\x1F\xE"
"\xD0\xC\xF\x10\x1\x34\x70\x2\x45\xA0\x1\x1\x70\x8B\xB8\x18\x0\x3\x80\x1\xD9\x50\x0\x1A\xE0\x32"
"\x1C\x90\x2\x72\x0\x9\x78\xE0\x4\x2A\x40\x2\xCA\x34\x2\x5C\x87\x20\x8B\x17\x3\x97\xA1\x0\x2D\xF0"
"\xE\xF0\xD0\xD\xF0\x50\x8D\xF1\x10\xF\xF2\xF0\xE\xF1\xC0\x34\x64\xD7\x0\xD0\xC0\x0\xEE\x80\x8D\xD7"
"\x98\x8\xEE\x80\x3\x1A\xF3\x61\xB3\xB1\x71\xE7\xA5\x3\x3C\x0\x5\xDA\xB0\x71\x17\xB3\x3\xDA\x80\x4D"
"\x3E\x30\xF\xF3\xA0\xD\xF6\x38\xF\xD8\xE4\xC\xFC\x30\x77\xD7\xC4\xF\x74\x53\x63\x85\x53\x38\x37\xD6"
"\xE\xF7\xC1\x63\x47\x10\x2F\x86\x37\x2\xCA\x78\x0\x1A\x76\x36\x36\x90\x4\x49\x60\x3\xFC\x0\x90\xDF"
"\x61\x1E\x82\x23\x38\xE5\xA1\x25\x9\x1\x6A\xB2\xD7\x7F\x6\x21\x24\x8C\x20\x7\x82\xB0\x55\x60\x78\x92"
"\x4D\x24\x7B\x5E\xD1\x30\x43\x88\x80\x71\x90\x83\x65\x90\xFE\x10\x31\x79\x55\x33\x9\x0\x35\xB9\x44\x8B"
"\x90\x10\xDA\xE0\x55\x16\x5\xB\x77\xC0\x7\x77\xC0\x8\x9E\x10\x22\x0\x90\xD\x9\x51\x2D\x74\x0\x9"
"\x7A\xB0\x3C\x24\x8\x0\xB4\x13\xF\x9\x41\xF\x5C\x40\xE\x77\x80\x6\x9\xD1\xD\xEF\xA6\x85\x6\x61"
"\x6\x77\xD0\x95\xF0\x0\xB\x16\x48\x3C\x0\x90\x93\xFB\x67\x10\x8B\xD0\x4\x9A\x50\xF\x5A\x9\x0\xF7"
"\xD3\x59\x7E\xB5\x93\x6\x31\xF\x3D\xA5\x24\x3E\x9\xE\x41\x9\xB\xE5\x43\x66\xF3\x44\x6F\xF9\x60\x80"
"\xFD\x60\x0\x1F\xD2\x3D\x6F\xD8\x52\x9F\x5\x0\x1E\x69\x6D\x0\x30\x92\x8D\xC0\x82\xCB\x92\x79\x4C\xE4"
"\x8\xE9\xF7\x8\x75\x30\x99\x39\xD8\x94\x48\x35\x7\x7F\xB0\x94\x67\x30\x7E\x69\x30\x7\x90\xC0\x8\x0"
"\x90\x8\x6\x1\x99\x93\x39\x7E\x73\x20\x3B\x4B\x64\x6\xE4\x37\x99\x76\x60\x9\x7D\x0\x6A\xDB\x50\x7"
"\x74\x70\x7E\x93\x59\x7\xA1\x80\x7\x69\x66\x10\x11\x61\x7\x99\x50\x92\x93\x10\xA\xA6\x9\x9\xA9\xC0"
"\x3E\x0\x40\xF\x0\xE0\x8\x73\xB0\x9A\x73\xC0\xD\x69\x10\xA\x75\x90\x6\xB8\x9\x81\x66\x0\x0\x77"
"\x50\x7\x68\x10\x0\x69\x80\x7E\x69\xFE\x50\xE\xC3\x50\x67\x6\x61\xF\xB9\xB8\x9\x6\xA1\x9\x68\x20"
"\x7\x76\x50\x7\x72\xE0\x7\x6\x1\x6\x5E\x90\x6\x72\x40\x7\x76\x40\x7\x9A\x10\x6\x6\x91\x8B\xB7"
"\x78\x1\xD7\xD2\x24\xEE\x70\x6\x1\xC0\xD\xED\x39\x7\x75\x90\x9\xD1\x49\x43\x7\x80\x9\x5E\x80\x8B"
"\xA7\x0\x0\x2C\x40\x1\xF6\xC9\x1\xCA\x25\x98\x2A\x8\x0\xF4\x39\x46\x1D\xC9\x98\x8C\x30\x7\x91\xC0"
"\x98\xC5\xD3\x98\x5A\x30\x8\x92\x30\x9\x93\x40\x9\x76\x40\x9\x95\xA9\x3E\xE\x98\x10\xE5\x77\x7\xE5"
"\xC7\x7\x7E\xE0\x7\x80\xC0\x6\x9E\xC9\x50\x78\x90\x9\xE9\x47\x9\x7E\xA0\x9\xF8\xB7\x44\xB\xA0\xB"
"\xBA\x40\x7\xA1\xB0\x6\x77\xF0\x6\x58\x16\xB\x72\x90\x9\x7E\xF0\x9\x4D\x80\x7\x8C\x0\x8\xCE\x59"
"\x92\x71\x65\x10\x46\x99\x7E\x6B\x60\x9\x8F\x0\x8\x20\xA\x8\x74\x30\x8C\xF3\x87\x5B\x1\xD0\x4\xED"
"\xE9\x7\x7A\x80\x7\x4D\x90\x7\x90\x90\x6\x69\x0\x8\x54\xF8\x3B\x66\x30\x6\x5E\xC0\x6\x93\xF0\x9"
"\x62\xCA\x5\x80\x60\x9\x73\xC0\x7B\x15\x58\x0\x15\x90\x1\xDC\x10\x0\xBA\x23\x6\xFE\x19\x7\x7C\x10"
"\x7\x94\xB0\x6\xFE\x39\x38\xD\xE5\xE0\xD\x6D\xBA\x6\x82\x30\x8\x61\x32\xE\xF6\xC0\xD\xDC\x50\x0"
"\xA7\x40\xE\x29\x22\x3D\x3\x10\x0\x2\xC0\x1\xE6\x40\x4\x4D\x50\xF\x7C\xD0\x99\x25\x19\x5\x14\x1"
"\x8\x6B\xF0\xA\x72\x90\x6\x6D\x0\x0\xDE\x70\x8B\x28\x50\x0\x28\x80\x2\x15\xF0\xA4\x83\xA5\x3D\x5E"
"\xB1\x4\x61\x60\xAB\x61\x90\xAB\x61\x20\x5\xBC\xCA\xAB\x53\xA0\x5\x95\x30\x7\x82\xF0\x0\x27\x20\x87"
"\x75\x8\x4\x55\x90\xAC\xC9\xAA\x5\xC9\x1A\x4\x27\xE0\x5E\xE\xC0\x4\x96\x20\x9\xD7\xE2\x18\x23\x30"
"\x4A\x93\xC1\x3\x19\xF3\x9E\x7C\x30\x9\x7A\xF0\x1\x51\x0\x1\x57\x70\x9\x98\x40\x7\x87\x90\x5D\x1F"
"\x3\x9\x99\xA0\x9\x4D\x20\xAE\x3C\x80\x89\xA4\xE8\x3\x41\xA0\x5\x9\x0\x9\x9F\x80\x8\x42\x80\x3"
"\x60\x0\xA0\x4A\x9\x88\x58\x80\x5\xD1\xEA\x7\x1\xEA\xA\xC4\x40\x17\x43\xA0\x8\xAB\x80\x7E\x1F\xEA"
"\x8\xB4\xE5\x9\x5F\x10\x7\x74\x80\x9\x7\x42\x5\x8C\x17\x0\x5E\xE0\x5\xE2\x50\x3\x35\xC0\x4\xC3"
"\x20\x4\x97\xB0\x6\x71\x10\x8\x13\xB0\xA\xCF\x0\x8D\xD3\x78\x8B\xE1\x40\x4\x1F\x0\x3\x4C\xC0\xFE"
"\x4\x34\x50\xD\x70\x40\x7\x96\xB0\xD\xD1\x60\x76\xC7\x10\xD\x2F\xE0\x1\x52\x80\x1\xDC\x80\x1\x3"
"\x20\x0\xA7\x40\x4\x1A\xDB\x4\x70\x8A\x8\x27\xD0\x1B\xD6\x20\x6\xE1\x70\x5\xE\x30\x88\x40\xA0\xA"
"\x61\x60\xD\x1B\x30\xE\xF5\x50\xC\xE1\xFA\x2\xF7\x78\x8B\xD9\x40\x4\x4E\x60\xC\x47\xE0\x4\xE1\xDA"
"\x6\x69\x80\x6\x9F\x30\x3\x51\x20\x4F\xC2\x40\x6\x64\xB0\x6\x75\x40\xA\xAF\xC0\x6\xA7\xE0\x6\xB0"
"\xD0\xA\x6E\x40\x4\x46\xE0\x0\xCC\x60\x5\xE5\x64\x4E\xE3\xD1\x52\x42\x62\x10\x13\x2A\xA1\xEE\x72\xA1"
"\x19\xBA\x82\x86\xB\x0\x98\x7\x92\x0\xB0\x21\x8F\x40\x9\x54\xB8\x86\x9D\x46\x7\xEB\x3A\x8\x1D\x12"
"\x92\x0\x80\x7\x6C\x10\xA\x85\xAB\x3\x77\x10\xA\x7E\x0\x6B\x5B\xA9\x9\x42\xB8\x3F\x7C\x0\x9\xC2"
"\x57\x6\x90\xF9\x8\x25\x89\x29\x30\x71\x8\x75\x0\x8\x9B\x6\x0\x1D\x12\xA0\x77\x0\x96\x0\x40\x43"
"\x5F\x90\x9\xBD\x19\x5A\x26\x20\x7\x7F\xD0\x7\x4C\x8\x0\x50\xA8\x2\x6B\x10\x9\x9E\x90\x45\xC7\xB9"
"\x6D\x1D\x0\x0\xF3\x66\x10\x6E\xE6\xD\x68\x0\x8\xB8\xF2\x5A\x0\x70\xF\x1\xFE\x70\xF\xA7\xE0\xA"
"\x20\x50\xB9\xA3\xB6\xA1\x0\x0\x9\x87\xC0\x5\xC0\xA5\xD\xA1\x0\x7\xB0\xA0\x84\x0\xA0\xD\x44\x70"
"\x8B\xC1\x4B\x7D\x3\x70\x6\xF8\xA0\x41\x6\xA1\x97\xBA\x70\x6\x34\xF8\x9\x64\xA6\x86\x6A\x68\x70\x82"
"\xE5\x29\x7F\xB\x0\xFF\x1B\xB8\x31\xC1\x8\x6C\x50\xB8\x86\xA9\xA1\x0\xA0\xB8\x8A\x4B\x46\xAF\xFB\xB8"
"\xBB\x22\x5D\x76\x10\x7\x8E\x80\x6D\x11\x5\x0\x70\x10\xA\x92\x0\x20\x3A\x30\x8\x75\x40\x9\xAB\x90"
"\x10\xE4\x17\x7\x9E\x6\x0\xDC\x0\x7\x65\x52\x6\x22\x1A\xB\x2A\xB5\x9E\x9\xB1\x8\x8C\x90\x94\x1F"
"\xC\x2D\x0\xD0\xC1\x13\x3C\x82\xF5\x36\xA5\x92\xF0\xB\xBE\xE2\xBB\x8E\x80\x45\x7\xE1\x7B\x5C\x40\x66"
"\xBC\x13\x7\x76\x80\x9\x60\xE9\xC3\xD3\x99\x98\x72\x30\xE\xB2\xE3\x66\x0\xA0\x85\xF8\xC0\xD\xE4\x20"
"\x7C\xCD\xB\x0\xB2\xD7\x3F\x8C\x10\xA\x80\x20\x28\x33\x25\xF\x75\x90\x7\x14\xFC\x7A\xD9\x10\x0\xF6"
"\xF0\xBF\x21\x14\x6\x1D\x10\x0\x19\x20\x5B\x36\xFC\xA\x73\xC0\x5\xAD\xE0\x15\xD0\x95\xB\x3D\x65\x5C"
"\x9E\xD2\x2C\x0\x80\xC7\xFF\x4B\x46\x8C\xF0\x7\x6\x5C\x98\xFE\x1F\x24\x7B\xB2\x47\x46\x33\xB8\x80\xBB"
"\x82\x6F\x8D\x9B\x83\x81\xEB\x23\x78\x10\xB1\xB8\x29\x55\x87\x90\x9\x97\x90\x10\x92\x49\x8C\xA9\xC3\x5"
"\xDC\x90\xA0\x6\x51\x6\x72\xD0\xC1\xA\xC0\x8\x5D\xD9\xD\x5D\x79\x7\xDD\xA0\x9\x72\x20\x9\xE2\x6B"
"\x10\xFD\x97\x94\xD1\x9\x0\x7A\x19\x2\x83\x30\xA2\xDD\x66\x10\x49\xF0\x9B\x74\x30\x7\x79\x0\xCA\xDC"
"\xB0\x7E\x4\xB8\x66\x8\x18\x0\x12\xCC\x8\x5D\xD0\x95\x1D\x70\x6\x9A\xA0\x9\x2A\x2A\x9\x13\xC\x5B"
"\x4F\xC\x0\xF8\x60\x1\xF5\x70\x81\xDE\x69\x10\x45\xFA\x9\x98\x96\x10\xDC\xC0\x6\xD6\xFC\xBF\x3B\xD0"
"\x5\x1\x80\x2\xD3\x50\xF\x1D\x40\xE\xEE\x40\xE\xE4\x60\x0\xE5\x7C\xBD\xD1\x6C\x10\xA2\x6A\x10\xA3"
"\xC0\x6\x13\xEC\x83\x6\x91\x43\x0\x90\x4\x75\xDC\x53\x5E\x71\x2\xFA\xAC\xCF\x2F\xD0\xCF\x2F\xD0\x1B"
"\x4B\xB0\x4\xBC\xDA\x6\x87\x10\x9\xE\x20\x4\xBA\x1A\x6\x40\xE0\x2\x9B\xF0\x7\x29\xF0\x2\x52\x10"
"\x4\x12\xCD\xAB\x2\xBD\x4\x33\xD8\x7\x2A\x40\x1C\x8E\xF1\x88\x49\x10\x3\x3C\x30\xA2\x4D\x20\x1\x40"
"\x50\x1B\x6E\xC7\x3\x32\x20\xB9\x5C\x70\xFE\x2\x1A\xB7\x9\x9E\x5B\x5\x60\xD0\xD\x35\x5A\x9\x39\x50"
"\x6\x5D\x90\x6\xAE\x40\x3\x2E\x30\x8A\x73\x40\x7\x94\x80\x9\xE9\x77\x9E\x59\x5A\x7E\x72\xA0\xB\x82"
"\x10\xD2\x55\x90\x5D\x50\x30\x8C\x35\x80\x5\x10\xF0\x0\x4E\x40\x66\xC5\xC1\x9B\x5F\x20\x2\xF1\x95\x5"
"\xAC\xF0\xA\xB1\x20\x9B\x41\x6D\x9A\xDF\xA0\x1\x9\x30\x18\xF4\x40\xF\xE6\x9\x9\xE5\xE0\x9E\x76\x70"
"\xAA\x17\xDB\x9E\xE3\x20\x8\x7A\xA0\x8\x86\xC0\x19\xB\x10\x34\x73\x80\x6\x37\x4D\xD\xD3\xD0\x8D\x65"
"\x37\x35\x52\x83\xF\x73\x0\x7\xD5\xA0\x5\x3A\x90\x8\xF2\xE0\x5\xD8\x80\x8\x43\x0\x4\xB2\xB1\x31"
"\x73\x90\x6\x8E\xBA\xA7\xF6\xC9\xAA\x6\x60\x4\x51\xF0\x0\xFB\xE0\x0\xFE\x1\x2\xF8\x80\x6\x6E\x40"
"\x8\x64\x80\x1C\x7\x80\x4\x67\x63\x2\x49\x60\x2\x54\xA0\x37\x7A\x73\x1D\x2D\xB5\x21\x1A\x62\x92\xF4"
"\xF9\x5\x9C\xD0\x9\x9\x11\xB8\x55\x0\x8\x72\xC0\x8\xD1\x72\xC0\x14\x3A\x83\xAD\x77\x68\x48\x35\xA2"
"\xC7\xAB\xB8\xBC\x55\x7\x98\x30\xC1\xC6\x83\x7\xC2\x3D\x7F\x98\x50\x7\x77\x10\xB\x94\x50\x44\x72\xC0"
"\x7\xC3\xD0\xC2\x69\xFE\x30\x6\x77\xF0\x9\x83\x80\x7\x83\xD0\x4\xD7\x2D\xA6\x83\x50\x3\x7D\x20\xBF"
"\x9\x25\x7\x71\xF0\x21\xB4\xE7\x15\x8F\x10\xB\x35\x9C\x54\x0\xF0\x6\x9F\x10\x9\x79\x10\x8\x93\xE0"
"\x7\x92\x10\x7\xA1\xF0\x7\xBC\x8C\x3B\x98\x79\x7\x78\x80\x7\x7A\x30\xC\xD8\x1D\xA6\xC3\x50\x3\x4D"
"\xC0\x18\x0\xC0\x6A\x50\x29\x9\x96\x60\xE\xEF\x36\x2E\x14\x8\x0\xCF\x90\x6\x62\xA0\x7\x70\x6\x0"
"\x6C\xAB\xE0\x8E\xB9\x3\x1\xAA\x9\x44\x80\x7\xC3\x30\xC\x46\x10\xE0\x1E\x5E\x3\xC3\xF0\x1\xB4\x65"
"\x6E\x10\xC1\xD\x46\x0\xB9\x87\x86\x5B\xF\x18\x58\x9E\xA2\xDA\x8B\x9B\x10\x30\x4E\x9F\x9F\xF0\xDA\x18"
"\x34\x5\xA0\xC0\x9\x8E\x70\x6E\xA2\x45\xA1\xA1\x20\xA\xB\xA8\x86\xC8\x36\xA2\xF8\x27\x7B\x62\x4\xB"
"\x75\x20\x9\xB8\x9\x92\x93\x69\xCD\x75\x10\xB\x0\x40\x9\x96\x80\x3\x9E\x50\x7\x81\x0\x3B\xF6\xE3"
"\xD\xDA\x4C\x5A\x58\xE\x0\xB1\xFB\xBF\xA5\x33\x7\x98\x20\xAB\xA0\xEB\xCA\x55\xAE\xE4\x9\xD1\x97\x0"
"\xA4\x2\x6F\xF0\x6\x4D\xF0\x6\x78\xE0\x7\x99\x20\x9\x29\x62\x3B\x87\x70\x8\x4B\x9\x0\x29\x6E\x10"
"\xFE\xD1\x6D\x10\xB2\xFA\x3B\xBA\x83\xF\x6C\x60\xE1\x6B\xF5\x6E\xE5\xF2\xC\x6D\x80\x6\x6D\x80\x65\x73"
"\x0\x8\x42\x68\x6B\xAF\x17\xC9\x3B\x9E\x10\xE8\xCB\xBD\x3C\x1E\xBB\x19\xD0\xA5\xC\x58\x85\x88\x76\x24"
"\x1F\xD8\x52\x33\x61\x10\xA1\x1E\xE3\x96\xFB\x5\xA3\x0\xDB\xCC\x2\x13\xA4\x50\xA\x78\x0\xDE\x81\x4B"
"\x9F\x7F\x20\xA\xBB\xBD\x97\x56\x38\xC3\xA6\xB0\x7E\xA0\x26\x46\x93\x60\x7\x81\x90\x22\xE4\xB6\x6\x76"
"\xA0\xE4\xA1\xB0\x98\x77\xF0\x8\xDF\x10\x9\xB1\xF0\x9\x5D\xAE\x3\x6D\x20\x0\xD8\x80\xC7\xD7\x46\x65"
"\x9\x21\x9A\x9D\x19\x8\x32\x4E\x13\x81\x40\x7\x81\x30\x7F\xB7\xF5\x8\x93\x0\x0\xC8\xD6\xCE\x6F\xF0"
"\x8\x6B\x80\x7F\xFA\x60\x10\x7E\x10\xA\xA9\x5A\xE0\xBD\x67\x10\xC6\x89\xBC\x0\xF0\xE\x0\x40\xDB\xEB"
"\x5C\xE8\x35\x72\xEF\xE\xDE\xA\x68\x10\xE\x28\xE5\x7\x69\xB0\xBA\x90\x3E\x6D\x6D\x20\x7A\x65\x5E\x98"
"\x8A\x8B\xC7\x7A\x62\x10\x99\x9E\xE2\xE9\xC3\x86\xF5\x3C\x47\x5E\x21\x4\x42\xF0\x4\x13\xFF\x4\x16\x7F"
"\xF1\xFF\xBC\xAB\xA7\x80\xA\xA9\x40\xAC\x11\xED\xAB\xAA\x80\xA\xA8\xE0\x6\xF\xF0\xFE\x4\x2\x3D\x87"
"\x53\x50\x5F\x99\x0\xA\x78\xE0\x0\xE\x10\x40\x2B\x20\x4A\x7B\xB0\x5\x5B\x10\xA0\xA2\xB0\xA\x41\x60"
"\x71\x3D\xE0\x5D\x4A\x60\x7\xB1\xC0\x8\xF\x70\x5\x55\x40\x71\xE0\xF0\x8\x8F\xC0\x7\x6B\xA0\x7\x27"
"\xA0\x6\x76\xF0\x7\x98\x30\x9\x46\xDD\x5D\xCF\x80\x6\x62\x60\x8\x3D\x10\x49\x8B\x90\x8\x97\x88\x89"
"\x66\xD0\xD\x39\xB0\x3\x3A\xF0\x89\x60\xD0\x99\x7C\x60\xD\xC8\x6A\x72\x24\x73\x5\xD5\xCC\xD9\x90\x91"
"\x4\x3E\x7A\xB\x31\xC0\xC\xFD\xD1\xC\x10\x30\x4\x34\x60\x7\x50\xDF\x1\x28\x60\x1\x3\x60\xF\x99"
"\x80\x9\xD8\x30\xC6\x8F\x8D\x8B\xD9\xA0\x1\x37\xF0\xE\x4\x0\xF\xF4\xD0\xD\x73\x10\xA\x5C\x60\x0"
"\x9\xF0\xE\x92\xDF\x2\x9B\xA1\x34\xA0\xA1\x4B\x4\xC0\xD\xDF\x20\xF\xDC\x10\xE\x4C\x60\x4\x55\x30"
"\x35\xAD\xB1\x1\x54\x6F\x8\x2E\x0\xD\x3B\x80\xFA\x60\x5F\x49\x39\x90\x0\x40\xE0\xCF\x2F\x70\x2\xBF"
"\xB1\xF7\xDA\x3B\x4F\x2\x72\x1C\xCA\x78\x20\x25\x40\x5\xA2\xAD\x36\xE0\xD4\x52\x9\xF\x0\xA3\x3E\xEA"
"\x9B\xE2\x6\x49\xC0\xA\x48\x88\xB8\xA0\x80\xA\xAD\xC0\xBD\x1F\xFE\xD4\x7F\x99\x80\xA\xAE\x60\x7D\xB4"
"\x6E\xEB\xAF\x20\xA\xD7\xB6\x3\xB0\x10\xB\x76\x90\x7\xDC\x7E\x6D\x46\x2F\x9\x9A\x80\xE5\x8F\x30\xA2"
"\x77\x60\xC\x65\xCE\x12\xD8\x80\x6\xDE\x30\xFD\x0\x10\x6E\x0\x0\xD3\x76\xF0\x8\xEA\xB9\xC9\x0\xD0"
"\x9E\xE1\xA0\xB\xC7\x2B\x46\x7D\xC0\x6\x72\xD0\xEB\x0\x41\x6\xC0\xC0\x60\x75\xEA\x40\x4A\x32\x10\xC0"
"\x94\x81\xB1\xEC\x44\x2\x1\xC0\x88\x42\x4C\x7F\x32\x39\xA\xA0\x30\xA3\xA3\x47\x76\xE8\x70\x1\x70\x43"
"\x23\x80\x38\x73\xB6\x29\xEC\xA6\x30\x81\x42\x5\xA\x17\x0\xD0\xD3\x85\x5B\x3D\x34\xE2\x10\x29\x6C\xA0"
"\x30\x19\x80\x35\x6C\xD8\xB8\x1A\xE8\x4E\xE1\x3B\x39\x5E\xD2\x9C\x52\x8\x44\xE1\x80\x0\xE4\x0\x18\x53"
"\x18\x22\xAA\x42\x2A\xA\x59\x28\x54\xA6\x50\x2B\x0\x9\xA\xBB\xE\x7C\x32\x50\xD6\x2C\x5A\xB5\xA8\xD8"
"\x92\x55\xAB\xD6\xAD\x59\x6D\x71\x6D\xC9\xD5\xEA\xE6\x40\x5D\xB8\xEC\x8E\x42\x65\xAA\x14\x28\xBE\xA0\x44"
"\xED\x7A\x3\xE0\x0\x0\x52\xA8\x32\x89\xE2\xF5\xCA\x94\x28\x46\x8C\xE\x59\x32\x95\x67\x90\xC2\x2A\xA"
"\x21\xC5\x92\xC4\x68\xAE\xA4\x4C\x7E\x1C\x1\xFE\x78\xA1\xB0\x7\x80\x37\xD8\xC4\x74\xF1\x26\xCE\x8C\xA6"
"\x40\x74\xE8\xD8\x59\xC3\x88\x89\xC2\x33\x62\xD2\x84\x6B\x63\x7B\xDC\x26\x4D\x70\xD2\xCC\xF1\xD3\x7\x80"
"\x30\x85\xBC\x5C\x87\xA2\x13\x2B\xF\xA3\x77\x81\x3A\x92\xF2\x34\x70\x86\x42\xF\xA4\x30\xD5\x91\xB3\xFC"
"\xCE\x99\x50\x72\xE8\xC4\x56\x1\xE0\x2\x80\x3E\xB1\xD2\x60\x9A\x33\x27\x9C\x24\x48\x25\x21\x89\x3\xD0"
"\x72\xE0\xCA\x81\xF2\xC3\x75\xF9\xC6\xE1\x83\x7\x85\xC\x70\x2\x50\x61\x8D\x43\xE6\x18\x23\x5\x33\xC8"
"\x9\xC4\x20\xD8\x34\xD3\xC9\x1E\x7D\xEC\x9\x20\x80\xC\x34\xB0\x27\x1B\x14\x32\x40\x6A\x20\xA9\x6\xDA"
"\x43\x21\x13\x14\x52\x65\x2B\x85\x68\xF0\xAA\x44\x0\x7A\x71\xA3\x17\x5F\x7E\xF9\xC5\x97\x5E\x64\x81\x31"
"\xC6\x5E\x56\x50\xE1\x3\x85\x58\x61\x25\x97\x5C\xDA\x2\xA6\x96\x54\x82\xB9\x65\x97\x5D\x6E\xF9\x2\x80"
"\x11\xBE\x28\xE5\xAF\x2F\x3C\xF1\x65\x17\x51\x4C\xE1\xA4\x94\x5D\x1C\x51\xE1\x88\xA4\x14\xDA\xE6\x95\x49"
"\x6\x99\x8B\x11\x4A\xF2\x10\x2E\x8\x85\xA0\x18\x48\x5\x72\xB0\x29\xA7\x8B\x2E\xBC\x98\x23\x8E\x40\x3E"
"\x29\x4\x80\x21\x6\x62\xFE\x44\xE\x31\xE0\xE0\x62\x98\x26\xE0\xB0\x2D\xD\x36\xB0\x31\x27\x3C\x0\x36"
"\x4\xC0\xD\x5D\x26\x69\x64\x8D\x38\xE8\xA8\xE3\x11\x4B\x0\x11\xA4\x6\x85\x42\x1B\xC8\x9\x63\x1C\x21"
"\x85\x12\x4B\x1E\xA9\x23\x13\x48\x2\x71\x64\x98\xA5\x0\x0\xC4\xB\x31\x28\x91\xC4\xF\x3F\xE0\x88\x3"
"\x12\x48\x0\xC9\x3\x80\x69\x54\xA2\x15\x0\x57\xF0\x69\xC3\x15\x10\x14\x71\xE9\xBF\xA7\x4\xF1\x3\x13"
"\x3A\xD2\xF0\x2\x8D\x70\xDE\xF4\x4\x84\xB9\x0\xF8\x6\x8D\x6F\xB2\xC1\xF5\x94\x7B\xB2\xA1\x16\x9F\xC"
"\x1\x10\x41\x21\x24\x14\x4A\x68\x20\x67\x44\x4\x80\x6\x71\xC7\x1D\x57\x2\x9\x68\x80\x0\x86\x23\xD6"
"\x3D\xA2\xCA\x76\xDF\x3D\xE2\xD\x27\x9C\x78\x40\x82\x13\x84\x30\xE2\x3\x27\xDE\x88\x37\xDE\x37\xFE\x15"
"\x46\x5\x15\xC8\x20\x78\x84\x15\x5B\x19\x21\xA\x44\x86\xC1\xA3\xE1\x3E\xA\x39\x2\xB\x1A\x5E\x98\xA2"
"\x62\x8B\x97\xC8\xC3\x11\x2C\x86\x90\x2\x8\x29\x4\xD1\x98\x86\x29\x5C\x20\x19\xA\x17\xB4\xA8\xE6\x4"
"\x9\x5C\x71\x85\x88\x26\x8C\x40\xE4\x3\x2C\x98\xB8\x22\x8\x28\x7A\xD0\x62\x95\x26\x10\xA9\x1\x91\x21"
"\x3C\xFE\xB8\xC2\xE5\x1A\x9C\x10\xD8\x9\x2B\x57\x8\x41\x4\x11\x18\x19\x44\x98\x56\x7C\x71\xC4\x8D\x26"
"\xF0\x60\x2\xB\x44\xAE\xA8\xC2\x7\x17\x7E\x0\x22\x8C\x13\xF6\x31\xC6\x9\x3C\xA6\xC6\x63\x10\x4F\xDE"
"\x80\x81\x8\x3\x2A\x40\x61\x80\xB\x2A\x21\x47\xF\x23\x86\xA1\xBB\x6E\x3D\x87\x71\x65\x83\x1B\xF6\x6E"
"\xA1\x85\x4\xFE\x56\xA0\x81\x14\x8A\x70\xA5\xF\x26\x28\x60\x60\x1\x5\x16\x60\x9C\xF1\x6\xA6\xB1\xA6"
"\x1A\x45\x3E\xF9\x44\x8F\x97\x63\xB6\x5A\x82\x6A\x80\xA8\x62\x8A\x17\xF4\xA8\x1\x6\xD1\x61\x28\xA4\xF4"
"\x7D\x7\x16\x61\x4\xA5\x47\x8\x81\x4\x4\xF6\xA0\xC2\x84\x2D\x4C\x60\xE1\x7\x67\xBE\xDD\x6A\xCE\x81"
"\x48\xDC\x5D\x21\x62\x14\x2A\xC6\x77\x85\x1C\x50\x48\x77\x39\x87\x57\xC8\x9\x85\x22\x1A\x28\xDB\x81\x7A"
"\x19\x51\x21\x2C\x14\x5A\x42\x21\x86\x6\xAA\x7E\xA0\x2B\x8A\xA7\x4C\x21\x17\xAC\x57\x68\x59\xDE\x1\x18"
"\x6D\x20\x29\x14\xA\x6B\xA0\x65\x21\x50\x8\xAA\x81\x88\x1B\x68\xB0\x81\x8C\xBF\x1E\x0\x19\xBC\x57\x88"
"\xFD\x81\x98\x7\x40\x7F\x0\x50\x50\x88\x53\x6\xD2\x1\x85\x10\x70\x20\x5\x50\x8\x6\xFE\x14\xD2\x2"
"\x85\x18\x40\x21\x1B\x60\x49\x4\x7\x12\xD\x85\xCC\x66\x20\x42\x50\x8\x5\x7\x52\xD\xE4\xD\xC4\x4A"
"\xFB\x53\xC8\x8\x14\xB2\x2\xAA\x58\x5\x5C\xC7\xEB\x5D\xA\x51\x8\x80\x8\x70\x4F\x85\x18\x4\x4B\xF4"
"\xE6\xA7\x90\x28\x84\x50\x21\xB6\x98\x14\xFA\x14\x72\x3E\xF3\x29\x24\xC\x3B\xA4\x5E\xF7\x6\xF2\xBD\x21"
"\x2\x71\x20\x95\x19\x48\xF9\x0\x40\xA6\x22\xE\xE4\x87\x3\x39\x1\xD\x15\xE2\x3C\x0\x6C\x6B\x20\x56"
"\x4\x80\xE\x14\xA2\xC5\x81\xDC\x6F\x20\xF5\x83\x21\x0\xA6\x33\xC3\x81\x40\x70\x20\x19\x50\x8\x2\x7"
"\x42\x0\x85\x8C\x67\x20\xA\x1C\xC8\x4B\x6\xC2\xC0\xF9\x48\x10\x0\x72\x4\xC0\x35\x14\x62\x8\x9D\x8"
"\x11\x34\x2E\x4\xC0\x7\x7\x35\x15\xE\x79\xE8\x84\x2D\x1C\x8\x22\x57\x38\x3E\x46\x9A\x8\x0\x61\x4C"
"\x1F\x0\x22\x39\x3E\xE2\x69\xC8\x84\xD8\xB\xA2\x13\x7D\x68\x44\x0\x88\xE9\x8B\x57\x3A\xA2\x42\xB4\x80"
"\xBF\x81\x30\x71\x89\xA2\x41\xE5\x40\x46\x89\xC9\x81\x54\xD2\x48\xA\x41\x80\x42\xB2\xA0\x10\x25\x28\x4"
"\x7\x5B\x54\x88\x17\x1\x40\x44\x0\x64\x4F\x8C\x80\xD4\x80\x42\x4\xFE\x30\xAA\x81\xB8\x51\x3C\xA\x11"
"\xC9\x1C\x6B\x5\x0\xFA\xC4\xA7\x57\x71\x54\xC8\x33\x32\xA8\x10\x6A\x28\x64\x7B\x3\xB1\xD1\x40\x48\xD8"
"\x3C\x6D\x29\x64\xB\xE0\x82\x40\x4\xC2\x19\x1\x72\x92\x73\x8\x11\x18\x42\x3A\xD3\x49\x2E\x1A\x9C\x4B"
"\x5C\xE6\x32\x97\x10\x24\x20\x4\x7A\xD2\xF3\x9\x4F\xA0\xA7\xB9\xCE\x9\x1\x7\x58\x6A\x50\xA9\x3B\x40"
"\x9\x4C\x60\x82\x17\x14\xF4\x5\x4B\x40\x68\x42\x11\x1A\x6\x86\x32\x54\xA\xF\x95\x42\x10\x22\x1A\x4"
"\x8A\x5A\xAC\x62\x40\xC0\x28\xE7\xAA\xB0\xD1\x2A\x68\xC1\xA3\x24\x3\x29\x14\x44\x2A\xD2\x1E\xDC\x6C\xA4"
"\x24\xEB\x5C\x10\x96\x70\x82\x2B\xC\x1\x11\x35\x3C\x40\xD2\x44\x10\x82\x3\x20\x81\x5\x26\xB0\x1\x15"
"\x70\xB0\x53\x25\xF4\xB4\xA7\x38\x50\xC2\x4E\x73\x90\x3\x1D\xE8\x60\x7\x47\x95\x41\x49\xB5\x6\x84\x29"
"\x78\x6D\x8\x33\x80\xEA\x3\x20\x30\x4\x9\x4C\x80\x2\x15\xB0\x80\x5\x4\xB0\xD5\x1\x74\x95\x0\x5F"
"\x25\xC0\x5\xC4\x7A\x1\xC\x94\x15\x3\x7C\xBB\x41\xDF\xFE\xB6\xD6\x4\x28\xC0\xAD\x6F\x5D\x1C\xE3\x18"
"\xC0\x80\x67\x3C\x63\x1A\xD3\x88\x46\x34\xAE\x51\xFE\x5\x6A\x48\xA1\x1A\x2F\x50\x84\x4\x86\x0\x1\x7D"
"\x81\xE0\x0\x48\x53\x5D\xEA\x56\x40\x2\x24\xC0\xCE\x6\x5B\x98\xE5\x56\xFC\xA7\x48\x45\x1A\xCF\x78\x8D"
"\x1C\xC8\x57\x1E\xA9\xC3\xCC\x86\x4F\x21\xF2\xAB\x62\xE\x7\x42\xA9\x5E\x66\x12\x0\x4F\x4\x0\xF\x3B"
"\x9\xBE\x4F\x86\xD2\xB5\x0\x58\xE5\x2E\xC7\x34\x5B\x55\x6E\x32\x91\x23\xC4\xED\x40\xBE\x39\x90\x1C\xD0"
"\xD2\xB7\x3\xB9\xE5\x40\xB8\x68\x3F\x85\xF8\x80\x93\x63\x5C\xA1\x19\x1\x60\x1\x62\x2\x80\x8D\xC5\x4C"
"\xE0\x2\xA5\x5B\xC7\xFA\x3C\x13\x0\xC8\x50\x88\x1E\x37\x28\x43\x0\xF0\x4F\x84\xDA\x54\x48\xC\x4E\xF8"
"\x80\xFC\x29\x84\xB2\xE6\x5\x24\x66\xB9\xE2\xC8\xF1\x91\x37\x7E\xB0\x54\x48\x14\x47\x6B\x5A\x5F\xFA\x12"
"\xB5\xA8\x55\x6D\xFD\xEA\x87\x44\x0\xF0\x37\xB6\xBC\xE4\x65\x6C\x55\x6B\x3C\xD0\x12\xEA\x43\xC2\x55\x48"
"\x6F\x7\x52\xCB\x5\xFF\x16\x0\xA\x26\x6E\x29\x8F\x8B\xDE\x32\x2A\x84\xB9\x3\x19\x80\x42\x9E\x7B\xCC"
"\x37\x4E\x17\x0\x74\x64\xA6\x1D\x73\x32\x41\x6A\x52\x27\x79\x84\x1C\x64\x21\xC1\xE5\x5E\x0\xB0\xD8\x7F"
"\x93\xA5\xF0\x22\xB9\xAB\x5E\xFE\x16\x6B\x5\xB4\xF2\x5\x0\x8E\x71\x4C\xDA\xFA\xDA\xF6\xB4\x9C\xF4\xE4"
"\x42\x40\xD9\x5F\x51\x92\x92\xC8\x3D\x54\xA1\x56\xA8\x58\x95\x81\xEC\x0\x97\xBC\xB5\xA5\x83\x83\x9B\xC5"
"\x5C\xD2\x36\xB5\xA\x41\xAE\x22\x39\x20\xCC\xE6\x6E\xD8\x98\x70\xFC\xF0\x32\xE5\x73\x47\x85\xCC\x6A\x20"
"\xD5\x84\xA2\x42\xB2\x9\x80\x6D\x62\xAB\x9B\x22\x72\x40\x9C\x1D\xF0\x0\x3A\xD7\xB9\xCE\x10\xC0\xB3\x38"
"\xF5\x5C\x4E\x3E\xAB\x73\x9D\xEC\x1C\xD7\x3E\x11\xE1\x80\x28\x84\xE7\x0\xAA\xB\x81\x4D\x93\xC0\x82\x7B"
"\x3E\xE1\x4\x8E\x3E\x41\xA4\x23\xFD\x82\x13\x18\xB4\xA0\xA\xC5\x74\x43\xC3\x0\x51\x88\x52\xD4\xD3\x16"
"\x9D\x42\x46\x39\xDA\x51\x8F\x72\x94\xA9\x53\x90\xC2\x12\x28\x2D\x4\x97\x16\x3A\xA6\xAA\x1B\xC1\xA\x5E"
"\x17\x83\x24\x64\xE1\xA8\x47\x35\x6A\x51\x75\x9D\x3\x1C\xF0\x9A\xA7\x3E\x5\x76\xAF\x87\x5A\x54\xA4\xF2"
"\xA0\xA4\x2E\xA8\x82\xC7\xAC\x20\x4\xA8\xCE\x60\xCE\x11\xA0\xC1\x15\xC\xC0\x81\xAC\x6A\x55\x0\x5D\xF5"
"\xEA\x57\xC7\x4A\x56\xB3\xEE\x8D\x6F\x7E\xF3\x9B\x5B\x35\xB0\x0\x6\x6C\xC0\xAE\x86\xC8\x2B\x35\xA8\xB1"
"\xA\xC9\xFE\x9\xC1\x3\x4C\x28\xEC\x61\x43\x90\xD8\x10\xC8\xBA\xB1\x70\xEE\x60\x8B\x15\xC2\x62\x16\x9F"
"\xF7\xB6\x64\xC\x17\x20\x97\xE5\x5D\x43\xA6\xD9\xE0\x39\x16\xED\x1F\x59\x59\xDA\x85\xAB\x36\xC8\x41\xAE"
"\x9F\x52\x5E\xCB\xDF\x20\x5F\x33\x90\x53\x54\x48\x9\x2E\x9\x0\x27\x23\xD8\xE3\xF\x8E\x72\x83\x81\xFB"
"\x64\x8E\x5B\x39\xC8\x59\x56\x48\xA\x98\x37\xCC\x81\xB0\xDC\xB9\x6D\x8C\xEE\x40\x92\x19\xE2\x81\x8C\x18"
"\x0\x7C\x1C\x88\x3\x55\x48\xF0\xF7\x82\xEB\x77\x3\xF9\xB9\xBE\x7\xE2\xE2\x7D\xC7\xD8\xDF\x2B\x34\x9E"
"\xFF\xDC\xE7\x66\xDD\x72\x56\x92\xF1\x85\xFA\xC1\x7B\xAC\x49\xAA\xFF\x78\x20\xF\x67\x2D\x0\x24\xAE\x75"
"\x4E\x46\x32\x78\x96\x1C\x48\x2C\x7\x72\xE0\x8\x97\xFC\xE3\xC3\x9D\x32\x83\x1\xA0\x76\xB5\x43\xB8\xE3"
"\xE4\x53\xC8\xC9\x63\x9C\x2\x2E\x63\x58\xC3\x30\xEF\xB0\x32\x7\x12\xCC\x81\x98\x19\x0\x68\x6\x0\x11"
"\x4E\xC\xF6\x14\x8B\x28\xE8\x87\xCF\x37\xBF\x8B\x3E\x10\x18\xFF\x9B\x85\x8B\x7\x10\xC6\x9B\x7E\x41\xA7"
"\x47\x32\x92\x3A\x4E\xF8\xD4\x19\x6E\xF5\x2B\x5F\x3D\xEB\xF5\x53\x6D\x24\x5D\x49\x28\xD0\xEE\xFE\x16\x0"
"\x3C\xA8\x72\x93\x15\xF2\xF6\xE1\x42\x38\xED\x21\xA7\xB2\xEA\x25\xDC\xDA\x5F\x32\x5E\x21\x45\xA8\x3B\x0"
"\x32\xBC\x46\xBC\x87\x64\x99\x7E\xD7\x2E\x0\x78\x85\xCD\xDC\x32\x7D\x2B\x51\x20\x46\xF2\x95\xBF\x7C\xE6"
"\xCB\x79\xCE\x76\x86\x0\x9D\xF1\x9C\xE7\xE9\xF3\x99\xCF\x10\x40\xC4\x3\x88\x51\xE8\x88\x24\x6D\x4\x1"
"\x1D\x28\x3C\xE1\x59\x4F\x21\x34\xDA\xD1\x8D\x7E\xB4\xA4\x25\x4D\x69\xF6\x1B\x54\xA1\x61\x48\xA8\xA6\xA5"
"\xB0\x69\x4E\x7B\xBA\xA2\x14\x7D\x28\x42\x23\x2D\x4\x1A\x30\x1\x2\xC5\x8\xF\xA4\x51\x9A\xD6\x29\x1"
"\x2A\x98\x9D\x3D\xE8\x81\x4\x4C\x40\x1E\x60\x40\x1E\x90\x81\x7\x94\x81\x5B\xC3\xB5\x1D\xD0\xB5\xA2\xEA"
"\xB5\x9D\xFA\x35\x60\xB\xAA\x5E\xD3\xB5\x62\x4B\x40\x92\x61\xAA\x30\x78\x2\x66\x68\xB6\x66\x20\xA7\xAA"
"\x2A\x2\xAC\xCA\x2A\xAE\xCA\x36\x6D\x13\xAB\xB2\xBA\x81\x6C\xF8\x1B\xD\xD0\x80\xD\xD8\x0\x43\x30\x84"
"\x6B\xA0\x6\x3\x58\x85\x9\x50\x84\x77\x8B\x37\x1\x1C\x40\xC3\x13\x1E\xA0\x2B\x42\x0\x70\x25\x57\x52"
"\x3C\xDB\x63\xC2\xC7\x1B\x3A\x85\x10\x24\x42\x61\xB2\xF5\xA2\xBC\x2A\x7C\xFE\xBA\x18\x3A\xB8\x1D\xCB\x3C"
"\xD3\xC2\xAF\xB8\xF3\xC2\xAA\xC3\x31\xFF\x1\xAD\xEF\x2\x80\xC8\x3A\xA5\x24\x52\x8\xD4\xEB\xA2\xD4\x8B"
"\xBD\x36\x74\x3D\x7\x6B\xBB\xD5\x4B\x25\x21\x93\x8E\x18\xA3\x80\xDC\xDB\xBD\x97\xCB\x3B\x9A\x93\x95\x12"
"\x1B\x8\xFE\x0\xA1\x81\x20\xC3\xAD\x40\x3C\x23\x34\x44\x0\x28\x44\x24\x84\x3C\xA2\x6B\x42\x16\x53\x1E"
"\xC2\xEB\x10\x15\x1A\x1F\xCD\x82\x24\xA7\xC3\xBC\x83\xE3\x31\xFA\xF2\x31\xD5\x42\xAD\x48\x52\x24\x25\xDB"
"\x38\x53\x32\x25\x25\x52\xC3\xB2\xD3\xA5\xE1\x6A\x3D\xD8\x63\x3B\xD8\x7B\x3B\x25\xDA\x3A\xE4\x62\xB1\x3B"
"\x1C\x88\xB\xD3\xBD\xDE\xCB\x6\x85\xA8\x80\x94\x53\x88\xE1\x3\x80\x47\x2C\x3C\x42\x3C\xC2\x44\x14\xC6"
"\xC4\x5B\x44\xC8\x13\xA4\x36\xD3\x38\x80\x53\x2F\x4A\xAC\x3C\x4B\x8C\x3A\x85\xDB\x3C\xCD\x43\x2D\x5F\xC2"
"\x31\xB\x7A\xA\xC9\x3\x80\x48\x94\xAD\x26\x3A\x43\xB8\x43\xC3\x35\x4\x47\xB3\x73\x43\x55\x84\x3D\xB7"
"\x9B\xC3\xFA\x81\xC5\x6\xB2\xB0\xE6\x2\x33\xBE\xBB\xB9\x2\x52\xB3\xE2\xD3\xA\xE4\x4B\x3E\x7A\xDC\x3E"
"\xE5\xB3\x47\x7B\x64\xBE\x7D\x24\x6\xE7\x7B\x3E\x3B\xFE\xAB\x33\x7\xD8\x3E\xA2\x89\x88\x43\x9B\x29\x45"
"\x63\x1\x3F\xA3\x81\x21\x0\xB4\x73\x11\xBF\x78\xAA\x27\xF3\x43\xBF\xF3\x53\x3F\xF5\xB3\x34\x4C\x7B\x3F"
"\x4C\xA3\xB4\x47\x93\xA7\x73\x72\x80\x62\xB0\x92\x98\x5A\x9D\x9A\xDA\x3\xD9\xA1\x82\x8F\x2\x29\x17\x30"
"\x99\x91\x22\x29\x5\x34\x36\x6\x4C\x6\x8\x8C\x40\x9\xC4\xB5\xA\x1C\x2A\x5F\x3\x2A\xD\xDC\xC0\x61"
"\x23\xB6\x1D\x90\x1\x63\x33\x19\xAE\x91\x82\x65\x6B\xB6\x67\xA3\x1\x45\x98\xB6\x6A\xBB\xB6\x1\x20\x0"
"\x7D\xC0\x80\x6C\xC8\x80\x2\xA8\x0\x1B\xE4\x80\xC1\x31\x80\xE\xF8\xC1\x61\x88\xB7\x10\x20\x94\x60\xF4"
"\xCA\x43\x1C\xC6\x43\x54\xC2\x7C\xF3\x45\xAD\x20\x81\x18\xBB\x2C\xEE\xD2\x2C\x66\xC4\xC2\x2B\x44\xB8\x2C"
"\x7C\x46\xCD\xA3\x46\x40\xAA\x21\xC2\x13\x3B\x0\x20\x3B\xFE\xE2\x25\x51\x9C\x43\x25\xD2\xA5\xB7\x63\xBD"
"\x4\x23\x47\x91\x3\x39\xD9\xF3\x46\xAE\xAB\xC3\x27\x1C\x88\x55\xC8\x3D\x30\xCB\xC5\x81\xA0\xBB\x81\x10"
"\xBC\x40\x24\x42\xB0\xFC\x4A\x44\xBC\xCC\x44\x4C\xC2\xC1\xDB\x8A\x36\xD3\xC6\xCA\x9A\x31\x47\x62\x4B\xB7"
"\xBC\xBC\x67\x24\xAD\x4C\x5C\x38\xFE\x1C\xD3\xAC\xAF\x2B\x3C\xD0\xEA\x96\x23\x83\xCD\xBD\xB4\x32\x25\xF2"
"\x4B\x39\x34\xCC\x54\x1C\x39\xC2\x54\xBB\x29\x1B\x2E\x57\x2C\x2F\xC5\x4\x0\xE\xE2\xBD\x3\x52\x88\x2D"
"\x1B\x88\x9\x50\x88\x38\xF1\xB9\xCC\x64\x4E\xCB\x1C\x88\xBA\xC4\xCC\x43\x2C\x4B\x14\x9B\xC2\xA3\xB3\xAC"
"\xD0\xEC\x2C\x2B\xB4\x3C\x67\xC4\xC4\x84\xC3\x31\x4A\x2A\x3E\x42\xB1\x81\xAC\xE3\x2F\xFF\x32\xB2\x51\x9C"
"\x43\x5D\xFA\x4B\x92\x43\x3B\x38\x14\x4C\xC3\x54\x22\xDC\x1\x80\x7D\x80\x3C\xE4\x1C\x88\x5B\x1C\x88\x36"
"\x50\x8\xC6\x54\x1F\x70\xF9\x7\x7C\x4\xD0\x7A\xC\xD0\x7B\x14\xD0\x2\x25\xD0\xE5\xCB\x47\x7C\x8C\x82"
"\x75\x31\x6\x10\xE8\x3E\x80\x12\x28\x13\x90\xAA\xE9\x1B\x27\xEB\x33\x27\x3F\x63\x48\x76\x72\xA7\x87\x24"
"\x3F\x7C\x92\xC8\x7B\x4A\xBF\x8A\xAC\xB4\x11\x95\xB4\x7B\x92\x27\x1A\x88\x80\xEC\x5B\x50\xC3\x9A\x37\xC5"
"\x9A\xB5\x5A\xB\x2\x50\x13\x35\x8E\xD2\x2\x52\x4B\xC9\x92\x61\xC9\x9B\x51\xC0\x1E\x60\x40\x99\x8C\xC0"
"\x99\xBC\xB5\xA\xD4\x81\x9B\xC4\xC0\x9C\xC\x36\xC\xAC\x40\x9F\x4C\x6\xA5\xD2\x82\x1F\x68\xAA\xAF\x29"
"\x4A\xA9\x1A\xFE\x2\x45\x58\x85\x14\x90\xCA\xA\xA8\xCA\x22\x20\x87\xE\x20\x2\x23\x90\x94\xAD\xF8\x7"
"\xE8\xC\xCB\xE8\x24\xD3\x31\x4D\x44\xE8\xF4\x45\xFE\xA1\xA2\xD7\x7C\x31\xA3\x4B\x2F\xEC\xA4\xC2\xCD\x6A"
"\xCB\xED\xEC\xCE\x83\xD3\xAC\x81\xC3\xC6\xAB\xF0\x3C\xDA\xDB\x2F\x3F\x92\xCD\xD9\x3B\xCC\xDA\x34\xCC\xC0"
"\x84\xB2\xDC\x5C\x3B\x7\x83\xB0\xDE\xF4\xA3\xF1\x9\x3A\x40\x4\x80\x6B\x99\x4C\xAD\xF8\x87\x49\x6D\xCE"
"\x32\xAD\xD4\x31\x15\x24\x35\xF5\xA6\x62\x74\xBC\xA3\x53\x24\xF5\x1A\x9F\x30\xAA\xC4\xB6\xBC\x44\xB7\xD4"
"\x2C\x45\xD2\xD4\x81\x48\xC6\x6C\xFC\x42\x3A\x44\x4C\xD8\x34\x4F\x6E\x44\xCF\x6F\x2C\x3B\xC0\x24\x39\x8"
"\x5B\x45\xC2\x4C\xD4\x34\x1C\x32\x46\xAD\x20\x78\x4\x53\x4A\x75\x4E\x4B\x1D\x56\x33\x3D\xC2\x34\xC5\x46"
"\x33\x1C\x4B\xE0\x6C\x3C\x27\x74\xD6\xB4\x54\xA1\xB5\x54\x88\x51\x25\x4D\x47\xF2\x1F\x41\x79\xA5\x2B\xA"
"\x2F\x20\xFB\xBC\x21\x8B\xD5\x6D\xEC\x46\xDA\x64\xC3\xF5\x3C\xBB\xC1\x3C\xD4\x42\x15\x47\xDF\x4\x38\x5F"
"\x5C\x16\x85\x98\xD4\x49\x3D\xD0\x4\x35\x50\x79\x8D\xD7\x1\xCD\xC7\x19\x88\x82\x19\x98\x17\x6\xFE\x75"
"\x50\x36\x4B\x9A\x44\x63\x81\x45\xEB\x47\x39\x7B\x80\x7F\x84\xBE\x9\xCD\xB3\x3E\xBB\xD0\x75\x52\x27\x40"
"\x7B\xA7\xF1\xEB\xD0\xF2\xFB\x50\x7C\x3A\xD1\x74\x4A\x51\x81\x3C\x2\xA8\x10\x42\x9A\x2A\x1\x16\x98\x1D"
"\x16\x58\x2\xF9\xAB\xBF\x4F\xB3\x18\xA6\xC2\xA8\x51\xAB\x51\x94\xBC\xD1\x1C\xDD\xD1\x5\x74\x40\x1F\xA5"
"\x49\xA\xB4\xC9\xA1\xC2\x40\x9D\xDC\x40\xE\x24\xB6\x9F\x14\x29\xAE\x51\x29\x95\xD9\x87\x8C\x5D\x3A\x49"
"\x7D\x57\x78\xBD\xD4\xA2\x1D\x56\x64\x85\xC4\x23\x5C\x56\xA1\xEB\x9F\xDF\x74\x56\xD0\x54\x46\xB5\x9C\xD6"
"\x66\xB4\x42\x45\xF2\xC5\x36\x6B\xB3\xD7\xBC\x2F\x6E\xE5\x53\x3F\xD2\xCB\xF3\xEC\x4B\x36\xB4\xD5\x8F\x7B"
"\x43\xDD\x7C\x4F\x71\x34\xAE\x85\x13\x91\xA1\x65\xDB\x62\x35\x5A\x62\x25\x53\xE8\x5C\x3A\x64\xBC\xCC\xCD"
"\x4\x4E\x46\x7C\xDA\x37\x95\x44\x47\x12\x55\x47\x32\x1E\xD6\x6C\x33\x3\xE3\xC2\x4D\x6C\x55\xFD\xF2\x5A"
"\x23\xFB\xD3\x40\xED\xA3\x70\x24\xD4\x36\x7C\x3D\xC2\x1C\x2E\x5D\x3A\xA1\x81\x60\xDB\xB6\x9D\xDC\xCB\xC5"
"\xDC\xCC\xD5\xDC\xCD\xE5\xDC\xCE\xF5\xDC\xCF\x5\xDD\xD0\x15\xDD\xD1\x25\xDD\x3E\xC9\xAD\xDC\xCA\x2D\xDD"
"\xD4\x55\xDD\xD5\x65\xDD\xD6\x75\xDD\xD7\x65\xDD\xD3\x3D\x5D\xD8\xA5\xDD\xDA\xB5\xDD\xDB\xC5\xDD\xDC\x5"
"\x0\xD9\xE5\x5D\xDD\xF5\xDD\xDF\x5\xDE\xE0\xC5\x5D\xDE\x25\xDE\xA1\x15\xDE\xE3\x45\xDE\xE4\x55\x5E\xA1"
"\xE5\xDD\x80\x0\x0\x3B";
#endif
+155
View File
@@ -0,0 +1,155 @@
/* Copyrights 2002 Luis Figueiredo (stdio@netc.pt) All rights reserved.
*
* See the LICENSE file
*
* The origin of this software must not be misrepresented, either by
* explicit claim or by omission. Since few users ever read sources,
* credits must appear in the documentation.
*
* date: Sat Mar 30 14:25:25 GMT 2002
*
* -- memory functions
*/
#include "memory.h"
IFDEBUG(int _t=0;)
/*********************************************************************************************************/
/*
* same as malloc with error reporting and libwebserver debug
*/
void * __ILWS_malloc(size_t s) {
void *ret;
ret=malloc(s);
if(ret==NULL) {
IFDEBUG(fprintf(stderr,"memory.c: malloc: %s (size %d)\n",strerror(errno),s);fflush(stderr));
return NULL;
};
IFDEBUG(_t++;);
IFDEBUG(fprintf(stderr,"memory.c (%d): Allocated %d bytes to %p\n",_t,s,ret);fflush(stderr));
return ret;
}
/*********************************************************************************************************/
/*
* same as calloc with error reporting and libwebserver debug
*/
void * __ILWS_calloc(size_t nmemb,size_t s) {
void *ret;
ret=calloc(nmemb,s);
if(ret==NULL) {
IFDEBUG(fprintf(stderr,"memory.c: calloc %s\n",strerror(errno));fflush(stderr));
return NULL;
};
IFDEBUG(_t++;);
IFDEBUG(fprintf(stderr,"memory.c (%d): Allocated %d bytes to %p\n",_t,s*nmemb,ret);fflush(stderr));
return ret;
}
/*********************************************************************************************************/
/*
* same as realloc with error reporting and libwebserver debug
*/
void * __ILWS_realloc(void *buf,size_t s) {
void *ret;
ret=realloc(buf,s);
#ifdef DEBUG
if(buf==NULL) {
_t++;
IFDEBUG(fprintf(stderr,"memory.c (%d): Allocated %d bytes to %p\n",_t,s,ret);fflush(stderr));
};
#endif
if(ret==NULL) {
IFDEBUG(fprintf(stderr,"memory.c: realloc: %s\n",strerror(errno));fflush(stderr));
return NULL;
};
IFDEBUG(fprintf(stderr,"memory.c: Realloc buffer %p to %d\n",buf,s);fflush(stderr));
return ret;
}
/*********************************************************************************************************/
/*
* same as free with error report and libwebserver debug
*/
void __ILWS_free(void *ptr) {
if(ptr!=NULL) {
free(ptr);
IFDEBUG(fprintf(stderr,"memory.c (%d): Buffer %p freed\n",_t,ptr);fflush(stderr));
IFDEBUG(_t--;);
};
}
/*********************************************************************************************************/
/*
* Add a buffer to memrequest list
*/
void *__ILWS_add_buffer(struct memrequest *list,unsigned int size) {
struct memrequest *tmem;
if(size==0) {
return NULL;
};
if(list!=NULL) {
tmem=list;
}else {
return NULL;
};
while(tmem->next!=NULL)tmem=tmem->next;
tmem->next=__ILWS_malloc(sizeof(struct memrequest));
if(tmem->next==NULL) return NULL; // ERROR
tmem->next->ptr=__ILWS_malloc(size);
tmem->next->next=NULL;
return tmem->next->ptr;
}
/*********************************************************************************************************/
/*
* Initialize memrequest list of buffers
*/
struct memrequest *__ILWS_init_buffer_list() {
struct memrequest *newlist;
newlist=__ILWS_malloc(sizeof(struct memrequest));
if(newlist==NULL) return NULL;
newlist->next=NULL;
newlist->ptr=NULL;
return newlist;
}
/*********************************************************************************************************/
/*
* Delete memrequest buffer node (free)
*/
void __ILWS_delete_buffer(struct memrequest *mem) {
__ILWS_free(mem->ptr);
__ILWS_free(mem);
}
/*********************************************************************************************************/
/*
* Delete memrequest next buffer
*/
void __ILWS_delete_next_buffer(struct memrequest *mem) {
struct memrequest *tmem;
tmem=mem->next;
mem->next=mem->next->next;
__ILWS_delete_buffer(tmem);
}
/*********************************************************************************************************/
/*
* Delete whole memrequest buffer list
*/
void __ILWS_delete_buffer_list(struct memrequest *list) {
struct memrequest *tmem=list;
if(tmem==NULL) return;
while(tmem->next!=NULL) {
__ILWS_delete_next_buffer(tmem);
};
__ILWS_delete_buffer(tmem);
}
+46
View File
@@ -0,0 +1,46 @@
/* Copyrights 2002 Luis Figueiredo (stdio@netc.pt) All rights reserved.
*
* See the LICENSE file
*
* The origin of this software must not be misrepresented, either by
* explicit claim or by omission. Since few users ever read sources,
* credits must appear in the documentation.
*
* date: Sat Mar 30 14:25:25 GMT 2002
*
* memory functions
*/
#ifndef _MEMORY_H_
#define _MEMORY_H_
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h> // Johannes E. Schindelin
#include "debug.h"
extern int errno;
void *__ILWS_malloc(size_t);
void *__ILWS_calloc(size_t,size_t);
void *__ILWS_realloc(void *,size_t);
void __ILWS_free(void *);
struct memrequest {
char *ptr;
struct memrequest *next;
};
struct memrequest *__ILWS_init_buffer_list();
void *__ILWS_add_buffer(struct memrequest *,unsigned int);
void __ILWS_delete_buffer(struct memrequest *);
void __ILWS_delete_next_buffer(struct memrequest *);
void __ILWS_delete_buffer_list(struct memrequest *);
#endif
+22
View File
@@ -0,0 +1,22 @@
/* Copyrights 2002 Luis Figueiredo (stdio@netc.pt) All rights reserved.
*
* See the LICENSE file
*
* The origin of this software must not be misrepresented, either by
* explicit claim or by omission. Since few users ever read sources,
* credits must appear in the documentation.
*
* date: Wen Jul 30 06:57:42 GMT 2003
*
* -- module function
*
* Tested on WIN32 only
*/
#include "module.h"
+25
View File
@@ -0,0 +1,25 @@
#ifndef _MODULE_H_
#define _MODULE_H_
struct module {
const char *handle;
void (func)();
};
#endif
+587
View File
@@ -0,0 +1,587 @@
/*
* Luis Figueiredo - why remake the wheel, this functions feets perfectly
* and the credits still here :)
*/
/*
* xvgifwr.c - handles writing of GIF files. based on flgife.c and
* flgifc.c from the FBM Library, by Michael Maudlin
*
* Contains:
* WriteGIF(fp, pic, ptype, w, h, rmap, gmap, bmap, numcols, colorstyle,
* comment)
*
* Note: slightly brain-damaged, in that it'll only write non-interlaced
* GIF files (in the interests of speed, or something)
*
*/
/*****************************************************************
* Portions of this code Copyright (C) 1989 by Michael Mauldin.
* Permission is granted to use this file in whole or in
* part for any purpose, educational, recreational or commercial,
* provided that this copyright notice is retained unchanged.
* This software is available to all free of charge by anonymous
* FTP and in the UUNET archives.
*
*
* Authors: Michael Mauldin (mlm@cs.cmu.edu)
* David Rowley (mgardi@watdcsu.waterloo.edu)
*
* Based on: compress.c - File compression ala IEEE Computer, June 1984.
*
* Spencer W. Thomas (decvax!harpo!utah-cs!utah-gr!thomas)
* Jim McKie (decvax!mcvax!jim)
* Steve Davies (decvax!vax135!petsd!peora!srd)
* Ken Turkowski (decvax!decwrl!turtlevax!ken)
* James A. Woods (decvax!ihnp4!ames!jaw)
* Joe Orost (decvax!vax135!petsd!joe)
*****************************************************************/
#include "outgif.h"
static int __ILWS_Width, __ILWS_Height;
static int __ILWS_curx, __ILWS_cury;
static long __ILWS_CountDown;
static int __ILWS_Interlace;
//static unsigned char bw[2] = {0, 0xff};
static void __ILWS_putword PARM((int, FILE *));
static void __ILWS_compress PARM((int, FILE *, unsigned char *, int));
static void __ILWS_output PARM((int));
static void __ILWS_cl_block PARM((void));
static void __ILWS_cl_hash PARM((count_int));
static void __ILWS_char_init PARM((void));
static void __ILWS_char_out PARM((int));
static void __ILWS_flush_char PARM((void));
static unsigned char pc2nc[256],r1[256],g1[256],b1[256];
/*************************************************************/
int __ILWS_WriteGIF(FILE *fp, unsigned char *pic, int w, int h, unsigned char *rmap, unsigned char *gmap, unsigned char *bmap, int numcols, int colorstyle,int transparency,
char *comment)
{
int RWidth, RHeight;
int LeftOfs, TopOfs;
int ColorMapSize, InitCodeSize, Background, BitsPerPixel;
int i,j,nc;
unsigned char *pic8;
//unsigned char rtemp[256],gtemp[256],btemp[256];
pic8 = pic;
__ILWS_Interlace = 0;
Background = 0;
for (i=0; i<256; i++) { pc2nc[i] = r1[i] = g1[i] = b1[i] = 0; }
/* compute number of unique colors */
nc = 0;
for (i=0; i<numcols; i++) {
/* see if color #i is already used */
for (j=0; j<i; j++) {
if (rmap[i] == rmap[j] && gmap[i] == gmap[j] &&
bmap[i] == bmap[j]) break;
}
if (j==i) { /* wasn't found */
pc2nc[i] = nc;
r1[nc] = rmap[i];
g1[nc] = gmap[i];
b1[nc] = bmap[i];
nc++;
}
else pc2nc[i] = pc2nc[j];
}
/* figure out 'BitsPerPixel' */
for (i=1; i<8; i++)
if ( (1<<i) >= nc) break;
BitsPerPixel = i;
ColorMapSize = 1 << BitsPerPixel;
RWidth = __ILWS_Width = w;
RHeight = __ILWS_Height = h;
LeftOfs = TopOfs = 0;
__ILWS_CountDown = w * h; /* # of pixels we'll be doing */
if (BitsPerPixel <= 1) InitCodeSize = 2;
else InitCodeSize = BitsPerPixel;
__ILWS_curx = __ILWS_cury = 0;
if (!fp) {
fprintf(stderr, "WriteGIF: file not open for writing\n" );
return (1);
}
if (comment && strlen(comment) > (size_t) 0)
fwrite("GIF89a", (size_t) 1, (size_t) 6, fp); /* the GIF magic number */
else
fwrite("GIF87a", (size_t) 1, (size_t) 6, fp); /* the GIF magic number */
__ILWS_putword(RWidth, fp); /* screen descriptor */
__ILWS_putword(RHeight, fp);
i = 0x80; /* Yes, there is a color map */
i |= (8-1)<<4; /* OR in the color resolution (hardwired 8) */
i |= (BitsPerPixel - 1); /* OR in the # of bits per pixel */
fputc(i,fp);
fputc(Background, fp); /* background color */
fputc(0, fp); /* future expansion unsigned char */
if (colorstyle == 1) { /* greyscale */
for (i=0; i<ColorMapSize; i++) {
j = MONO(r1[i], g1[i], b1[i]);
fputc(j, fp);
fputc(j, fp);
fputc(j, fp);
}
}
else {
for (i=0; i<ColorMapSize; i++) { /* write out Global colormap */
fputc(r1[i], fp);
fputc(g1[i], fp);
fputc(b1[i], fp);
}
}
if (comment && strlen(comment) > (size_t) 0) { /* write comment blocks */
char *sp;
int i, blen;
fputc(0x21, fp); /* EXTENSION block */
fputc(0xF9,fp); // graphic control extension// Luis Figueiredo
fputc(4,fp); // blocksize
fputc(0x1,fp); // transparency flag
fputc(100,fp);// delay (unsigned?)
fputc(100,fp);// delay (unsigned?)
fputc(transparency,fp); // Luis figueiredo
fputc(0, fp); /* zero-length data subblock to end extension */
fputc(0x21, fp); /* EXTENSION block */
fputc(0xFE, fp); /* comment extension */
sp = comment;
while ( (blen=strlen(sp)) > 0) {
if (blen>255) blen = 255;
fputc(blen, fp);
for (i=0; i<blen; i++, sp++) fputc(*sp, fp);
}
fputc(0, fp); /* zero-length data subblock to end extension */
}
fputc( ',', fp ); /* image separator */
/* Write the Image header */
__ILWS_putword(LeftOfs, fp);
__ILWS_putword(TopOfs, fp);
__ILWS_putword(__ILWS_Width, fp);
__ILWS_putword(__ILWS_Height, fp);
if (__ILWS_Interlace) fputc(0x40, fp); /* Use Global Colormap, maybe Interlace */
else fputc(0x00, fp);
fputc(InitCodeSize, fp);
__ILWS_compress(InitCodeSize+1, fp, pic8, w*h);
fputc(0,fp); /* Write out a Zero-length packet (EOF) */
fputc(';',fp); /* Write GIF file terminator */
if (ferror(fp)) return -1;
return (0);
}
/******************************/
static void __ILWS_putword(int w, FILE *fp)
{
/* writes a 16-bit integer in GIF order (LSB first) */
fputc(w & 0xff, fp);
fputc((w>>8)&0xff, fp);
}
/***********************************************************************/
static unsigned long __ILWS_cur_accum = 0;
static int __ILWS_cur_bits = 0;
#define min(a,b) ((a>b) ? b : a)
#define XV_BITS 12 /* BITS was already defined on some systems */
#define MSDOS 1
#define HSIZE 5003 /* 80% occupancy */
typedef unsigned char char_type;
static int __ILWS_n_bits; /* number of bits/code */
static int __ILWS_maxbits = XV_BITS; /* user settable max # bits/code */
static int __ILWS_maxcode; /* maximum code, given n_bits */
static int __ILWS_maxmaxcode = 1 << XV_BITS; /* NEVER generate this */
#define MAXCODE(n_bits) ( (1 << (n_bits)) - 1)
static count_int __ILWS_htab [HSIZE];
static unsigned short __ILWS_codetab [HSIZE];
#define HashTabOf(i) __ILWS_htab[i]
#define CodeTabOf(i) __ILWS_codetab[i]
static int __ILWS_hsize = HSIZE; /* for dynamic table sizing */
/*
* To save much memory, we overlay the table used by compress() with those
* used by decompress(). The tab_prefix table is the same size and type
* as the codetab. The tab_suffix table needs 2**BITS characters. We
* get this from the beginning of htab. The output stack uses the rest
* of htab, and contains characters. There is plenty of room for any
* possible stack (stack used to be 8000 characters).
*/
#define tab_prefixof(i) CodeTabOf(i)
#define tab_suffixof(i) ((char_type *)(htab))[i]
#define de_stack ((char_type *)&tab_suffixof(1<<XV_BITS))
static int __ILWS_free_ent = 0; /* first unused entry */
/*
* block compression parameters -- after all codes are used up,
* and compression rate changes, start over.
*/
static int __ILWS_clear_flg = 0;
static long int __ILWS_in_count = 1; /* length of input */
static long int __ILWS_out_count = 0; /* # of codes output (for debugging) */
/*
* compress stdin to stdout
*
* Algorithm: use open addressing double hashing (no chaining) on the
* prefix code / next character combination. We do a variant of Knuth's
* algorithm D (vol. 3, sec. 6.4) along with G. Knott's relatively-prime
* secondary probe. Here, the modular division first probe is gives way
* to a faster exclusive-or manipulation. Also do block compression with
* an adaptive reset, whereby the code table is cleared when the compression
* ratio decreases, but after the table fills. The variable-length output
* codes are re-sized at this point, and a special CLEAR code is generated
* for the decompressor. Late addition: construct the table according to
* file size for noticeable speed improvement on small files. Please direct
* questions about this implementation to ames!jaw.
*/
static int __ILWS_g_init_bits;
static FILE *__ILWS_g_outfile;
static int __ILWS_ClearCode;
static int __ILWS_EOFCode;
/********************************************************/
static void __ILWS_compress(int init_bits, FILE *outfile, unsigned char *data, int len)
{
register long fcode;
register int i = 0;
register int c;
register int ent;
register int disp;
register int hsize_reg;
register int hshift;
/*
* Set up the globals: g_init_bits - initial number of bits
* g_outfile - pointer to output file
*/
__ILWS_g_init_bits = init_bits;
__ILWS_g_outfile = outfile;
/* initialize 'compress' globals */
__ILWS_maxbits = XV_BITS;
__ILWS_maxmaxcode = 1<<XV_BITS;
memset((char *) __ILWS_htab,0, sizeof(__ILWS_htab));
memset((char *) __ILWS_codetab,0, sizeof(__ILWS_codetab));
__ILWS_hsize = HSIZE;
__ILWS_free_ent = 0;
__ILWS_clear_flg = 0;
__ILWS_in_count = 1;
__ILWS_out_count = 0;
__ILWS_cur_accum = 0;
__ILWS_cur_bits = 0;
/*
* Set up the necessary values
*/
__ILWS_out_count = 0;
__ILWS_clear_flg = 0;
__ILWS_in_count = 1;
__ILWS_maxcode = MAXCODE(__ILWS_n_bits = __ILWS_g_init_bits);
__ILWS_ClearCode = (1 << (init_bits - 1));
__ILWS_EOFCode = __ILWS_ClearCode + 1;
__ILWS_free_ent = __ILWS_ClearCode + 2;
__ILWS_char_init();
ent = pc2nc[*data++];
len--;
hshift = 0;
for ( fcode = (long) __ILWS_hsize; fcode < 65536L; fcode *= 2L )
hshift++;
hshift = 8 - hshift; /* set hash code range bound */
hsize_reg = __ILWS_hsize;
__ILWS_cl_hash( (count_int) hsize_reg); /* clear hash table */
__ILWS_output(__ILWS_ClearCode);
while (len) {
c = pc2nc[*data++]; len--;
__ILWS_in_count++;
fcode = (long) ( ( (long) c << __ILWS_maxbits) + ent);
i = (((int) c << hshift) ^ ent); /* xor hashing */
if ( HashTabOf (i) == fcode ) {
ent = CodeTabOf (i);
continue;
}
else if ( (long)HashTabOf (i) < 0 ) /* empty slot */
goto nomatch;
disp = hsize_reg - i; /* secondary hash (after G. Knott) */
if ( i == 0 )
disp = 1;
probe:
if ( (i -= disp) < 0 )
i += hsize_reg;
if ( HashTabOf (i) == fcode ) {
ent = CodeTabOf (i);
continue;
}
if ( (long)HashTabOf (i) >= 0 )
goto probe;
nomatch:
__ILWS_output(ent);
__ILWS_out_count++;
ent = c;
if ( __ILWS_free_ent < __ILWS_maxmaxcode ) {
CodeTabOf (i) = __ILWS_free_ent++; /* code -> hashtable */
HashTabOf (i) = fcode;
}
else
__ILWS_cl_block();
}
/* Put out the final code */
__ILWS_output(ent);
__ILWS_out_count++;
__ILWS_output(__ILWS_EOFCode);
}
/*****************************************************************
* TAG( output )
*
* Output the given code.
* Inputs:
* code: A n_bits-bit integer. If == -1, then EOF. This assumes
* that n_bits =< (long)wordsize - 1.
* Outputs:
* Outputs code to the file.
* Assumptions:
* Chars are 8 bits long.
* Algorithm:
* Maintain a BITS character long buffer (so that 8 codes will
* fit in it exactly). Use the VAX insv instruction to insert each
* code in turn. When the buffer fills up empty it and start over.
*/
static
unsigned long __ILWS_masks[] = { 0x0000, 0x0001, 0x0003, 0x0007, 0x000F,
0x001F, 0x003F, 0x007F, 0x00FF,
0x01FF, 0x03FF, 0x07FF, 0x0FFF,
0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF };
static void __ILWS_output(int code)
{
__ILWS_cur_accum &= __ILWS_masks[__ILWS_cur_bits];
if (__ILWS_cur_bits > 0)
__ILWS_cur_accum |= ((long)code << __ILWS_cur_bits);
else
__ILWS_cur_accum = code;
__ILWS_cur_bits += __ILWS_n_bits;
while( __ILWS_cur_bits >= 8 ) {
__ILWS_char_out( (int) (__ILWS_cur_accum & 0xff) );
__ILWS_cur_accum >>= 8;
__ILWS_cur_bits -= 8;
}
/*
* If the next entry is going to be too big for the code size,
* then increase it, if possible.
*/
if (__ILWS_free_ent > __ILWS_maxcode || __ILWS_clear_flg) {
if( __ILWS_clear_flg ) {
__ILWS_maxcode = MAXCODE (__ILWS_n_bits = __ILWS_g_init_bits);
__ILWS_clear_flg = 0;
}
else {
__ILWS_n_bits++;
if ( __ILWS_n_bits == __ILWS_maxbits )
__ILWS_maxcode = __ILWS_maxmaxcode;
else
__ILWS_maxcode = MAXCODE(__ILWS_n_bits);
}
}
if( code == __ILWS_EOFCode ) {
/* At EOF, write the rest of the buffer */
while( __ILWS_cur_bits > 0 ) {
__ILWS_char_out( (int)(__ILWS_cur_accum & 0xff) );
__ILWS_cur_accum >>= 8;
__ILWS_cur_bits -= 8;
}
__ILWS_flush_char();
fflush( __ILWS_g_outfile );
#ifdef FOO
if( ferror( g_outfile ) )
FatalError("unable to write GIF file");
#endif
}
}
/********************************/
static void __ILWS_cl_block () /* table clear for block compress */
{
/* Clear out the hash table */
__ILWS_cl_hash ( (count_int) __ILWS_hsize );
__ILWS_free_ent = __ILWS_ClearCode + 2;
__ILWS_clear_flg = 1;
__ILWS_output(__ILWS_ClearCode);
}
/********************************/
static void __ILWS_cl_hash(register count_int hsize) /* reset code table */
{
register count_int *htab_p = __ILWS_htab+hsize;
register long i;
register long m1 = -1;
i = hsize - 16;
do { /* might use Sys V memset(3) here */
*(htab_p-16) = m1;
*(htab_p-15) = m1;
*(htab_p-14) = m1;
*(htab_p-13) = m1;
*(htab_p-12) = m1;
*(htab_p-11) = m1;
*(htab_p-10) = m1;
*(htab_p-9) = m1;
*(htab_p-8) = m1;
*(htab_p-7) = m1;
*(htab_p-6) = m1;
*(htab_p-5) = m1;
*(htab_p-4) = m1;
*(htab_p-3) = m1;
*(htab_p-2) = m1;
*(htab_p-1) = m1;
htab_p -= 16;
} while ((i -= 16) >= 0);
for ( i += 16; i > 0; i-- )
*--htab_p = m1;
}
/******************************************************************************
*
* GIF Specific routines
*
******************************************************************************/
/*
* Number of characters so far in this 'packet'
*/
static int __ILWS_a_count;
/*
* Set up the 'unsigned char output' routine
*/
static void __ILWS_char_init()
{
__ILWS_a_count = 0;
}
/*
* Define the storage for the packet accumulator
*/
static char __ILWS_accum[ 256 ];
/*
* Add a character to the end of the current packet, and if it is 254
* characters, flush the packet to disk.
*/
static void __ILWS_char_out(int c)
{
__ILWS_accum[ __ILWS_a_count++ ] = c;
if( __ILWS_a_count >= 254 )
__ILWS_flush_char();
}
/*
* Flush the packet to disk, and reset the accumulator
*/
static void __ILWS_flush_char()
{
if( __ILWS_a_count > 0 ) {
fputc(__ILWS_a_count, __ILWS_g_outfile );
fwrite(__ILWS_accum, (size_t) 1, (size_t) __ILWS_a_count, __ILWS_g_outfile );
__ILWS_a_count = 0;
}
}
+63
View File
@@ -0,0 +1,63 @@
/* Copyrights 2002 Luis Figueiredo (stdio@netc.pt) All rights reserved.
*
* See the LICENSE file
*
* The origin of this software must not be misrepresented, either by
* explicit claim or by omission. Since few users ever read sources,
* credits must appear in the documentation.
*
* file: web_outgif.h
*
* description: output gif outgif.c is copyrighted by
*/
/*****************************************************************
* Portions of this code Copyright (C) 1989 by Michael Mauldin.
* Permission is granted to use this file in whole or in
* part for any purpose, educational, recreational or commercial,
* provided that this copyright notice is retained unchanged.
* This software is available to all free of charge by anonymous
* FTP and in the UUNET archives.
*
*
* Authors: Michael Mauldin (mlm@cs.cmu.edu)
* David Rowley (mgardi@watdcsu.waterloo.edu)
*
* Based on: compress.c - File compression ala IEEE Computer, June 1984.
*
* Spencer W. Thomas (decvax!harpo!utah-cs!utah-gr!thomas)
* Jim McKie (decvax!mcvax!jim)
* Steve Davies (decvax!vax135!petsd!peora!srd)
* Ken Turkowski (decvax!decwrl!turtlevax!ken)
* James A. Woods (decvax!ihnp4!ames!jaw)
* Joe Orost (decvax!vax135!petsd!joe)
*****************************************************************/
/*
*
* date: 20:57,13-57-2002
*/
#ifndef _WEB_OUTGIF_H_
#define _WEB_OUTGIF_H_
#include <stdio.h>
#include <string.h>
#include "debug.h"
#undef PARM
#ifdef __STDC__
# define PARM(a) a
#else
# define PARM(a) ()
# define const
#endif
/* MONO returns total intensity of r,g,b triple (i = .33R + .5G + .17B) */
#define MONO(rd,gn,bl) ( ((int)(rd)*11 + (int)(gn)*16 + (int)(bl)*5) >> 5)
typedef long int count_int;
int __ILWS_WriteGIF(FILE *, unsigned char *, int, int, unsigned char *, unsigned char *, unsigned char *, int, int, int, char *);
#endif
+122
View File
@@ -0,0 +1,122 @@
/* Copyrights 2002 Luis Figueiredo (stdio@netc.pt) All rights reserved.
*
* See the LICENSE file
*
* The origin of this software must not be misrepresented, either by
* explicit claim or by omission. Since few users ever read sources,
* credits must appear in the documentation.
*
* date: Sat Mar 30 14:25:25 GMT 2002
*
* -- stream list functions
*/
#include "outstream.h"
/*********************************************************************************************************/
/*
* add_outstream, add a file to output (client) stream
*/
int __ILWS_add_outstream(struct outstream *list,char *fname,FILE* stream,int istmp){
struct outstream *temp=list;
FILE *tmp;
while(temp->next!=NULL)temp=temp->next;
if(!(temp->next=__ILWS_malloc(sizeof(struct outstream)))) {
LWSERR(LE_MEMORY);
return 0;
};
// file check (0.5.3);
tmp=fopen(fname,"rb");
if(tmp==NULL) {
__ILWS_free(temp->next);
temp->next=NULL;
return 0;
};
fclose(tmp);
// --
temp->next->fname=NULL;
if(fname!=NULL) {
if(!(temp->next->fname=__ILWS_malloc(strlen(fname)+1))) {
__ILWS_free(temp->next);
temp->next=NULL;
LWSERR(LE_MEMORY);
return 0;
};
memcpy(temp->next->fname,fname,strlen(fname));
temp->next->fname[strlen(fname)]='\0';
};
temp->next->todelete=istmp;
temp->next->fstream=stream;
temp->next->wsize=1;
temp->next->rsize=0;
temp->next->wrotesize=0;
temp->next->varsize=0;
temp->next->next=NULL;
return 1;
}
/*********************************************************************************************************/
/*
* Initializate (allocate) outstream list
*/
struct outstream *__ILWS_init_outstream_list() {
struct outstream *ret;
if(!(ret=__ILWS_malloc(sizeof(struct outstream)))) {
LWSERR(LE_MEMORY);
return NULL;
};
ret->todelete=0;
ret->fname=NULL;
ret->flags=0;
ret->fstream=NULL;
ret->next=NULL;
return ret;
}
/*********************************************************************************************************/
/*
* Delete a especific node
*/
void __ILWS_delete_outstream(struct outstream *node) { // Changed
int rt;
if(node->fstream!=NULL)fclose(node->fstream); // better here;
if(node->todelete) { // is temporary file
rt=unlink(node->fname);
if(rt==-1) {
LWSERR(LE_FILESYS);
};
};
if(node->fname!=NULL)__ILWS_free(node->fname);
__ILWS_free(node);
}
/*********************************************************************************************************/
/*
* delete next node
*/
void __ILWS_delete_next_outstream(struct outstream *node) {
struct outstream *temp=node->next;
node->next=node->next->next;
__ILWS_delete_outstream(temp);
}
/*********************************************************************************************************/
/*
* delete all nodes on the list (reset list)
*/
void __ILWS_delete_outstream_list(struct outstream *list) {
struct outstream *temp=list;
while(temp->next!=NULL) {
__ILWS_delete_next_outstream(temp);
};
__ILWS_delete_outstream(temp);
}
+53
View File
@@ -0,0 +1,53 @@
/* Copyrights 2002 Luis Figueiredo (stdio@netc.pt) All rights reserved.
*
* See the LICENSE file
*
* The origin of this software must not be misrepresented, either by
* explicit claim or by omission. Since few users ever read sources,
* credits must appear in the documentation.
*
* date: Sat Mar 30 14:25:25 GMT 2002
*
* stream functions
*/
#ifndef _OUTSTREAM_H_
#define _OUTSTREAM_H_
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifndef WIN32
#include <unistd.h>
#endif
#include "debug.h"
#include "memory.h"
#include "error.h"
struct outstream {
FILE *fstream;
char *fname;
int todelete;
int wsize,rsize;
long wrotesize;
long varsize;
int flags;
struct outstream *next;
};
int __ILWS_add_outstream(struct outstream *, char *,FILE *,int);
struct outstream *__ILWS_init_outstream_list();
void __ILWS_delete_next_outstream(struct outstream *);
void __ILWS_delete_outstream_list(struct outstream *);
void __ILWS_delete_outstream(struct outstream *);
#endif
+448
View File
@@ -0,0 +1,448 @@
/* Copyrights 2002 Luis Figueiredo (stdio@netc.pt) All rights reserved.
*
* See the LICENSE file
*
* The origin of this software must not be misrepresented, either by
* explicit claim or by omission. Since few users ever read sources,
* credits must appear in the documentation.
*
* date: Sat Mar 30 14:44:42 GMT 2002
*
* -- core server functions
*
*/
#include "server.h"
#include "logo.h"
#ifdef WIN32
#define _SERVER_VERSION "libwebserver/0.5.3(win32)" // update allways when changing version (damn win)
#endif
#ifndef _SERVER_VERSION
#define _SERVER_VERSION "libwebserver/(unknow)"
#endif
#ifdef DEBUG
char *_libwebserver_version= _SERVER_VERSION "(debug)";
#else
char *_libwebserver_version= _SERVER_VERSION;
#endif
struct web_server *current_web_server;
/*********************************************************************************************************/
/*
* Define certificate file (open_ssl)
*/
void web_server_useSSLcert(struct web_server *server,const char *file) {
#ifdef HAVE_OPENSSL
if(!(server->cert_file=__ILWS_malloc(strlen(file)+1))) {
LWSERR(LE_MEMORY);
return;
};
memcpy(server->cert_file,file,strlen(file));
server->cert_file[strlen(file)]=0;
#else
printf("OpenSSL not supported in this compilation\n");
#endif
}
void web_server_useMIMEfile(struct web_server *server,const char *file) {
if(!(server->mimefile=__ILWS_malloc(strlen(file)+1))) {
LWSERR(LE_MEMORY);
return;
};
memcpy(server->mimefile,file,strlen(file));
server->mimefile[strlen(file)]=0;
};
/*********************************************************************************************************/
/*
* Handler for libwebserver logotipe
*/
void _web_server_logo() {
printf("Content-type: image/gif\r\n\r\n");
fwrite((char *)_logo,sizeof(_logo),1,stdout);
}
/*********************************************************************************************************/
/*
* Add an handler to request data
*/
int web_server_addhandler(struct web_server *server,const char *mstr,void (*func)(),int flag) {
_logfile=server->weblog;
// xor?
flag ^= (server->flags & WS_LOCAL); // global flag to handler flag
flag ^= (server->flags & WS_DYNVAR); // global flag to handler flag
flag ^= (server->flags & WS_USELEN); // global flag to handler flag
web_log("[%s] Adding handler %s <--%s%s%s\n",__ILWS_date(time(NULL),"%d/%b/%Y:%H:%M:%S %z"),mstr, ((flag & WS_LOCAL) == WS_LOCAL && !((server->flags & WS_LOCAL) == WS_LOCAL))?"[LOCAL] ":"", ((flag & WS_DYNVAR) == WS_DYNVAR)?"[DYNVAR]":"", ((flag & WS_USELEN) == WS_USELEN)?"[USELEN]":"");
return __ILWS_add_handler((struct gethandler *)server->gethandler,mstr,func,NULL,flag,GH_FUNCTION);
}
/*********************************************************************************************************/
/*
* Add an alias dir (new on 0.5.2)
*/
int web_server_aliasdir(struct web_server *server, const char *str, char *path,int flag) {
char *mstr;
int ret;
mstr=__ILWS_malloc(strlen(str)+7);
if(!strlen(str)) {
snprintf(mstr,strlen(str)+7,"* /*");
} else {
snprintf(mstr,strlen(str)+7,"* /%s/*",str);
};
_logfile=server->weblog;
flag ^= (server->flags & WS_LOCAL); // global flag to handler flag
flag ^= (server->flags & WS_DYNVAR); // global flag to handler flag
flag ^= (server->flags & WS_USELEN); // global flag to handler flag
web_log("[%s] Adding directory %s <--%s%s%s\n",__ILWS_date(time(NULL),"%d/%b/%Y:%H:%M:%S %z"),mstr, ((flag & WS_LOCAL) == WS_LOCAL && !((server->flags & WS_LOCAL) == WS_LOCAL))?"[LOCAL] ":"", ((flag & WS_DYNVAR) == WS_DYNVAR)?"[DYNVAR]":"", ((flag & WS_USELEN) == WS_USELEN)?"[USELEN]":"");
ret=__ILWS_add_handler((struct gethandler *)server->gethandler,mstr,NULL,path,flag,GH_DIRECTORY);
__ILWS_free(mstr);
return ret;
};
/*********************************************************************************************************/
/*
* Personal config (new on 0.5.0)
*/
char *web_server_getconf(struct web_server *server, const char *topic,const char *key) {
char *dataconf;
char *tmp1,*tmp2,*tmp3;
long tmpsize=0;
dataconf=__ILWS_stristr(server->dataconf,topic);
if(dataconf==NULL) {
return NULL;
};
dataconf+=strlen(topic);
tmp1=__ILWS_stristr(dataconf,key);
do {
tmp1=__ILWS_stristr(dataconf,key);
dataconf+=1;
if(dataconf[0]==0) {
return NULL;
};
if(dataconf[0]=='[' && dataconf[-1]=='\n') {
return NULL;
};
}while(!(tmp1!=NULL && tmp1[-1]=='\n' && tmp1[strlen(key)]=='='));
tmp1+=strlen(key)+1;
tmp2=__ILWS_stristr(tmp1,"\n");
if(tmp2==NULL) {
tmp2=tmp1+strlen(tmp1);
};
tmpsize=tmp2-tmp1;
if(!(tmp3=__ILWS_malloc(tmpsize+1))) {
LWSERR(LE_MEMORY);
return NULL;
};
memcpy(tmp3,tmp1,tmpsize);
tmp3[tmpsize]=0;
return tmp3;
};
/*********************************************************************************************************/
/*
* Define config file to setup server (new on 0.5.0)
*/
int web_server_setup(struct web_server *server,const char *conffile) {
FILE *tmpf;
char *tmp3;
//long tmpsize=0;
long sizec;
struct stat statf; // tested only on win
if(!(server->conffile=__ILWS_malloc(strlen(conffile)+1))) {
LWSERR(LE_MEMORY);
return 0;
};
memcpy(server->conffile,conffile,strlen(conffile));
server->conffile[strlen(conffile)]=0;
tmpf=fopen(server->conffile,"r");
if(tmpf==NULL) {
printf("no config file found\r\n");
server->dataconf="";
return(0);
};
fseek(tmpf,SEEK_SET,SEEK_END);
sizec=ftell(tmpf);
fseek(tmpf,0,SEEK_SET);
if(!(server->dataconf=__ILWS_malloc(sizec+1))) {
LWSERR(LE_MEMORY);
return 0;
};
fread(server->dataconf,sizec,1,tmpf);
server->dataconf[sizec]=0; // Hilobok Andrew (han@km.if.ua) said to remove the -9 :)
fclose(tmpf);
stat(server->conffile,&statf); // tested only on win
server->conffiletime=statf.st_mtime; // tested only on win
if((server->logfile=web_server_getconf(server,"LIBWEBSERVER","LOG"))) {
web_log("\nUsing logfile [%s]\n",server->logfile);
server->weblog=open_weblog(server->logfile);
} else {
web_log("\nLOG entry not found\r\n");
server->weblog=NULL;
};
if((tmp3=web_server_getconf(server,"LIBWEBSERVER","PORT"))) {
web_log("\nListen port [%s]\n",tmp3);
server->port=atoi(tmp3);
__ILWS_free(tmp3);
} else {
web_log("PORT entry not found\r\n");
server->port=0;
};
#ifdef HAVE_OPENSSL
// Fetch SSL
if((tmp3=web_server_getconf(server,"LIBWEBSERVER","USESSL"))) {
if(tmp3[0]=='1') {
server->flags = server->flags | WS_USESSL;
}else if(tmp3[0]=='0') {
server->flags = server->flags & ~WS_USESSL;
} else {
fprintf(stderr,"[USESSL=] argument invalid\n");
};
__ILWS_free(tmp3);
}
// Fetch CERTFILE
server->cert_file=web_server_getconf(server,"LIBWEBSERVER","CERTFILE");
server->mimefile=web_server_getconf(server,"LIBWEBSERVER","MIMEFILE");
#endif
// Fetch LOCAL
if((tmp3=web_server_getconf(server,"LIBWEBSERVER","LOCAL"))) {
if(tmp3[0]=='1') {
server->flags = server->flags | WS_LOCAL;
} else if(tmp3[0]=='0') {
server->flags=server->flags & ~WS_LOCAL;
}else {
fprintf(stderr,"[LOCAL=] argument invalid\n");
};
__ILWS_free(tmp3);
}
return 1;
};
/*********************************************************************************************************/
/*
* This function initialize one web_server handler
*/
int web_server_init(struct web_server *server,int port,const char *logfile,int flags) {
#ifdef WIN32
unsigned long t=IOC_INOUT;
WSADATA WSAinfo;
WSAStartup(2,&WSAinfo); // Damn w32 sockets
#endif
current_web_server=server;
server->port=port;
server->conffile=NULL;
server->mimefile=NULL;
server->weblog=NULL;
server->usessl=0;
server->flags=flags;
server->dataconf="";
if((flags & WS_USEEXTCONF) == WS_USEEXTCONF) {
if(!(web_server_setup(server,logfile))) {
#ifdef WIN32
WSACleanup();
#endif
return 0;
};
_logfile=server->weblog; // Set current log stream
web_log("%s using config file %s\n",_libwebserver_version,logfile);
};
// Create a listen socket port 'port' and listen addr (0) (all interfaces)
server->socket=__ILWS_listensocket((short)server->port,0);
if(server->socket==-1) {
LWSERR(LE_NET);
#ifdef WIN32
WSACleanup();
#endif
return 0;
};
#ifdef WIN32
ioctlsocket(server->socket,FIONBIO,&t); //non blocking sockets for win32
#else
fcntl(server->socket,F_SETFL,O_NONBLOCK);
#endif
// Setup FILE structure of logfile
if(logfile!=NULL && !((flags & WS_USEEXTCONF) == WS_USEEXTCONF)) {
server->logfile=__ILWS_malloc(strlen(logfile)+1);
memcpy(server->logfile,logfile,strlen(logfile));
server->logfile[strlen(logfile)]=0;
server->weblog=open_weblog(logfile); // Create File stream for log
};
web_log("\n[%s] Server started at port %d (%s)\n",__ILWS_date(time(NULL),"%d/%b/%Y:%H:%M:%S %z"),server->port,_libwebserver_version);
// Setup Flags
// openssl
#ifdef HAVE_OPENSSL
if((server->flags & WS_USESSL) == WS_USESSL) {
web_log("[%s] (FLAG) Using SSL in connections\n",__ILWS_date(time(NULL),"%d/%b/%Y:%H:%M:%S %z"));
web_log(" +-- %s certificate file\n",server->cert_file);
SSL_load_error_strings();
SSLeay_add_ssl_algorithms();
server->ctx=SSL_CTX_new (SSLv23_server_method());
if (SSL_CTX_use_certificate_file(server->ctx, server->cert_file, SSL_FILETYPE_PEM) <= 0) {
ERR_print_errors_fp(stderr);
exit(3);
}
if (SSL_CTX_use_PrivateKey_file(server->ctx, server->cert_file, SSL_FILETYPE_PEM) <= 0) {
ERR_print_errors_fp(stderr);
exit(4);
}
if (SSL_CTX_check_private_key(server->ctx)<= 0) {
ERR_print_errors_fp(stderr);
exit(4);
};
server->usessl=1;
};
#endif
if((server->flags & WS_LOCAL) == WS_LOCAL) {
web_log("[%s] (FLAG) Accepting only local connections\n",__ILWS_date(time(NULL),"%d/%b/%Y:%H:%M:%S %z"));
};
server->client=__ILWS_init_client_list(); // Initializate client list
server->gethandler=__ILWS_init_handler_list(); // Initializate handlers list
web_server_addhandler(server,"* /libwebserver.gif",_web_server_logo,0); // Add logo default handler
#ifndef WIN32
signal(SIGPIPE,SIG_IGN);
#endif
return 1;
}
/*********************************************************************************************************/
/*
* This function shuts down a running web server, frees its allocated memory,
* and closes its socket. If called on a struct web_server that has already
* been shut down, this is a noop.
*/
void web_server_shutdown(struct web_server *server) {
// free and close things in opposite order of web_server_init
__ILWS_delete_handler_list(server->gethandler);
server->gethandler = NULL;
__ILWS_delete_client_list(server->client);
server->client = NULL;
if(server->socket > 0) {
#ifdef WIN32
closesocket(server->socket);
#else
close(server->socket);
#endif
server->socket = -1;
}
if(server->weblog) {
fclose(server->weblog);
server->weblog = NULL;
__ILWS_free(server->logfile);
server->logfile = NULL;
}
#ifdef WIN32
WSACleanup();
#endif
}
/*********************************************************************************************************/
/*
* Core function, return 2 if no client to process, 1 if some client processed, 0 if error
*/
int web_server_run(struct web_server *server) {
struct web_client *client;
int rt;
int tsalen=0;
int tsocket=0;
struct sockaddr_in tsa;
_logfile=server->weblog;
current_web_server=server;
if(server->client->next==NULL) {
//if(__ILWS_newdata(server->socket)); // does nothing but act like usleep
};
// search for client
tsalen=sizeof(client->sa);
tsocket=accept(server->socket,(struct sockaddr *)&tsa,&tsalen);
if(tsocket==-1) {
#ifdef WIN32
if(WSAGetLastError()!=WSAEWOULDBLOCK) {
#else
if(errno!=EAGAIN) {
#endif
fprintf(stderr,"What kind of error is this?\n"); // REMOVE
// client fucked up? warn somebody? (error or log or something?)
return 0; // don't process nothing
};
} else {
client=__ILWS_malloc(sizeof(struct web_client));
if(client==NULL) {
rt=shutdown(tsocket,SHUT_RDWR);
#ifdef WIN32
rt=closesocket(tsocket);
#else
rt=close(tsocket);
#endif
LWSERR(LE_MEMORY);
return 0;
};
client->salen=tsalen;
client->socket=tsocket;
client->sa=tsa;
#ifdef HAVE_OPENSSL
if((server->flags & WS_USESSL) == WS_USESSL) {
client->ssl = SSL_new(server->ctx);
SSL_set_fd(client->ssl,client->socket);
SSL_accept(client->ssl);
//client->cert = SSL_get_peer_certificate (client->ssl);
} else {
client->ssl=NULL;
};
#endif
if(!__ILWS_add_client(server->client,client)) {
fprintf(stderr,"No client?\n"); // REMOVE
return 0;
}else {
web_log("%s - - [%s] Connected\n",inet_ntoa(client->sa.sin_addr),__ILWS_date(time(NULL),"%d/%b/%Y:%H:%M:%S %z")); //REMOBE
};
};
// end search for client
client=server->client; // init list
if(!client->next) { // think of Rocco Carbone (rocco@tecsiel.it)
return 2; // i don't need to process the list (nothing next) returns 2 if there is no client to process
};
while(client->next!=NULL) { // Process the client and swap to next;
current_web_client=client->next;
switch(client->next->stat) {
case 1: {
__ILWS_read_client(current_web_client);
};break;
case 2: {
__ILWS_process_client(current_web_client,server->gethandler);
};break;
case 4: {
__ILWS_output_client(current_web_client);
};break;
case 5: {
__ILWS_delete_next_client(client);
continue;
};break;
};
client=client->next;
};
return 1; // return 1 if something processed
}
+86
View File
@@ -0,0 +1,86 @@
/* Copyrights 2002 Luis Figueiredo (stdio@netc.pt) All rights reserved.
*
* See the LICENSE file
*
* The origin of this software must not be misrepresented, either by
* explicit claim or by omission. Since few users ever read sources,
* credits must appear in the documentation.
*
* date: Sat Mar 30 14:44:42 GMT 2002
*
*
* --
*
*/
#ifndef _SERVER_H_
#define _SERVER_H_
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <signal.h>
#include <time.h>
#include "memory.h"
#include "client.h"
#include "gethandler.h"
#include "socket.h"
#include "error.h"
#include "debug.h"
#ifdef WIN32
#define SHUT_RDWR SD_BOTH
#endif
extern char *_libwebserver_version;
extern struct web_server *current_web_server;
struct web_server {
int socket;
unsigned int port;
char *logfile;
char *conffile;
time_t conffiletime; // tested only on win
char *mimefile;
char *dataconf;
FILE *weblog;
int flags;
struct gethandler *gethandler;
struct web_client *client;
int usessl;
#ifdef HAVE_OPENSSL
char *cert_file;
SSL_CTX *ctx;
#else
void *pad[2];
#endif
};
#define WS_LOCAL 1 // Can be only accessed by localhost
#define WS_USESSL 2 // Use ssl conections (openssl lib required)
#define WS_USEEXTCONF 4 // Use external config file (new 0.5.0)
void web_server_useSSLcert(struct web_server *,const char *); // Mandatory if WS_USESSL set
void web_server_useMIMEfile(struct web_server*,const char *); // new on 0.5.2
int web_server_init(struct web_server *,int,const char *,int);
void web_server_shutdown(struct web_server *);
int web_server_addhandler(struct web_server *,const char *,void (*)(),int);
int web_server_aliasdir(struct web_server *, const char *, char *,int );
int web_server_run(struct web_server *);
int web_server_setup(struct web_server *server,const char *conffile); // (new on 0.5.0)
char *web_server_getconf(struct web_server *, const char *,const char *); // (new on 0.5.0)
#include "weblog.h"
#endif
+74
View File
@@ -0,0 +1,74 @@
/* Copyrights 2002 Luis Figueiredo (stdio@netc.pt) All rights reserved.
*
* See the LICENSE file
*
* The origin of this software must not be misrepresented, either by
* explicit claim or by omission. Since few users ever read sources,
* credits must appear in the documentation.
*
* date: Sat Mar 30 14:44:42 GMT 2002
*
* -- Basic socket operations
*
*/
#include "socket.h"
/*********************************************************************************************************/
/*
* socket operations
*/
int __ILWS_newdata(int sock) {
int ret;
struct timeval tv;
fd_set rfds;
FD_ZERO(&rfds);
FD_SET((unsigned)sock,&rfds);
tv.tv_usec=2;
tv.tv_sec=0;
ret=select(sock+1,&rfds,NULL,NULL,&tv);
FD_CLR((unsigned)sock,&rfds);
return ret;
}
/*********************************************************************************************************/
/*
* to add a listen socket
*/
int __ILWS_listensocket(short port, int saddr) {
struct sockaddr_in sa;
int ret;
int sockopt=1; /* Rocco Was Here */
sa.sin_addr.s_addr=saddr;
sa.sin_port=htons((short)port);
sa.sin_family=AF_INET;
ret=socket(AF_INET,SOCK_STREAM,6); // tcp
if(ret==-1) {
return -1;
};
/* Rocco Was Here */
setsockopt(ret,SOL_SOCKET,SO_REUSEADDR,(char *)&sockopt,sizeof(sockopt)); // why? Rocco
if(bind(ret,(struct sockaddr *)&sa,sizeof(sa))==-1) {
close(ret); /* Rocco Was Here */
return -1;
};
if(listen(ret,512)==-1) { // 512 backlog
close(ret); /* Rocco Was Here */
return -1;
};
IFDEBUG(fprintf(stderr,"socket.c: Listen on port %d\n",port));
return ret;
}
/*********************************************************************************************************/
/*
* as the read function
*/
int __ILWS_read(int sock,void *buf,size_t s) {
return recv(sock,buf,s,0);
}
+51
View File
@@ -0,0 +1,51 @@
/* Copyrights 2002 Luis Figueiredo (stdio@netc.pt) All rights reserved.
*
* See the LICENSE file
*
* The origin of this software must not be misrepresented, either by
* explicit claim or by omission. Since few users ever read sources,
* credits must appear in the documentation.
*
* date: Sat Mar 30 14:44:42 GMT 2002
*
*
* --
*
*/
#ifndef _SOCKET_H_
#define _SOCKET_H_
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <stdarg.h>
#ifdef WIN32
#include <winsock2.h>
#include <io.h>
#else
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <sys/time.h> // struct tv
#include <sys/types.h> // freebsd need it i gues that is no problem if other system includes it
#endif
#include "debug.h"
extern int errno;
int __ILWS_newdata(int);
int __ILWS_listensocket(short, int);
int __ILWS_read(int,void *,size_t);
#endif
+155
View File
@@ -0,0 +1,155 @@
/* Copyrights 2002 Luis Figueiredo (stdio@netc.pt) All rights reserved.
*
* See the LICENSE file
*
* The origin of this software must not be misrepresented, either by
* explicit claim or by omission. Since few users ever read sources,
* credits must appear in the documentation.
*
* date: 19:49,07-49-2002
*
* -- description: utilitys
*
*/
#include "utils.h"
/*********************************************************************************************************/
/*
* search a string in a string ignoring case
*/
char *__ILWS_stristr(char *str, const char *nedle) {
char *tmp1=str;
int ret=1;
int snedle=strlen(nedle),sstr=strlen(str);
if(strlen(str)<strlen(nedle))return NULL;
while((ret=strncasecmp(tmp1,nedle,snedle) && (unsigned int)(tmp1+snedle)<=(unsigned int) (str+sstr))) {
tmp1++;
};
if(strncasecmp(tmp1,nedle,snedle))
return NULL;
return tmp1;
};
/*********************************************************************************************************/
/*
* gives a new temporary path(file) name that doesn't exists
*/
char *_tmpnameprefix="";
char *__ILWS_tmpfname() {
char *ret=NULL;
char *tmpdir=NULL;
char nam[TMPNAMESIZE+1];
int i;
struct stat foostat;
if(tmpdir==NULL) {
tmpdir=getenv("TEMP");
};
if(tmpdir==NULL) {
tmpdir=getenv("TMP");
};
if(tmpdir==NULL) {
tmpdir=getenv("TMPDIR");
};
if(tmpdir==NULL) {
tmpdir=P_tmpdir; // defined in stdio.h
};
IFDEBUG(fprintf(stderr,"utils.c: Allocating temporary file name: "));
if(!(ret=__ILWS_malloc(strlen(tmpdir)+strlen(_tmpnameprefix)+TMPNAMESIZE+2))) {
LWSERR(LE_MEMORY);
return NULL;
};
srand(time(NULL)); // seed
do {
for(i=0;i<TMPNAMESIZE;i++) {
nam[i]=(rand()%2)?(rand()%26)+'A':(rand()%26)+'a';
}
nam[i]=0;
snprintf(ret,strlen(tmpdir)+strlen(_tmpnameprefix)+TMPNAMESIZE+2,"%s/%s%s",tmpdir,_tmpnameprefix,nam); // include '0'
IFDEBUG(fprintf(stderr,"Temporary filename is: %s, stat:%d\n",ret,stat(ret,&foostat)));
}while((stat(ret,&foostat)!=-1) && (lstat(ret,&foostat)!=-1)); // redundancy if win32 // <- race condition?
return ret;
};
/*********************************************************************************************************/
/*
* an date function
*/
#define DATE_MAX 100
char __ILWS_datem[DATE_MAX];
char *__ILWS_date(time_t t,const char *format) {
struct tm *tm;
tm=localtime(&t);
strftime(__ILWS_datem,DATE_MAX,format,tm);
return __ILWS_datem;
}
/*********************************************************************************************************/
/*
* wasn't me, base64decode
*/
static const unsigned char __ILWS_chtb[256] = {
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 62, 64, 64, 64, 63,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 64, 64, 64, 64, 64, 64,
64, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 64, 64, 64, 64, 64,
64, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 64, 64, 64, 64,
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64};
int __ILWS_base64decode(char *bufplain, const char *bufcoded){
int nb;
const unsigned char *in;
unsigned char *out;
int nprbytes;
in = (const unsigned char *) bufcoded;
while (__ILWS_chtb[*(in++)] <= 63);
nprbytes = (in - (const unsigned char *) bufcoded) - 1;
nb = ((nprbytes + 3) / 4) * 3;
out = (unsigned char *) bufplain;
in = (const unsigned char *) bufcoded;
while (nprbytes > 4) {
*(out++) =
(unsigned char) (__ILWS_chtb[*in] << 2 | __ILWS_chtb[in[1]] >> 4);
*(out++) =
(unsigned char) (__ILWS_chtb[in[1]] << 4 | __ILWS_chtb[in[2]] >> 2);
*(out++) =
(unsigned char) (__ILWS_chtb[in[2]] << 6 | __ILWS_chtb[in[3]]);
in += 4;
nprbytes -= 4;
}
if (nprbytes > 1) {
*(out++) =
(unsigned char) (__ILWS_chtb[*in] << 2 | __ILWS_chtb[in[1]] >> 4);
}
if (nprbytes > 2) {
*(out++) =
(unsigned char) (__ILWS_chtb[in[1]] << 4 | __ILWS_chtb[in[2]] >> 2);
}
if (nprbytes > 3) {
*(out++) =
(unsigned char) (__ILWS_chtb[in[2]] << 6 | __ILWS_chtb[in[3]]);
}
nb -= (4 - nprbytes) & 3;
return nb;
}
+59
View File
@@ -0,0 +1,59 @@
/* Copyrights 2002 Luis Figueiredo (stdio@netc.pt) All rights reserved.
*
* See the LICENSE file
*
* The origin of this software must not be misrepresented, either by
* explicit claim or by omission. Since few users ever read sources,
* credits must appear in the documentation.
*
* file: utils.h
*
* description: Header
*
* date: 19:50,07-50-2002
*/
#ifndef _UTILS_H_
#define _UTILS_H_
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <ctype.h>
#ifdef TM_IN_SYS_TIME
#include <sys/time.h>
#else
#include <time.h>
#endif
#include "debug.h"
#include "error.h"
#include "memory.h"
#ifdef WIN32
#define strncasecmp strnicmp
#define snprintf _snprintf
#define lstat stat
#define vsnprintf _vsnprintf
#endif
#define TMPNAMESIZE 8
extern char *_tmpnameprefix;
char *__ILWS_stristr(char *, const char *);
char *__ILWS_tmpfname();
int __ILWS_base64decode(char *, const char *);
char *__ILWS_date(time_t,const char *);
#endif
+129
View File
@@ -0,0 +1,129 @@
/* Copyrights 2002 Luis Figueiredo (stdio@netc.pt) All rights reserved.
*
* See the LICENSE file
*
* The origin of this software must not be misrepresented, either by
* explicit claim or by omission. Since few users ever read sources,
* credits must appear in the documentation.
*
* Fri Dec 28 12:51:11 GMT 2001
* Luis Figueiredo -- I Corrected the input to handle only data when \n\r(twice) is arrived
*
* Mon Feb 25 06:27:58 GMT 2002
* Luis Figueiredo -- Many corrections and new functions were added, until today
*
* Mon Mar 25 14:46:13 GMT 2002
* Luis Figueiredo -- wow, one month later..., discard web_server_addstr, and now process the stdout to server
* using a tmpfile for streaming (not so good, but :o))
* Wed Mar 27 18:59:10 GMT 2002
* Luis Figueiredo -- using regex instead of fnmatch(fnmatch only appears becouse of apache, i didn't knew it)
* Mon Apr 8 15:04:31 GMT 2002
* Luis Figueiredo -- Oh my.. kurt cobain is dead :o), restructured the code, separated into various files
* Wed Apr 10 20:02:55 GMT 2002
* Luis Figueiredo -- Make use of autoconf , removed open_memstream (doesn't work well w/ stdout structure on netbsd portability)
* linux slack 7.1 uses "extern FILE *stdout", netbsd uses "extern FILE __sF[]" so i cannot make use of pointers
* Mon Oct 7 16:56:15 GMT 2002
* Luis Figueiredo -- Repaired some safe bugs, Added vars to stats proposes, inserted an liblogo, added debug instructions
*
* VERSION 0.5.3
*/
#ifndef _WEB_SERVER_H_
#define _WEB_SERVER_H_
#include <stdio.h> // for struct FILE
#include <time.h> // for time_t
#ifdef __cplusplus
extern "C"{
#endif
extern char *_libwebserver_version;
extern char *_tmpnameprefix;
extern int WEBTIMEOUT;
struct _MultiPart {
char *id;
char *data;
unsigned int size;
char *filename;
void *pad;
};
char *__Header(char *);
char *__Query(char *);
char *__Post(char *);
struct _MultiPart __MultiPart(char *);
char *__Cookie(char *);
extern struct ClientInfo {
int outfd;
char *inetname;
char *request;
char *method;
char *user;
char *pass;
char *(*Header)(char *);
char *(*Query)(char *);
char *(*Post)(char *);
char *(*Cookie)(char *);
char *(*Conf)(char *,char *); // new on 0.5.0
struct _MultiPart (*MultiPart)(char *);
void *__pad[9];
} *ClientInfo; // PROTOTYPE
struct web_server {
int socket;
unsigned int port;
char *logfile;
char *conffile;
time_t conffiletime; // tested only on win
char *mimefile;
char *dataconf;
FILE *weblog;
int flags;
struct gethandler *gethandler;
struct web_client *client;
int usessl;
void *pad[2]; // SSL pad
};
#define WS_LOCAL 1 // Can be only accessed by localhost (usefull for local programs gui's)
#define WS_USESSL 2 // Use ssl conections (openssl lib required) (security transation) (there is no sense using WS_LOCAL & WS_USESSL together)
#define WS_USEEXTCONF 4 // Use external config file (new 0.5.0)
#define WS_DYNVAR 8 // Use dynamic variables on output (new 0.5.1)
#define WS_USELEN 16 //Use Content-length calculator(new 0.5.1)
void web_server_useSSLcert(struct web_server *,const char *); // useless if not using openssl
void web_server_useMIMEfile(struct web_server *,const char *); // new on 0.5.2
int web_server_init(struct web_server *,int,const char *,int);
void web_server_shutdown(struct web_server *);
char *web_server_getconf(struct web_server *,char *,char *);
int web_server_addhandler(struct web_server *,const char *,void (*)(),int);
int web_server_aliasdir(struct web_server *, const char *,char *,int); // new on 0.5.2
int web_server_run(struct web_server *);
int web_client_addfile(char *);
extern unsigned char GLOBALGIFPAL[256][3];
void web_client_gifsetpalette(const char *);
int web_client_gifoutput(char *,int,int,int);
void web_client_setcookie(char *,char *,char *,char *, char *,int); // improved on 0.5.1
void web_client_deletecookie(char *); // improved on 0.5.1
int web_client_setvar(char *,char *); //(new (0.5.1)
char *web_client_getvar(char *); //(new (0.5.1)
int web_client_delvar(char *); //(new (0.5.1)
void web_client_HTTPdirective(char *);
void web_client_contenttype(char *); // 0.5.2
void web_log(const char *,...);
#ifdef __cplusplus
}
#endif
#endif
+43
View File
@@ -0,0 +1,43 @@
/* Copyrights 2002 Luis Figueiredo (stdio@netc.pt) All rights reserved.
*
* See the LICENSE file
*
* The origin of this software must not be misrepresented, either by
* explicit claim or by omission. Since few users ever read sources,
* credits must appear in the documentation.
*
* date: Sat Mar 30 14:44:42 GMT 2002
*
* -- web_log operations
*
*/
#include "weblog.h"
FILE *_logfile=NULL;
/*********************************************************************************************************/
/*
* Open weblog file
*/
FILE *open_weblog(const char *logfile) {
FILE *ret;
ret=fopen(logfile,"a+");
_logfile=ret;
return ret;
}
/*********************************************************************************************************/
/*
* Log to _logfile;
*/
void web_log(const char *fmt,...) {
va_list args;
if(_logfile) {
va_start(args,fmt);
vfprintf(_logfile,fmt,args);
va_end(args);
fflush(_logfile);
}
}
+40
View File
@@ -0,0 +1,40 @@
/* Copyrights 2002 Luis Figueiredo (stdio@netc.pt) All rights reserved.
*
* See the LICENSE file
*
* The origin of this software must not be misrepresented, either by
* explicit claim or by omission. Since few users ever read sources,
* credits must appear in the documentation.
*
* date: Sat Mar 30 14:25:25 GMT 2002
*
* memory functions
*/
#ifndef _WEBLOG_H_
#define _WEBLOG_H_
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#ifdef WIN32
#define snprintf _snprintf
#endif
#include "debug.h"
extern FILE *_logfile;
void web_log(const char *,...);
FILE *open_weblog(const char *);
char *mydate();
#endif