Push files

This commit is contained in:
Stian Lund 2020-07-01 14:06:53 +02:00
parent 0f6b4baaa6
commit 4aac31a5de
94 changed files with 115240 additions and 0 deletions

52
AUTHORS Executable file
View File

@ -0,0 +1,52 @@
To the best of my knowledge, here are the known authors for these
filters. If you have additions/corrections to this information, please
submit them.
The filters were collected into a single package, optimized, and
converted to work as a library by Mark Lindner.
------------------------------------------------------------------------------
austro - Tom van Nes
b1ff - Matt Welsh, David Whitten
brooklyn - Daniel V. Klein [originally named "nyc"]
chef - John Hagerman
cockney - "ken" by Stephen K Mulrine, Edward Betts; merged
with "cockney" by (unknown) which was expanded significantly by
Samuel Stoddard
drawl - Adam Hudd
dubya - (anonymous submission)
fudd - (unknown)
funetak - "Eclipse Enterprises" (unknown)
jethro - Duane Paulson
jive - Daniel V. Klein, Clement Cole, Samuel Stoddard
kraut - John Sparks
pansy - (unknown)
pirate - Dougal Campbell (originally Perl code); conversion and additions
by Mark Lindner
postmodern - (unknown) [this filter is also known as "feminazi"]
redneck - Brand Hilton
valspeak - (unknown)
warez - Ian Johnston
wrap - Mark Lindner
------------------------------------------------------------------------------

340
COPYING Executable file
View File

@ -0,0 +1,340 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

111
ChangeLog Executable file
View File

@ -0,0 +1,111 @@
2007-12-29 Mark Lindner <markl@neuromancer>
* talkfilters.c, talkfilters.h, Makefile.am, Makefile.in, config.h,
- MinGW & VC++ build fixes
* config.guess, config.sub, ltmain.sh, aclocal.m4, libtool
- updated to newest
2006-11-21 Mark Lindner <markl@neuromancer>
* pirate.l - minor improvements
* dubya.l - minor improvements
* common.h - use VERSION instead of hardcoded version number
2006-10-27 Mark Lindner <markl@neuromancer>
* common.c - fix compiler warning
* *.sln, *.vcproj, win32/unistd.h - add Visual C++ Express 2005
build files
* talkfilters.c - update version number
* common.h - use C99 varargs macro notation; added some #defines for
win32
* pirate.l - added rule
* talkfilters.h - added extern "C" guard
2006-09-18 Mark Lindner <markl@neuromancer>
* common.c - fix compiler warnings
* talkfilters.h, talkfilters.c, configure.in, Makefile.am
- changes for DLL creation
2006-04-17 Mark Lindner <markl@neuromancer>
* funetak.l - replaced random() with gtf_random(); eliminates build
error in mingw
2006-04-15 Mark Lindner <markl@neuromancer>
* <multiple> - added support for pkg-config
2005-11-21 Mark Lindner <markl@neuromancer>
* gaim_plugin/talkfilters.c, Makefile.am - Removed the GAIM plugin,
as it's now being maintained elsewhere.
* common.c, talkfilters.c, common.h, configure.in - Build fixes.
* talkfilters.spec - added new file
The above all contributed by Peter Lawler
2005-01-10 Mark Lindner <markl@neuromancer>
* gaim_plugin/talkfilters.c - Updated to work with GAIM 1.1.0.
2004-06-28 Mark Lindner <markl@neuromancer>
* gaim_plugin/talkfilters.c - Incorporated bug fix submitted by a user.
The bug caused the IM to only be filtered locally (not sent in
filtered form to the other end). This must be a regression when
moving to GAIM 0.78/0.79.
2004-06-26 Mark Lindner <markl@neuromancer>
* gaim_plugin/* - Updated plugin to work with GAIM 0.79, and clarified
installation instructions.
2004-01-06 Mark Lindner <markl@neuromancer>
* funetak.l - Fixed a capitalization problem.
* austro.l - Added missing rules, whose absence caused garbled output
from filter function.
* gaim_plugin/* - New plugin for GAIM.
2003-12-02 Mark Lindner <markl@neuromancer>
* *.l, *.c, *.h - Added contributed austro and dubya filters.
2003-07-22 Mark Lindner <markl@neuromancer>
* *.l - Added rules to leave HTML tags intact. Do you see where
I'm going with this? ;-)
* kraut.l - Minor fixes and corrections (submitted by Thomas M. Ott)
* talkfilters.man - Documentation updates.
* configure.in - Rewrote `flex' check.
2003-04-29 Mark Lindner <markl@neuromancer>
* jive.l - Added a few more rules.
2003-02-13 Mark Lindner <markl@dystance.net>
* *.l - Made a fix so that compilation doesn't fail with older
versions of gcc: moved declaration of _yybuf so that it's before the
first statement in the filter function.
2003-02-11 Mark Lindner <markl@dystance.net>
* <multiple> - Complete overhaul of package; added automake/libtool
support, and produce not only executables but also a library.
Tue Jul 4 21:33:08 2000 Mark A. Lindner <markl@dystance.net>
* Makefile.in: Modified `dist' target and added `info' target.
* talkfilters.texi: Texinfo documentation added.
Thu Dec 31 17:09:45 1998 Joel N. Weber II <devnull@melange.gnu.org>
* configure.in: Rewrote the check for lex to just check for flex
and bail if it isn't found.
* src/talkfilters-1.0/Makefile.in (LIBS): Hardcode -lfl, since we
always use flex.

229
INSTALL Executable file
View File

@ -0,0 +1,229 @@
Copyright 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.

102
Makefile.am Executable file
View File

@ -0,0 +1,102 @@
#
filters = austro b1ff brooklyn chef cockney drawl dubya fudd funetak \
jethro jive kraut pansy pirate postmodern redneck valspeak warez
bin_PROGRAMS = $(filters) wrap
lib_LTLIBRARIES = libtalkfilters.la
# Versioning rules ( C:R:A )
# 1. Start with version 0:0:0.
# 2. If the library source code has changed at all, incremement R.
# 3. If any interfaces have been added, removed, or changed, increment C and
# set R to 0.
# 4. If any interfaces have been added, increment A.
# 5. If any interfaces have been removed, set A to 0.
# For more info see page 27 of the GNU Libtool Manual.
VERINFO = -version-info 1:4:0
libtalkfilters_la_LDFLAGS = $(VERINFO) -no-undefined
commonsrc = common.c common.h getopt.c getopt1.c getopt.h
libsrc = talkfilters.c
libtalkfilters_la_CPPFLAGS = -DLIBRARY_MODE
if GNU_WIN
libtalkfilters_la_CPPFLAGS += -DTALKFILTERS_EXPORTS
endif
libtalkfilters_la_SOURCES = $(libsrc) $(commonsrc) \
austro.l b1ff.l brooklyn.l chef.l cockney.l drawl.l \
dubya.l fudd.l funetak.l jethro.l jive.l kraut.l pansy.l pirate.l \
postmodern.l redneck.l valspeak.l warez.l
include_HEADERS = talkfilters.h
austro_SOURCES = austro.l $(commonsrc)
b1ff_SOURCES = b1ff.l $(commonsrc)
brooklyn_SOURCES = brooklyn.l $(commonsrc)
chef_SOURCES = chef.l $(commonsrc)
cockney_SOURCES = cockney.l $(commonsrc)
drawl_SOURCES = drawl.l $(commonsrc)
dubya_SOURCES = dubya.l $(commonsrc)
fudd_SOURCES = fudd.l $(commonsrc)
funetak_SOURCES = funetak.l $(commonsrc)
jethro_SOURCES = jethro.l $(commonsrc)
jive_SOURCES = jive.l $(commonsrc)
kraut_SOURCES = kraut.l $(commonsrc)
pansy_SOURCES = pansy.l $(commonsrc)
pirate_SOURCES = pirate.l $(commonsrc)
postmodern_SOURCES = postmodern.l $(commonsrc)
redneck_SOURCES = redneck.l $(commonsrc)
valspeak_SOURCES = valspeak.l $(commonsrc)
warez_SOURCES = warez.l $(commonsrc)
wrap_SOURCES = wrap.c $(commonsrc)
info_TEXINFOS = talkfilters.texi
talkfilters_TEXINFOS = gpl.texi
filter_man = talkfilters
man1_MANS = $(filter_man).man wrap.man
EXTRA_DIST = $(man1_MANS) *.vcproj *.sln win32/unistd.h
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = talkfilters.pc
#install-data-hook:
# cd @MANDIR@/man1; \
# for i in $(filters); do \
# rm -f $$i.1; \
# ln -s $(filter_man).1 $$i.1; \
# done
# eof

1432
Makefile.in Executable file

File diff suppressed because it is too large Load Diff

0
NEWS Executable file
View File

43
README Executable file
View File

@ -0,0 +1,43 @@
This group of filters serves no utilitarian purpose but is nonetheless
quite amusing and hence should be maintained for posterity.
These programs are maintained by Mark Lindner
(mark_a_lindner@yahoo.com). The original authors of these programs are
listed in the file `AUTHORS'.
If you are the author of one of these programs and do not wish to have
it distributed in this package, contact the maintainer immediately.
These filters are provided for amusement only. No racial or societal
slurs are intended.
Some of these filters contain vulgarity, and thus are inappropriate
for some audiences. If you find something offensive in one or more of
these filters, please do not flame me or ask me to censor or remove
the filter(s) in question. Requests of this type will be silently
ignored. Note that I am only the package maintainer; I am NOT the
author of the translation rules in the filters (with the exception of
the `wrap' filter).
These filters are not guaranteed to be idempotent across all inputs;
that is, repeated applications of a given filter on an input may cause
the output to differ each time. Moreover, some of the filters use
randomization techniques so a given input is not guaranteed to produce
the same output across invocations.
You no longer need to have `flex' (or any other lexer program, for
that matter) to build and use this package. However, you *will* need a
lexer (specifically, `flex') to recompile if you change any `.l'
files.
The GAIM plugin is no longer distributed with TalkFilters, as it's now
part of a separate project, "Gaim Plugin Pack", which can be found
here: http://guifications.sourceforge.net/PluginPack/
The package may be built on Windows using either the MinGW
environment, or Visual Studio C++ 2005, Visual Studio.NET 2005, or
later.
Mark Lindner
November 1, 2006.

7537
aclocal.m4 vendored Executable file

File diff suppressed because it is too large Load Diff

1787
austro.c Executable file

File diff suppressed because it is too large Load Diff

121
austro.l Executable file
View File

@ -0,0 +1,121 @@
/* GNU Talkfilters
Copyright (C) 1998-2003 Free Software Foundation, Inc.
This file is part of GNU Talkfilters
GNU Talkfilters is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2, or (at
your option) any later version.
This software is distributed in the hope that it will be amusing, 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 software; see the file COPYING. If not, write to the
Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
%option prefix="austro_yy"
%option outfile="lex.yy.c"
%option noyywrap
%option nounput
%e 2000
%p 5000
%n 1000
%k 500
%a 4000
%o 2000
BW [ \t]
EW [ \t.,;!?]
EOT \4
%{
#include "common.h"
#include "talkfilters.h"
#define YY_DECL int yylex(gtf_databuf_t *buf)
%}
%%
\<(\/)?[A-Za-z][^\>]*\> gtf_echo(); // don't damage HTML tags
[Ss]ch gtf_puts_case("sh");
" c" gtf_puts(" k");
" C" gtf_puts(" K");
ec gtf_puts("ek");
ac gtf_puts("ak");
[Pp]h gtf_puts_case("f");
cc gtf_puts("c");
ee gtf_puts("e");
ff gtf_puts("f");
ll gtf_puts("l");
mm gtf_puts("m");
nn gtf_puts("n");
pp gtf_puts("p");
rr gtf_puts("r");
ss gtf_puts("s");
tt gtf_puts("t");
[Tt]h gtf_puts_case("z");
w gtf_puts("v");
ou gtf_puts("u");
"de " gtf_puts("d ");
"le " gtf_puts("l ");
"me " gtf_puts("m ");
"ne " gtf_puts("n ");
"re " gtf_puts("r ");
"ve " gtf_puts("v ");
[Cc] gtf_puts_case("s");
[Pp]ie gtf_puts_case("mozer's pie");
[Ss]teak gtf_puts_case("shnitzel");
[Gg]overnor gtf_puts_case("govenator");
{EOT} /* ignore trailing EOT character */
. gtf_echo();
\n gtf_puts("\n");
%%
#ifdef LIBRARY_MODE
int gtf_filter_austro(const char *input, char *buf, size_t bufsz)
{
gtf_databuf_t buffer;
YY_BUFFER_STATE _yybuf;
gtf_strbuf_init(&buffer, buf, bufsz);
_yybuf = yy_scan_string(input);
yylex(&buffer);
yy_delete_buffer(_yybuf);
gtf_reset();
return(buffer.overflow);
}
int __gtf_filter_austro(const char *input, char *buf, size_t bufsz)
{
return(gtf_filter_austro(input, buf, bufsz));
}
#else /* LIBRARY_MODE */
int main(int argc, char **argv)
{
gtf_parse_args();
gtf_random_seed();
yylex(NULL);
return(EXIT_SUCCESS);
}
#endif /* LIBRARY_MODE */
/* end of source file */

202
austro.vcproj Executable file
View File

@ -0,0 +1,202 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="austro"
ProjectGUID="{C793F479-D373-4984-9170-ACB1604CCAC3}"
RootNamespace="austro"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="3"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
>
<File
RelativePath=".\austro.c"
>
</File>
<File
RelativePath=".\common.c"
>
</File>
<File
RelativePath=".\getopt.c"
>
</File>
<File
RelativePath=".\getopt1.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
>
<File
RelativePath=".\common.h"
>
</File>
<File
RelativePath=".\getopt.h"
>
</File>
<File
RelativePath=".\talkfilters.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

2324
b1ff.c Executable file

File diff suppressed because it is too large Load Diff

244
b1ff.l Executable file
View File

@ -0,0 +1,244 @@
/* GNU Talkfilters
Copyright (C) 1998-2003 Free Software Foundation, Inc.
This file is part of GNU Talkfilters
GNU Talkfilters is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2, or (at
your option) any later version.
This software is distributed in the hope that it will be amusing, 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 software; see the file COPYING. If not, write to the
Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
For the information of some:
B1FF is a fictitious person who is "new" on the 'net.
You can recognize his posts by:
He always SHOUTS as he types.
He sometimes spells FONET1KLEE (phonetically) the rest of the time, he
just misspells words or punctuates them incorrectly.
He shortens some words (presumably for ease in typing)
like '4' for 'for' or 'four'
like '2' for 'two' or 'to' or 'too'
like '&' for 'and'
like 'U' for 'you' or 'ewe'
like 'R' for 'are'
like 'C' for 'sea' or 'see'
He can't see the difference between certain letters
like '1' and 'i'
or like '0' and 'o'
or like '5' and 's'
or like '2' and 'z'
His speech is peppered with profanity.
He never uses only one '!' or '?' when '!!!!!!!!' or '????!!!!' will do.
He never uses the apostrophe (') and always uses the double quote (")
instead.
I have some vague memory of B1FF being mentioned in the New Hackers
dictionary, but I can't verify the validity of this.
I can't even validate that his full name is NELSON 0TB1FF , but it sounds
correct.
Here's the promised and long-awaited 'b1ff.x' English->B1FF converter
that everyone's been clamoring for. I made a few small changes since the
last version and made sure that it compiled correctly.
To compile this, save it to the file 'b1ff.x' and execute the following
two commands:
lex b1ff.x
cc -o B1ff lex.yy.c -ll
Note that the flags on cc should be in that order. You'll end up with the
executable 'B1ff' (if you call it 'biff' with a lowercase 'b' you'll
conflict with the biff mail-checking program).
Send me any bugs or patches; I'm good friends with B1FF and since this is
the first program he's ever posted to the net, he wants to know if you
have any problems.
mdw
B1FF.X by Matt Welsh (mdw@tc.cornell.edu) +1 607 253 2737
modified and improved by David Whitten
*/
%option prefix="b1ff_yy"
%option outfile="lex.yy.c"
%option noyywrap
%e 3000
%p 6000
%n 1000
%k 500
%a 4000
%o 15000
%{
#include "common.h"
#include "talkfilters.h"
#define YY_DECL int yylex(gtf_databuf_t *buf)
%}
BW [ \t]
EW [ \t.,;!?]
WC [A-Za-z']
NW [^A-Za-z']
EOT \4
%s INW NIW
%%
\<(\/)?[A-Za-z][^\>]*\> gtf_echo(); // don't damage HTML tags
\\[^ \n]+ gtf_echo();
{NW} BEGIN NIW; gtf_echo();
"..." { BEGIN NIW; gtf_printf(gtf_random(2) ? "...C00L HUH!?! "
: "...!! "); }
"."/{NW} BEGIN NIW; gtf_printf(gtf_random(2) ? "." : "!!" );
".\"" BEGIN NIW; gtf_printf(gtf_random(2) ? "!!!\"" : "!1!!\"" );
"!"$ BEGIN NIW; gtf_printf("!!!!!!!!!!1");
"!"+/{NW} BEGIN NIW; gtf_printf("!1!");
"?"/{NW} BEGIN NIW; gtf_printf("\?\?!!");
":)" BEGIN NIW; gtf_printf(";-)!!! ");
"8)" BEGIN NIW; gtf_printf(";-)!!! ");
":*)" BEGIN NIW; gtf_printf(";-)!!!! ");
":-)" BEGIN NIW; gtf_printf(";-)!!!! ");
' BEGIN NIW; gtf_printf("\"");
ove BEGIN INW; gtf_printf("UV ");
move BEGIN INW; gtf_printf("MOOV");
ea BEGIN INW; gtf_printf("EE");
ies BEGIN INW; gtf_printf("YS");
please BEGIN INW; gtf_printf("PLEEZ!");
Please BEGIN INW; gtf_printf("PLEEZ");
Thanks BEGIN INW; gtf_printf("THANX!!");
thanks BEGIN INW; gtf_printf("THANX");
[Ee]nough BEGIN INW; gtf_printf("ENUF");
[Dd]oes BEGIN INW; gtf_printf("DUZ");
[Ff]uck/{NW} BEGIN INW; gtf_printf("FUCK !!!!!1 ");
<NIW>hell/{NW} BEGIN INW; gtf_printf("FUCK!! ");
[Dd]amn BEGIN INW; gtf_printf("FUCK!! ");
[Ss]hit BEGIN INW; gtf_printf("FUCK!! ");
<NIW>Hell/{NW} BEGIN INW; gtf_printf("FUCK!! ");
<NIW>dick/{NW} BEGIN INW; gtf_printf("FUCK!! ");
<NIW>Dick/{NW} BEGIN INW; gtf_printf("FUCK!! ");
<NIW>mad/{NW} BEGIN INW; gtf_printf("PISSED 0FF!!!1! ");
<NIW>Mad/{NW} BEGIN INW; gtf_printf("PISSED 0FF!!!1! ");
ar/{NW} BEGIN NIW; gtf_printf("RE");
are/{NW} BEGIN INW; gtf_printf("R");
ain/{NW} BEGIN NIW; gtf_printf("ANE");
before/{NW} BEGIN NIW; gtf_printf("B4");
for(e)?/{NW} BEGIN NIW; gtf_printf("4");
four/{NW} BEGIN NIW; gtf_printf("FORE ");
se(a|e)/{NW} BEGIN NIW; gtf_printf("C ");
to(o)?/{NW} BEGIN NIW; gtf_printf("2");
two/{NW} BEGIN NIW; gtf_printf("TO ");
one/{NW} BEGIN NIW; gtf_printf("1");
<INW>ould/{NW} BEGIN NIW; gtf_printf("UD ");
ic/{NW} BEGIN NIW; gtf_printf("IK");
le/{NW} BEGIN NIW; gtf_printf("EL");
by/{NW} BEGIN NIW; gtf_printf("BUY");
buy/{NW} BEGIN NIW; gtf_printf("BY");
bye/{NW} BEGIN NIW; gtf_printf("BY");
e/{NW} { BEGIN NIW; gtf_printf(gtf_random(2) ? "E"
: (gtf_random(2) ? "E" : "3")); }
ewe|you BEGIN INW; gtf_printf("U");
your BEGIN INW; gtf_printf("YOU'RE");
the(y')?re BEGIN INW; gtf_printf("THARE");
cause BEGIN INW; gtf_printf("CUZ");
<INW>or BEGIN INW; gtf_printf(gtf_random(2) ? "OR" : "ER");
and BEGIN INW; gtf_printf("&");
biff BEGIN INW; gtf_printf("B1FFSTER!!!!!");
BIFF|Biff BEGIN INW; gtf_printf("B1FFSTERE!!!1!");
tion BEGIN INW; gtf_printf("SHUN");
good|cool BEGIN INW; gtf_printf("C00L!!!");
computer BEGIN INW; gtf_printf("C-64");
software|program BEGIN INW; gtf_printf("WAREZ!1!!");
gal|girl|woman BEGIN INW; gtf_printf("BAB3");
boy|dude|Mr|Man BEGIN INW; gtf_printf("D00D");
man/{NW} BEGIN INW; gtf_printf("D00D");
some BEGIN INW; gtf_printf("SUM");
ll { BEGIN INW; gtf_printf(gtf_random(2) ? "LL"
: (gtf_random(2) ? "L" : "LLL")); }
nn { BEGIN INW; gtf_printf(gtf_random(2) ? "NN"
: (gtf_random(2) ? "N" : "NNN")); }
oo BEGIN INW; gtf_printf(gtf_random(2) ? "00" : "UU");
OO BEGIN INW; gtf_printf(gtf_random(2) ? "00" : "UU");
ph BEGIN INW; gtf_printf("F");
Ph BEGIN INW; gtf_printf("F");
[a-hj-rt-y] BEGIN INW; gtf_printf("%c", toupper(*yytext));
i BEGIN INW; gtf_printf(gtf_random(2) ? "I" : "1");
I BEGIN INW; gtf_printf(gtf_random(2) ? "I" : "1");
s BEGIN INW; gtf_printf(gtf_random(2) ? "5" : "S");
S BEGIN INW; gtf_printf(gtf_random(2) ? "5" : "S");
z BEGIN INW; gtf_printf(gtf_random(2) ? "2" : "Z");
. BEGIN INW; gtf_echo();
{EOT} /* ignore trailing EOT character */
%%
#ifdef LIBRARY_MODE
int gtf_filter_b1ff(const char *input, char *buf, size_t bufsz)
{
gtf_databuf_t buffer;
YY_BUFFER_STATE _yybuf;
gtf_strbuf_init(&buffer, buf, bufsz);
_yybuf = yy_scan_string(input);
yylex(&buffer);
yy_delete_buffer(_yybuf);
gtf_reset();
return(buffer.overflow);
}
int __gtf_filter_b1ff(const char *input, char *buf, size_t bufsz)
{
return(gtf_filter_b1ff(input, buf, bufsz));
}
#else /* LIBRARY_MODE */
int main(int argc, char **argv)
{
gtf_parse_args();
gtf_random_seed();
yylex(NULL);
return(EXIT_SUCCESS);
}
#endif /* LIBRARY_MODE */
/* end of source file */

202
b1ff.vcproj Executable file
View File

@ -0,0 +1,202 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="b1ff"
ProjectGUID="{D876F3A7-D38D-4ADC-8E2A-927C88363FEA}"
RootNamespace="b1ff"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="3"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
>
<File
RelativePath=".\b1ff.c"
>
</File>
<File
RelativePath=".\common.c"
>
</File>
<File
RelativePath=".\getopt.c"
>
</File>
<File
RelativePath=".\getopt1.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
>
<File
RelativePath=".\common.h"
>
</File>
<File
RelativePath=".\getopt.h"
>
</File>
<File
RelativePath=".\talkfilters.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

2114
brooklyn.c Executable file

File diff suppressed because it is too large Load Diff

170
brooklyn.l Executable file
View File

@ -0,0 +1,170 @@
/* GNU Talkfilters
Copyright (C) 1998-2003 Free Software Foundation, Inc.
This file is part of GNU Talkfilters
GNU Talkfilters is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2, or (at
your option) any later version.
This software is distributed in the hope that it will be amusing, 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 software; see the file COPYING. If not, write to the
Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* Lex filter to transform plain English into Brooklyn English.
* No racial or societal slurs are intended. For amusement only.
*
* Copyright 1986 by Daniel Klein.
*
* Reproduction permitted so long as this notice is retained.
*/
%option prefix="brooklyn_yy"
%option outfile="lex.yy.c"
%option noyywrap
WB [\n\t ]
WC [A-Za-z'0-9]
NW [^A-Za-z'0-9]
EOT \4
%s NIW INW
%{
#include "common.h"
#include "talkfilters.h"
#define YY_DECL int yylex(gtf_databuf_t *buf)
static const char *expletives[] = { "Okay?", "Right?", "Yuh got me so fahr?",
"Ya' dig?", "Yuh with me?" };
#define EXPLETIVES_LEN (sizeof(expletives) / sizeof(expletives[0]))
%}
%%
<NIW,INITIAL>{
\<(\/)?[A-Za-z][^\>]*\> gtf_echo(); // don't damage HTML tags
[Nn]othing/{NW} gtf_puts_case("nuttin'");
[Tt]hin gtf_puts_case("tin"); BEGIN(INW);
[Tt]hir gtf_puts_case("toi"); BEGIN(INW);
[Tt]he gtf_puts_case("de"); BEGIN(INW);
[Tt]hi gtf_puts_case("di"); BEGIN(INW);
[Tt]hat/{NW} gtf_puts_case("dat"); BEGIN(INW);
I'm{WB}going{WB}to/{NW} gtf_puts_case("I'manna");
going{WB}to/{NW} gtf_puts_case("gonna");
want{WB}to/{NW} gtf_puts_case("wanna");
[Dd]id{WB}you{WB}/[eaiou] gtf_puts_case("d'j");
[Dd]id{WB}you/{NW} gtf_puts_case("d'ja");
[Hh]ow{WB}are{WB}you/{NW} gtf_puts_case("howahrya");
[Yy]ou/{NW} gtf_puts_case("yuh");
[Ww]ith gtf_puts_case("wit'"); BEGIN(INW);
[Dd]on't/{NW} gtf_puts_case("doan");
[Ss]tupid/{NW} gtf_puts_case("stoopid");
[Uu]nder gtf_puts_case("unner"); BEGIN(INW);
[Tt]o/{NW} gtf_puts_case("tuh");
[Aa]ctual gtf_puts_case("ackshul"); BEGIN(INW);
[Nn]egro/{NW} gtf_puts_case("spade");
[Pp]uerto{WB}[Rr]ican/{NW} gtf_puts_case("spic");
[Ii]talian/{NW} gtf_puts_case("greaser");
[Jj]ewish/{NW} gtf_puts_case("jew");
[Jj]ew/{NW} gtf_puts_case("hebe");
[Ii]sn't/{NW} gtf_puts_case("ain't");
{WC} { BEGIN(INW); gtf_echo(); }
}
<INW>{
[^Mm]mer/[^aeiouhrs] gtf_puts_case("mmoi"); BEGIN(INW);
er/{NW} gtf_puts_case("uh"); BEGIN(NIW);
[Ww]ord |
[Hh]eard |
[BbGgLlPpSs]urg |
[CcHh][eu]r[ntv] { gtf_printf("%coi%c", yytext[0],
yytext[yyleng-1]); }
[Oo]re/{NW} gtf_puts_case("awh"); BEGIN(NIW);
[Oo]r gtf_puts_case("awh");
[Oo]f gtf_puts_case("uhv");
tion gtf_puts_case("shun");
alk |
our[st] |
or[st] gtf_printf("awh%c", yytext[yyleng-1]);
ause gtf_puts_case("awze");
[Oo]ff gtf_puts_case("awhf");
ing/{NW} gtf_puts_case("in'"); BEGIN(NIW);
(l)?dn't/{NW} gtf_puts_case("n't"); BEGIN(NIW);
t{WB}you/{NW} gtf_puts_case("tcha"); BEGIN(NIW);
[ao]ther { gtf_printf("%cdder",
yytext[0] == 'a' ? 'a' : 'u'); }
[a-z]":" { *(yytext+1) = ',';
gtf_printf("%s like, uhh:", yytext);
BEGIN(NIW); }
[a-z]"?" { *(yytext+1) = ',';
gtf_printf("%s or what?", yytext);
BEGIN(NIW); }
! gtf_puts_case("! Okay?"); BEGIN(NIW);
[a-z]"." { gtf_printf("%s %s", yytext,
expletives[gtf_random(EXPLETIVES_LEN)]); }
{NW} BEGIN(NIW); unput(yytext[0]);
}
{EOT} /* ignore trailing EOT character */
. gtf_echo();
%%
/*
*/
#ifdef LIBRARY_MODE
int gtf_filter_brooklyn(const char *input, char *buf, size_t bufsz)
{
gtf_databuf_t buffer;
YY_BUFFER_STATE _yybuf;
gtf_strbuf_init(&buffer, buf, bufsz);
_yybuf = yy_scan_string(input);
yylex(&buffer);
yy_delete_buffer(_yybuf);
gtf_reset();
return(buffer.overflow);
}
int __gtf_filter_brooklyn(const char *input, char *buf, size_t bufsz)
{
return(gtf_filter_brooklyn(input, buf, bufsz));
}
#else /* LIBRARY_MODE */
int main(int argc, char **argv)
{
gtf_parse_args();
gtf_random_seed();
yylex(NULL);
return(EXIT_SUCCESS);
}
#endif /* LIBRARY_MODE */
/* end of source file */

202
brooklyn.vcproj Executable file
View File

@ -0,0 +1,202 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="brooklyn"
ProjectGUID="{A02DACFE-8B71-4BCB-AE8B-381AC81C9F10}"
RootNamespace="brooklyn"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="3"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
>
<File
RelativePath=".\brooklyn.c"
>
</File>
<File
RelativePath=".\common.c"
>
</File>
<File
RelativePath=".\getopt.c"
>
</File>
<File
RelativePath=".\getopt1.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
>
<File
RelativePath=".\common.h"
>
</File>
<File
RelativePath=".\getopt.h"
>
</File>
<File
RelativePath=".\talkfilters.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

1842
chef.c Executable file

File diff suppressed because it is too large Load Diff

135
chef.l Executable file
View File

@ -0,0 +1,135 @@
/* GNU Talkfilters
Copyright (C) 1998-2003 Free Software Foundation, Inc.
This file is part of GNU Talkfilters
GNU Talkfilters is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2, or (at
your option) any later version.
This software is distributed in the hope that it will be amusing, 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 software; see the file COPYING. If not, write to the
Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* chef - convert English on stdin to Mock Swedish on stdout
*
* The WC definition matches any word character, and the NW definition matches
* any non-word character. Two start conditions are maintained: INW (in word)
* and NIW (not in word). The first rule passes TeX commands without change.
*
* HISTORY
*
* Apr 26, 1993; John Hagerman: Added ! and ? to the Bork Bork Bork rule.
* Apr 15, 1992; John Hagerman: Created.
*/
%option prefix="chef_yy"
%option outfile="lex.yy.c"
%option noyywrap
%{
#include "common.h"
#include "talkfilters.h"
#define YY_DECL int yylex(gtf_databuf_t *buf)
static int i_seen = 0;
%}
WC [A-Za-z']
NW [^A-Za-z']
EOT \4
%s INW NIW
%%
\<(\/)?[A-Za-z][^\>]*\> gtf_echo(); // don't damage HTML tags
\\[^ \n\4]+ gtf_echo();
{NW} { BEGIN NIW; i_seen = 0; gtf_echo(); }
[.!?]$ { BEGIN NIW; i_seen = 0;
gtf_printf("%c\nBork Bork Bork!", yytext[0]); }
<NIW>[Bb]ork/{NW} gtf_echo();
"an" { BEGIN INW; gtf_printf("un"); }
"An" { BEGIN INW; gtf_printf("Un"); }
"au" { BEGIN INW; gtf_printf("oo"); }
"Au" { BEGIN INW; gtf_printf("Oo"); }
"a"/{WC} { BEGIN INW; gtf_printf("e"); }
"A"/{WC} { BEGIN INW; gtf_printf("E"); }
"en"/{NW} { BEGIN INW; gtf_printf("ee"); }
<INW>"ew" { BEGIN INW; gtf_printf("oo"); }
<INW>"e"/{NW} { BEGIN INW; gtf_printf("e-a"); }
<NIW>"e" { BEGIN INW; gtf_printf("i"); }
<NIW>"E" { BEGIN INW; gtf_printf("I"); }
<INW>"f" { BEGIN INW; gtf_printf("ff"); }
<INW>"ir" { BEGIN INW; gtf_printf("ur"); }
<INW>"i" { BEGIN INW; gtf_printf(i_seen++ ? "i" : "ee"); }
<INW>"ow" { BEGIN INW; gtf_printf("oo"); }
<NIW>"o" { BEGIN INW; gtf_printf("oo"); }
<NIW>"O" { BEGIN INW; gtf_printf("Oo"); }
<INW>"o" { BEGIN INW; gtf_printf("u"); }
"the" { BEGIN INW; gtf_printf("zee"); }
"The" { BEGIN INW; gtf_printf("Zee"); }
"th"/{NW} { BEGIN INW; gtf_printf("t"); }
<INW>"tion" { BEGIN INW; gtf_printf("shun"); }
<INW>"u" { BEGIN INW; gtf_printf("oo"); }
<INW>"U" { BEGIN INW; gtf_printf("Oo"); }
"v" { BEGIN INW; gtf_printf("f"); }
"V" { BEGIN INW; gtf_printf("F"); }
"w" { BEGIN INW; gtf_printf("v"); }
"W" { BEGIN INW; gtf_printf("V"); }
{EOT} /* ignore trailing EOT character */
. { BEGIN INW; gtf_echo(); }
%%
#ifdef LIBRARY_MODE
int gtf_filter_chef(const char *input, char *buf, size_t bufsz)
{
gtf_databuf_t buffer;
YY_BUFFER_STATE _yybuf;
gtf_strbuf_init(&buffer, buf, bufsz);
_yybuf = yy_scan_string(input);
yylex(&buffer);
yy_delete_buffer(_yybuf);
gtf_reset();
return(buffer.overflow);
}
int __gtf_filter_chef(const char *input, char *buf, size_t bufsz)
{
return(gtf_filter_chef(input, buf, bufsz));
}
#else /* LIBRARY_MODE */
int main(int argc, char **argv)
{
gtf_parse_args();
yylex(NULL);
return(EXIT_SUCCESS);
}
#endif /* LIBRARY_MODE */
/* end of source file */

202
chef.vcproj Executable file
View File

@ -0,0 +1,202 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="chef"
ProjectGUID="{742D6591-9D39-4513-AF8D-6CB47B13C6C3}"
RootNamespace="chef"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="3"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
>
<File
RelativePath=".\chef.c"
>
</File>
<File
RelativePath=".\common.c"
>
</File>
<File
RelativePath=".\getopt.c"
>
</File>
<File
RelativePath=".\getopt1.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
>
<File
RelativePath=".\common.h"
>
</File>
<File
RelativePath=".\getopt.h"
>
</File>
<File
RelativePath=".\talkfilters.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

4376
cockney.c Executable file

File diff suppressed because it is too large Load Diff

554
cockney.l Executable file
View File

@ -0,0 +1,554 @@
/* GNU Talkfilters
Copyright (C) 1998-2003 Free Software Foundation, Inc.
This file is part of GNU Talkfilters
GNU Talkfilters is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2, or (at
your option) any later version.
This software is distributed in the hope that it will be amusing, 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 software; see the file COPYING. If not, write to the
Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
%option prefix="cockney_yy"
%option outfile="lex.yy.c"
%option noyywrap
%option nowarn
/*
* ken:
* will turn English into Cockney, featuring (dubious) rhyming slang for a lot
* of computer terminology.
*
* Written by Stephen K Mulrine <smulrine%cs.strath.ac.uk@nsfnet-relay.ac.uk>
* Make copies if you want etc.etc.
*
* Contacted author in June 2001, asked him to clarify the license, he replied
* with some improvements and placed the program in the public domain.
* -- Edward Betts <edward@debian.org> Mon, 11 Jun 2001 12:04:29 +0100
*
* ken is named after Ken the Chirpy Cockney Character from the Viz Comic (tm),
* who speaks somewhat like that.
*/
%e 3000
%p 6000
%n 1000
%k 500
%a 4000
%o 2000
%{
#include "common.h"
#include "talkfilters.h"
#define YY_DECL int yylex(gtf_databuf_t *buf)
%}
WB [\n\t ]
WC [A-Za-z'0-9]
NW [^A-Za-z'0-9]
EOT \4
%s NIW INW
%%
<NIW,INITIAL>{
\<(\/)?[A-Za-z][^\>]*\> gtf_echo(); // don't damage HTML tags
[Tt]alk/{NW} gtf_puts_case("go on");
[Tt]alked/{NW} gtf_puts_case("went on");
[Tt]alking/{NW} gtf_puts_case("goin' on");
[Aa]s{WB}soon/{NW} gtf_puts_case("soon");
[Gg]oing{WB}to/{NW} gtf_puts_case("gonna");
[Aa]{WB}try/{NW} gtf_puts_case("a go");
[Oo][Kk]"." |
[Ff]ine/{NW} gtf_puts_case("not so bad");
Take/{NW} gtf_puts_case("'Ave");
take/{NW} gtf_puts_case("'ave");
Take{WB}a{WB}look/{NW} |
Look/{NW} gtf_puts_case("'Ave a look");
take{WB}a{WB}look/{NW} |
look/{NW} gtf_puts_case("'ave a look");
[Hh]onestly/{NW} |
[Ss]eriously/{NW} gtf_puts_case("straight up");
seam/{NW} gtf_puts_case("join");
[Gg]ood/{NW} { if(gtf_random(3) == 0)
gtf_puts_case("right good");
else
gtf_echo();
}
[Ll]end{WB}me/{NW} gtf_puts_case("borrow us");
[Ll]end/{NW} gtf_puts_case("borrow");
[Gg]ive{WB}me/{NW} gtf_puts_case("give us");
[Gg]ive{WB}up/{NW} gtf_puts_case("give over");
[Pp]ut{WB}it/{NW} gtf_puts_case("stick it");
[Pp]ut{WB}those/{NW} gtf_puts_case("stick those");
[Pp]ut{WB}them/{NW} gtf_puts_case("stick 'em");
[Dd]iscussion gtf_puts_case("chat"); BEGIN(INW);
[Tt]ry({WB}it)?/{NW} gtf_puts_case("give it a go");
[Oo]ur/{NW} gtf_puts_case("us");
[Ss]aw/{NW} gtf_puts_case("seen");
[Ss]ee/{NW} gtf_puts_case("spot");
[Ss]ees/{NW} gtf_puts_case("spots");
[Aa]{WB}lot/{NW} gtf_puts_case("a bit");
[Ll]ots{WB}of/{NW} gtf_puts_case("a bit a'");
[Aa]nyway/{NW} gtf_puts_case("any road, so");
[Aa]nyhow/{NW} gtf_puts_case("any road");
Around/{NW} gtf_puts_case("'Round");
around/{NW} gtf_puts_case("'round");
[Pp]ants/{NW} gtf_puts_case("kegs");
[Cc]lothes/{NW} gtf_puts_case("kit");
[Ss]occer/{NW} |
[Ff]ootball/{NW} gtf_puts_case("footie");
[Yy](ou{WB}|')all/{NW} gtf_puts_case("you lot");
[Nn]ude/{NW} gtf_puts_case("buff");
[Nn]aked/{NW} gtf_puts_case("stark bloody naked");
[Pp]laying({WB}around)?/{NW} |
[Hh]aving{WB}fun/{NW} gtf_puts_case("messing");
[Cc]lassy/{NW} gtf_puts_case("posh");
[Gg]et/{NW} gtf_puts_case("cop");
[Gg]etting/{NW} gtf_puts_case("copping");
[Gg]et{WB}me/{NW} gtf_puts_case("get us");
[Dd]own/{NW} gtf_puts_case("dahn");
[Dd]ownstairs/{NW} gtf_puts_case("down the apples and pears");
[Ee]yes/{NW} gtf_puts_case("mince pies");
[Pp]erhaps/{NW} gtf_puts_case("peraps");
[Ss]tairs/{NW} gtf_puts_case("apples and pears");
[Tt]own/{NW} gtf_puts_case("tahn");
[Uu]pstairs/{NW} gtf_puts_case("up the apples and pears");
[Pp]olice/{NW} |
[Cc]ops/{NW} |
[Pp]olice(wo)?men/{NW} gtf_puts_case("bobbies");
[Cc]op/{NW} |
[Pp]olice(wo)?man/{NW} gtf_puts_case("bobby");
[Ss]uit/{NW} gtf_puts_case("whistle and flute");
[Pp]rofessional |
[Ee]xpert gtf_puts_case("ace"); BEGIN(INW);
[Ll]ove gtf_puts_case("luv"); BEGIN(INW);
[Cc]lean gtf_puts_case("tidy"); BEGIN(INW);
[Mm]outh/{NW} gtf_puts_case("North and South");
[Ff]ace/{NW} gtf_puts_case("boat race");
[Tt]rouble/{NW} gtf_puts_case("Barney Rubble");
[Ww]ife/{NW} { switch(gtf_random(2))
{
case 0: gtf_puts_case("trouble and strife"); break;
case 1: gtf_puts_case("ole lady"); break;
}
}
[Rr]oad/{NW} gtf_puts_case("frog and toad");
[Pp]ub/{NW} gtf_puts_case("rub-a-dub");
[Pp]ubs/{NW} gtf_puts_case("rub-a-dubs");
[Bb]ar/{NW} gtf_puts_case("boozer");
[Bb]ars/{NW} gtf_puts_case("boozers");
[Hh]usband/{NW} gtf_puts_case("ole man");
[Pp]arty gtf_puts_case("knees-up");
[Pp]arties/{NW} gtf_puts_case("knees-ups");
[Mm]y/{NW} gtf_puts_case("me");
[Yy]ou/{NW} gtf_puts_case("yer");
[Yy]ou({WB}are|r)? gtf_puts_case("yor");
[Yy]ou({WB}a|')re/{NW} gtf_puts_case("yor");
[Tt]hose/{NW} gtf_puts_case("them");
[Tt]he/{NW} { switch(gtf_random(5))
{
case 0: gtf_puts_case("the bleedin'"); break;
case 1: gtf_puts_case("the bloody"); break;
case 2: gtf_puts_case("the bloomin'"); break;
case 3: gtf_puts_case("the chuffin'"); break;
default: gtf_echo();
}
}
[Tt]his gtf_echo(); BEGIN(INW);
[Tt]hat gtf_echo(); BEGIN(INW);
[Tt]hus/{NW} |
[Hh]ence/{NW} gtf_puts_case("so");
[Tt]han gtf_echo(); BEGIN(INW);
[Ww]ho gtf_echo(); BEGIN(INW);
old/{NW} gtf_puts_case("ole");
to/{NW} gtf_puts("ter");
[Ww]hat gtf_puts_case("wot"); BEGIN(INW);
[Ww]as/{NW} gtf_puts_case("were");
[Aa]ren't{WB}you/{NW} gtf_puts_case("Aintcha ");
[Aa]ren't/{NW} |
[Aa]re{WB}not/{NW} |
[Ii]s({WB}no|n')t/{NW} gtf_puts_case("Ain't");
[Ww]hat({WB}i|')s{WB}that/{NW} gtf_puts_case("wossat");
[Ww]hat({WB}i|')s/{NW} gtf_puts_case("woss");
[Ww]hat({WB}a|')re{WB}you(r)?/{NW} |
[Ww]hat{WB}you({WB}a|')re/{NW} |
[Ww]hat{WB}do{WB}you(r)?/{NW} gtf_puts_case("wotcher");
[Ww]atch{WB}it/{NW} gtf_puts_case("wotchit");
[Ii]({WB}a|')m/{NW} { switch(gtf_random(2))
{ case 0: gtf_puts_case("I'm bloody well"); break;
default: gtf_echo();
}
}
[Ww]hat{WB}is{WB}th gtf_puts_case("Woss"); BEGIN(INW);
[Ww]hat{WB}you({WB}a|')re/{NW} gtf_puts_case("wotcher");
[Ww]hat{WB}(are|do){WB}you(r)? gtf_puts_case("wotcher");
H[aeu]llo/{NW} gtf_puts_case("'Allo");
h[aeu]llo/{NW} gtf_puts_case("'allo");
[Ww]hat gtf_puts_case("wot"); BEGIN(INW);
[Ww]ere/{NW} gtf_puts_case("was");
[Bb]other gtf_puts_case("ars"); BEGIN(INW);
[Bb]oys/{NW} gtf_puts_case("fellas");
[Mm]other gtf_puts_case("Muvver"); BEGIN(INW);
[Mm]om gtf_puts_case("mum"); BEGIN(INW);
[Aa]rrest |
[Ss]teal |
[Bb]ust gtf_puts_case("nick"); BEGIN(INW);
[Ss]tole(n)?/{NW} |
[Hh]andcuffed/{NW} gtf_puts_case("nicked");
[Hh]ell/{NW} gtf_puts_case("hell fire");
[Uu]neployed/{NW} gtf_puts_case("on dole");
[Rr]ude/{NW} |
[Ss]assy/{NW} |
[Ii]mpudent/{NW} gtf_puts_case("cheeky");
[Tt]elephone/{NW} |
[Pp]hone/{NW} gtf_puts_case("dog and bone");
[Pp]erson gtf_puts_case("bloke"); BEGIN(INW);
[Pp]eople gtf_puts_case("blokes"); BEGIN(INW);
([Aa]n{WB})?[Aa]merican/{NW} |
[Yy]ank(ee)?/{NW} gtf_puts_case("a septic tank"); BEGIN(INW);
[Oo]ld{WB}man/{NW} |
[Gg]entleman/{NW} gtf_puts_case("geezer"); BEGIN(INW);
[Oo]ld{WB}men/{NW} |
[Gg]entlemen/{NW} gtf_puts_case("geezers"); BEGIN(INW);
[Gg]uy gtf_puts_case("lad"); BEGIN(INW);
[Ss]omeone/{NW} gtf_puts_case("some bloke");
[Ss]omebody/{NW} gtf_puts_case("some geezer");
[Oo]ther gtf_puts_case("uvver"); BEGIN(INW);
[Aa]nother gtf_puts_case("aunuvver"); BEGIN(INW);
[Hh]i/{NW} gtf_puts_case("oi");
[Ww]ow/{NW} |
[Yy]ay/{NW} |
[Yy]ahoo/{NW} gtf_puts_case("cor");
[Hh]oora(y|h)/{NW} |
[Yy]eehaw/{NW} |
[Gg]eez/{NW} |
[Gg]osh/{NW} |
[Gg]olly/{NW} gtf_puts_case("blimey");
[Hh]ey/{NW} { switch(gtf_random(2))
{ case 0: gtf_puts_case("eh, up"); break;
case 1: gtf_puts_case("oi"); break;
}
}
[Cc]ow/{NW} gtf_puts_case("cah");
[Ss]tate{WB}of{WB}the{WB}art/{NW} gtf_puts_case("top o' the range");
[Ff]ather gtf_puts_case("favver"); BEGIN(INW);
[Rr]ather/{NW} gtf_puts_case("ravver");
[Ww]eather gtf_puts_case("wevver"); BEGIN(INW);
[Ll]eather/{NW} gtf_puts_case("Levver");
[Ww]ither/{NW} gtf_puts_case("wivver");
[Ee]ither/{NW} gtf_puts_case("eever");
[Ss]mart gtf_puts_case("keen"); BEGIN(INW);
[Ww]ith gtf_puts_case("wiv"); BEGIN(INW);
[Aa]nything/{NW} gtf_puts_case("anyfink");
[Ss]omething/{NW} gtf_puts_case("sumfink");
[Nn]othing/{NW} gtf_puts_case("nuffink");
[Ee]verything/{NW} gtf_puts_case("evryfink");
[Vv]ery/{NW} |
[Rr]eally/{NW} gtf_puts_case("right");
[Bb]other/{NW} gtf_puts_case("bovver");
[Dd]umb gtf_puts_case("daft"); BEGIN(INW);
[Cc]ool{WB}it/{NW} |
[Cc]hill{WB}out/{NW} gtf_puts_case("don't get a benny on");
[Ii]mmoral |
[Cc]rude gtf_puts_case("naughty"); BEGIN(INW);
[Pp]rofanity/{NW} gtf_puts_case("naughty language");
[Ss]wear{WB}word gtf_puts_case("naughty word"); BEGIN(INW);
[Gg]et{WB}over/{NW} gtf_puts_case("grow out");
[Gg]ot{WB}over/{NW} gtf_puts_case("grew out");
[Gg]otten{WB}over/{NW} gtf_puts_case("grown out");
[Ss]uppose/{NW} gtf_puts_case("s'pose");
[Kk]ind{WB}of/{NW} gtf_puts_case("sort of");
[Dd]oesn't/{NW} gtf_puts_case("don't");
[Gg]uitar(s)?/{NW} |
[Dd]rum(s)?/{NW} |
[Tt]rumpet(s)?/{NW} |
[Vv]iolin(s)?/{NW} |
[Cc]larinet(s)?/{NW} |
[Tt]rombone(s)?/{NW} |
[Oo]boe(s)?/{NW} |
[Ff]lute(s)?/{NW} |
[Tt]uba(s)?/{NW} gtf_puts_case("spoons");
[Pp]iano/{NW} gtf_puts_case("joanna");
[Dd]ata gtf_puts_case("Info"); BEGIN(INW);
[Dd]irectory/{NW} gtf_puts_case("Lockup");
[Dd]irectories/{NW} gtf_puts_case("Lockups");
[Pp]rocess { switch(gtf_random(2))
{
case 0: gtf_puts_case("Queen Bess"); break;
case 1: gtf_puts_case("Rudolf 'Ess"); break;
}
}
[Cc]omputer gtf_puts_case("French Tutor"); BEGIN(INW);
[Bb]yte gtf_puts_case("Jimmy White"); BEGIN(INW);
[Ff]iles gtf_puts_case("Nobby Stiles"); BEGIN(INW);
[Ff]ile gtf_puts_case("Royal Mile"); BEGIN(INW);
[Ll]anguage gtf_puts_case("'Am Sandwich"); BEGIN(INW);
[Zz]ero gtf_puts_case("Emperor Nero"); BEGIN(INW);
[Jj]ob gtf_puts_case("Uncle Bob"); BEGIN(INW);
[Ss]hell gtf_puts_case("Bow Bell"); BEGIN(INW);
[Ss]ave gtf_puts_case("Chas'n'Dave"); BEGIN(INW);
[Ll]oad gtf_puts_case("Old Kent Road"); BEGIN(INW);
[Mm]ouse gtf_puts_case("Doll's 'Ouse"); BEGIN(INW);
[Bb]uffer gtf_puts_case("Sausage Stuffer"); BEGIN(INW);
[Kk]eyboard gtf_puts_case("Henry Ford"); BEGIN(INW);
[Mm]anual gtf_puts_case("Cocker Spaniel"); BEGIN(INW);
[Ss]creen gtf_puts_case("James Dean"); BEGIN(INW);
[Pp]rinter gtf_puts_case("'Arold Pinter"); BEGIN(INW);
[Pp]lotter gtf_puts_case("Pansy Potter"); BEGIN(INW);
[Cc]ompiler gtf_puts_case("Martin Tyler"); BEGIN(INW);
[Ss]tring gtf_puts_case("Emperor Ming"); BEGIN(INW);
[Bb]rain gtf_puts_case("Michael Caine"); BEGIN(INW);
[Pp][Aa][Ss][Cc][Aa][Ll]/{NW} { switch(gtf_random(2))
{
case 0: gtf_puts_case("Pall Mall"); break;
case 1: gtf_puts_case("Roald Dahl"); break;
}
}
[Aa][Ll][Gg][Oo][Ll]/{NW} gtf_puts_case("Johnny Ball");
[Ff][Oo][Rr][Tt][Rr][Aa][Nn]/{NW} gtf_puts_case("Manfred Mann");
[Cc][Oo][Bb][Oo][Ll]/{NW} gtf_puts_case("Albert Hall");
C/{NW} { switch(gtf_random(4))
{
case 0: gtf_puts_case("Bruce Lee"); break;
case 1: gtf_puts_case("Circus Flea"); break;
case 2: gtf_puts_case("Bumble Bee"); break;
case 3: gtf_puts_case("Door Key"); break;
}
}
[Jj]ava/{NW} gtf_puts_case("Wot a palavah");
[Ww][aA][pP]/{NW} gtf_puts_case("Pony and trap");
[Ll]oon(e)?y |
[Ff]ruitcake |
[Nn]utcase gtf_puts_case("nutter"); BEGIN(INW);
[Bb]ook gtf_puts_case("butcher's hook"); BEGIN(INW);
[Ss]topped/{NW} gtf_puts_case("'Ad the mockers put on");
[Ss]topping/{NW} gtf_puts_case("Putting the mockers on");
stops/{NW} gtf_puts_case("puts the mockers on");
[Ss]top/{NW} gtf_puts_case("put the mockers on");
[Ll]ondoner gtf_puts_case("Cockney"); BEGIN(INW);
[Hh] gtf_puts_case("'"); BEGIN(INW);
[Mm]ini(ature)? |
[Tt]iny |
[Ll]ittle |
[Ss]mall gtf_puts_case("wee"); BEGIN(INW);
[Mm]oney/{NW} gtf_puts_case("brass");
[Pp]al/{NW} |
[Bb]uddy/{NW} gtf_puts_case("mate");
[Pp]als/{NW} gtf_puts_case("mates");
[Ff]riend { switch(gtf_random(3))
{
case 0: gtf_puts_case("mucker"); break;
case 1: gtf_puts_case("mate"); break;
case 2: gtf_puts_case("china"); break;
}
BEGIN(INW);
}
[Ww]oman/{NW} { switch(gtf_random(4))
{ case 0: gtf_puts_case("bint"); break;
case 1: gtf_puts_case("cow"); break;
case 2: gtf_puts_case("lass"); break;
case 3: gtf_puts_case("tart"); break;
}
}
[Ww]omen/{NW} { switch(gtf_random(4))
{ case 0: gtf_puts_case("bints"); break;
case 1: gtf_puts_case("cows"); break;
case 2: gtf_puts_case("ruddy ladies"); break;
case 3: gtf_puts_case("tarts"); break;
}
}
[Tt]hing { switch(gtf_random(2))
{ case 0: gtf_puts_case("fink");
case 1: gtf_puts_case("bugger");
}
BEGIN(INW);
}
[Dd]evil |
[Rr]ascal |
[Aa]sshole |
[Dd]ork |
[Dd]olt |
[Nn]erd |
[Ii]diot { switch(gtf_random(6))
{ case 0: gtf_puts_case("bog eyes"); break;
case 1: gtf_puts_case("poof"); break;
case 2: gtf_puts_case("git"); break;
case 3: gtf_puts_case("fairy"); break;
case 4: gtf_puts_case("tosser"); break;
case 5: gtf_puts_case("divvy"); break;
}
BEGIN(INW);
}
[Bb]e{WB}quiet/{NW} |
[Ss]hut{WB}up/{NW} { switch(gtf_random(2))
{ case 0: gtf_puts_case("shut it"); break;
default: gtf_puts_case("Button it"); break;
}
}
[Aa]l(l{WB})?right/{NW} { switch(gtf_random(3))
{ case 0: gtf_puts_case("arright"); break;
case 1: gtf_puts_case("awright"); break;
case 2: gtf_puts_case("right"); break;
}
}
[Cc]igarette gtf_puts_case("fag"); BEGIN(INW);
[Gg]oing/{NW} gtf_puts_case("gahn");
[Bb]ring |
[Ss]ting |
[Ss]wing |
[CcFfSs]ling |
[BbKkMmPpRrSsWw]ing gtf_echo(); BEGIN(INW);
[Tt]here |
[Tt]hey |
[Tt]his |
[Tt]hat gtf_echo(); BEGIN(INW);
Th gtf_puts("F"); BEGIN(INW);
[Mm]r"."/{NW} gtf_puts("Guvnor");
[Ww]hy |
[Ww]here | gtf_echo(); BEGIN(INW);
[Ww]h gtf_puts_case("W"); BEGIN(INW);
[Oo]f/{NW} gtf_puts_case("o'");
{WC} { BEGIN(INW); gtf_echo(); }
}
<INW>{
[Aa]{WB}h gtf_puts_case("an '");
aw gtf_puts_case("or");
ing/{NW} gtf_puts_case("in'"); BEGIN(NIW);
"." { switch(gtf_random(32))
{
case 0:
gtf_puts_case(". I'll get out me spoons.");
break;
case 1:
gtf_puts_case(". Yer can't 'ave a knees-up wivout a joanna.");
break;
case 2:
gtf_puts_case(". Cor blimey guv, would I lie to you.");
break;
case 3:
gtf_puts_case(". I'll make us all a nice cup a' tea.");
break;
case 4:
gtf_puts_case(", do wot Guvnor!");
break;
case 5:
gtf_puts_case(", right?");
break;
case 6:
gtf_puts_case(". Right.");
break;
case 7:
case 8:
gtf_puts_case(", i'n it?");
break;
default:
gtf_echo();
}
BEGIN(NIW);
}
"?" { if(gtf_random(3) == 0)
gtf_puts(", isit?");
else
{
switch(gtf_random(4))
{
case 0: gtf_puts(", then"); break;
case 1: gtf_puts(", eh"); break;
case 2: gtf_puts(", then, eh"); break;
}
switch(gtf_random(6))
{
case 0: gtf_puts(", mate?"); break;
case 1: gtf_puts(", guv?"); break;
case 2: gtf_puts(", squire?"); break;
case 3: gtf_puts(", luv?"); break;
default: gtf_echo();
}
}
}
, { if(gtf_random(3) == 0)
gtf_puts(", right,");
else
gtf_echo();
}
! { switch(gtf_random(7))
{
case 0: gtf_puts_case("! Blimey!"); break;
case 1: gtf_puts_case("! Struth!"); break;
case 2: gtf_puts_case("! Right!"); break;
case 3: gtf_puts_case(", guv!"); break;
case 4: gtf_puts_case("! Honest, guv!"); break;
case 5: gtf_puts_case("! Oi!"); break;
case 6: gtf_puts_case(", mate!"); break;
default: gtf_echo();
}
}
{NW} BEGIN(NIW); unput(yytext[0]);
}
{EOT} /* ignore trailing EOT character */
. gtf_echo();
%%
#ifdef LIBRARY_MODE
int gtf_filter_cockney(const char *input, char *buf, size_t bufsz)
{
gtf_databuf_t buffer;
YY_BUFFER_STATE _yybuf;
gtf_strbuf_init(&buffer, buf, bufsz);
_yybuf = yy_scan_string(input);
yylex(&buffer);
yy_delete_buffer(_yybuf);
gtf_reset();
return(buffer.overflow);
}
int __gtf_filter_cockney(const char *input, char *buf, size_t bufsz)
{
return(gtf_filter_cockney(input, buf, bufsz));
}
#else /* LIBRARY_MODE */
int main(int argc, char **argv)
{
gtf_parse_args();
gtf_random_seed();
yylex(NULL);
return(EXIT_SUCCESS);
}
#endif /* LIBRARY_MODE */
/* end of source file */

202
cockney.vcproj Executable file
View File

@ -0,0 +1,202 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="cockney"
ProjectGUID="{3289D467-6173-49B4-9E7E-8098D959BBDA}"
RootNamespace="cockney"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="3"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
>
<File
RelativePath=".\cockney.c"
>
</File>
<File
RelativePath=".\common.c"
>
</File>
<File
RelativePath=".\getopt.c"
>
</File>
<File
RelativePath=".\getopt1.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
>
<File
RelativePath=".\common.h"
>
</File>
<File
RelativePath=".\getopt.h"
>
</File>
<File
RelativePath=".\talkfilters.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

167
common.c Executable file
View File

@ -0,0 +1,167 @@
/* GNU Talkfilters
Copyright (C) 1998-2003 Free Software Foundation, Inc.
This file is part of GNU Talkfilters
GNU Talkfilters is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2, or (at
your option) any later version.
This software is distributed in the hope that it will be amusing, 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 software; see the file COPYING. If not, write to the
Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <stddef.h>
#include <stdarg.h>
#include <unistd.h>
#include <stdio.h>
#include <time.h>
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include "getopt.h"
#include "common.h"
/*
*/
static const struct option __gtf_options[] = { { "help", 0, NULL, 0 },
{ "version", 0, NULL, 0 },
{ NULL, 0, NULL, 0 } };
/*
*/
void gtf_parse_args_basic(int argc, char **argv, const char *help,
const char *version)
{
int c, option_index;
while((c = getopt_long(argc, argv, "g", __gtf_options, &option_index))
!= EOF)
{
switch(c)
{
case 0:
if(option_index == HELP_OPTION)
fprintf(stderr, help, *argv);
else if(option_index == VERSION_OPTION)
{
fputs(version, stderr);
fputc('\n', stderr);
}
exit(EXIT_SUCCESS);
break;
default:
fprintf(stderr, help, *argv);
exit(EXIT_FAILURE);
break;
}
}
}
/*
*/
void gtf_strbuf_init(gtf_databuf_t *sbuf, char *buf, size_t bufsz)
{
sbuf->buf = buf;
sbuf->bufsz = bufsz;
sbuf->left = bufsz - 1;
sbuf->pos = sbuf->buf;
sbuf->overflow = 0;
}
/*
*/
int gtf_strbuf_vprintf(gtf_databuf_t *buf, const char *fmt, ...)
{
va_list vp;
int l;
va_start(vp, fmt);
l = vsnprintf(buf->pos, buf->left, fmt, vp);
va_end(vp);
if(l > buf->left)
{
buf->pos += buf->left;
buf->left = 0;
buf->overflow = 1;
}
else
{
buf->left -= l;
buf->pos += l;
*(buf->pos) = 0;
}
return(l);
}
/*
*/
int gtf_strbuf_puts(gtf_databuf_t *buf, const char *s)
{
int l = strlen(s);
if(l > buf->left)
{
buf->overflow = 1;
l = buf->left;
}
strncpy(buf->pos, s, l);
buf->pos += l;
buf->left -= l;
*(buf->pos) = 0;
return(l);
}
/*
*/
int gtf_strbuf_putc(gtf_databuf_t *buf, char c)
{
if(buf->left < 1)
{
buf->overflow = 1;
return(0);
}
*(buf->pos) = c;
buf->pos++;
*(buf->pos) = 0;
buf->left--;
return(1);
}
/*
*/
void gtf_random_seed(void)
{
srand(time(NULL) | getpid());
}
/* end of source file */

115
common.h Executable file
View File

@ -0,0 +1,115 @@
/* GNU Talkfilters
Copyright (C) 1998-2003 Free Software Foundation, Inc.
This file is part of GNU Talkfilters
GNU Talkfilters is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2, or (at
your option) any later version.
This software is distributed in the hope that it will be amusing, 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 software; see the file COPYING. If not, write to the
Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __gtf_common_h
#define __gtf_common_h
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#if (defined WIN32) && !(defined __MINGW32__)
#define fileno _fileno
#define strcasecmp stricmp
#endif
#include "config.h"
typedef struct
{
char *buf;
size_t bufsz;
char *pos;
size_t left;
char overflow;
} gtf_databuf_t;
/* We NEVER want to read from stdin when called thru the library API, but flex
* insists on doing so anyway, so redefine YY_INPUT to always return EOF
* immediately.
*/
#ifdef LIBRARY_MODE
#define YY_INPUT(buffer,result,max_size) YY_NULL
#endif
#define HELP_OPTION 0
#define VERSION_OPTION 1
extern void gtf_parse_args_basic(int argc, char **argv, const char *help,
const char *version);
#define gtf_parse_args() \
gtf_parse_args_basic(argc, argv, GTF_HELP, GTF_VERSION)
extern void gtf_strbuf_init(gtf_databuf_t *sbuf, char *buf, size_t bufsz);
extern int gtf_strbuf_vprintf(gtf_databuf_t *buf, const char *fmt, ...);
extern int gtf_strbuf_puts(gtf_databuf_t *buf, const char *s);
extern int gtf_strbuf_putc(gtf_databuf_t *buf, char c);
#ifdef LIBRARY_MODE
#define gtf_printf(...) \
gtf_strbuf_vprintf(buf, __VA_ARGS__)
#define gtf_putc(S) \
gtf_strbuf_putc(buf, (S))
#define gtf_puts(S) \
gtf_strbuf_puts(buf, (S))
#else /* LIBRARY_MODE */
#define gtf_printf printf
#define gtf_putc putchar
#define gtf_puts(S) \
fputs((S), stdout)
#endif /* LIBRARY_MODE */
#define gtf_unput_last() \
unput(*(yytext + yyleng - 1))
#define gtf_match_case(X, Y) \
isupper(X) ? toupper(Y) : tolower(Y)
#define gtf_puts_case(T) \
gtf_printf("%c%s", gtf_match_case(*yytext, *(T)), (T) + 1)
#define gtf_echo() \
gtf_puts(yytext)
#define gtf_reset() \
{ yyrestart(NULL); BEGIN(0); }
extern void gtf_random_seed(void);
#define gtf_random(R) \
(int)(rand() % (R))
#define GTF_HELP \
"Usage: %s [OPTIONS]\n\n\
Options:\n\
--help display this help information and exit\n\
--version output version information and exit\n\n\
This program is a filter; it reads data from standard input, processes it,\n\
and writes the results to standard output.\n"
#define GTF_VERSION "GNU Talk Filters v" VERSION
#endif /* __gtf_common_h */

99
compile Executable file
View File

@ -0,0 +1,99 @@
#! /bin/sh
# Wrapper for compilers which do not understand `-c -o'.
# Copyright 1999, 2000 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Usage:
# compile PROGRAM [ARGS]...
# `-o FOO.o' is removed from the args passed to the actual compile.
prog=$1
shift
ofile=
cfile=
args=
while test $# -gt 0; do
case "$1" in
-o)
# configure might choose to run compile as `compile cc -o foo foo.c'.
# So we do something ugly here.
ofile=$2
shift
case "$ofile" in
*.o | *.obj)
;;
*)
args="$args -o $ofile"
ofile=
;;
esac
;;
*.c)
cfile=$1
args="$args $1"
;;
*)
args="$args $1"
;;
esac
shift
done
if test -z "$ofile" || test -z "$cfile"; then
# If no `-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
# `.c' file was seen then we are probably linking. That is also
# ok.
exec "$prog" $args
fi
# Name of file we expect compiler to create.
cofile=`echo $cfile | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
# Create the lock directory.
# Note: use `[/.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo $cofile | sed -e 's|[/.-]|_|g'`.d
while true; do
if mkdir $lockdir > /dev/null 2>&1; then
break
fi
sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir $lockdir; exit 1" 1 2 15
# Run the compile.
"$prog" $args
status=$?
if test -f "$cofile"; then
mv "$cofile" "$ofile"
fi
rmdir $lockdir
exit $status

1516
config.guess vendored Executable file

File diff suppressed because it is too large Load Diff

62
config.h.in Executable file
View File

@ -0,0 +1,62 @@
/* config.h.in. Generated from configure.in by autoheader. */
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION
/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
`char[]'. */
#undef YYTEXT_POINTER
/* Define to empty if `const' does not conform to ANSI C. */
#undef const

1626
config.sub vendored Executable file

File diff suppressed because it is too large Load Diff

22458
configure vendored Executable file

File diff suppressed because it is too large Load Diff

49
configure.in Executable file
View File

@ -0,0 +1,49 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(common.c)
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE(talkfilters, 2.3.8)
AM_CONFIG_HEADER(config.h)
dnl Checks for programs.
AC_PROG_INSTALL
AC_PROG_CC
AM_PROG_LEX
if test Z"$LEX" != Zflex; then
cat <<EOF
*******************************************************************
You do not seem to have flex. While flex is not required to build
talkfilters, you may need it to regenerate the lexers if you change
any of the .l files. Other "lex" programs may not be able to handle
some of the .l files in this package.
*******************************************************************
EOF
fi
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
dnl Checks for libraries.
dnl AC_CHECK_LIB(fl, main)
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h string.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
dnl Checks for library functions.
dnl Check for MinGW. Workaround for libtool's DLL_EXPORT stupidity.
case "$target" in
*-*-cygwin* | *-*-mingw*)
gnuwin=yes;;
esac
AM_CONDITIONAL(GNU_WIN, test x$gnuwin = xyes)
AC_OUTPUT(Makefile talkfilters.pc)

423
depcomp Executable file
View File

@ -0,0 +1,423 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
# Copyright 1999, 2000 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# `libtool' can also be set to `yes' or `no'.
if test -z "$depfile"; then
base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'`
dir=`echo "$object" | sed 's,/.*$,/,'`
if test "$dir" = "$object"; then
dir=
fi
# FIXME: should be _deps on DOS.
depfile="$dir.deps/$base"
fi
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say).
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the `deleted header file' problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
tr ' ' '
' < "$tmpdepfile" |
## Some versions of gcc put a space before the `:'. On the theory
## that the space means something, we add a space to the output as
## well.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like `#:fec' to the end of the
# dependency line.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr '
' ' ' >> $depfile
echo >> $depfile
# The second pass generates a dummy entry for each header file.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> $depfile
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. This file always lives in the current directory.
# Also, the AIX compiler puts `$object:' at the start of each line;
# $object doesn't have directory information.
stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
tmpdepfile="$stripped.u"
outname="$stripped.o"
if test "$libtool" = yes; then
"$@" -Wc,-M
else
"$@" -M
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
if test -f "$tmpdepfile"; then
# Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in `foo.d' instead, so we check for that too.
# Subdirectories are respected.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1="$dir.libs/$base.lo.d"
tmpdepfile2="$dir.libs/$base.d"
"$@" -Wc,-MD
else
tmpdepfile1="$dir$base.o.d"
tmpdepfile2="$dir$base.d"
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
if test -f "$tmpdepfile1"; then
tmpdepfile="$tmpdepfile1"
else
tmpdepfile="$tmpdepfile2"
fi
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a space and a tab in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the proprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'. We will use -o /dev/null later,
# however we can't do the remplacement now because
# `-o $object' might simply not be used
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
"$@" -o /dev/null $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' '
' < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# X makedepend
shift
cleared=no
for arg in "$@"; do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
-*)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix="`echo $object | sed 's/^.*\././'`"
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' '
' | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the proprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E |
sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the proprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool.
"$@" || exit $?
IFS=" "
for arg
do
case "$arg" in
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
echo " " >> "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0

5734
drawl.c Executable file

File diff suppressed because it is too large Load Diff

487
drawl.l Executable file
View File

@ -0,0 +1,487 @@
/* GNU Talkfilters
Copyright (C) 1998-2003 Free Software Foundation, Inc.
This file is part of GNU Talkfilters
GNU Talkfilters is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2, or (at
your option) any later version.
This software is distributed in the hope that it will be amusing, 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 software; see the file COPYING. If not, write to the
Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* Title: English to Texan translator
* Author: Adam Hudd (adam@dadhb1.ti.com)
* Date: 5 March 1991
* Version: 1.0
*/
%option prefix="drawl_yy"
%option outfile="lex.yy.c"
%option noyywrap
%{
#include "common.h"
#include "talkfilters.h"
#define YY_DECL int yylex(gtf_databuf_t *buf)
%}
WB [\n\t ]
WC [A-Za-z'0-9]
NW [^A-Za-z'0-9]
EOT \4
%s NIW INW
%%
<NIW,INITIAL>{
\<(\/)?[A-Za-z][^\>]*\> gtf_echo(); // don't damage HTML tags
American/{NW} gtf_puts_case("Amerkin");
California gtf_puts_case("Caleyfornyuh"); BEGIN(INW);
Dallas/{NW} gtf_puts_case("Big D.");
Fort{WB}Worth gtf_puts_case("Fowert Wurth"); BEGIN(INW);
Houston gtf_puts_case("Useton"); BEGIN(INW);
I{WB}don't{WB}know/{NW} gtf_puts_case("I-O-no");
I({WB}wi|')ll/{NW} gtf_puts_case("Ahl");
I{WB}would gtf_puts_case("Ahd"); BEGIN(INW);
I/{NW} gtf_puts_case("Ah");
I({WB}a|')m/{NW} gtf_puts_case("Ahm");
I({WB}ha|')ve gtf_puts_case("Ahv"); BEGIN(INW);
Mexico gtf_puts_case("Messyco"); BEGIN(INW);
San{WB}Antonio/{NW} gtf_puts_case("Santone");
TV|[Tt]elevision|[Tt]elly/{NW} gtf_puts_case("tayvay");
Texan gtf_puts_case("Texun"); BEGIN(INW);
Texas/{NW} gtf_puts_case("Teksus");
[Aa]{WB}while/{NW} gtf_puts_case("uhwahl");
[Aa]/{NW} gtf_puts_case("uh");
[Aa]bout gtf_puts_case("bout"); BEGIN(INW);
[Aa]dult gtf_puts_case("a-dult"); BEGIN(INW);
[Aa]fraid/{NW} gtf_puts_case("frayed");
[Aa]nd/{NW} gtf_puts_case("an");
[Aa]nniversary/{NW} gtf_puts_case("anavarsry");
[Aa]ny/{NW} gtf_puts_case("no");
[Aa]nywhere/{NW} gtf_puts_case("anywhare");
[Aa]ppreciate gtf_puts_case("preshate"); BEGIN(INW);
[Aa]pril/{NW} gtf_puts_case("abrul");
[Aa]re{WB}going{WB}to/{NW} gtf_puts_case("sar gunna");
[Aa]re{WB}known/{NW} gtf_puts_case("iz node");
[Aa]re/{NW} gtf_puts_case("is");
[Aa]ren't{WB}you/{NW} gtf_puts_case("arncha");
[Aa]t{WB}them/{NW} gtf_puts_case("attum");
[Aa]ugust/{NW} gtf_puts_case("awg-ghust");
[Aa]way/{NW} gtf_puts_case("awf");
[Aa]wkward gtf_puts_case("aukerd"); BEGIN(INW);
[Bb]ad gtf_puts_case("bayud"); BEGIN(INW);
[Bb]aptist/{NW} gtf_puts_case("babtuss");
[Bb]aptists/{NW} gtf_puts_case("babtusses");
[Bb]arbed/{NW} gtf_puts_case("bob");
[Bb]e/{NW} gtf_puts_case("bay");
[Bb]ear gtf_puts_case("bayur"); BEGIN(INW);
[Bb]eautiful/{NW} gtf_puts_case("butiful");
[Bb]ecause/{NW} gtf_puts_case("cuz");
[Bb]elieve/{NW} gtf_puts_case("bleeve");
[Bb]lack gtf_puts_case("blaak"); BEGIN(INW);
[Bb]lue gtf_puts_case("bulloo"); BEGIN(INW);
[Bb]orn/{NW} gtf_puts_case("bornd");
[Bb]r(ake|eak)/{NW} gtf_puts_case("brayke");
[Bb]rick gtf_puts_case("breck"); BEGIN(INW);
[Bb]righter/{NW} gtf_puts_case("brotter");
[Bb]ringing/{NW} gtf_puts_case("brangin");
[Bb]rown gtf_puts_case("braoyne"); BEGIN(INW);
[Bb]building/{NW} gtf_puts_case("bildun");
[Cc]all{WB}you/{NW} gtf_puts_case("cawya");
[Cc]alled{WB}you/{NW} gtf_puts_case("cawdja");
[Cc]amera/{NW} gtf_puts_case("Instuhmatik");
[Cc]an('|no|{WB}no)t/{NW} gtf_puts_case("kaynt");
[Cc]apital gtf_puts_case("captul"); BEGIN(INW);
[Cc]ar/{NW} gtf_puts_case("cawer");
[Cc]atch gtf_puts_case("ketch"); BEGIN(INW);
[Cc]hair gtf_puts_case("chayer"); BEGIN(INW);
[Cc]heer gtf_puts_case("chair"); BEGIN(INW);
[Cc]hicken gtf_puts_case("chikun"); BEGIN(INW);
[Cc]hild gtf_puts_case("kid"); BEGIN(INW);
[Cc]hildren gtf_puts_case("kids"); BEGIN(INW);
[Cc]lean gtf_puts_case("klane"); BEGIN(INW);
[Cc]limate/{NW} gtf_puts_case("kliment");
[Cc]old gtf_puts_case("code"); BEGIN(INW);
[Dd]amn gtf_puts_case("dawgone"); BEGIN(INW);
[Dd]arker/{NW} gtf_puts_case("dawerker");
[Dd]eaf/{NW} gtf_puts_case("dayuf");
[Dd]eath/{NW} gtf_puts_case("dayuth");
[Dd]ecember/{NW} gtf_puts_case("deceyumbur");
[Dd]efinite gtf_puts_case("defnut"); BEGIN(INW);
[Dd]id('|{WB}no)t/{NW} gtf_puts_case("didunt");
[Dd]id{WB}you/{NW} gtf_puts_case("dja");
[Dd]idn't{WB}it/{NW} gtf_puts_case("diduhnit");
[Dd]ifferent/{NW} gtf_puts_case("difernt");
[Dd]ifficult/{NW} gtf_puts_case("difahkult");
[Dd]ivide gtf_puts_case("duhvide"); BEGIN(INW);
[Dd]oes/{NW} gtf_puts_case("duz");
[Dd]oesn't/{NW} gtf_puts_case("don't");
[Dd]og/{NW} gtf_puts_case("dawg");
I{WB}don't{WB}care/{NW} gtf_puts_case("don't make no nevur mind to may");
[Dd]oor gtf_puts_case("dower"); BEGIN(INW);
[Dd]reaming/{NW} gtf_puts_case("draimun");
[Dd]rink/{NW} gtf_puts_case("drank");
[Dd]rinking/{NW} gtf_puts_case("drankin");
[Dd]rive gtf_puts_case("drahv"); BEGIN(INW);
[Ee]ight/{NW} gtf_puts_case("ate");
[Ee]ighteen/{NW} gtf_puts_case("a-tane");
[Ee]ighth/{NW} gtf_puts_case("athd");
[Ee]ighty/{NW} gtf_puts_case("ady");
[Ee]leven/{NW} gtf_puts_case("lebum");
[Ee]ntire/{NW} gtf_puts_case("entahr");
[Ee]specially/{NW} gtf_puts_case("speshuly");
[Ee]ven/{NW} gtf_puts_case("evun");
[Ee]vening/{NW} gtf_puts_case("eevnun");
[Ee]ventually/{NW} gtf_puts_case("eventchly");
[Ee]ver/{NW} gtf_puts_case("evur");
[Ee]very{WB}once{WB}in{WB}a{WB}while/{NW} {
gtf_puts_case("evur wons in a whahl"); }
[Ee]very/{NW} gtf_puts_case("evur");
[Ee]xactly/{NW} gtf_puts_case("zakly");
[Ee]xecutive/{NW} gtf_puts_case("zekatuv");
[Ee]ye/{NW} gtf_puts_case("ah");
[Ff]ather/{NW} gtf_puts_case("papa");
[Ff]ebruary/{NW} gtf_puts_case("febberyawary");
[Ff]ell/{NW} gtf_puts_case("fayul");
[Ff]ifteen/{NW} gtf_puts_case("fiftane");
[Ff]ifth/{NW} gtf_puts_case("fifd");
[Ff]ifty/{NW} gtf_puts_case("fifdy");
[Ff]ight gtf_puts_case("fite"); BEGIN(INW);
[Ff]igure/{NW} gtf_puts_case("figger");
[Ff]illing/{NW} gtf_puts_case("fillin");
[Ff]ine gtf_puts_case("fahn"); BEGIN(INW);
[Ff]ire gtf_puts_case("far"); BEGIN(INW);
[Ff]irst/{NW} gtf_puts_case("fursd");
[Ff]ive/{NW} gtf_puts_case("fav");
[Ff]ixing/{NW} gtf_puts_case("fixin");
[Ff]lower/{NW} gtf_puts_case("flare");
[Ff]ollow gtf_puts_case("faller"); BEGIN(INW);
[Ff]or/{NW} gtf_puts_case("fahwar");
[Ff]orget/{NW} gtf_puts_case("fergit");
[Ff]ork/{NW} gtf_puts_case("fowerk");
[Ff]orty/{NW} gtf_puts_case("fardy");
[Ff]our/{NW} gtf_puts_case("fower");
[Ff]ourteen/{NW} gtf_puts_case("fortane");
[Ff]ourth/{NW} gtf_puts_case("fowerth");
[Ff]reeze gtf_puts_case("fraze"); BEGIN(INW);
[Ff]riday/{NW} gtf_puts_case("frydy");
[Ff]rom/{NW} gtf_puts_case("frum");
[Ff]ront gtf_puts_case("frunt"); BEGIN(INW);
[Gg]as gtf_puts_case("gayus"); BEGIN(INW);
[Gg]eography/{NW} gtf_puts_case("joggerfee");
[Gg]et{WB}a{WB}hold{WB}of{WB}you/{NW} {
gtf_puts_case("gitta hold a yew"); }
[Gg]et gtf_puts_case("git"); BEGIN(INW);
[Gg]oing{WB}to/{NW} gtf_puts_case("gunna");
[Gg]old/{NW} gtf_puts_case("gode");
[Gg]ot{WB}to/{NW} gtf_puts_case("gotta");
[Gg]reen gtf_puts_case("grane"); BEGIN(INW);
[Gg]r(e|a)y gtf_puts_case("graey"); BEGIN(INW);
[Gg]uests/{NW} gtf_puts_case("guesss");
[Gg]uitar/{NW} gtf_puts_case("gitahwer");
[Gg]ulf/{NW} gtf_puts_case("guf");
[Hh]ard gtf_puts_case("hayud"); BEGIN(INW);
[Hh]ave{WB}a/{NW} gtf_puts_case("havuh");
[Hh]ave({WB}no|n')t/{NW} gtf_puts_case("habumt");
[Hh]ave/{NW} gtf_puts_case("hav");
[Hh]e/{NW} gtf_puts_case("hay");
[Hh]eaded/{NW} gtf_puts_case("hardud");
[Hh]ere/{NW} gtf_puts_case("hare");
[Hh]igh/{NW} gtf_puts_case("ha");
[Hh]our gtf_puts_case("air"); BEGIN(INW);
[Hh]ow{WB}are{WB}you/{NW} gtf_puts_case("hyeru");
[Hh]ow{WB}do{WB}you{WB}do/{NW} gtf_puts_case("howdee");
[Hh]uh! gtf_puts_case("hawh!");
[Hh]uh? gtf_puts_case("hawh?");
[Hh]undred/{NW} gtf_puts_case("hunnerd");
[Ii]f{WB}I/{NW} gtf_puts_case("fah");
[Ii]f{WB}it/{NW} gtf_puts_case("hifit");
[Ii]f{WB}you gtf_puts_case("few"); BEGIN(INW);
[Ii]f/{NW} gtf_puts_case("hif");
[Ii]gnoran(ce|t)/{NW} gtf_puts_case("ignernt");
[Ii]ndian/{NW} gtf_puts_case("hinyun");
[Ii]nside/{NW} gtf_puts_case("n-sod");
[Ii]nstead{WB}of/{NW} gtf_puts_case("instudda");
[Ii]nstitute/{NW} gtf_puts_case("instatoot");
[Ii]ntersection/{NW} gtf_puts_case("innersekshun");
[Ii]s{WB}a/{NW} gtf_puts_case("izza");
[Ii]s{WB}it/{NW} gtf_puts_case("izit");
[Ii]s{WB}that/{NW} gtf_puts_case("izzat");
[Ii]s{WB}that{WB}right/{NW} gtf_puts_case("zatrot");
[Ii]s/{NW} gtf_puts_case("iz");
[Ii]sn't{WB}it/{NW} gtf_puts_case("hiduhnit");
[Ii]t{WB}appears/{NW} gtf_puts_case("pears");
[Ii]t{WB}would/{NW} gtf_puts_case("it'd");
[Jj]ail gtf_puts_case("jayul"); BEGIN(INW);
[Jj]anuary/{NW} gtf_puts_case("janyawary");
[Jj]eans/{NW} gtf_puts_case("janes");
[Jj]et/{NW} gtf_puts_case("jeyut");
[Jj]ewelry/{NW} gtf_puts_case("julry");
[Jj]uly/{NW} gtf_puts_case("djoolie");
[Jj]une/{NW} gtf_puts_case("djoon");
[Jj]ust gtf_puts_case("gist"); BEGIN(INW);
[Kk]ind{WB}of/{NW} gtf_puts_case("kinduh");
[Kk]ing gtf_puts_case("kang"); BEGIN(INW);
[Ll]ibrary/{NW} gtf_puts_case("liberry");
[Ll]ie gtf_puts_case("lah"); BEGIN(INW);
[Ll]iar/{NW} gtf_puts_case("lahr");
[Ll]ife gtf_puts_case("lahf"); BEGIN(INW);
[Ll]ight gtf_puts_case("laht"); BEGIN(INW);
[Ll]ighter/{NW} gtf_puts_case("lahter");
[Ll]ike gtf_puts_case("lahk"); BEGIN(INW);
[lL]ittle/{NW} gtf_puts_case("liddel");
[Ll]og gtf_puts_case("lawg"); BEGIN(INW);
[Ll]ot{WB}of/{NW} gtf_puts_case("lottuh");
[Ll]ots{WB}of/{NW} gtf_puts_case("lotsa");
[Ll]ove gtf_puts_case("luv"); BEGIN(INW);
[Mm]all/{NW} gtf_puts_case("mawl");
[Mm]aterial gtf_puts_case("mahtearyul"); BEGIN(INW);
[Mm]ay gtf_puts_case("maey"); BEGIN(INW);
[Mm]e/{NW} gtf_puts_case("may");
[Mm]ile/{NW} gtf_puts_case("mahl");
[Mm]inute/{NW} gtf_puts_case("minent");
[Mm]onday/{NW} gtf_puts_case("mundy");
[Mm]osquito/{NW} gtf_puts_case("skeeter");
[Mm]oss/{NW} gtf_puts_case("mawce");
[Mm]other/{NW} gtf_puts_case("ma");
[Mm]y/{NW} gtf_puts_case("mah");
[Mm]yself/{NW} gtf_puts_case("mahsef");
[Nn]ever/{NW} gtf_puts_case("nevur");
[Nn]ine/{NW} gtf_puts_case("nahn");
[Nn]ineteen/{NW} gtf_puts_case("nontane");
[Nn]inth/{NW} gtf_puts_case("nonth");
[Nn]inety/{NW} gtf_puts_case("nondy");
[Nn]o/{NW} gtf_puts_case("naw");
[Nn]othing/{NW} gtf_puts_case("nuthin'");
[Nn]ovember/{NW} gtf_puts_case("noveyumbur");
[Oo]cean/{NW} gtf_puts_case("oshun");
[Oo]ctober/{NW} gtf_puts_case("oktobur");
[Oo]f/{NW} gtf_puts_case("uh");
[Oo]ff/{NW} gtf_puts_case("awf");
[Oo]il/{NW} gtf_puts_case("ahl");
[Oo]ld/{NW} gtf_puts_case("ode");
[Oo]ne{WB}of/{NW} gtf_puts_case("wunna");
[Oo]ne/{NW} gtf_puts_case("wun");
[Oo]nly/{NW} gtf_puts_case("monly");
[Oo]pposite/{NW} gtf_puts_case("opsit");
[Oo]range/{NW} gtf_puts_case("arnjuh");
[Oo]ver{WB}there/{NW} gtf_puts_case("ovare");
[Oo]ver/{NW} gtf_puts_case("ovur");
[Pp]arking/{NW} gtf_puts_case("parkin");
[Pp]eople/{NW} gtf_puts_case("paypul");
[Pp]icture/{NW} gtf_puts_case("pitcher");
[Pp]illow/{NW} gtf_puts_case("piller");
[Pp]ine/{NW} gtf_puts_case("pahn");
[Pp]ink/{NW} gtf_puts_case("pank");
[Pp]lease gtf_puts_case("playze"); BEGIN(INW);
[Pp]retty/{NW} gtf_puts_case("purdy");
[Pp]robably/{NW} gtf_puts_case("probly");
[Pp]urple/{NW} gtf_puts_case("burpel");
[Qq]ueen/{NW} gtf_puts_case("kwane");
[Qq]uit gtf_puts_case("kewyut"); BEGIN(INW);
[Rr]ather/{NW} gtf_puts_case("ruthur");
[Rr]eady/{NW} gtf_puts_case("reddy");
[Rr]eal gtf_puts_case("reeyul"); BEGIN(INW);
[Rr]eally/{NW} gtf_puts_case("rilly");
[Rr]ed/{NW} gtf_puts_case("rayud");
[Rr]ight gtf_puts_case("raht"); BEGIN(INW);
[Rr]ing gtf_puts_case("rang"); BEGIN(INW);
[Ss]aid/{NW} gtf_puts_case("sayud");
[Ss](ale|ail|ell)/{NW} gtf_puts_case("sayul");
[Ss]aturday/{NW} gtf_puts_case("sadderdy");
[Ss]chool/{NW} gtf_puts_case("skoo");
[Ss]creen/{NW} gtf_puts_case("skrane");
[Ss]econd/{NW} gtf_puts_case("sekunt");
[Ss]ee gtf_puts_case("say"); BEGIN(INW);
[Ss]eptember/{NW} gtf_puts_case("ceptimbur");
[Ss]even/{NW} gtf_puts_case("saybumn");
[Ss]eventeen/{NW} gtf_puts_case("saybumtane");
[Ss]eventh/{NW} gtf_puts_case("saybumthd");
[Ss]eventy/{NW} gtf_puts_case("saybumdy");
[Ss]he/{NW} gtf_puts_case("shay");
[Ss]ign gtf_puts_case("sahn"); BEGIN(INW);
[Ss]ilver/{NW} gtf_puts_case("seeyulvur");
[Ss]it gtf_puts_case("set"); BEGIN(INW);
[Ss]ix/{NW} gtf_puts_case("sicks");
[Ss]ixteen/{NW} gtf_puts_case("sickstane");
[Ss]ixth/{NW} gtf_puts_case("sicksed");
[Ss]ixty/{NW} gtf_puts_case("sicksdy");
[Ss]mell gtf_puts_case("smayul"); BEGIN(INW);
[Ss]mile gtf_puts_case("smahl"); BEGIN(INW);
[Ss]ofter/{NW} gtf_puts_case("sowftur");
[Ss]ome{WB}of{WB}those/{NW} gtf_puts_case("sumoze");
[Ss]ome gtf_puts_case("sum"); BEGIN(INW);
[Ss]omething/{NW} gtf_puts_case("sumpn");
[Ss]ometime/{NW} gtf_puts_case("sumtom");
[Ss]outh gtf_puts_case("saowth"); BEGIN(INW);
[Ss]p(eak|oke)/{NW} gtf_puts_case("spake");
[Ss]pring gtf_puts_case("sprang"); BEGIN(INW);
[Ss]prinkle gtf_puts_case("sprankul"); BEGIN(INW);
[Ss]tadium/{NW} gtf_puts_case("stadyum");
[Ss]tation gtf_puts_case("stayshun"); BEGIN(INW);
[Ss]tring gtf_puts_case("strang"); BEGIN(INW);
[Ss]unday/{NW} gtf_puts_case("sundy");
[Ss]ure gtf_puts_case("shore"); BEGIN(INW);
[Tt]a(le|il) gtf_puts_case("tayul"); BEGIN(INW);
[Tt]alk gtf_puts_case("tawk"); BEGIN(INW);
[Tt]all gtf_puts_case("tahl"); BEGIN(INW);
[Tt]an gtf_puts_case("tayun"); BEGIN(INW);
[Tt]en gtf_puts_case("teyun"); BEGIN(INW);
[Tt]enth/{NW} gtf_puts_case("teyunth");
[Tt]errible/{NW} gtf_puts_case("tarbul");
[Tt]hat({WB}i|')s/{NW} gtf_puts_case("thets");
[Tt]hat gtf_puts_case("thet"); BEGIN(INW);
[Tt]he{WB}only/{NW} gtf_puts_case("thonly");
[Tt]he{WB}other/{NW} gtf_puts_case("thuther");
[Tt]he/{NW} gtf_puts_case("thuh");
[Tt]heir/{NW} gtf_puts_case("thur");
[Tt]here gtf_puts_case("thayure"); BEGIN(INW);
[Tt]hey gtf_puts_case("thay"); BEGIN(INW);
[Tt]hing gtf_puts_case("thang"); BEGIN(INW);
[Tt]hink gtf_puts_case("thank"); BEGIN(INW);
[Tt]hird/{NW} gtf_puts_case("thurd");
[Tt]hirteen/{NW} gtf_puts_case("thurtane");
[T]thirty/{NW} gtf_puts_case("thurdy");
[Tt]his/{NW} gtf_puts_case("thus");
[Tt]hose/{NW} gtf_puts_case("them");
[Tt]housand/{NW} gtf_puts_case("thousun");
[Tt]hree/{NW} gtf_puts_case("thray");
[Tt]hrough gtf_puts_case("thoo"); BEGIN(INW);
[Tt]hrow gtf_puts_case("thow"); BEGIN(INW);
[Tt]hr(own|ew)/{NW} gtf_puts_case("thowed");
[Tt]hursday/{NW} gtf_puts_case("thursdy");
[Tt]ie gtf_puts_case("tah"); BEGIN(INW);
[Tt]ight gtf_puts_case("taht"); BEGIN(INW);
[Tt]ime gtf_puts_case("tahm"); BEGIN(INW);
[Tt]o/{NW} gtf_puts_case("tuh");
[Tt]oday/{NW} gtf_puts_case("tuhday");
[Tt]oilet/{NW} gtf_puts_case("outhouse");
[Tt]old/{NW} gtf_puts_case("tode");
[Tt]omorrow/{NW} gtf_puts_case("tuhmorrow");
[Tt]ree/{NW} gtf_puts_case("tray");
[Tt]uesday/{NW} gtf_puts_case("chewsdy");
[Tt]welve/{NW} gtf_puts_case("twayulv");
[Tt]wenty/{NW} gtf_puts_case("twindy");
[Uu]nderstand/{NW} gtf_puts_case("understaynd");
[Uu]sed{WB}to/{NW} gtf_puts_case("ustuh");
[Vv]ehicle/{NW} gtf_puts_case("vee-hicul");
[Vv]ictory/{NW} gtf_puts_case("viktray");
[Vv]iolation/{NW} gtf_puts_case("vahlayshun");
[Vv]irtual/{NW} gtf_puts_case("vurchul");
[Ww]ant{WB}to/{NW} gtf_puts_case("wonna");
[Ww]as{WB}that/{NW} gtf_puts_case("wuzzat");
[Ww]as/{NW} gtf_puts_case("wuz");
[Ww]ash gtf_puts_case("wartch"); BEGIN(INW);
[Ww]ater gtf_puts_case("warder"); BEGIN(INW);
[Ww]e/{NW} gtf_puts_case("way");
[Ww]edding/{NW} gtf_puts_case("wedden");
[Ww]ednesday/{NW} gtf_puts_case("winsdy");
[Ww]ell gtf_puts_case("wayul"); BEGIN(INW);
[Ww]ere/{NW} gtf_puts_case("wuz");
[Ww]est/{NW} gtf_puts_case("wayust");
[Ww]hat{WB}did{WB}you/{NW} gtf_puts_case("whudja");
[Ww]hat{WB}will/{NW} gtf_puts_case("whuddle");
[Ww]hat{WB}do{WB}you/{NW} gtf_puts_case("wadja");
[Ww]hat({WB}i|')s{WB}the{WB}matter/{NW} {
gtf_puts_case("smatter"); }
[Ww]hat({WB}i|')s/{NW} gtf_puts_case("whuts");
[Ww]hat gtf_puts_case("whut"); BEGIN(INW);
[Ww]heel gtf_puts_case("whale"); BEGIN(INW);
[Ww]hen gtf_puts_case("wheyun"); BEGIN(INW);
[Ww]here{WB}did{WB}you/{NW} gtf_puts_case("whardja");
[Ww]here gtf_puts_case("whayer"); BEGIN(INW);
[Ww]hite gtf_puts_case("waht"); BEGIN(INW);
[Ww]hy{WB}don't{WB}you/{NW} gtf_puts_case("wah-oncha");
[Ww]hy/{NW} gtf_puts_case("wha");
[Ww]ife/{NW} gtf_puts_case("wahf");
[Ww]indow gtf_puts_case("wender"); BEGIN(INW);
[Ww]inter gtf_puts_case("winner"); BEGIN(INW);
[Ww]ire gtf_puts_case("wahr"); BEGIN(INW);
[Ww]ith{WB}you/{NW} gtf_puts_case("witchew");
[Ww]oman/{NW} gtf_puts_case("whoamun");
[Ww]omen/{NW} gtf_puts_case("wimmen");
[Ww]orld gtf_puts_case("warld"); BEGIN(INW);
[Ww]orse{WB}than/{NW} gtf_puts_case("worsun");
[Yy]ard gtf_puts_case("chard"); BEGIN(INW);
[Yy]ellow/{NW} gtf_puts_case("yeller");
[Yy]up/{NW} gtf_puts_case("yuh-betcha");
[Yy]es/{NW} gtf_puts_case("yayus");
[Yy]ou({WB}all)?/{NW} gtf_puts_case("yawl");
[Yy]ou({WB}a|')re gtf_puts_case("yore");
[Yy]our gtf_puts_case("chur");
{WC} { BEGIN(INW); gtf_echo(); }
}
<INW>{
inging/{NW} gtf_puts_case("ingin'"); BEGIN(NIW);
ing/{NW} gtf_puts_case("in'"); BEGIN(NIW);
ball gtf_puts_case("bawl");
bitty gtf_puts_case("biddy");
bulb gtf_puts_case("bub");
{NW} BEGIN(NIW); unput(yytext[0]);
}
{EOT} /* ignore trailing EOT character */
. gtf_echo();
%%
#ifdef LIBRARY_MODE
int gtf_filter_drawl(const char *input, char *buf, size_t bufsz)
{
gtf_databuf_t buffer;
YY_BUFFER_STATE _yybuf;
gtf_strbuf_init(&buffer, buf, bufsz);
_yybuf = yy_scan_string(input);
yylex(&buffer);
yy_delete_buffer(_yybuf);
gtf_reset();
return(buffer.overflow);
}
int __gtf_filter_drawl(const char *input, char *buf, size_t bufsz)
{
return(gtf_filter_drawl(input, buf, bufsz));
}
#else /* LIBRARY_MODE */
int main(int argc, char **argv)
{
gtf_parse_args();
gtf_random_seed();
yylex(NULL);
return(EXIT_SUCCESS);
}
#endif /* LIBRARY_MODE */
/* end of source file */

202
drawl.vcproj Executable file
View File

@ -0,0 +1,202 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="drawl"
ProjectGUID="{2B81129D-CB20-4276-9300-29347A1AA220}"
RootNamespace="drawl"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="3"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
>
<File
RelativePath=".\common.c"
>
</File>
<File
RelativePath=".\drawl.c"
>
</File>
<File
RelativePath=".\getopt.c"
>
</File>
<File
RelativePath=".\getopt1.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
>
<File
RelativePath=".\common.h"
>
</File>
<File
RelativePath=".\getopt.h"
>
</File>
<File
RelativePath=".\talkfilters.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

2534
dubya.c Executable file

File diff suppressed because it is too large Load Diff

225
dubya.l Executable file
View File

@ -0,0 +1,225 @@
/* GNU Talkfilters
Copyright (C) 1998-2003 Free Software Foundation, Inc.
This file is part of GNU Talkfilters
GNU Talkfilters is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2, or (at
your option) any later version.
This software is distributed in the hope that it will be amusing, 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 software; see the file COPYING. If not, write to the
Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
%option prefix="dubya_yy"
%option outfile="lex.yy.c"
%option noyywrap
%option nowarn
%e 3000
%p 6000
%n 1000
%k 500
%a 4000
%o 2000
%{
#include "common.h"
#include "talkfilters.h"
#define YY_DECL int yylex(gtf_databuf_t *buf)
%}
WB [\n\t ]
WC [A-Za-z']
NW [^A-Za-z']
EOT \4
%s NIW INW
%%
<NIW,INITIAL>{
\<(\/)?[A-Za-z][^\>]*\> gtf_echo(); // don't damage HTML tags
[Tt]errorist |
[Oo]sama |
[Bb]in(-|{WB})[Ll]ad(e|i)n { switch(gtf_random(3))
{
case 0: gtf_puts_case("bad guy"); break;
case 1: gtf_puts_case("evildoer"); break;
case 2: gtf_puts_case("terrier"); break;
}
}
[Uu]njustified/{NW} gtf_puts_case("pre-emptive");
[Cc]ontra/{NW} gtf_puts_case("freedom-fighter");
[Un]nder gtf_puts_case("misunder"); BEGIN(INW);
[Mm]isunderstand gtf_puts_case("misunderestimate"); BEGIN(INW);
[Mm]isunderstood gtf_puts_case("misunderestimated"); BEGIN(INW);
[Kk]ill/{NW} gtf_puts_case("oblitifry");
[Kk]illed/{NW} gtf_puts_case("oblitifried");
[Dd]destroy/{NW} gtf_puts_case("destructifry");
[Dd]destroyed/{NW} gtf_puts_case("destructifried");
[Rr]esonat/{NW} gtf_puts_case("resignat");
[Ee]ven(-|{WB})[Hh]anded/{NW} gtf_puts_case("foreign-handed");
[Ee]mbitter gtf_puts_case("embetter"); BEGIN(INW);
[Ff]allability/{NW} gtf_puts_case("fallacy");
[An]tidote/{NW} gtf_puts_case("anecdote");
[Ss]ubliminal/{NW} gtf_puts_case("subliminabable");
[Pp]eacemaker gtf_puts_case("pacemaker"); BEGIN(INW);
[Ii]nvad gtf_puts_case("liberat"); BEGIN(INW);
[Hh]ostage/{NW} gtf_puts_case("hostile");
[Cc]ommensurate/{NW} gtf_puts_case("commiserate");
[Ss]addam/{NW} gtf_puts_case("soddam");
[Nn]uclear gtf_puts_case("nucular"); BEGIN(INW);
[Dd]iplomacy/{NW} gtf_puts_case("a preemptive military strike"); BEGIN(INW);
[Oo]verthrow/{NW} gtf_puts_case("change");
[Gg]overnment(ification)/{NW} gtf_puts_case("regime");
[Oo]il/{NW} |
[Bb]ig{WB}[Bb]usiness/{NW} { switch(gtf_random(3))
{
case 0: gtf_puts_case("freedom"); break;
case 1: gtf_puts_case("democracy"); break;
case 2: gtf_puts_case("liberty"); break;
}
}
[Ii]raq gtf_puts_case("Eyeraq"); BEGIN(INW);
[Ii]ran/{NW} |
[Nn]orth{WB}Korea/{NW} |
[Ss]yria/{NW} |
[Cc]uba/{NW} |
[Ss]udan/{NW} |
[Ll]ibya/{NW} { switch(gtf_random(5))
{
case 0: gtf_puts_case("a rogue state");
break;
case 1: gtf_puts_case("a failed nation");
break;
case 2: gtf_puts_case("a nation in the axis of evil");
break;
case 3: gtf_puts_case("an enemy of freedom");
break;
case 4: gtf_puts_case("a state sponsor of terrorism");
break;
}
}
[Bb]udget/{NW} gtf_puts_case("lot of numbers");
[Dd]emocrats/{NW} |
[Dd]emocratic{WB}[Pp]arty/{NW} gtf_puts_case("the Party o' Cut n' Run");
[Aa]re/{NW} gtf_puts_case("is");
[Rr]esort gtf_puts_case("retort"); BEGIN(INW);
[Rr]eveng gtf_puts_case("justic"); BEGIN(INW);
[Tt]hey{WB}were/{NW} gtf_puts_case("them were");
[Pp]olicy/{NW} gtf_puts_case("policy stuff");
[Aa]re{WB}our/{NW} gtf_puts_case("is our");
[Tt]he{WB}[Ii]nternet/{NW} gtf_puts_case("dark dungeons of the Innurnet");
[Oo]mnipresent/{NW} gtf_puts_case("hemispheric");
[Ss]atirist/{NW} gtf_puts_case("garbage man");
[Ee]ditor/{NW} gtf_puts_case("fucking son of a bitch");
"Dick Cheney" gtf_puts("Big Dick");
"George Bush Sr." |
"George H W Bush" gtf_puts("Daddy"); BEGIN(INW);
[Uu]pset |
[Aa]ggravate |
[Ii]nflame gtf_puts_case("vulcanize"); BEGIN(INW);
[Dd]issent/{NW} gtf_puts_case("Anti-Americanism");
[Dd]issenting/{NW} gtf_puts_case("Unpatriotic");
[Ff]iscal{WB}policy |
[Ee]conomic{WB}(stimulus|reform) gtf_puts_case("Tax cuts"); BEGIN(INW);
[Ee]conomics/{NW} gtf_puts_case("Reaganomics");
[Aa]nd{WB}the/{NW} gtf_puts_case("And -- but first things first. The -- These");
[Ll]eave\. gtf_puts_case("cut n' run.");
{WC} { BEGIN(INW); gtf_echo(); }
}
<INW>{
ic/{NW} gtf_puts_case("ically"); BEGIN(NIW);
al/{NW} gtf_puts_case("abable"); BEGIN(NIW);
ate/{NW} gtf_puts_case("atify"); BEGIN(NIW);
ation/{NW} gtf_puts_case("atification"); BEGIN(NIW);
ct/{NW} gtf_puts_case("ctify"); BEGIN(NIW);
ction/{NW} gtf_puts_case("ctification"); BEGIN(NIW);
ain/{NW} gtf_puts_case("ainify"); BEGIN(NIW);
ent/{NW} gtf_puts_case("entification");
ten/{NW} gtf_puts_case("tenify"); BEGIN(NIW);
ize/{NW} gtf_puts_case("izification"); BEGIN(NIW);
lysis/{NW} gtf_puts_case("lyzation"); BEGIN(NIW);
ing/{NW} gtf_puts_case("in'"); BEGIN(NIW);
"." { switch(gtf_random(10))
{
case 0: gtf_puts_case(". Yee haw!"); break;
case 1: gtf_puts_case(", by golly."); break;
case 2:
case 3: gtf_puts_case(". Stay the course!"); break;
case 4: gtf_puts_case(". I'm the decider!"); break;
default: gtf_echo();
}
BEGIN(NIW);
}
", " { switch(gtf_random(5))
{
case 0: gtf_puts(" -- I think -- "); break;
case 1: gtf_puts(" -- I mean -- "); break;
case 2: gtf_puts(", and uhh... umm..., "); break;
default: gtf_echo();
}
}
{NW} BEGIN(NIW); gtf_unput_last();
}
{EOT} /* ignore trailing EOT character */
. gtf_echo();
%%
#ifdef LIBRARY_MODE
int gtf_filter_dubya(const char *input, char *buf, size_t bufsz)
{
gtf_databuf_t buffer;
YY_BUFFER_STATE _yybuf;
gtf_strbuf_init(&buffer, buf, bufsz);
_yybuf = yy_scan_string(input);
yylex(&buffer);
yy_delete_buffer(_yybuf);
gtf_reset();
return(buffer.overflow);
}
int __gtf_filter_dubya(const char *input, char *buf, size_t bufsz)
{
return(gtf_filter_dubya(input, buf, bufsz));
}
#else /* LIBRARY_MODE */
int main(int argc, char **argv)
{
gtf_parse_args();
gtf_random_seed();
yylex(NULL);
return(EXIT_SUCCESS);
}
#endif /* LIBRARY_MODE */
/* end of source file */

202
dubya.vcproj Executable file
View File

@ -0,0 +1,202 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="dubya"
ProjectGUID="{7CBCB0BE-8144-47CA-B697-3AA92A8BDE1E}"
RootNamespace="dubya"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="3"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
>
<File
RelativePath=".\common.c"
>
</File>
<File
RelativePath=".\dubya.c"
>
</File>
<File
RelativePath=".\getopt.c"
>
</File>
<File
RelativePath=".\getopt1.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
>
<File
RelativePath=".\common.h"
>
</File>
<File
RelativePath=".\getopt.h"
>
</File>
<File
RelativePath=".\talkfilters.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

1678
fudd.c Executable file

File diff suppressed because it is too large Load Diff

103
fudd.l Executable file
View File

@ -0,0 +1,103 @@
/* GNU Talkfilters
Copyright (C) 1998-2003 Free Software Foundation, Inc.
This file is part of GNU Talkfilters
GNU Talkfilters is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2, or (at
your option) any later version.
This software is distributed in the hope that it will be amusing, 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 software; see the file COPYING. If not, write to the
Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
%option prefix="fudd_yy"
%option outfile="lex.yy.c"
%option noyywrap
%e 2000
%p 5000
%n 1000
%k 500
%a 4000
%o 2000
BW [ ]
EW [ .,;!?]
EOT \4
%{
#include "common.h"
#include "talkfilters.h"
#define YY_DECL int yylex(gtf_databuf_t *buf)
%}
%%
\<(\/)?[A-Za-z][^\>]*\> gtf_echo(); // don't damage HTML tags
"r" gtf_printf("w");
"l" gtf_printf("w");
"qu" gtf_printf("qw");
"th " gtf_printf("f ");
"th" gtf_printf("d");
"n." gtf_printf("n, uh-hah-hah-hah. ");
"R" gtf_printf("W");
"L" gtf_printf("W");
"Qu" gtf_printf("Qw");
"QU" gtf_printf("QW");
"TH " gtf_printf("F ");
"TH" gtf_printf("D");
"Th" gtf_printf("D");
"N." gtf_printf("N, uh-hah-hah-hah. ");
{EOT} /* ignore trailing EOT character */
. gtf_echo();
%%
#ifdef LIBRARY_MODE
int gtf_filter_fudd(const char *input, char *buf, size_t bufsz)
{
gtf_databuf_t buffer;
YY_BUFFER_STATE _yybuf;
gtf_strbuf_init(&buffer, buf, bufsz);
_yybuf = yy_scan_string(input);
yylex(&buffer);
yy_delete_buffer(_yybuf);
gtf_reset();
return(buffer.overflow);
}
int __gtf_filter_fudd(const char *input, char *buf, size_t bufsz)
{
return(gtf_filter_fudd(input, buf, bufsz));
}
#else /* LIBRARY_MODE */
int main(int argc, char **argv)
{
gtf_parse_args();
yylex(NULL);
return(EXIT_SUCCESS);
}
#endif /* LIBRARY_MODE */
/* end of source file */

202
fudd.vcproj Executable file
View File

@ -0,0 +1,202 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="fudd"
ProjectGUID="{FC23ECAB-295A-4BFD-B67A-97D25BA1BC47}"
RootNamespace="fudd"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="3"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
>
<File
RelativePath=".\common.c"
>
</File>
<File
RelativePath=".\fudd.c"
>
</File>
<File
RelativePath=".\getopt.c"
>
</File>
<File
RelativePath=".\getopt1.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
>
<File
RelativePath=".\common.h"
>
</File>
<File
RelativePath=".\getopt.h"
>
</File>
<File
RelativePath=".\talkfilters.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

2946
funetak.c Executable file

File diff suppressed because it is too large Load Diff

280
funetak.l Executable file
View File

@ -0,0 +1,280 @@
/* GNU Talkfilters
Copyright (C) 1998-2003 Free Software Foundation, Inc.
This file is part of GNU Talkfilters
GNU Talkfilters is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2, or (at
your option) any later version.
This software is distributed in the hope that it will be amusing, 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 software; see the file COPYING. If not, write to the
Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* static char version[] = "funetak. v1.2. Eclipse Enterprises"; */
%option prefix="funetak_yy"
%option outfile="lex.yy.c"
%option noyywrap
%e 2000
%p 6000
%n 1000
%k 500
%a 4000
%o 2000
%{
#include "common.h"
#include "talkfilters.h"
#define YY_DECL int yylex(gtf_databuf_t *buf)
%}
WB [\n\t ]
WC [A-Za-z'0-9]
NW [^A-Za-z'0-9]
EOT \4
%s NIW INW
%%
<NIW,INITIAL>{
\<(\/)?[A-Za-z][^\>]*\> gtf_echo(); // don't damage HTML tags
[Aa]nybody/{NW} gtf_puts_case("uni boodi");
[Aa]re/{NW} gtf_puts_case("ure");
[Aa]sshole/{NW} gtf_puts_case("uss hool");
[Aa]t/{NW} gtf_puts_case("et");
[Bb]y/{NW} gtf_puts_case("bi");
[Cc]ould/{NW} gtf_puts_case("cud");
[Ee]mpty/{NW} gtf_puts_case("umpti");
[Ee]yes/{NW} gtf_puts_case("i's");
[Ff]actory/{NW} gtf_puts_case("fuctawri");
[Ff]ile gtf_puts_case("fuel"); BEGIN(INW);
[Ff]rom/{NW} gtf_puts_case("frum");
[Ff]uck gtf_puts_case("fak"); BEGIN(INW);
[Gg]oing/{NW} gtf_puts_case("go en");
[Gg]uess/{NW} gtf_puts_case("gus");
[Hh]eap/{NW} gtf_puts_case("hup");
[Hh]ere/{NW} gtf_puts_case("hear");
[Hh]ope/{NW} gtf_puts_case("hup");
[Ii]'m/{NW} gtf_puts_case("eye em");
[Ii]f/{NW} gtf_puts_case("uf");
[Jj]unk/{NW} gtf_puts_case("joonk");
[Jj]ust/{NW} gtf_puts_case("juzst");
[Nn]ut/{NW} gtf_puts_case("noot");
[Oo]ut gtf_puts_case("ut"); BEGIN(INW);
[Pp]ocket/{NW} gtf_puts_case("puket");
[Rr]ide/{NW} gtf_puts_case("wide");
[Rr]un gtf_puts_case("wun"); BEGIN(INW);
[Ss]aw/{NW} gtf_puts_case("sor");
[Ss]ay gtf_puts_case("sa"); BEGIN(INW);
[Ss]elling/{NW} gtf_puts_case("sulen");
[Ss]hit/{NW} gtf_puts_case("shiet");
[Ss]hould { if(gtf_random(4))
gtf_puts_case("sud");
else
gtf_puts_case("shud");
BEGIN(INW);
}
[Ss]traight gtf_puts_case("stwait"); BEGIN(INW);
[Ss]unset/{NW} gtf_puts_case("soon sut");
[Tt]hough/{NW} gtf_puts_case("tho");
[Tt]rans gtf_puts_case("twains"); BEGIN(INW);
[Tt]wo/{NW} gtf_puts_case("to");
[Uu]p gtf_puts_case("oop"); BEGIN(INW);
[Wh]ich gtf_puts_case("wutch"); BEGIN(INW);
[Ww]ould gtf_puts_case("wud"); BEGIN(INW);
[Yy]our gtf_puts_case("ur"); BEGIN(INW);
[Ii]/{NW} gtf_puts_case("em");
[Aa]/{NW} gtf_puts_case("ar");
[Aa]bout/{NW} gtf_puts_case("abut");
[Aa]ll/{NW} gtf_puts_case("awl");
[Aa]l(l)?right/{NW} gtf_puts_case("awl wight");
[Aa]m/{NW} gtf_puts_case("um");
[Aa]nd/{NW} gtf_puts_case("en");
[Aa]ren't/{NW} gtf_puts_case("r ent");
[Aa]void/{NW} gtf_puts_case("av void");
[Bb]e/{NW} gtf_puts_case("b");
[Bb]oy gtf_puts_case("boi"); BEGIN(INW);
[Bb]rackets/{NW} gtf_puts_case("bruketz");
[Bb]ut gtf_puts_case("bot"); BEGIN(INW);
[Cc]an/{NW} gtf_puts_case("kun");
[Cc]an't{NW} { if(gtf_random(4))
gtf_puts_case("car ent");
else
gtf_puts_case("kunt");
}
[Cc]onver gtf_puts_case("cunvur"); BEGIN(INW);
[Cc]ool/{NW} gtf_puts_case("kewl");
[Cc]os gtf_puts_case("cuz"); BEGIN(INW);
[Dd]ay gtf_puts_case("di"); BEGIN(INW);
[Dd]id gtf_puts_case("ded"); BEGIN(INW);
[Dd]o gtf_puts_case("dew"); BEGIN(INW);
[Dd]oes { if (gtf_random(3)) gtf_puts_case("dus");
else gtf_puts_case("duz");
BEGIN(INW); }
[Dd]ude/{NW} gtf_puts_case("do ed");
[Ee]nglish/{NW} gtf_puts_case("unglush");
[Ff]ilter/{NW} gtf_puts_case("felt her");
[Ff]irst/{NW} gtf_puts_case("fuzt");
[Ff]ixed/{NW} gtf_puts_case("fuckzed");
[Ff]ools/{NW} gtf_puts_case("fulz");
[Ff]or |
[Ff]our gtf_puts_case("vor"); BEGIN(INW);
[Gg]etting/{NW} gtf_puts_case("gut en");
[Gg]et gtf_puts_case("gut"); BEGIN(INW);
[Gg]onna/{NW} { if(gtf_random(2))
gtf_puts_case("gun nar");
else
gtf_puts_case("gunna");
}
[Gg]ood gtf_puts_case("gud"); BEGIN(INW);
[Hh]as gtf_puts_case("huz"); BEGIN(INW);
[Hh]mm/{NW} gtf_puts_case("humm");
[Hh]ow gtf_puts_case("huw"); BEGIN(INW);
[Hh]undred/{NW} gtf_puts_case("hundrud");
[Ii]n gtf_puts_case("un"); BEGIN(INW);
[Ii]s { if(gtf_random(5))
gtf_puts_case("ez");
else
gtf_puts_case("uz");
BEGIN(INW);
}
[Ii]t/{NW} { if(gtf_random(5))
gtf_puts_case("et");
else
gtf_puts_case("ut");
}
[Ii]ts/{NW} gtf_puts_case("etz");
[Ll]ame/{NW} { if(gtf_random(7))
gtf_puts_case("lye em");
else
gtf_puts_case("lyem");
}
[Ll]ibrary/{NW} gtf_puts_case("wibwari");
[Ll]ots/{NW} gtf_puts_case("wuntz");
[Mm]ake gtf_puts_case("muk"); BEGIN(INW);
[Mm]e/{NW} gtf_puts_case("mi");
[Mm]ore/{NW} gtf_puts_case("mur");
[Mm]uch/{NW} gtf_puts_case("mutch");
[Mm]y/{NW} gtf_puts_case("mi");
[Nn]eed gtf_puts_case("nud"); BEGIN(INW);
[Nn]one gtf_puts_case("noon"); BEGIN(INW);
[Nn]ot gtf_puts_case("nut"); BEGIN(INW);
[Nn]umerics gtf_puts_case("numerekz");
[Oo]f gtf_puts_case("uf"); BEGIN(INW);
[Oo]ne/{NW} gtf_puts_case("wun");
[Oo]nly/{NW} gtf_puts_case("own we");
[Oo]ther gtf_puts_case("udder"); BEGIN(INW);
[Pp]eople/{NW} gtf_puts_case("poopel");
[Pp]eoples/{NW} gtf_puts_case("poopelz");
[Pp]roblem gtf_puts_case("prublim"); BEGIN(INW);
[Rr]ead gtf_puts_case("wed"); BEGIN(INW);
[Rr]ule/{NW} gtf_puts_case("wul");
[Ss]o/{NW} gtf_puts_case("zo");
[Ss]ort/{NW} gtf_puts_case("surt");
[Ss]orting/{NW} gtf_puts_case("surten");
[Tt]alk gtf_puts_case("tak"); BEGIN(INW);
[Tt]hat/{NW} { if(gtf_random(4))
gtf_puts_case("dat");
else
gtf_puts_case("dut");
}
[Tt]he/{NW} gtf_puts_case("da");
[Tt]here gtf_puts_case("der"); BEGIN(INW);
[Tt]hink gtf_puts_case("tunk"); BEGIN(INW);
[Tt]his/{NW} { if(gtf_random(2) == 0)
gtf_puts_case("des");
else if(gtf_random(3) == 0)
gtf_puts_case("dis");
else if(gtf_random(3) == 0)
gtf_puts_case("dus");
else gtf_puts_case("duz");
}
[Tt]ime gtf_puts_case("tym"); BEGIN(INW);
[Tt]o gtf_puts_case("two"); BEGIN(INW);
[Tt]oday/{NW} gtf_puts_case("tow di");
[Tt]otally/{NW} gtf_puts_case("toate awli");
[Tt]raffic/{NW} gtf_puts_case("twufak");
[Tt]ranslator/{NW} gtf_puts_case("twunz waiter");
[Tt]wenty/{NW} gtf_puts_case("twunti");
[Tt]imes/{NW} gtf_puts_case("tymz");
[Ww]asn't/{NW} gtf_puts_case("wuz ent");
[Ww]hat gtf_puts_case("wut"); BEGIN(INW);
[Ww]ill gtf_puts_case("wul"); BEGIN(INW);
[Ww]ith gtf_puts_case("wif"); BEGIN(INW);
[Ww]ord/{NW} gtf_puts_case("wud");
[Ww]ords/{NW} gtf_puts_case("wudz");
[Ww]rite/{NW} gtf_puts_case("wyt");
[Yy]ou/{NW} gtf_puts_case("ewe");
[Zz]appy/{NW} gtf_puts_case("zipi");
{WC} { BEGIN(INW); gtf_echo(); }
}
<INW>{
i/{NW} gtf_puts_case("eye"); BEGIN(NIW);
[Pp]hone/{NW} gtf_puts_case("fune"); BEGIN(NIW);
}
{EOT} /* ignore trailing EOT character */
. gtf_echo();
\n gtf_echo();
%%
/*
*/
#ifdef LIBRARY_MODE
int gtf_filter_funetak(const char *input, char *buf, size_t bufsz)
{
gtf_databuf_t buffer;
YY_BUFFER_STATE _yybuf;
gtf_strbuf_init(&buffer, buf, bufsz);
_yybuf = yy_scan_string(input);
yylex(&buffer);
yy_delete_buffer(_yybuf);
gtf_reset();
return(buffer.overflow);
}
int __gtf_filter_funetak(const char *input, char *buf, size_t bufsz)
{
return(gtf_filter_funetak(input, buf, bufsz));
}
#else /* LIBRARY_MODE */
int main(int argc, char **argv)
{
gtf_parse_args();
gtf_random_seed();
yylex(NULL);
return(EXIT_SUCCESS);
}
#endif /* LIBRARY_MODE */
/* end of source file */

202
funetak.vcproj Executable file
View File

@ -0,0 +1,202 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="funetak"
ProjectGUID="{C5A1161E-4A3F-4433-B595-A192BD851AB4}"
RootNamespace="funetak"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="3"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
>
<File
RelativePath=".\common.c"
>
</File>
<File
RelativePath=".\funetak.c"
>
</File>
<File
RelativePath=".\getopt.c"
>
</File>
<File
RelativePath=".\getopt1.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
>
<File
RelativePath=".\common.h"
>
</File>
<File
RelativePath=".\getopt.h"
>
</File>
<File
RelativePath=".\talkfilters.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

748
getopt.c Executable file
View File

@ -0,0 +1,748 @@
/* Getopt for GNU.
NOTE: getopt is now part of the C library, so if you don't know what
"Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu
before changing it!
Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
Ditto for AIX 3.2 and <stdlib.h>. */
#ifndef _NO_PROTO
#define _NO_PROTO
#endif
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#if !defined (__STDC__) || !__STDC__
/* This is a separate conditional since some stdc systems
reject `defined (const)'. */
#ifndef const
#define const
#endif
#endif
#include <stdio.h>
/* Comment out all this code if we are using the GNU C Library, and are not
actually compiling the library itself. This code is part of the GNU C
Library, but also included in many other GNU distributions. Compiling
and linking in this code is a waste when using the GNU C library
(especially if it is a shared library). Rather than having every GNU
program understand `configure --with-gnu-libc' and omit the object files,
it is simpler to just do this in the source for each such file. */
#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
/* This needs to come after some library #include
to get __GNU_LIBRARY__ defined. */
#ifdef __GNU_LIBRARY__
/* Don't include stdlib.h for non-GNU C libraries because some of them
contain conflicting prototypes for getopt. */
#include <stdlib.h>
#endif /* GNU C library. */
/* This version of `getopt' appears to the caller like standard Unix `getopt'
but it behaves differently for the user, since it allows the user
to intersperse the options with the other arguments.
As `getopt' works, it permutes the elements of ARGV so that,
when it is done, all the options precede everything else. Thus
all application programs are extended to handle flexible argument order.
Setting the environment variable POSIXLY_CORRECT disables permutation.
Then the behavior is completely standard.
GNU application programs can use a third alternative mode in which
they can distinguish the relative order of options and other arguments. */
#include "getopt.h"
/* For communication from `getopt' to the caller.
When `getopt' finds an option that takes an argument,
the argument value is returned here.
Also, when `ordering' is RETURN_IN_ORDER,
each non-option ARGV-element is returned here. */
char *optarg = NULL;
/* Index in ARGV of the next element to be scanned.
This is used for communication to and from the caller
and for communication between successive calls to `getopt'.
On entry to `getopt', zero means this is the first call; initialize.
When `getopt' returns EOF, this is the index of the first of the
non-option elements that the caller should itself scan.
Otherwise, `optind' communicates from one call to the next
how much of ARGV has been scanned so far. */
/* XXX 1003.2 says this must be 1 before any call. */
int optind = 0;
/* The next char to be scanned in the option-element
in which the last option character we returned was found.
This allows us to pick up the scan where we left off.
If this is zero, or a null string, it means resume the scan
by advancing to the next ARGV-element. */
static char *nextchar;
/* Callers store zero here to inhibit the error message
for unrecognized options. */
int opterr = 1;
/* Set to an option character which was unrecognized.
This must be initialized on some systems to avoid linking in the
system's own getopt implementation. */
int optopt = '?';
/* Describe how to deal with options that follow non-option ARGV-elements.
If the caller did not specify anything,
the default is REQUIRE_ORDER if the environment variable
POSIXLY_CORRECT is defined, PERMUTE otherwise.
REQUIRE_ORDER means don't recognize them as options;
stop option processing when the first non-option is seen.
This is what Unix does.
This mode of operation is selected by either setting the environment
variable POSIXLY_CORRECT, or using `+' as the first character
of the list of option characters.
PERMUTE is the default. We permute the contents of ARGV as we scan,
so that eventually all the non-options are at the end. This allows options
to be given in any order, even with programs that were not written to
expect this.
RETURN_IN_ORDER is an option available to programs that were written
to expect options and other ARGV-elements in any order and that care about
the ordering of the two. We describe each non-option ARGV-element
as if it were the argument of an option with character code 1.
Using `-' as the first character of the list of option characters
selects this mode of operation.
The special argument `--' forces an end of option-scanning regardless
of the value of `ordering'. In the case of RETURN_IN_ORDER, only
`--' can cause `getopt' to return EOF with `optind' != ARGC. */
static enum
{
REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
} ordering;
/* Value of POSIXLY_CORRECT environment variable. */
static char *posixly_correct;
#ifdef __GNU_LIBRARY__
/* We want to avoid inclusion of string.h with non-GNU libraries
because there are many ways it can cause trouble.
On some systems, it contains special magic macros that don't work
in GCC. */
#include <string.h>
#define my_index strchr
#else
/* Avoid depending on library functions or files
whose names are inconsistent. */
char *getenv ();
static char *
my_index (str, chr)
const char *str;
int chr;
{
while (*str)
{
if (*str == chr)
return (char *) str;
str++;
}
return 0;
}
/* If using GCC, we can safely declare strlen this way.
If not using GCC, it is ok not to declare it. */
#ifdef __GNUC__
/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h.
That was relevant to code that was here before. */
#if !defined (__STDC__) || !__STDC__
/* gcc with -traditional declares the built-in strlen to return int,
and has done so at least since version 2.4.5. -- rms. */
extern int strlen (const char *);
#endif /* not __STDC__ */
#endif /* __GNUC__ */
#endif /* not __GNU_LIBRARY__ */
/* Handle permutation of arguments. */
/* Describe the part of ARGV that contains non-options that have
been skipped. `first_nonopt' is the index in ARGV of the first of them;
`last_nonopt' is the index after the last of them. */
static int first_nonopt;
static int last_nonopt;
/* Exchange two adjacent subsequences of ARGV.
One subsequence is elements [first_nonopt,last_nonopt)
which contains all the non-options that have been skipped so far.
The other is elements [last_nonopt,optind), which contains all
the options processed since those non-options were skipped.
`first_nonopt' and `last_nonopt' are relocated so that they describe
the new indices of the non-options in ARGV after they are moved. */
static void
exchange (argv)
char **argv;
{
int bottom = first_nonopt;
int middle = last_nonopt;
int top = optind;
char *tem;
/* Exchange the shorter segment with the far end of the longer segment.
That puts the shorter segment into the right place.
It leaves the longer segment in the right place overall,
but it consists of two parts that need to be swapped next. */
while (top > middle && middle > bottom)
{
if (top - middle > middle - bottom)
{
/* Bottom segment is the short one. */
int len = middle - bottom;
register int i;
/* Swap it with the top part of the top segment. */
for (i = 0; i < len; i++)
{
tem = argv[bottom + i];
argv[bottom + i] = argv[top - (middle - bottom) + i];
argv[top - (middle - bottom) + i] = tem;
}
/* Exclude the moved bottom segment from further swapping. */
top -= len;
}
else
{
/* Top segment is the short one. */
int len = top - middle;
register int i;
/* Swap it with the bottom part of the bottom segment. */
for (i = 0; i < len; i++)
{
tem = argv[bottom + i];
argv[bottom + i] = argv[middle + i];
argv[middle + i] = tem;
}
/* Exclude the moved top segment from further swapping. */
bottom += len;
}
}
/* Update records for the slots the non-options now occupy. */
first_nonopt += (optind - last_nonopt);
last_nonopt = optind;
}
/* Initialize the internal data when the first call is made. */
static const char *
_getopt_initialize (optstring)
const char *optstring;
{
/* Start processing options with ARGV-element 1 (since ARGV-element 0
is the program name); the sequence of previously skipped
non-option ARGV-elements is empty. */
first_nonopt = last_nonopt = optind = 1;
nextchar = NULL;
posixly_correct = getenv ("POSIXLY_CORRECT");
/* Determine how to handle the ordering of options and nonoptions. */
if (optstring[0] == '-')
{
ordering = RETURN_IN_ORDER;
++optstring;
}
else if (optstring[0] == '+')
{
ordering = REQUIRE_ORDER;
++optstring;
}
else if (posixly_correct != NULL)
ordering = REQUIRE_ORDER;
else
ordering = PERMUTE;
return optstring;
}
/* Scan elements of ARGV (whose length is ARGC) for option characters
given in OPTSTRING.
If an element of ARGV starts with '-', and is not exactly "-" or "--",
then it is an option element. The characters of this element
(aside from the initial '-') are option characters. If `getopt'
is called repeatedly, it returns successively each of the option characters
from each of the option elements.
If `getopt' finds another option character, it returns that character,
updating `optind' and `nextchar' so that the next call to `getopt' can
resume the scan with the following option character or ARGV-element.
If there are no more option characters, `getopt' returns `EOF'.
Then `optind' is the index in ARGV of the first ARGV-element
that is not an option. (The ARGV-elements have been permuted
so that those that are not options now come last.)
OPTSTRING is a string containing the legitimate option characters.
If an option character is seen that is not listed in OPTSTRING,
return '?' after printing an error message. If you set `opterr' to
zero, the error message is suppressed but we still return '?'.
If a char in OPTSTRING is followed by a colon, that means it wants an arg,
so the following text in the same ARGV-element, or the text of the following
ARGV-element, is returned in `optarg'. Two colons mean an option that
wants an optional arg; if there is text in the current ARGV-element,
it is returned in `optarg', otherwise `optarg' is set to zero.
If OPTSTRING starts with `-' or `+', it requests different methods of
handling the non-option ARGV-elements.
See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
Long-named options begin with `--' instead of `-'.
Their names may be abbreviated as long as the abbreviation is unique
or is an exact match for some defined option. If they have an
argument, it follows the option name in the same ARGV-element, separated
from the option name by a `=', or else the in next ARGV-element.
When `getopt' finds a long-named option, it returns 0 if that option's
`flag' field is nonzero, the value of the option's `val' field
if the `flag' field is zero.
The elements of ARGV aren't really const, because we permute them.
But we pretend they're const in the prototype to be compatible
with other systems.
LONGOPTS is a vector of `struct option' terminated by an
element containing a name which is zero.
LONGIND returns the index in LONGOPT of the long-named option found.
It is only valid when a long-named option has been found by the most
recent call.
If LONG_ONLY is nonzero, '-' as well as '--' can introduce
long-named options. */
int
_getopt_internal (argc, argv, optstring, longopts, longind, long_only)
int argc;
char *const *argv;
const char *optstring;
const struct option *longopts;
int *longind;
int long_only;
{
optarg = NULL;
if (optind == 0)
optstring = _getopt_initialize (optstring);
if (nextchar == NULL || *nextchar == '\0')
{
/* Advance to the next ARGV-element. */
if (ordering == PERMUTE)
{
/* If we have just processed some options following some non-options,
exchange them so that the options come first. */
if (first_nonopt != last_nonopt && last_nonopt != optind)
exchange ((char **) argv);
else if (last_nonopt != optind)
first_nonopt = optind;
/* Skip any additional non-options
and extend the range of non-options previously skipped. */
while (optind < argc
&& (argv[optind][0] != '-' || argv[optind][1] == '\0'))
optind++;
last_nonopt = optind;
}
/* The special ARGV-element `--' means premature end of options.
Skip it like a null option,
then exchange with previous non-options as if it were an option,
then skip everything else like a non-option. */
if (optind != argc && !strcmp (argv[optind], "--"))
{
optind++;
if (first_nonopt != last_nonopt && last_nonopt != optind)
exchange ((char **) argv);
else if (first_nonopt == last_nonopt)
first_nonopt = optind;
last_nonopt = argc;
optind = argc;
}
/* If we have done all the ARGV-elements, stop the scan
and back over any non-options that we skipped and permuted. */
if (optind == argc)
{
/* Set the next-arg-index to point at the non-options
that we previously skipped, so the caller will digest them. */
if (first_nonopt != last_nonopt)
optind = first_nonopt;
return EOF;
}
/* If we have come to a non-option and did not permute it,
either stop the scan or describe it to the caller and pass it by. */
if ((argv[optind][0] != '-' || argv[optind][1] == '\0'))
{
if (ordering == REQUIRE_ORDER)
return EOF;
optarg = argv[optind++];
return 1;
}
/* We have found another option-ARGV-element.
Skip the initial punctuation. */
nextchar = (argv[optind] + 1
+ (longopts != NULL && argv[optind][1] == '-'));
}
/* Decode the current option-ARGV-element. */
/* Check whether the ARGV-element is a long option.
If long_only and the ARGV-element has the form "-f", where f is
a valid short option, don't consider it an abbreviated form of
a long option that starts with f. Otherwise there would be no
way to give the -f short option.
On the other hand, if there's a long option "fubar" and
the ARGV-element is "-fu", do consider that an abbreviation of
the long option, just like "--fu", and not "-f" with arg "u".
This distinction seems to be the most useful approach. */
if (longopts != NULL
&& (argv[optind][1] == '-'
|| (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1])))))
{
char *nameend;
const struct option *p;
const struct option *pfound = NULL;
int exact = 0;
int ambig = 0;
int indfound;
int option_index;
for (nameend = nextchar; *nameend && *nameend != '='; nameend++)
/* Do nothing. */ ;
/* Test all long options for either exact match
or abbreviated matches. */
for (p = longopts, option_index = 0; p->name; p++, option_index++)
if (!strncmp (p->name, nextchar, nameend - nextchar))
{
if (nameend - nextchar == strlen (p->name))
{
/* Exact match found. */
pfound = p;
indfound = option_index;
exact = 1;
break;
}
else if (pfound == NULL)
{
/* First nonexact match found. */
pfound = p;
indfound = option_index;
}
else
/* Second or later nonexact match found. */
ambig = 1;
}
if (ambig && !exact)
{
if (opterr)
fprintf (stderr, "%s: option `%s' is ambiguous\n",
argv[0], argv[optind]);
nextchar += strlen (nextchar);
optind++;
return '?';
}
if (pfound != NULL)
{
option_index = indfound;
optind++;
if (*nameend)
{
/* Don't test has_arg with >, because some C compilers don't
allow it to be used on enums. */
if (pfound->has_arg)
optarg = nameend + 1;
else
{
if (opterr)
{
if (argv[optind - 1][1] == '-')
/* --option */
fprintf (stderr,
"%s: option `--%s' doesn't allow an argument\n",
argv[0], pfound->name);
else
/* +option or -option */
fprintf (stderr,
"%s: option `%c%s' doesn't allow an argument\n",
argv[0], argv[optind - 1][0], pfound->name);
}
nextchar += strlen (nextchar);
return '?';
}
}
else if (pfound->has_arg == 1)
{
if (optind < argc)
optarg = argv[optind++];
else
{
if (opterr)
fprintf (stderr, "%s: option `%s' requires an argument\n",
argv[0], argv[optind - 1]);
nextchar += strlen (nextchar);
return optstring[0] == ':' ? ':' : '?';
}
}
nextchar += strlen (nextchar);
if (longind != NULL)
*longind = option_index;
if (pfound->flag)
{
*(pfound->flag) = pfound->val;
return 0;
}
return pfound->val;
}
/* Can't find it as a long option. If this is not getopt_long_only,
or the option starts with '--' or is not a valid short
option, then it's an error.
Otherwise interpret it as a short option. */
if (!long_only || argv[optind][1] == '-'
|| my_index (optstring, *nextchar) == NULL)
{
if (opterr)
{
if (argv[optind][1] == '-')
/* --option */
fprintf (stderr, "%s: unrecognized option `--%s'\n",
argv[0], nextchar);
else
/* +option or -option */
fprintf (stderr, "%s: unrecognized option `%c%s'\n",
argv[0], argv[optind][0], nextchar);
}
nextchar = (char *) "";
optind++;
return '?';
}
}
/* Look at and handle the next short option-character. */
{
char c = *nextchar++;
char *temp = my_index (optstring, c);
/* Increment `optind' when we start to process its last character. */
if (*nextchar == '\0')
++optind;
if (temp == NULL || c == ':')
{
if (opterr)
{
if (posixly_correct)
/* 1003.2 specifies the format of this message. */
fprintf (stderr, "%s: illegal option -- %c\n", argv[0], c);
else
fprintf (stderr, "%s: invalid option -- %c\n", argv[0], c);
}
optopt = c;
return '?';
}
if (temp[1] == ':')
{
if (temp[2] == ':')
{
/* This is an option that accepts an argument optionally. */
if (*nextchar != '\0')
{
optarg = nextchar;
optind++;
}
else
optarg = NULL;
nextchar = NULL;
}
else
{
/* This is an option that requires an argument. */
if (*nextchar != '\0')
{
optarg = nextchar;
/* If we end this ARGV-element by taking the rest as an arg,
we must advance to the next element now. */
optind++;
}
else if (optind == argc)
{
if (opterr)
{
/* 1003.2 specifies the format of this message. */
fprintf (stderr, "%s: option requires an argument -- %c\n",
argv[0], c);
}
optopt = c;
if (optstring[0] == ':')
c = ':';
else
c = '?';
}
else
/* We already incremented `optind' once;
increment it again when taking next ARGV-elt as argument. */
optarg = argv[optind++];
nextchar = NULL;
}
}
return c;
}
}
int
getopt (argc, argv, optstring)
int argc;
char *const *argv;
const char *optstring;
{
return _getopt_internal (argc, argv, optstring,
(const struct option *) 0,
(int *) 0,
0);
}
#endif /* _LIBC or not __GNU_LIBRARY__. */
#ifdef TEST
/* Compile with -DTEST to make an executable for use in testing
the above definition of `getopt'. */
int
main (argc, argv)
int argc;
char **argv;
{
int c;
int digit_optind = 0;
while (1)
{
int this_option_optind = optind ? optind : 1;
c = getopt (argc, argv, "abc:d:0123456789");
if (c == EOF)
break;
switch (c)
{
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
if (digit_optind != 0 && digit_optind != this_option_optind)
printf ("digits occur in two different argv-elements.\n");
digit_optind = this_option_optind;
printf ("option %c\n", c);
break;
case 'a':
printf ("option a\n");
break;
case 'b':
printf ("option b\n");
break;
case 'c':
printf ("option c with value `%s'\n", optarg);
break;
case '?':
break;
default:
printf ("?? getopt returned character code 0%o ??\n", c);
}
}
if (optind < argc)
{
printf ("non-option ARGV-elements: ");
while (optind < argc)
printf ("%s ", argv[optind++]);
printf ("\n");
}
exit (0);
}
#endif /* TEST */

129
getopt.h Executable file
View File

@ -0,0 +1,129 @@
/* Declarations for getopt.
Copyright (C) 1989, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef _GETOPT_H
#define _GETOPT_H 1
#ifdef __cplusplus
extern "C" {
#endif
/* For communication from `getopt' to the caller.
When `getopt' finds an option that takes an argument,
the argument value is returned here.
Also, when `ordering' is RETURN_IN_ORDER,
each non-option ARGV-element is returned here. */
extern char *optarg;
/* Index in ARGV of the next element to be scanned.
This is used for communication to and from the caller
and for communication between successive calls to `getopt'.
On entry to `getopt', zero means this is the first call; initialize.
When `getopt' returns EOF, this is the index of the first of the
non-option elements that the caller should itself scan.
Otherwise, `optind' communicates from one call to the next
how much of ARGV has been scanned so far. */
extern int optind;
/* Callers store zero here to inhibit the error message `getopt' prints
for unrecognized options. */
extern int opterr;
/* Set to an option character which was unrecognized. */
extern int optopt;
/* Describe the long-named options requested by the application.
The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
of `struct option' terminated by an element containing a name which is
zero.
The field `has_arg' is:
no_argument (or 0) if the option does not take an argument,
required_argument (or 1) if the option requires an argument,
optional_argument (or 2) if the option takes an optional argument.
If the field `flag' is not NULL, it points to a variable that is set
to the value given in the field `val' when the option is found, but
left unchanged if the option is not found.
To have a long-named option do something other than set an `int' to
a compiled-in constant, such as set a value from `optarg', set the
option's `flag' field to zero and its `val' field to a nonzero
value (the equivalent single-letter option character, if there is
one). For long options that have a zero `flag' field, `getopt'
returns the contents of the `val' field. */
struct option
{
#if defined (__STDC__) && __STDC__
const char *name;
#else
char *name;
#endif
/* has_arg can't be an enum because some compilers complain about
type mismatches in all the code that assumes it is an int. */
int has_arg;
int *flag;
int val;
};
/* Names for the values of the `has_arg' field of `struct option'. */
#define no_argument 0
#define required_argument 1
#define optional_argument 2
#if defined (__STDC__) && __STDC__
#ifdef __GNU_LIBRARY__
/* Many other libraries have conflicting prototypes for getopt, with
differences in the consts, in stdlib.h. To avoid compilation
errors, only prototype getopt for the GNU C library. */
extern int getopt (int argc, char *const *argv, const char *shortopts);
#else /* not __GNU_LIBRARY__ */
extern int getopt ();
#endif /* __GNU_LIBRARY__ */
extern int getopt_long (int argc, char *const *argv, const char *shortopts,
const struct option *longopts, int *longind);
extern int getopt_long_only (int argc, char *const *argv,
const char *shortopts,
const struct option *longopts, int *longind);
/* Internal only. Users should not call this directly. */
extern int _getopt_internal (int argc, char *const *argv,
const char *shortopts,
const struct option *longopts, int *longind,
int long_only);
#else /* not __STDC__ */
extern int getopt ();
extern int getopt_long ();
extern int getopt_long_only ();
extern int _getopt_internal ();
#endif /* __STDC__ */
#ifdef __cplusplus
}
#endif
#endif /* _GETOPT_H */

180
getopt1.c Executable file
View File

@ -0,0 +1,180 @@
/* getopt_long and getopt_long_only entry points for GNU getopt.
Copyright (C) 1987, 88, 89, 90, 91, 92, 1993, 1994
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "getopt.h"
#if !defined (__STDC__) || !__STDC__
/* This is a separate conditional since some stdc systems
reject `defined (const)'. */
#ifndef const
#define const
#endif
#endif
#include <stdio.h>
/* Comment out all this code if we are using the GNU C Library, and are not
actually compiling the library itself. This code is part of the GNU C
Library, but also included in many other GNU distributions. Compiling
and linking in this code is a waste when using the GNU C library
(especially if it is a shared library). Rather than having every GNU
program understand `configure --with-gnu-libc' and omit the object files,
it is simpler to just do this in the source for each such file. */
#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
/* This needs to come after some library #include
to get __GNU_LIBRARY__ defined. */
#ifdef __GNU_LIBRARY__
#include <stdlib.h>
#else
char *getenv ();
#endif
#ifndef NULL
#define NULL 0
#endif
int
getopt_long (argc, argv, options, long_options, opt_index)
int argc;
char *const *argv;
const char *options;
const struct option *long_options;
int *opt_index;
{
return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
}
/* Like getopt_long, but '-' as well as '--' can indicate a long option.
If an option that starts with '-' (not '--') doesn't match a long option,
but does match a short option, it is parsed as a short option
instead. */
int
getopt_long_only (argc, argv, options, long_options, opt_index)
int argc;
char *const *argv;
const char *options;
const struct option *long_options;
int *opt_index;
{
return _getopt_internal (argc, argv, options, long_options, opt_index, 1);
}
#endif /* _LIBC or not __GNU_LIBRARY__. */
#ifdef TEST
#include <stdio.h>
int
main (argc, argv)
int argc;
char **argv;
{
int c;
int digit_optind = 0;
while (1)
{
int this_option_optind = optind ? optind : 1;
int option_index = 0;
static struct option long_options[] =
{
{"add", 1, 0, 0},
{"append", 0, 0, 0},
{"delete", 1, 0, 0},
{"verbose", 0, 0, 0},
{"create", 0, 0, 0},
{"file", 1, 0, 0},
{0, 0, 0, 0}
};
c = getopt_long (argc, argv, "abc:d:0123456789",
long_options, &option_index);
if (c == EOF)
break;
switch (c)
{
case 0:
printf ("option %s", long_options[option_index].name);
if (optarg)
printf (" with arg %s", optarg);
printf ("\n");
break;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
if (digit_optind != 0 && digit_optind != this_option_optind)
printf ("digits occur in two different argv-elements.\n");
digit_optind = this_option_optind;
printf ("option %c\n", c);
break;
case 'a':
printf ("option a\n");
break;
case 'b':
printf ("option b\n");
break;
case 'c':
printf ("option c with value `%s'\n", optarg);
break;
case 'd':
printf ("option d with value `%s'\n", optarg);
break;
case '?':
break;
default:
printf ("?? getopt returned character code 0%o ??\n", c);
}
}
if (optind < argc)
{
printf ("non-option ARGV-elements: ");
while (optind < argc)
printf ("%s ", argv[optind++]);
printf ("\n");
}
exit (0);
}
#endif /* TEST */

386
gpl.texi Executable file
View File

@ -0,0 +1,386 @@
@center GNU GENERAL PUBLIC LICENSE
@center Version 2, June 1991
@c This file is intended to be included in another file.
@display
Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@end display
@sp 1
@center Preamble
@sp 1
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software---to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
@page
@center GNU GENERAL PUBLIC LICENSE
@center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
@sp 1
@enumerate 0
@item
This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The ``Program'', below,
refers to any such program or work, and a ``work based on the Program''
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term ``modification''.) Each licensee is addressed as ``you''.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
@item
You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
@item
You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
@enumerate a
@item
You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
@item
You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
@item
If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
@end enumerate
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
@item
You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
@enumerate a
@item
Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
@item
Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
@item
Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
@end enumerate
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
@item
You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
@item
You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
@item
Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
@item
If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
@item
If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
@item
The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and ``any
later version'', you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
@item
If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
@sp 1
@center NO WARRANTY
@sp 1
@item
BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
@item
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
@end enumerate
@sp 1
@center END OF TERMS AND CONDITIONS
@page
@unnumberedsec Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the ``copyright'' line and a pointer to where the full notice is found.
@smallexample
@var{one line to give the program's name and a brief idea of what it does.}
Copyright (C) @var{yyyy} @var{name of author}
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
@end smallexample
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
@smallexample
Gnomovision version 69, Copyright (C) 19@var{yy} @var{name of author}
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type
`show w'. This is free software, and you are welcome to redistribute
it under certain conditions; type `show c' for details.
The hypothetical commands @samp{show w} and @samp{show c} should show
the appropriate parts of the General Public License. Of course, the
commands you use may be called something other than @samp{show w} and
@samp{show c}; they could even be mouse-clicks or menu items---whatever
suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a ``copyright disclaimer'' for the program, if
necessary. Here is a sample; alter the names:
@example
Yoyodyne, Inc., hereby disclaims all copyright interest in the
program `Gnomovision' (which makes passes at compilers) written
by James Hacker.
@var{signature of Ty Coon}, 1 April 1989
Ty Coon, President of Vice
@end example
This General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications
with the library. If this is what you want to do, use the GNU Library
General Public License instead of this License.
@end smallexample

119
install-sh Executable file
View File

@ -0,0 +1,119 @@
#!/bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5; it is not part of GNU.
#
# $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $
#
# This script is compatible with the BSD install script, but was written
# from scratch.
#
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
instcmd="$mvprog"
chmodcmd=""
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
fi
# Make a temp file name in the proper directory.
dstdir=`dirname $dst`
dsttmp=$dstdir/#inst.$$#
# Move or copy the file name to the temp name
$doit $instcmd $src $dsttmp
# and set any options; do chmod last to preserve setuid bits
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi
# Now rename the file to the real destination.
$doit $rmcmd $dst
$doit $mvcmd $dsttmp $dst
exit 0

3793
jethro.c Executable file

File diff suppressed because it is too large Load Diff

339
jethro.l Executable file
View File

@ -0,0 +1,339 @@
/* GNU Talkfilters
Copyright (C) 1998-2003 Free Software Foundation, Inc.
This file is part of GNU Talkfilters
GNU Talkfilters is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2, or (at
your option) any later version.
This software is distributed in the hope that it will be amusing, 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 software; see the file COPYING. If not, write to the
Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
** jethro v. 1.00 06/10/93
** Duane Paulson <ci922@cleveland.freenet.edu> "dap"
** Hillbilly text filter. Compile with lex, then C.
** syntax will be:
** jethro <input_file >output_file.
** Public domain. Use at your own risk. Y'all come back now, heah?
*/
/*************************************************************************
REVISION LOG
when ver who change
-------- ---- --- -----------------------------------------------------
06/10/93 1.00 dap Initial release.
8.May.94 1.10 beg Fixed for HP-UX
*************************************************************************/
%option prefix="jethro_yy"
%option outfile="lex.yy.c"
%option noyywrap
%option nowarn
%e 7000
%k 5000
%p 9000
%n 2000
%a 9000
%o 7000
%{
#include "common.h"
#include "talkfilters.h"
#define YY_DECL int yylex(gtf_databuf_t *buf)
%}
WB [\n\t ]
WC [A-Za-z'0-9]
NW [^A-Za-z'0-9]
EOT \4
%s INW NIW
%%
<NIW,INITIAL>{
\<(\/)?[A-Za-z][^\>]*\> gtf_echo(); // don't damage HTML tags
[Gg]reetings/{NW} |
[Hh]i/{NW} |
[Hh]ello/{NW} gtf_puts_case("Howdy");
[Bb]ye/{NW} |
[Gg]oodbye/{NW} gtf_puts_case("Y'all come back now, heah?");
[Hh]ear/{NW} gtf_puts_case("Heah");
[Cc]ar/{NW} |
[Aa]uto/{NW} |
[Aa]utomobile/{NW} gtf_puts_case("Gasoline buggy");
[Rr]elax/{NW} gtf_puts_case("Set a spell -- put yore feet up");
[Ss]wimming{WB}pool/{NW} gtf_puts_case("Cement pond");
[Pp]ool{WB}table gtf_puts_case("Fancy eatin table"); BEGIN(INW);
[Pp]ool{WB}cue |
[Cc]ue{WB}stick gtf_puts_case("Fancy pot passer"); BEGIN(INW);
(r)?oil/{NW} |
[Bb]ake/{NW} |
[Ff]ry/{NW} |
[Ss]aute/{NW} |
[Cc]ook/{NW} gtf_puts_case("Whomp up");
[Bb][r]?oiling/{NW} |
[Bb]akeing/{NW} |
[Ff]rying/{NW} |
[Ss]auteing/{NW} |
[Cc]ooking/{NW} gtf_puts_case("Whompin up");
[Bb][r]?oiled/{NW} |
[Bb]aked/{NW} |
[Ff]ryed/{NW} |
[Ss]auted/{NW} |
[Cc]ooked/{NW} gtf_puts_case("Done whomped up");
[Bb][r]?oils/{NW} |
[Bb]akes/{NW} |
[Ff]rys/{NW} |
[Ss]autes/{NW} |
[Cc]ooks/{NW} gtf_puts_case("Whomps up");
[Gg]roceries/{NW} |
[Ff]ood/{NW} gtf_puts_case("Vittles");
[Ss]alad gtf_puts_case("Slaw"); BEGIN(INW);
[Vv]egetable gtf_puts_case("Green"); BEGIN(INW);
[Pp]otato/{NW} gtf_puts_case("Tater");
[Pp]otatoes/{NW} gtf_puts_case("Taters");
[Tt]omato/{NW} gtf_puts_case("Tuhmater");
[Tt]omatoes/{NW} gtf_puts_case("Tuhmaters");
[Rr]hubarb/{NW} gtf_puts_case("Pie plant");
[Ll]iquor/{NW} |
[Ww]hisk[e]?y/{NW} |
[Ss]cotch/{NW} |
[Bb]ourbon/{NW} |
[Gg]in/{NW} |
[Vv]odka/{NW} |
[Tt]equila/{NW} |
[Ll]iqueur/{NW} gtf_puts_case("Rheumatiz medcin");
[Bb]ooze/{NW} gtf_puts_case("Corn likker");
[Cc]ocktail/{NW} |
[Mm]ixed{WB}drink/{NW} gtf_puts_case("Waste of good likker");
[Bb]ar/{NW} gtf_puts_case("Dance hall");
[Bb]ars/{NW} gtf_puts_case("Dance halls");
[Ss]aloon |
[Cc]ocktail{WB}lounge gtf_puts_case("Dance hall"); BEGIN(INW);
[Ww]hore |
[Pp]rostitute |
[Ss]lut gtf_puts_case("Dance hall girl"); BEGIN(INW);
[Ss]ecret{WB}agent/{NW} |
[Ss]py/{NW} |
007/{NW} gtf_puts_case("Double nought spy");
[Zz]ero/{NW} gtf_puts_case("Nought");
[Pp]ants/{NW} gtf_puts_case("Trousers");
[Jj]eans/{NW} |
[Dd]ungarees/{NW} |
[Ll]evi[']?s/{NW} gtf_puts_case("Overhalls");
[Ss]hoe gtf_puts_case("High-button shoe"); BEGIN(INW);
[Jj]acket gtf_puts_case("Coat"); BEGIN(INW);
[Ss]hotgun gtf_puts_case("Fowlin piece"); BEGIN(INW);
[Rr]evolver |
[Gg]un gtf_puts_case("Shootin iron"); BEGIN(INW);
[Rr]ifle gtf_puts_case("Ozark longrifle"); BEGIN(INW);
[Ll]ibrar[yi] gtf_puts_case("Liberry"); BEGIN(INW);
[Ww]ash gtf_puts_case("Warsh"); BEGIN(INW);
[Ff]amily/{NW} gtf_puts_case("Fambly");
[Ff]ry(ing)?{WB}pan |
[Ss]aute{WB}pan gtf_puts_case("Skillet"); BEGIN(INW);
[Aa]nimal gtf_puts_case("Critter"); BEGIN(INW);
FBI/{NW} |
F.B.I./{NW} |
CIA/{NW} |
C.I.A./{NW} |
ATF/{NW} |
A.T.F./{NW} |
IRS/{NW} |
I.R.S./{NW} |
SS/{NW} |
S.S./{NW} |
[Ss]elective{WB}[Ss]ervice/{NW} |
[Ss]elective{WB}[Ss]ervice{WB}[Ss]ystem/{NW} |
[Ss]ecret{WB}[Ss]ervice/{NW} gtf_puts_case("Revanooers");
[Pp]olice/{NW} |
[Pp]oliceman/{NW} |
[Ss]heriff/{NW} |
[Dd]eputy/{NW} |
[Dd]eputy{WB}[Ss]heriff/{NW} |
[Mm]arshall/{NW} |
[Dd]eputy{WB}[Mm]arshall/{NW} |
[Pp]ark{WB}[Rr]anger/{NW} |
[Tt]exas{WB}[Rr]anger/{NW} |
[Hh]ighway{WB}[Pp]atrol/{NW} gtf_puts_case("Constable");
[Mm]other/{NW} |
[Mm][ao]mm[ay]?/{NW} |
[Mm]ommie/{NW} |
[Mm]a/{NW} |
[Mm]om/{NW} gtf_puts_case("Maw");
[Ff]ather/{NW} |
[Dd]ad/{NW} |
[Dd]addy/{NW} |
[Pp]a/{NW} |
[Pp][ao]p/{NW} |
[Pp][ao]pp[ay]?/{NW} gtf_puts_case("Paw");
[Gg]randmother/{NW} |
[Gg]randma[w]?/{NW} gtf_puts_case("Granny");
[Gg]randfather/{NW} |
[Gg]ran[d]{1,2}ad[d]?[y]?/{NW} |
[Gg]randpop/{NW} |
[Gg]randpa[w]?/{NW} gtf_puts_case("Grampy");
[Mm]y/{NW} gtf_puts_case("Mah");
them/{NW} gtf_puts_case("'em");
[Dd]og gtf_puts_case("Dawg"); BEGIN(INW);
[Ll]awyer |
[Ll]egal{WB}counc[ei]l |
[Ll]egal{WB}councellor |
[Aa]ttorney |
[Aa]ttorney{WB}[Aa]t{WB}[Ll]aw gtf_puts_case("City slicker"); BEGIN(INW);
[Tt]han/{NW} gtf_puts_case("Then");
[Cc]haracterize gtf_puts_case("Show"); BEGIN(INW);
[Vv]ery/{NW} |
[Ee]xtremely/{NW} |
[Rr]eally/{NW} |
[Rr]eal/{NW} gtf_puts_case("Right");
[Hh]aven't/{NW} |
[Ii]sn't/{NW} |
[Aa]ren't/{NW} gtf_puts_case("Aint");
[Ss]aid/{NW} |
[Ss]ays/{NW} gtf_puts_case("Sez");
[Aa]re/{NW} gtf_puts_case("Is");
[Ss]hould/{NW} gtf_puts_case("Ortta");
[Pp]erhaps/{NW} |
[Mm]aybe/{NW} gtf_puts_case("Mebbe");
[Ss]ick/{NW} gtf_puts_case("Ailin'");
I({WB}a|')m{WB}not/{NW} gtf_puts_case("I ain't");
[Ss]cared/{NW} gtf_puts_case("A-skeert");
[Ss]care gtf_puts_case("Skeer"); BEGIN(INW);
[Hh]ave/{NW} gtf_puts_case("Got");
[Pp]ossess/{NW} gtf_puts_case("Have");
[Hh]elp gtf_puts_case("Hep"); BEGIN(INW);
[Tt]ired/{NW} gtf_puts_case("Tuckered out");
[Cc]ompletely/{NW} gtf_puts_case("Plumb");
[Dd]runk/{NW} gtf_puts_case("A mite woozy");
[Yy]es/{NW} gtf_puts_case("Yep");
[Nn]o/{NW} gtf_puts_case("Nope");
[Ii]t{WB}is/{NW} gtf_puts_case("Tis");
[Aa]t{WB}all/{NW} gtf_puts_case("A tall");
[Aa]m/{NW} |
[Aa]re/{NW} gtf_puts_case("Is");
[Ww]as/{NW} |
[Ww]ere/{NW} gtf_puts_case("Wuz");
[Ww]asn't/{NW} gtf_puts_case("Wasunt");
[Ee]very gtf_puts_case("Ever"); BEGIN(INW);
[Ww]ants/{NW} gtf_puts_case("Is after");
[Ww]anted/{NW} gtf_puts_case("Was after");
[Ww]anting/{NW} gtf_puts_case("Hankering after");
[Dd]oesn't/{NW} |
[Dd]on't/{NW} gtf_puts_case("Dasent");
[Yy]ou'll/{NW} gtf_puts_case("Y'all will");
[Yy]our gtf_puts_case("Yore");
[Mm]ore/{NW} gtf_puts_case("Mo");
[Cc]an/{NW} gtf_puts_case("C'n");
[Yy]ou/{NW} gtf_puts_case("Y'all");
[Ff]or/{NW} gtf_puts_case("Fer");
[Tt]he/{NW} gtf_puts_case("Duh");
[Tt]oo/{NW} gtf_puts_case("Besides");
[Tt]o/{NW} gtf_puts_case("Tuh");
[Aa](n)?/{NW} gtf_puts_case("Ah");
[Aa]re/{NW} |
[Oo]ur/{NW} |
[Oo]r/{NW} gtf_puts_case("Ore");
[Oo]f/{NW} gtf_puts_case("Uv");
I/{NW} gtf_puts_case("Ah");
I'm/{NW} gtf_puts_case("Ahm");
I'll/{NW} gtf_puts_case("Ahl");
I'd/{NW} gtf_puts_case("Ah wood");
[Oo]wn/{NW} |
[Tt]own/{NW} |
[Dd]own/{NW} |
[Gg]own/{NW} |
[Bb]rown/{NW} |
[Bb]elow/{NW} |
[Kk]now/{NW} |
[Tt]hrow/{NW} |
[Gg]row/{NW} |
[Hh]ow/{NW} |
[Nn]ow/{NW} |
[Bb]row/{NW} |
[Ss]how/{NW} |
[Cc]an't/{NW} |
[Hh]er/{NW} gtf_echo();
{WC} { BEGIN(INW); gtf_echo(); }
}
<INW>{
! gtf_puts(". Ye Dawgies!!!"); BEGIN(NIW);
ing/{NW} gtf_puts("in'"); BEGIN(NIW);
tial/{NW} gtf_puts("shul"); BEGIN(NIW);
cious/{NW} gtf_puts("shus"); BEGIN(NIW);
ious/{NW} gtf_puts("yus"); BEGIN(NIW);
tion/{NW} gtf_puts("shun"); BEGIN(NIW);
ow/{NW} gtf_puts("er"); BEGIN(NIW);
re/{NW} |
er/{NW} gtf_puts("uh"); BEGIN(NIW);
'nt/{NW} *(yytext) = 'u'; gtf_echo(); BEGIN(NIW);
're/{NW} gtf_puts(" is"); BEGIN(NIW);
've/{NW} gtf_puts(" done"); BEGIN(NIW);
eed/{NW} gtf_echo(); BEGIN(NIW);
ed/{NW} gtf_puts("d"); BEGIN(NIW);
wn/{NW} gtf_puts("ed"); BEGIN(NIW);
{NW} BEGIN(NIW); unput(yytext[0]);
}
{EOT} /* ignore trailing EOT character */
. gtf_echo();
%%
#ifdef LIBRARY_MODE
int gtf_filter_jethro(const char *input, char *buf, size_t bufsz)
{
gtf_databuf_t buffer;
YY_BUFFER_STATE _yybuf;
gtf_strbuf_init(&buffer, buf, bufsz);
_yybuf = yy_scan_string(input);
yylex(&buffer);
yy_delete_buffer(_yybuf);
gtf_reset();
return(buffer.overflow);
}
int __gtf_filter_jethro(const char *input, char *buf, size_t bufsz)
{
return(gtf_filter_jethro(input, buf, bufsz));
}
#else /* LIBRARY_MODE */
int main(int argc, char **argv)
{
gtf_parse_args();
yylex(NULL);
return(EXIT_SUCCESS);
}
#endif /* LIBRARY_MODE */
/* end of source file */

202
jethro.vcproj Executable file
View File

@ -0,0 +1,202 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="jethro"
ProjectGUID="{C5BF6F5B-14CD-41D2-B870-7CC4586D5C41}"
RootNamespace="jethro"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="3"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
>
<File
RelativePath=".\common.c"
>
</File>
<File
RelativePath=".\getopt.c"
>
</File>
<File
RelativePath=".\getopt1.c"
>
</File>
<File
RelativePath=".\jethro.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
>
<File
RelativePath=".\common.h"
>
</File>
<File
RelativePath=".\getopt.h"
>
</File>
<File
RelativePath=".\talkfilters.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

4569
jive.c Executable file

File diff suppressed because it is too large Load Diff

376
jive.l Executable file
View File

@ -0,0 +1,376 @@
/* GNU Talkfilters
Copyright (C) 1998-2003 Free Software Foundation, Inc.
This file is part of GNU Talkfilters
GNU Talkfilters is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2, or (at
your option) any later version.
This software is distributed in the hope that it will be amusing, 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 software; see the file COPYING. If not, write to the
Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
%option prefix="jive_yy"
%option outfile="lex.yy.c"
%option noyywrap
%e 2000
%p 6000
%n 1000
%k 500
%a 4000
%o 2000
%{
#include "common.h"
#include "talkfilters.h"
#define YY_DECL int yylex(gtf_databuf_t *buf)
%}
WB [\n\t ]
WC [A-Za-z'0-9]
NW [^A-Za-z'0-9]
EOT \4
%s NIW INW
%%
<NIW,INITIAL>{
\<(\/)?[A-Za-z][^\>]*\> gtf_echo(); // don't damage HTML tags
[Ff]iles/{NW} gtf_puts_case("stashes");
[Ff]ile/{NW} gtf_puts_case("stash");
[Ss]end gtf_puts_case("t'row"); BEGIN(INW);
([Cc]ute|[Aa]ttractive|[Hh]andsome)/{NW} gtf_puts_case("fine");
([Bb]eautiful|[Gg]orgeous)/{NW} gtf_puts_case("supa' fly");
[Pp]rogram gtf_puts_case("honky code"); BEGIN(INW);
[Ss]oftware{WB}[Ee]ngineer/{NW} gtf_puts_case("honky coder");
[Pp]rogrammer gtf_puts_case("honky coder"); BEGIN(INW);
[Ss]oftware/{NW} gtf_puts_case("honky code");
takes/{NW} gtf_puts_case("snatches");
took/{NW} gtf_puts_case("dun snatch'd");
[Ww]e're/{NW} gtf_puts_case("we's");
[Kk]ept/{NW} gtf_puts_case("kep'");
[Aa]wesome/{NW} gtf_puts_case("happenin'");
[Gg]reasy/{NW} gtf_puts_case("geesy");
[Bb]itch/{NW} gtf_puts_case("bits");
[Ff]uck/{NW} gtf_puts_case("funk");
([Ss]hit|[Cc]rap)/{NW} gtf_puts_case("s'it");
[Dd]runk/{NW} gtf_puts_case("d'unk");
[Mm]asturbating/{NW} gtf_puts_case("spankin'");
[Mm]asturbation/{NW} gtf_puts_case("spankin' da damn monkey");
[Mm]asturbate/{NW} gtf_puts_case("spank");
jerking{WB}off/{NW} gtf_puts_case("spankin'");
jerk{WB}off/{NW} gtf_puts_case("spank");
[Mm]exican/{NW} gtf_puts_case("wet-back");
[Ii]talian/{NW} gtf_puts_case("geesa'");
[Tt]ake/{NW} gtf_puts_case("snatch");
[Dd]on't/{NW} gtf_puts_case("duzn't");
[Jj]ive/{NW} gtf_puts_case("jibe");
[Ff]ool/{NW} gtf_puts_case("honkyfool");
[Cc]ool/{NW} gtf_puts_case("damn coo'");
[Ww]eird/{NW} gtf_puts_case("funky-ass");
modem/{NW} gtf_puts_case("doodad");
[Mm]an/{NW} gtf_puts_case("dude");
[Ww]oman/{NW} gtf_puts_case("mama");
([Mm]o(m|ther))/{NW} gtf_puts_case("mama");
([Dd]ad|[Ff]ather)/{NW} gtf_puts_case("big daddy");
[Gg]irl/{NW} gtf_puts_case("goat");
[Ss]omething/{NW} gtf_puts_case("sump'n");
(lie|[Ll]ies)/{NW} gtf_puts_case("honky jibe");
[Ss]ure/{NW} gtf_puts_case("sho' 'nuff");
[Gg]et gtf_puts_case("git"); BEGIN(INW);
[Ww]hore |
[Pp]rostitute |
[Ss]lut gtf_puts_case("ho'"); BEGIN(INW);
will({WB}have)?/{WB}to{NW} gtf_puts_case("gots'ta");
(has|got){WB}to/{NW} gtf_puts_case("gots'ta");
must/{NW} gtf_puts_case("gots'ta");
[Ll]et{WB}me/{NW} gtf_puts_case("lemme");
[Cc]loth(es|ing)/{NW} gtf_puts_case("duds");
[Cc]ash/{NW} gtf_puts_case("Bens");
pay{WB}you{WB}back/{NW} gtf_puts_case("hitcha back");
I{WB}am/{NW} gtf_puts_case("I's gots'ta be");
(am|is|are){WB}not/{NW} gtf_puts_case("ain't");
([Aa]re|[Hh]ave|[Hh]as)n't/{NW} gtf_puts_case("ain't");
[Aa]re{WB}your/{NW} gtf_puts_case("is yo'");
are{WB}you/{NW} gtf_puts_case("you is");
Are{WB}you/{NW} gtf_puts_case("Is you");
[Hh]at/{NW} gtf_puts_case("fedora");
[Oo]ver gtf_puts_case("ova'"); BEGIN(INW);
[Oo]ther gtf_puts_case("oda'"); BEGIN(INW);
[Ss]hoe/{NW} gtf_puts_case("kicker");
[Hh]ave{WB}to/{NW} gtf_puts_case("gots'ta");
have/{NW} gtf_puts_case("gots");
has|(have{WB}to)/{NW} gtf_puts_case("gots'ta");
[Cc]ome{WB}over/{NW} gtf_puts_case("mosey on down");
[Gg]o{WB}down/{NW} gtf_puts_case("mosey on down");
come/{NW} gtf_puts_case("mosey on down");
[Rr]eturn/{NW} gtf_puts_case("git on back");
[Bb]uy gtf_puts_case("steal"); BEGIN(INW);
[Bb]ought/{NW} gtf_puts_case("robbed");
car/{NW} gtf_puts_case("wheels");
[Ll]ying({WB}to)?/{NW} gtf_puts_case("bull-shittin'");
(driven[[Dd]rove)/{NW} gtf_puts_case("roll'd");
[Dd]rive/{NW} gtf_puts_case("roll");
eat/{NW} gtf_puts_case("feed da bud");
([Bb]lack|[Nn]egro)/{NW} gtf_puts_case("brotha'");
[Ww]hite/{NW} gtf_puts_case("honky");
[Nn]igger/{NW} gtf_puts_case("gentleman");
[Nn]ice/{NW} gtf_puts_case("supa' fine");
borrow/{NW} gtf_puts_case("hold");
screw/{NW} gtf_puts_case("bump");
[Pp]erson/{NW} gtf_puts_case("sucka'");
[Pp]eople/{NW} gtf_puts_case("sucka's");
thing|element|gadget|widget|peripheral {
gtf_puts_case("doodad"); BEGIN(INW); }
[Nn]ame/{NW} gtf_puts_case("dojigga'");
path/{NW} gtf_puts_case("alley");
[Cc]omputer/{NW} gtf_puts_case("clunka'");
[Ww]indows{WB}(95|98|ME|NT|2000|XP|2K|CE)/{NW} {
gtf_puts_case("slow mo-fo Windaz'"); }
[Mm]icrosoft gtf_puts_case("dat damn monopoly"); BEGIN(INW);
([Kk]illed|[Dd]ead)/{NW} gtf_puts_case("wasted");
[Dd]ied/{NW} gtf_puts_case("gots wasted");
[Dd]ie/{NW} gtf_puts_case("kick d' cud");
[Pp]resident/{NW} gtf_puts_case("supa'-dude");
[Pp]rime{WB}[Mm]inister/{NW} gtf_puts_case("head honcho");
(injured|hurt)/{NW} gtf_puts_case("hosed");
government/{NW} gtf_puts_case("guv'ment");
knew/{NW} gtf_puts_case("knowed");
[Bb]ecause/{NW} gtf_puts_case("cuz");
[Yy]our/{NW} gtf_puts_case("yo'");
[Ff]our/{NW} gtf_puts_case("foe");
got/{NW} gtf_puts_case("gots");
[Yy]oung/{NW} gtf_puts_case("yung");
[Hh]oney/{NW} gtf_puts_case("baby doll");
[Yy]ou're/{NW} gtf_puts_case("you's");
you/{NW} gtf_puts_case("ya");
You/{NW} gtf_puts_case("You's");
[Ff]irst/{NW} gtf_puts_case("fust");
([Pp]olice|[Cc]ops)/{NW} gtf_puts_case("honky pigs");
[Ss]tring/{NW} gtf_puts_case("chittlin'");
read/{NW} gtf_puts_case("eyeball");
[Ww]rite/{NW} gtf_puts_case("scribble");
[Ww]riting/{NW} gtf_puts_case("scribblin'");
[Tt]o/{NW} gtf_puts_case("t'");
tion/{NW} gtf_puts_case("shun");
(al)?most/{NW} gtf_puts_case("mos'");
from/{NW} gtf_puts_case("fum");
([Aa]lright|[Oo]kay|OK)/{NW} gtf_puts_case("coo'");
[Kk]nown/{NW} gtf_puts_case("knode");
[Ww]ant/{NW} gtf_puts_case("wants'");
[Bb]eat/{NW} gtf_puts_case("whup'");
like/{NW} gtf_puts_case("likes");
did/{NW} gtf_puts_case("dun did");
kind{WB}of/{NW} gtf_puts_case("kind'a");
[Ww]omen/{NW} gtf_puts_case("honky chicks");
[Mm]en('s)?/{NW} gtf_puts_case("dudes");
[Gg]ood/{NW} gtf_puts_case("baaaad");
[Oo]pened/{NW} gtf_puts_case("jimmey'd ");
[Oo]pen/{NW} gtf_puts_case("jimmey");
[Ss]ource{WB}code/{NW} gtf_puts_case("clunka' scribblin'");
[Vv]ery/{NW} gtf_puts_case("real");
Dr./{NW} gtf_puts_case("Doc");
per(a)? gtf_puts_case("puh'");
can/{NW} gtf_puts_case("kin"); BEGIN(INW);
just/{NW} gtf_puts_case("plum");
Just/{NW} gtf_puts_case("Jes'");
[Dd]etroit/{NW} gtf_puts_case("Mo-town");
believe/{NW} gtf_puts_case("reckon'");
[Ii]ndianapolis/{NW} gtf_puts_case("Nap-town");
Jack/{NW} gtf_puts_case("Buckwheat");
Bob/{NW} gtf_puts_case("Liva' Lips");
Robert/{NW} gtf_puts_case("Leroy");
John/{NW} gtf_puts_case("Raz'tus");
Paul/{NW} gtf_puts_case("Fuh'rina");
Clinton/{NW} gtf_puts_case("Kingfish");
David/{NW} gtf_puts_case("Issac");
Jim/{NW} gtf_puts_case("Bo-Jangles");
Mary/{NW} gtf_puts_case("Snow Flake");
Mark/{NW} gtf_puts_case("Amos");
Anthony/{NW} gtf_puts_case("Mojo");
How(ie|ard)/{NW} gtf_puts_case("Holmes");
Jer(emy|ry)/{NW} gtf_puts_case("Holmes");
Ron(ald|nie)?/{NW} gtf_puts_case("Rolo");
Larry/{NW} gtf_puts_case("Remus");
Jo(e|seph)/{NW} gtf_puts_case("Massa'");
Mohammed/{NW} gtf_puts_case("Liva' Lips");
[Pp]o(ntiff|pe)/{NW} gtf_puts_case("wiz'");
Pravda/{NW} gtf_puts_case("dat commie rag");
[Bb]roken/{NW} gtf_puts_case("bugger'd");
[Ss]trange/{NW} gtf_puts_case("funky");
[Dd]ance/{NW} gtf_puts_case("boogy");
[Hh]ouse|[Hh]ome gtf_puts_case("crib"); BEGIN(INW);
[Aa]partment/{NW} gtf_puts_case("crib");
so/{NW} gtf_puts_case("so's");
[Hh]ead gtf_puts_case("'haid"); BEGIN(INW);
boss/{NW} gtf_puts_case("main man");
[Mm]oney/{NW} gtf_puts_case("bre'd");
[Aa]mateur gtf_puts_case("begina'");
[Rr]adio/{NW} gtf_puts_case("transista'");
[Ww]hat gtf_puts_case("whut"); BEGIN(INW);
[Dd]oes gtf_puts_case("duz"); BEGIN(INW);
[Ww]ere gtf_puts_case("wuz"); BEGIN(INW);
understand/{NW} gtf_puts_case("dig");
[Uu]nderstanding/{NW} gtf_puts_case("diggin'");
my/{NW} gtf_puts_case("mah'");
meta gtf_puts_case("meta-fuckin'"); BEGIN(INW);
[Hh]air/{NW} gtf_puts_case("fro");
[Tt]alk{WB}(to|with)/{NW} gtf_puts_case("rap wid");
[Bb]ig/{NW} gtf_puts_case("big-ass");
[Bb]ad/{NW} gtf_puts_case("bad-ass");
[Ss]mall/{NW} gtf_puts_case("little-ass");
sort{WB}of/{NW} gtf_puts_case("sorta'");
is/{NW} gtf_puts_case("be");
[Ww]ater/{NW} gtf_puts_case("booze");
[Bb]ook/{NW} gtf_puts_case("scribblin'");
magazine/{NW} gtf_puts_case("issue uh GQ");
paper/{NW} gtf_puts_case("sheet");
guys/{NW} gtf_puts_case("muthafucka's");
guy/{NW} gtf_puts_case("muthafucka'");
wow/{NW} gtf_puts_case("damn");
up/{NW} gtf_puts_case("down");
down/{NW} gtf_puts_case("waaay down");
[Bb]reak/{NW} gtf_puts_case("boogie");
apple|orange/{NW} gtf_puts_case("watahmelon");
[Ss]teak/{NW} gtf_puts_case("fried chicken");
[Hh]i/{NW} gtf_puts_case("'Sup, dude");
[Hh]ey/{NW} gtf_puts_case("'Sup");
[Pp]op{WB}[Rr]ock/{NW} gtf_puts_case("dat white boy music");
I{WB}told{WB}her/{NW} gtf_puts_case("Ah sez to her");
I{WB}told{WB}him/{NW} gtf_puts_case("Ah sez to him");
[Ii]/{NW} gtf_puts_case("Ah'");
[Tt]alking/{NW} gtf_puts_case("rappin'");
[Tt]elephone/{NW} gtf_puts_case("rap rod");
[Tt]alk gtf_puts_case("rap"); BEGIN(INW);
[Hh]ello/{NW} gtf_puts_case("sappnin'");
John{WB}Lennon/{NW} gtf_puts_case("L L Cool J");
The{WB}Beatles/{NW} gtf_puts_case("Boyz II Men");
kick{WB}your{WB}ass/{NW} gtf_puts_case("get evil on yo' ass");
[Mm]y{WB}mistake/{NW} gtf_puts_case("mah' bad");
[Mm]usic/{NW} gtf_puts_case("beat");
basketball/{NW} gtf_puts_case("hoop");
bastard gtf_puts_case("bast'id"); BEGIN(INW);
football/{NW} gtf_puts_case("ball");
[Hh]e's/{NW} gtf_puts_case("he be");
[Ss]he's/{NW} gtf_puts_case("she be");
[Tt]hey're/{NW} gtf_puts_case("dey be");
[Ff]riend/{NW} gtf_puts_case("homey");
[Ss]chool/{NW} gtf_puts_case("farm");
(swing|boing|.[ltr]?ing)/{NW} gtf_puts_case(yytext);
[Ww]ant{WB}to/{NW} gtf_puts_case("wanna");
wants{WB}to/{NW} gtf_puts_case("be hankerin' aftah");
[Aa]sk gtf_puts_case("ax'"); BEGIN(INW);
[Oo]r(r)? gtf_puts_case("o'"); BEGIN(INW);
[Aa]r(r)? gtf_puts_case("a'"); BEGIN(INW);
[Aa]nd/{NW} gtf_puts_case("an'");
a/{NW} gtf_puts_case("some damn");
of/{NW} gtf_puts_case("uh");
Well, gtf_puts_case("Sheeit...");
[Ww]"as"/{NW} gtf_puts_case("wuz");
[Aa]"re"/{NW} gtf_puts_case("is");
[Ee]xc gtf_puts_case("'s"); BEGIN(INW);
[Ee]x gtf_puts_case("'es"); BEGIN(INW);
[Tt]hink/{NW} gtf_puts_case(yytext);
[Tt]h gtf_puts_case("d"); BEGIN(INW);
{WC} { BEGIN(INW); gtf_echo(); }
}
<INW>{
[a-z]":" { *(yytext+1) = ',';
if(gtf_random(4) < 3)
gtf_printf("%s dig dis:", yytext);
else
gtf_printf("%s check it:", yytext);
BEGIN(NIW); }
[a-b]"." gtf_printf("%s Sheeeiit.", yytext); BEGIN(NIW);
[c-d]"." gtf_printf("%s Word!", yytext); BEGIN(INW);
[e-f]"." gtf_printf("%s What it is, Mama!", yytext); BEGIN(NIW);
[g-h]"." gtf_printf("%s Lop some boogie.", yytext); BEGIN(NIW);
[i-j]"." gtf_printf("%s Ya' know?", yytext); BEGIN(NIW);
[m-n]"." gtf_printf("%s 'S coo', bro.", yytext); BEGIN(NIW);
[o-p]"." { gtf_printf( "%s Jes hang loose, brotha'.", yytext);
BEGIN(NIW); }
[q-r]"." gtf_printf("%s Ah be baaad...", yytext); BEGIN(NIW);
[u-v]"." gtf_printf("%s Man!", yytext); BEGIN(NIW);
[w-x]"." { gtf_printf("%c, so cut me some slack, Jack.", *yytext);
BEGIN(NIW); }
[y-z]"." gtf_printf("%s Slap mah fro!", yytext); BEGIN(NIW);
! gtf_puts(". Right On!");
e{WB}the/{NW} gtf_puts_case("e da damn"); BEGIN(NIW);
a{WB}the/{NW} gtf_puts_case("a da damn"); BEGIN(NIW);
t{WB}the/{NW} gtf_puts_case("t da damn"); BEGIN(NIW);
d{WB}the/{NW} gtf_puts_case("d da damn"); BEGIN(NIW);
exp gtf_puts("'sp");
exs gtf_puts("'s");
er/{NW} gtf_puts("a'"); BEGIN(NIW);
inging/{NW} gtf_puts("ingin'"); BEGIN(NIW);
ing/{NW} gtf_puts("in'"); BEGIN(NIW);
or(r)? gtf_puts("o'");
ar(r)? gtf_puts("a'");
{NW} BEGIN(NIW); unput(yytext[0]);
}
{EOT} /* ignore trailing EOT character */
. gtf_echo();
%%
/*
*/
#ifdef LIBRARY_MODE
int gtf_filter_jive(const char *input, char *buf, size_t bufsz)
{
gtf_databuf_t buffer;
YY_BUFFER_STATE _yybuf;
gtf_strbuf_init(&buffer, buf, bufsz);
_yybuf = yy_scan_string(input);
yylex(&buffer);
yy_delete_buffer(_yybuf);
gtf_reset();
return(buffer.overflow);
}
int __gtf_filter_jive(const char *input, char *buf, size_t bufsz)
{
return(gtf_filter_jive(input, buf, bufsz));
}
#else
int main(int argc, char **argv)
{
gtf_parse_args();
gtf_random_seed();
yylex(NULL);
return(EXIT_SUCCESS);
}
#endif
/* end of source file */

202
jive.vcproj Executable file
View File

@ -0,0 +1,202 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="jive"
ProjectGUID="{74A2018C-C70A-4BD4-B17C-CDB79C665952}"
RootNamespace="jive"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="3"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
>
<File
RelativePath=".\common.c"
>
</File>
<File
RelativePath=".\getopt.c"
>
</File>
<File
RelativePath=".\getopt1.c"
>
</File>
<File
RelativePath=".\jive.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
>
<File
RelativePath=".\common.h"
>
</File>
<File
RelativePath=".\getopt.h"
>
</File>
<File
RelativePath=".\talkfilters.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

2009
kraut.c Executable file

File diff suppressed because it is too large Load Diff

150
kraut.l Executable file
View File

@ -0,0 +1,150 @@
/* GNU Talkfilters
Copyright (C) 1998-2003 Free Software Foundation, Inc.
This file is part of GNU Talkfilters
GNU Talkfilters is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2, or (at
your option) any later version.
This software is distributed in the hope that it will be amusing, 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 software; see the file COPYING. If not, write to the
Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
%option prefix="kraut_yy"
%option outfile="lex.yy.c"
%option noyywrap
%e 2000
%p 5000
%n 1000
%k 500
%a 4000
%o 2000
%{
#include "common.h"
#include "talkfilters.h"
#define YY_DECL int yylex(gtf_databuf_t *buf)
%}
BW [ \t]
EW [ \t.,;!?]
EOT \4
%%
\<(\/)?[A-Za-z][^\>]*\> gtf_echo(); // don't damage HTML tags
"Why " gtf_printf("Warum ");
"[Dd]amn" gtf_puts_case("verdammt");
"dammit" gtf_printf("Gott verdammt");
ing gtf_printf("inkt");
"Chev(y|rolet)" gtf_printf("Volkswagen");
" not " gtf_printf(" nicht ");
" not." gtf_printf("nicht.");
" not?" gtf_printf("nicht?");
" not!" gtf_printf("nicht!");
" the " gtf_printf(" ze ");
"The " gtf_printf("Ze ");
" with " gtf_printf(" mit ");
"With " gtf_printf("Mit ");
wr gtf_printf("w-r-r");
Wr gtf_printf("W-r-r");
R gtf_printf("R-r-r");
" r" gtf_printf(" r-r-r");
"Yes " gtf_printf("Jawohl ");
"Yes." gtf_printf("Jawohl.");
"Yes!" gtf_printf("Jawohl!");
"YES!" gtf_printf("JAWOHL!");
" yes " gtf_printf(" ja ");
" yes." gtf_printf(" ja.");
" yes!" gtf_printf(" ja!");
"No " gtf_printf("Nein ");
"No!" gtf_printf("Nein!");
"No?" gtf_printf("Nein?");
" no " gtf_printf(" nein ");
" no." gtf_printf(" nein.");
" no!" gtf_printf(" nein!");
" no?" gtf_printf(" nein?");
[Mm]"r." gtf_printf("Herr");
[Mm]"rs." gtf_printf("Frau");
Miss gtf_printf("Fraulein");
" of " gtf_printf(" uff ");
"Of " gtf_printf("Uff ");
[M]y gtf_puts_case("mein");
" and " gtf_printf(" und ");
"And " gtf_printf("Und ");
"One " gtf_printf("Ein ");
" one" gtf_printf(" ein");
"Is " gtf_printf("Ist ");
" is " gtf_printf(" ist ");
"ow " gtf_printf("ow ");
"w " gtf_printf("w ");
[Ss]h gtf_puts_case("sch");
[Cc]h gtf_puts_case("ch");
" c" gtf_printf(" k");
" C" gtf_printf(" K");
[Vv] gtf_puts_case("f");
" w" gtf_printf(" v");
W gtf_printf("V");
[Tt]his gtf_puts_case("das");
[Tt]h gtf_puts_case("d");
[Ww]illiam|[Bb]ill|[Bb]rad gtf_printf("Wilhelm");
[Gg]ary gtf_printf("Gerhardt");
[Jj]o(h)?n gtf_printf("Hans");
[Ss]mith gtf_printf("Schultz");
[a-f]"!" gtf_printf("%s Naturlich!", yytext);
[g-m]"!" gtf_printf("%s Scheisse!", yytext);
{EOT} /* ignore trailing EOT character */
. gtf_echo();
\n gtf_printf("\n");
%%
#ifdef LIBRARY_MODE
int gtf_filter_kraut(const char *input, char *buf, size_t bufsz)
{
gtf_databuf_t buffer;
YY_BUFFER_STATE _yybuf;
gtf_strbuf_init(&buffer, buf, bufsz);
_yybuf = yy_scan_string(input);
yylex(&buffer);
yy_delete_buffer(_yybuf);
gtf_reset();
return(buffer.overflow);
}
int __gtf_filter_kraut(const char *input, char *buf, size_t bufsz)
{
return(gtf_filter_kraut(input, buf, bufsz));
}
#else /* LIBRARY_MODE */
int main(int argc, char **argv)
{
gtf_parse_args();
yylex(NULL);
return(EXIT_SUCCESS);
}
#endif /* LIBRARY_MODE */
/* end of source file */

202
kraut.vcproj Executable file
View File

@ -0,0 +1,202 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="kraut"
ProjectGUID="{38E5F4FD-5440-4080-8261-7440CC5C7375}"
RootNamespace="kraut"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="3"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
>
<File
RelativePath=".\common.c"
>
</File>
<File
RelativePath=".\getopt.c"
>
</File>
<File
RelativePath=".\getopt1.c"
>
</File>
<File
RelativePath=".\kraut.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
>
<File
RelativePath=".\common.h"
>
</File>
<File
RelativePath=".\getopt.h"
>
</File>
<File
RelativePath=".\talkfilters.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

6930
ltmain.sh Executable file

File diff suppressed because it is too large Load Diff

336
missing Executable file
View File

@ -0,0 +1,336 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
# Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
run=:
# In the cases where this matters, `missing' is being run in the
# srcdir already.
if test -f configure.ac; then
configure_ac=configure.ac
else
configure_ac=configure.in
fi
case "$1" in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case "$1" in
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing 0.4 - GNU automake"
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
aclocal*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case "$f" in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
esac
done
touch $touch_files
;;
automake*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;;
autom4te)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is needed, and you do not seem to have it handy on your
system. You might have modified some files without having the
proper tools for further handling them.
You can get \`$1Help2man' as part of \`Autoconf' from any GNU
archive site."
file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo "#! /bin/sh"
echo "# Created by GNU Automake missing as a replacement of"
echo "# $ $@"
echo "exit 0"
chmod +x $file
exit 1
fi
;;
bison|yacc)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if [ ! -f y.tab.h ]; then
echo >y.tab.h
fi
if [ ! -f y.tab.c ]; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex|flex)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if [ ! -f lex.yy.c ]; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
fi
if [ -f "$file" ]; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit 1
fi
;;
makeinfo)
if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
# We have makeinfo, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
fi
touch $file
;;
tar)
shift
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
fi
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
# messages.
if (gnutar --version > /dev/null 2>&1); then
gnutar "$@" && exit 0
fi
if (gtar --version > /dev/null 2>&1); then
gtar "$@" && exit 0
fi
firstarg="$1"
if shift; then
case "$firstarg" in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
case "$firstarg" in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
;;
esac
fi
echo 1>&2 "\
WARNING: I can't seem to be able to run \`tar' with the given arguments.
You may want to install GNU tar or Free paxutils, or check the
command line arguments."
exit 1
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and you do not seem to have it handy on your
system. You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequirements for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0

32
mkinstalldirs Executable file
View File

@ -0,0 +1,32 @@
#!/bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Last modified: 1994-03-25
# Public domain
errstatus=0
for file in ${1+"$@"} ; do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
for d in ${1+"$@"} ; do
pathcomp="$pathcomp$d"
case "$pathcomp" in
-* ) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp" 1>&2
mkdir "$pathcomp" || errstatus=$?
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# mkinstalldirs ends here

1848
pansy.c Executable file

File diff suppressed because it is too large Load Diff

129
pansy.l Executable file
View File

@ -0,0 +1,129 @@
/* GNU Talkfilters
Copyright (C) 1998-2003 Free Software Foundation, Inc.
This file is part of GNU Talkfilters
GNU Talkfilters is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2, or (at
your option) any later version.
This software is distributed in the hope that it will be amusing, 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 software; see the file COPYING. If not, write to the
Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
%option prefix="pansy_yy"
%option outfile="lex.yy.c"
%option noyywrap
%e 2000
%p 6000
%n 1000
%k 500
%a 4000
%o 2000
BW [ \t]
EW [ \t.,;!?]
EOT \4
%{
#include "common.h"
#include "talkfilters.h"
#define YY_DECL int yylex(gtf_databuf_t *buf)
%}
%%
\<(\/)?[A-Za-z][^\>]*\> gtf_echo(); // don't damage HTML tags
"ise" gtf_puts("izthe");
" man " gtf_puts(" bitch ");
guy gtf_puts("babe");
woman gtf_puts("huthy");
girlfriend gtf_puts("thlut");
boyfriend gtf_puts("lover");
handsome gtf_puts("beautiful");
nice gtf_puts("wonderful");
great gtf_puts("fabuluth");
good gtf_puts("thplendid");
bad gtf_puts("nathty");
fag gtf_puts("queen");
faggot gtf_puts("piethe of wood");
"xch" gtf_puts("kthch");
"xc" gtf_puts("kth");
"es " gtf_puts("ezth ");
"sh" gtf_puts("sh");
"Sh" gtf_puts("Sh");
"ous" gtf_puts("uth");
S+ gtf_puts("Th");
s+ gtf_puts("th");
Z+ gtf_puts("Zth");
z+ gtf_puts("zth");
ce gtf_puts("the");
ci gtf_puts("thi");
cy gtf_puts("thy");
Cy gtf_puts("Thy");
Ce gtf_puts("The");
Ci gtf_puts("Thi");
x gtf_puts("kth");
!+ gtf_puts(". Mmmh, yeth!");
[a-e]"." gtf_printf("%s You know, honey?", yytext);
[f-j]"." gtf_printf("%s Like, ooh.", yytext);
[k-o]"." gtf_printf("%s Let me tell you...", yytext);
[p-t]"." gtf_printf("%s Mmmh.", yytext);
[u-z]"." gtf_printf("%s Fabuluth!", yytext);
{EOT} /* ignore trailing EOT character */
. gtf_echo();
\n gtf_echo();
%%
/*
*/
#ifdef LIBRARY_MODE
int gtf_filter_pansy(const char *input, char *buf, size_t bufsz)
{
gtf_databuf_t buffer;
YY_BUFFER_STATE _yybuf;
gtf_strbuf_init(&buffer, buf, bufsz);
_yybuf = yy_scan_string(input);
yylex(&buffer);
yy_delete_buffer(_yybuf);
gtf_reset();
return(buffer.overflow);
}
int __gtf_filter_pansy(const char *input, char *buf, size_t bufsz)
{
return(gtf_filter_pansy(input, buf, bufsz));
}
#else /* LIBRARY_MODE */
int main(int argc, char **argv)
{
gtf_parse_args();
yylex(NULL);
return(EXIT_SUCCESS);
}
#endif /* LIBRARY_MODE */
/* end of source file */

202
pansy.vcproj Executable file
View File

@ -0,0 +1,202 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="pansy"
ProjectGUID="{8B5CF214-2F60-4C22-B59D-0C75687B1921}"
RootNamespace="pansy"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="3"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
>
<File
RelativePath=".\common.c"
>
</File>
<File
RelativePath=".\getopt.c"
>
</File>
<File
RelativePath=".\getopt1.c"
>
</File>
<File
RelativePath=".\pansy.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
>
<File
RelativePath=".\common.h"
>
</File>
<File
RelativePath=".\getopt.h"
>
</File>
<File
RelativePath=".\talkfilters.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

2849
pirate.c Executable file

File diff suppressed because it is too large Load Diff

299
pirate.l Executable file
View File

@ -0,0 +1,299 @@
/* GNU Talkfilters
Copyright (C) 1998-2003 Free Software Foundation, Inc.
This file is part of GNU Talkfilters
GNU Talkfilters is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2, or (at
your option) any later version.
This software is distributed in the hope that it will be amusing, 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 software; see the file COPYING. If not, write to the
Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
%option prefix="pirate_yy"
%option outfile="lex.yy.c"
%option noyywrap
%option nowarn
%e 2000
%p 6000
%n 1000
%k 500
%a 4000
%o 2000
%{
#include "common.h"
#include "talkfilters.h"
#define YY_DECL int yylex(gtf_databuf_t *buf)
%}
WB [\n\t ]
WC [A-Za-z'0-9]
NW [^A-Za-z'0-9]
EOT \4
%s NIW INW
%%
<NIW,INITIAL>{
\<(\/)?[A-Za-z][^\>]*\> gtf_echo(); // don't damage HTML tags
[Tt]o./{NW} gtf_echo();
[Mm]y/{NW} gtf_puts_case("me");
([Bb]oss|[Mm]anager)/{NW} gtf_puts_case("admiral");
[Cc]aptain/{NW} gtf_puts_case("cap'n");
[Ff]riends|[Bb]uddies/{NW} gtf_puts_case("crew");
([Dd]elete|[Ee]rase|[Tt]hrow{WB}away)/{NW} gtf_puts_case("scuttle");
([Dd]eleted|[Ee]rased|[Tt]hr(ew|own){WB}away)/{NW} gtf_puts_case("scuttled");
[Mm]yself/{NW} gtf_puts_case("meself");
[Yy]our/{NW} gtf_puts_case("yer");
[Yy]ou/{NW} gtf_puts_case("ye");
[Ff]riend/{NW} gtf_puts_case("matey");
[Ff]riends/{NW} gtf_puts_case("maties");
[Cc]o(-)?worker/{NW} gtf_puts_case("shipmate");
[Cc]o(-)?workers/{NW} gtf_puts_case("shipmates");
[Pp]erson gtf_puts_case("landlubber");
[Pp]eople gtf_puts_case("landlubbers");
[Gg]uys/{NW} gtf_puts_case("scurvey dogs");
([Bb]efore|[Ee]arlier)/{NW} gtf_puts_case("afore");
[Oo]ld/{NW} gtf_puts_case("auld");
[Tt]he/{NW} gtf_puts_case("th'");
[Oo]f/{NW} gtf_puts_case("o'");
[Dd]o(n'|{WB}no)t/{NW} gtf_puts_case("dern't");
[Nn]ever gtf_puts_case("ne'er"); BEGIN(INW);
[Ee]ver/{NW} gtf_puts_case("e'er");
[Oo]ver gtf_puts_case("o'er"); BEGIN(INW);
[Yy](es|eah|up)/{NW} gtf_puts_case("aye");
[Nn](o|ah|ope)/{NW} gtf_puts_case("nay");
[Dd]on't{WB}know/{NW} gtf_puts_case("dinna");
[Hh]a(d|ve)n't/{NW} gtf_puts_case("ha'nae");
[Dd]idn't/{NW} gtf_puts_case("di'nae");
[Ww]asn't/{NW} gtf_puts_case("weren't");
[Ff]or gtf_puts_case("fer"); BEGIN(INW);
[Bb]etween/{NW} gtf_puts_case("betwixt");
[Aa]round/{NW} gtf_puts_case("aroun'");
[Tt]o gtf_puts_case("t'"); BEGIN(INW);
It's/{NW} gtf_puts("'Tis");
it's/{NW} gtf_puts("'tis");
([Ww]oman|[Ll]ady)/{NW} gtf_puts_case("wench");
[Ww]ife/{NW} gtf_puts_case("lady");
[Gg]irl/{NW} gtf_puts_case("lass");
[Gg]irls/{NW} gtf_puts_case("lassies");
[Gg]uy/{NW} |
[Mm]an/{NW} |
[Ff]ellow/{NW} |
[Dd]ude/{NW} gtf_puts_case("lubber");
[Bb]oy/{NW} gtf_puts_case("lad");
[Bb]oys/{NW} gtf_puts_case("laddies");
[Aa]m/{NW} gtf_puts_case("be");
[Aa]re/{NW} gtf_puts_case("be");
[Cc]hildren/{NW} gtf_puts_case("little sandcrabs");
[Kk]ids/{NW} gtf_puts_case("minnows");
[Hh]im/{NW} gtf_puts_case("that scurvey dog");
[Hh]er/{NW} gtf_puts_case("that comely wench");
[Hh]im\. gtf_puts_case("that drunken sailor.");
[Hh]er\. gtf_puts_case("that comely lass.");
[Hh]e/{NW} gtf_puts_case("that ornery cuss");
[Ss]he/{NW} gtf_puts_case("that winsome lass");
[Hh]e's/{NW} gtf_puts_case("he be");
[Ss]he's/{NW} gtf_puts_case("she be");
[Tt]hey're/{NW} gtf_puts_case("they be");
was/{NW} gtf_puts_case("were bein'");
[Hh](ey|i|ello)/{NW} gtf_puts_case("avast");
[Oo]cean/{NW} gtf_puts_case("high seas");
[Ff]ood/{NW} gtf_puts_case("chow");
[Rr]oad/{NW} gtf_puts_case("sea");
[Ff]reeway/{NW} gtf_puts_case("high seas");
[Rr]oads/{NW} gtf_puts_case("seas");
[Ss]treet/{NW} gtf_puts_case("river");
[Ss]treets/{NW} gtf_puts_case("rivers");
[Hh]ighway/{NW} gtf_puts_case("ocean");
[Hh]ighways/{NW} gtf_puts_case("oceans");
[Cc]ar/{NW} gtf_puts_case("boat");
[Cc]ars/{NW} gtf_puts_case("boats");
[Tt]ruck/{NW} gtf_puts_case("schooner");
[Tt]rucks/{NW} gtf_puts_case("schooners");
SUV/{NW} gtf_puts_case("ship");
([Aa]irplane|[Jj]et)/{NW} gtf_puts_case("flying machine");
[Mm]achine/{NW} gtf_puts_case("contraption");
[Dd]riving|[Tt]ravel(l)ing/{NW} gtf_puts_case("sailing");
[Ss]hit! |
[Dd]amn! gtf_puts_case("Arrrr!"); BEGIN(NIW);
[Aa]ss|[Bb]utt/{NW} gtf_puts_case("dungbie");
([Cc]heat|[Ff]raud)/{NW} gtf_puts_case("hornswaggle");
([Cc]heated|[Dd]efrauded)/{NW} gtf_puts_case("hornswaggled");
[Pp]irate/{NW} gtf_puts_case("buccaneer");
([Bb]eer|[Ww]ine|[Bb]ooze)/{NW} gtf_puts_case("grog");
[Bb]asement/{NW} gtf_puts_case("bilge");
[Pp]unish/{NW} gtf_puts_case("keel-haul");
[Pp]unished/{NW} gtf_puts_case("keel-hauled");
[Dd]ollar/{NW} gtf_puts_case("doubloon");
[Dd]ollars/{NW} gtf_puts_case("doubloons");
[Mm]oney/{NW} { switch(gtf_random(2))
{
case 0:
gtf_puts_case("gold");
break;
case 1:
gtf_puts_case("treasure");
break;
}
}
[Dd]rive|[Tt]ravel/{NW} gtf_puts_case("sail");
[Dd]rove|[Tt]ravel(l)ed/{NW} gtf_puts_case("sailed");
{WC} { BEGIN(INW); gtf_echo(); }
}
<INW>{
"!" { switch(gtf_random(10))
{
case 0:
gtf_puts("! Walk the plank!");
break;
case 1:
gtf_puts(", Arrrr!");
break;
case 2:
gtf_puts(", Yaaarrrr!");
break;
case 3:
gtf_puts(", and dinna spare the whip!");
break;
case 4:
gtf_puts("! Shiver me timbers!");
break;
case 5:
gtf_puts("! Fire the cannons!");
break;
case 6:
gtf_puts("! We'll keel-haul ye!");
break;
default:
gtf_echo();
}
BEGIN(NIW);
}
"," { switch(gtf_random(10))
{
case 0:
gtf_puts(", aye,");
break;
case 1:
gtf_puts(", I'll warrant ye,");
break;
case 2:
gtf_puts(", to be sure,");
break;
case 3:
gtf_puts(", arrrr,");
break;
case 4:
gtf_puts(", by Blackbeard's sword,");
break;
default:
gtf_echo();
}
BEGIN(NIW);
}
"." { switch(gtf_random(20))
{
case 0:
gtf_puts(", and a bottle of rum!");
break;
case 1:
gtf_puts(". And swab the deck!");
break;
case 2:
gtf_puts(", by Davy Jones's locker.");
break;
case 3:
gtf_puts(", ye scurvey dog.");
break;
case 4:
gtf_puts(", I'll warrant ye.");
break;
case 5:
gtf_puts(", arrrr.");
break;
case 6:
gtf_puts(", with a chest full a' booty.");
break;
case 7:
gtf_puts(". Pass the grog!");
break;
case 8:
gtf_puts(". Hoist the mainsail!");
break;
default:
gtf_echo();
}
BEGIN(NIW);
}
{NW} BEGIN(NIW); unput(yytext[0]);
}
{EOT} /* ignore trailing EOT character */
. gtf_echo();
%%
/*
*/
#ifdef LIBRARY_MODE
int gtf_filter_pirate(const char *input, char *buf, size_t bufsz)
{
gtf_databuf_t buffer;
YY_BUFFER_STATE _yybuf;
gtf_strbuf_init(&buffer, buf, bufsz);
_yybuf = yy_scan_string(input);
yylex(&buffer);
yy_delete_buffer(_yybuf);
gtf_reset();
return(buffer.overflow);
}
int __gtf_filter_pirate(const char *input, char *buf, size_t bufsz)
{
return(gtf_filter_pirate(input, buf, bufsz));
}
#else /* LIBRARY_MODE */
int main(int argc, char **argv)
{
gtf_parse_args();
gtf_random_seed();
yylex(NULL);
return(EXIT_SUCCESS);
}
#endif /* LIBRARY_MODE */
/* end of source file */

202
pirate.vcproj Executable file
View File

@ -0,0 +1,202 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="pirate"
ProjectGUID="{6FE67939-5755-4BCF-9FD8-39638F88600D}"
RootNamespace="pirate"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="3"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
>
<File
RelativePath=".\common.c"
>
</File>
<File
RelativePath=".\getopt.c"
>
</File>
<File
RelativePath=".\getopt1.c"
>
</File>
<File
RelativePath=".\pirate.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
>
<File
RelativePath=".\common.h"
>
</File>
<File
RelativePath=".\getopt.h"
>
</File>
<File
RelativePath=".\talkfilters.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

2184
postmodern.c Executable file

File diff suppressed because it is too large Load Diff

145
postmodern.l Executable file
View File

@ -0,0 +1,145 @@
/* GNU Talkfilters
Copyright (C) 1998-2003 Free Software Foundation, Inc.
This file is part of GNU Talkfilters
GNU Talkfilters is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2, or (at
your option) any later version.
This software is distributed in the hope that it will be amusing, 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 software; see the file COPYING. If not, write to the
Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
Postmodern feminazi talk
Postmodern "feminazi" type talk suitable for writing college papers for
various humanities type classes
*/
%option prefix="postmodern_yy"
%option outfile="lex.yy.c"
%option noyywrap
%a 3000
%e 3000
%p 5000
%n 3000
%{
#include "common.h"
#include "talkfilters.h"
#define YY_DECL int yylex(gtf_databuf_t *buf)
%}
WB [\n\t ]
WC [A-Za-z'0-9]
NW [^A-Za-z'0-9]
EOT \4
%%
\<(\/)?[A-Za-z][^\>]*\> gtf_echo(); // don't damage HTML tags
[Ww]e/{NW} gtf_puts_case("the dysfunctional group");
[Tt]hing/{NW} gtf_puts_case("phallic-symbol-like weapon");
[Hh]elp/{NW} gtf_puts_case("assault");
[Ss]ex/{NW} gtf_puts_case("rape");
[Ll]ove/{NW} gtf_puts_case("male domination");
[Mm]an/{NW} gtf_puts_case("the occuppying patriarch");
[Ii]t/{NW} gtf_puts_case("the semiotic object");
[Hh]im/{NW} gtf_puts_case("Foucault");
[Hh]er/{NW} gtf_puts_case("her postfeminist");
[Tt]hat/{NW} gtf_puts_case("that deconstructed");
[Nn]ew/{NW} gtf_puts_case("postmodern");
[Ss]elf/{NW} gtf_puts_case("inner child");
[Ii]n/{NW} gtf_puts_case("in the penetrated space of");
[Bb]lack/{NW} gtf_puts_case("postcolonialist");
[Ii]s/{NW} gtf_puts_case("is semiotically");
[Ww]as/{NW} gtf_puts_case("was semiotically");
[Ww]hite/{NW} gtf_puts_case("fascist ruling class");
[Aa]lways/{NW} gtf_puts_case("always control");
[Tt]hin/{NW} gtf_puts_case("think genderization");
[Nn]ever/{NW} gtf_puts_case("never empower");
[Ss]mall/{NW} gtf_puts_case("male-superior doctrine");
[Ll]arge/{NW} gtf_puts_case("nymphomanial");
[Gg]ood/{NW} gtf_puts_case("subliminated homosexuality type");
[Bb]ad/{NW} gtf_puts_case("absolutist");
[Ff]ree/{NW} gtf_puts_case("synergism");
[Gg]et/{NW} gtf_puts_case("acquire intersubjectivity");
[Ee]ven/{NW} gtf_puts_case("even Jean-Paul Sartre and");
[Ff]or/{NW} gtf_puts_case("for reevalution of Manichaeanism and");
[Ss]he/{NW} gtf_puts_case("Susan Faludi");
[Hh]e/{NW} gtf_puts_case("Ted Kennedy");
[Cc]ame/{NW} gtf_puts_case("subjugated");
[Ff]emale/{NW} gtf_puts_case("lesbian");
[Mm]ale/{NW} gtf_puts_case("paternalistic mutilator");
[Mm]oney/{NW} gtf_puts_case("power");
[Pp]ower/{NW} gtf_puts_case("mimetic process");
[Dd]aughter/{NW} gtf_puts_case("donna clitoridea");
[Ss]on/{NW} gtf_puts_case("chauvinistic male");
[Mm]y/{NW} gtf_puts_case("the objective");
[Ff]orm/{NW} gtf_puts_case("implicit lyrical form");
[Ss]tory/{NW} gtf_puts_case("mythos");
[Aa]pproach/{NW} gtf_puts_case("seduction-rape");
[Aa]sk/{NW} gtf_puts_case("empower");
[Hh]appy/{NW} gtf_puts_case("polarized");
[Ww]ords/{NW} gtf_puts_case("logos");
[Ww]ord/{NW} gtf_puts_case("logo");
[Oo]ld/{NW} gtf_puts_case("counter poetical");
[Mm]ade/{NW} gtf_puts_case("self-defined");
[Bb]elief/{NW} gtf_puts_case("penis envy");
[Ii]dea/{NW} gtf_puts_case("motif");
[Tt]hought/{NW} gtf_puts_case("formalised image of");
. gtf_echo();
\n gtf_echo();
{EOT} /* ignore trailing EOT character */
%%
#ifdef LIBRARY_MODE
int gtf_filter_postmodern(const char *input, char *buf, size_t bufsz)
{
gtf_databuf_t buffer;
YY_BUFFER_STATE _yybuf;
gtf_strbuf_init(&buffer, buf, bufsz);
_yybuf = yy_scan_string(input);
yylex(&buffer);
yy_delete_buffer(_yybuf);
gtf_reset();
return(buffer.overflow);
}
int __gtf_filter_postmodern(const char *input, char *buf, size_t bufsz)
{
return(gtf_filter_postmodern(input, buf, bufsz));
}
#else /* LIBRARY_MODE */
int main(int argc, char **argv)
{
gtf_parse_args();
yylex(NULL);
return(EXIT_SUCCESS);
}
#endif /* LIBRARY_MODE */
/* end of source file */

202
postmodern.vcproj Executable file
View File

@ -0,0 +1,202 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="postmodern"
ProjectGUID="{F8C57BD5-EFD3-4A0A-8C1E-03AF02555556}"
RootNamespace="postmodern"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="3"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
>
<File
RelativePath=".\common.c"
>
</File>
<File
RelativePath=".\getopt.c"
>
</File>
<File
RelativePath=".\getopt1.c"
>
</File>
<File
RelativePath=".\postmodern.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
>
<File
RelativePath=".\common.h"
>
</File>
<File
RelativePath=".\getopt.h"
>
</File>
<File
RelativePath=".\talkfilters.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

5111
redneck.c Executable file

File diff suppressed because it is too large Load Diff

420
redneck.l Executable file
View File

@ -0,0 +1,420 @@
/* GNU Talkfilters
Copyright (C) 1998-2003 Free Software Foundation, Inc.
This file is part of GNU Talkfilters
GNU Talkfilters is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2, or (at
your option) any later version.
This software is distributed in the hope that it will be amusing, 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 software; see the file COPYING. If not, write to the
Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* Written by Brand Hilton */
%option prefix="redneck_yy"
%option outfile="lex.yy.c"
%option noyywrap
%option nowarn
%e 10000
%p 25000
%n 4000
%k 1000
%a 8000
%o 4000
%{
#include "common.h"
#include "talkfilters.h"
#define YY_DECL int yylex(gtf_databuf_t *buf)
%}
WB [\n\t ]
WC [A-Za-z'0-9]
NW [^A-Za-z'0-9]
EOT \4
%s NIW INW
%%
<NIW,INITIAL>{
\<(\/)?[A-Za-z][^\>]*\> gtf_echo(); // don't damage HTML tags
[Gg]et{WB}your/{NW} gtf_puts_case("gitcher");
[Gg]et{WB}you/{NW} gtf_puts_case("gitcha");
[Ff]inger gtf_puts_case("finger"); BEGIN(INW);
[Ss]omething/{NW} gtf_puts_case("sump'm");
[Kk]issing/{NW} gtf_puts_case("swappin' slobber");
[Kk]iss/{NW} gtf_puts_case("swap slobber with");
[Kk]issed/{NW} gtf_puts_case("Swapped slobber with");
[Hh]appily/{NW} gtf_puts_case("happy");
[Rr]emember gtf_puts_case("'member"); BEGIN(INW);
[Rr]emind gtf_puts_case("'mind"); BEGIN(INW);
[Gg]raduat gtf_puts_case("gradjeeat"); BEGIN(INW);
[Oo]ther gtf_puts_case("uther"); BEGIN(INW);
[Ll]imousine gtf_puts_case("Chevy 4x4"); BEGIN(INW);
[Nn]ight gtf_puts_case("nite"); BEGIN(INW);
[Rr]ecognize gtf_puts_case("recunize"); BEGIN(INW);
[Bb]efore gtf_puts_case("afore"); BEGIN(INW);
[Ee]very gtf_puts_case("ever"); BEGIN(INW);
[Ii]nto/{NW} gtf_puts_case("inta");
[Ff]orget gtf_puts_case("fergit"); BEGIN(INW);
[Cc]ollege/{NW} gtf_puts_case("weldin' skool");
[Mm]arried/{NW} gtf_puts_case("hitched");
[Tt]hing gtf_puts_case("thang"); BEGIN(INW);
[Hh]uge/{NW} gtf_puts_case("big-ass");
[Aa]bout/{NW} gtf_puts_case("'bout");
[Cc]hildren/{NW} gtf_puts_case("young uns");
[Cc]hild/{NW} gtf_puts_case("young un");
[Ss]ip/{NW} gtf_puts_case("swaller");
[Ss]ips/{NW} gtf_puts_case("swallers");
[Dd]rink{WB}of/{NW} gtf_puts_case("swig uh");
[Dd]rinks{WB}of/{NW} gtf_puts_case("swigs uh");
[Dd]rink/{NW} gtf_puts_case("drank");
[Gg]lass/{NW} gtf_puts_case("can");
[Gg]lasses/{NW} gtf_puts_case("cans");
[Cc]hampaigne/{NW} gtf_puts_case("Budweiser");
[Ww]ine/{NW} gtf_puts_case("Coors");
[Tt]his/{NW} gtf_puts_case("this here");
[Tt]hose/{NW} gtf_puts_case("them");
[Tt]ook/{NW} gtf_puts_case("done took");
[Ww]ent/{NW} gtf_puts_case("done went");
[Ss]aw/{NW} gtf_puts_case("seen");
[Ee]nter gtf_puts_case("inner"); BEGIN(INW);
[Ii]nter gtf_puts_case("inner"); BEGIN(INW);
Inter gtf_puts_case("Inner");
them/{NW} gtf_puts_case("'em");
[Ss]hit/{NW} gtf_puts_case("sheeeiit");
[Ll]ovely/{NW} |
[Pp]retty/{NW} |
[Bb]eautiful/{NW} |
[Hh]andsome/{NW} gtf_puts_case("purty");
most{WB}beautiful/{NW} gtf_puts_case("purtiest");
[Tt]oo{WB}forward/{NW} gtf_puts_case("too horny");
[Hh]ello/{NW} gtf_puts_case("hey there");
[Hh]ouse/{NW} gtf_puts_case("trailer");
[Nn]eighborhood gtf_puts_case("trailer park"); BEGIN(INW);
[Pp]arty/{NW} gtf_puts_case("hoe-down");
[Pp]arties/{NW} gtf_puts_case("hoe-downs");
[Tt]ime gtf_puts_case("tahm"); BEGIN(INW);
[Mm]exican gtf_puts_case("Mescun"); BEGIN(INW);
[Ii]talian gtf_puts_case("Eye-talian"); BEGIN(INW);
[Bb]lack{WB}(man|guy)/{NW} |
[Nn]egro/{NW} gtf_puts_case("nigger");
[Bb]lack{WB}(men|guys)/{NW} |
[Bb]lacks/{NW} |
[Nn]egroes/{NW} |
[Aa]frican{WB}Americans gtf_puts_case("niggers");
[Aa]sian/{NW} gtf_puts_case("Slant-eye");
so{WB}that/{NW} gtf_puts_case("so'sn");
[Nn]o{WB}one{WB}ever/{NW} gtf_puts_case("Ain't nobody never");
No{WB}one/{NW} gtf_puts_case("Ain't nobody");
Nobody{WB}ever/{NW} gtf_puts_case("Ain't nobody never");
[Ss]ome/{NW} gtf_puts_case("sum");
[Tt]hink gtf_puts_case("thank"); BEGIN(INW);
met{WB}you/{NW} gtf_puts_case("laid eyes own yuh"); BEGIN(INW);
[Bb]roken/{NW} gtf_puts_case("busted");
[Mm]odem gtf_puts_case("modem doodad"); BEGIN(INW);
[Tt]he/{NW} gtf_puts_case("thuh");
[Aa]nd/{NW} gtf_puts_case("An'");
[Ee]lse/{NW} gtf_echo();
([Bb]oy|[Mm]an)/{NW} gtf_puts_case("feller");
[Mm]en/{NW} gtf_puts_case("fellers");
([Ww]oman|[Gg]irl)/{NW} gtf_puts_case("girlie");
[Ll]ie{WB}down/{NW} gtf_puts_case("lay down");
[Ss]ure/{NW} gtf_puts_case("shure");
[Gg]et gtf_puts_case("git"); BEGIN(INW);
[Ww]ile/{NW} gtf_puts_case("whahl");
[Gg]oing/{NW} gtf_puts_case("goin'");
[Gg]ot{WB}to/{NW} gtf_puts_case("gotta");
[Ss]hoe/{NW} gtf_puts_case("boot");
[Ss]hout gtf_puts_case("holler"); BEGIN(INW);
[Cc]uple{WB}of/{NW} gtf_puts_case("coupl'a");
[Ff]ond{WB}of/{NW} gtf_puts_case("sweet on");
[Cc]ome{WB}on/{NW} gtf_puts_case("c'moan ");
[Cc]ome{WB}over/{NW} gtf_puts_case("c'moan over");
[Cc]ome{WB}here/{NW} gtf_puts_case("c'mere");
[Cc]ar/{NW} gtf_puts_case("pickem-up truck");
[Cc]ars/{NW} gtf_puts_case("pickem-up trucks");
[Dd]riven/{NW} gtf_puts_case("done drove");
[Rr]idden/{NW} gtf_puts_case("done rode");
[Ee]at/{NW} gtf_puts_case("chow down on");
[Cc]omputer gtf_puts_case("'pyooter doomajigger"); BEGIN(INW);
[Dd]atabase gtf_puts_case("database doohickey"); BEGIN(INW);
[Kk]n(ew|own)/{NW} gtf_puts_case("knowed");
[Bb]ecause/{NW} gtf_puts_case("'cuz");
[Mm]ore{WB}than/{NW} gtf_puts_case("more'n");
[Yy]oung gtf_puts_case("young"); BEGIN(INW);
[Yy]our/{NW} gtf_puts_case("yer");
[Yy]ours gtf_puts_case("yores"); BEGIN(INW);
[Yy]ou/{NW} gtf_puts_case("yew");
[Pp]olice/{NW} gtf_puts_case("sher'ff");
[Kk]ind{WB}of/{NW} gtf_puts_case("kinda");
[Dd]ead/{NW} gtf_puts_case("deader'n a door nail");
[Vv]ery/{NW} gtf_puts_case("real");
[Qq]uite{WB}a{WB}(bit|few)/{NW} gtf_puts_case("a helluva lot");
[Qq]uite{WB}a/{NW} gtf_puts_case("one helluva");
[Qq]uite/{NW} gtf_puts_case("real");
[Nn]ice/{NW} gtf_puts_case("right nice");
[Mm]o(ther|m) gtf_puts_case("momma"); BEGIN(INW);
[Ff]ather|[Dd]ad gtf_puts_case("daddy"); BEGIN(INW);
[Ee]xclaim gtf_puts_case("yelp"); BEGIN(INW);
[Oo]h(,)?{WB}yes! gtf_puts_case("You betcha!");
[Pp]umpkin gtf_puts_case("punkin"); BEGIN(INW);
[Ff]orgotten/{NW} gtf_puts_case("fergot");
[Ff]amily/{NW} gtf_puts_case("fambly");
[Pp]articular gtf_puts_case("puhticlur"); BEGIN(INW);
[Pp]robably/{NW} gtf_puts_case("prob'ly");
[Aa]round/{NW} gtf_puts_case("aroun'");
[Ss]urprised/{NW} gtf_puts_case("s'prized");
[Cc]ontinue gtf_puts_case("continya"); BEGIN(INW);
[Aa]gain/{NW} gtf_puts_case("agin");
[Ll]ogically/{NW} gtf_puts_case("logik'ly");
[Ll]ogical/{NW} gtf_puts_case("logik'l");
[Mm]yself/{NW} gtf_puts_case("muhsef");
[Dd]istributed/{NW} gtf_puts_case("duhstribuhted");
[Dd]istributor/{NW} gtf_puts_case("duhstribuhter");
[Dd]istribute/{NW} gtf_puts_case("duhstribbit");
[Ss]econd gtf_puts_case("secint"); BEGIN(INW);
[Pp]erfect/{NW} gtf_puts_case("Purfik");
[Tt]entative gtf_puts_case("tennative"); BEGIN(INW);
[Mm]aintenance/{NW} gtf_puts_case("maint'nance");
[Ee]nough/{NW} gtf_puts_case("enuff");
[Bb]etween/{NW} gtf_puts_case("'atween");
[Tt]omorrow/{NW} gtf_puts_case("tomorry");
[Ss]unday/{NW} gtf_puts_case("Sundy");
[Mm]onday/{NW} gtf_puts_case("Mondy");
[Tt]uesday/{NW} gtf_puts_case("Tuesdy");
[Ww]ednesday/{NW} gtf_puts_case("Winsdy");
[Tt]hursday/{NW} gtf_puts_case("Thursdy");
[Ff]riday/{NW} gtf_puts_case("Fridy");
[Ss]aturday/{NW} gtf_puts_case("Saturdy");
[Aa]ny/{NW} gtf_puts_case("inny");
[Ff]act gtf_puts_case("fac'"); BEGIN(INW);
[Aa]sk gtf_puts_case("ass"); BEGIN(INW);
[Ll]et{WB}me/{NW} gtf_puts_case("lemme");
[Jj]ust/{NW} gtf_puts_case("jus'");
[Pp]eople|[Gg]uys/{NW} gtf_puts_case("folks");
[Bb]elieve/{NW} gtf_puts_case("reckon");
[Pp]erhaps/{NW} gtf_puts_case("maybe");
[Ww]ife/{NW} gtf_puts_case("ol' lady");
[Oo]f/{NW} gtf_puts_case("uh");
[Oo]f{WB}a/{NW} gtf_puts_case("uv a");
[Ww]hat{WB}you/{NW} gtf_puts_case("whutcha");
[Ww]hat/{NW} gtf_puts_case("whut");
[Dd]istraught/{NW} gtf_puts_case("confused as hayll");
[Ii]n{WB}love{WB}with/{NW} gtf_puts_case("real sweet on");
[Ll]ove gtf_puts_case("luv"); BEGIN(INW);
[Ww]ant{WB}to/{NW} gtf_puts_case("wonna");
[Bb]ig/{NW} gtf_puts_case("big-ass");
[Bb]ad/{NW} gtf_puts_case("bad-ass");
[Ss]mall/{NW} gtf_puts_case("li'l bitty");
[Ss]ort{WB}of/{NW} gtf_puts_case("sorta");
[Tt]o/{NW} gtf_puts_case("tuh");
[Hh]imself/{NW} gtf_puts_case("hisself");
[Bb]eat|[Ww]hip gtf_puts_case("whup"); BEGIN(INW);
[Ff]rom/{NW} gtf_puts_case("frum");
[Yy]ears/{NW} gtf_puts_case("yeers");
Jack/{NW} gtf_puts_case("Billy Jack"); BEGIN(INW);
Robert/{NW} |
Bob(by)?/{NW} gtf_puts_case("Jethro");
Mar[ck]/{NW} gtf_puts_case("Billy Bob");
Jim(my)?/{NW} |
James/{NW} gtf_puts_case("Jim Bob");
Jo(h)?n(ny)?/{NW} gtf_puts_case("Joe Bob");
Paul/{NW} gtf_puts_case("Billy Joe");
Bill(ly)?/{NW} |
Will(ie|iam|y)?/{NW} gtf_puts_case("Bubba");
Dav(e|id)/{NW} gtf_puts_case("Bobby Joe");
Jo(e|seph)/{NW} gtf_puts_case("Billy Joe");
Mi(ke|chael)/{NW} gtf_puts_case("Dwayne");
Br[iy]an/{NW} gtf_puts_case("Jimmy Dean");
Brad/{NW} gtf_puts_case("Jimmy Joe");
Stev[a-z]*/{NW} gtf_puts_case("Billy Wayne");
Ron[a-z]*/{NW} gtf_puts_case("Jimmy Jack");
Kris[a-z]*/{NW} gtf_puts_case("Minnie Mae");
Mary/{NW} gtf_puts_case("Mary Lou");
Jane/{NW} gtf_puts_case("Peggy Sue");
L[iy]nda/{NW} gtf_puts_case("Ellie Mae");
Su(s|z)an[a-z]*/{NW} gtf_puts_case("Mary Jo");
Jenn(y|i[a-z]*)/{NW} gtf_puts_case("Jenny Mae");
Kim[a-z]*/{NW} gtf_puts_case("Thelma Lou");
[CK]ath[a-z]*/{NW} gtf_puts_case("Reba Jewel");
Deb[a-z]*/{NW} gtf_puts_case("Betty Jo");
C[iy]n(d|th)[a-z]* gtf_puts_case("Velma Sue");
[Tt]alk{WB}to/{NW} gtf_puts_case("tawk at");
[Tt]alk gtf_puts_case("tawk"); BEGIN(INW);
[Ff]riend gtf_puts_case("frien'"); BEGIN(INW);
[Rr]ushed/{NW} gtf_puts_case("hightailed it");
[Ww]and/{NW} gtf_puts_case("banjo");
[Cc]an({WB}no|')t/{NW} gtf_puts_case("cain't");
[Uu]nder gtf_puts_case("unner"); BEGIN(INW);
[Mm]y/{NW} gtf_puts_case("muh");
I/{NW} gtf_puts_case("Ah");
[Ff]or/{NW} gtf_puts_case("fer");
[Cc]ould{WB}have/{NW} gtf_puts_case("could'a");
[Cc]ould({WB}no|n')t{WB}have/{NW} gtf_puts_case("couldn'a");
[Cc]ould({WB}no|n')t/{NW} gtf_puts_case("couldn'");
[Ss]hould({WB}ha|')ve/{NW} gtf_puts_case("should'a");
[Ss]hould({WB}no|n')t/{NW} gtf_puts_case("shouldn'");
[Ss]hould({WB}no|n')t{WB}have/{NW} gtf_puts_case("shouldn'a");
[Ss]hould({WB}no|n')t{WB}have{WB}to/{NW} gtf_puts_case("shouldn' hafta");
[Mm]ight{WB}have/{NW} gtf_puts_case("might'a");
[Mm]ight({WB}no|n')t{WB}have/{NW} gtf_puts_case("might not'a");
[Mm]ight({WB}no|n')t{WB}have{WB}to/{NW} gtf_puts_case("mightn' hafta");
[Ww]ould{WB}have/{NW} gtf_puts_case("would'a");
[Ww]ould({WB}no|n')t/{NW} gtf_puts_case("wouldn'");
[Ww]ould({WB}no|n')t{WB}have/{NW} gtf_puts_case("wouldn'a");
[Dd]id({WB}no|n')t/{NW} gtf_puts_case("didn'");
[Ww](ill{WB}no|on')t gtf_puts_case("ain't gunna");
[Ii]t{WB}will/{NW} gtf_puts_case("it'll");
[Hh]ave{WB}to/{NW} gtf_puts_case("hafta");
[Ii]t{WB}(would|had)/{NW} gtf_puts_case("it'd");
[Ii]t{WB}would{WB}have/{NW} gtf_puts_case("it'da");
[Ii]t{WB}would({WB}no|n')t/{NW} gtf_puts_case("it wouldn'");
[Ii]t{WB}was({WB}no|n')t/{NW} gtf_puts_case("'tweren't");
[Ww]e{WB}will/{NW} gtf_puts_case("we'll");
[Ww]e{WB}would/{NW} gtf_puts_case("we'd");
[Ww]e{WB}would{WB}have/{NW} gtf_puts_case("we'da");
[Ww]e{WB}wouldn't/{NW} gtf_puts_case("we wouldn'");
[Ww]e{WB}(had|would)/{NW} gtf_puts_case("we'd");
[Ww]e{WB}are/{NW} gtf_puts_case("we're");
[Tt]hat{WB}will/{NW} gtf_puts_case("that'll");
[Hh]aven't/{NW} gtf_puts_case("ain't");
[Tt]hat{WB}would({WB}|no|n')t/{NW} gtf_puts_case("that wouldn'");
[Tt]hat{WB}would{WB}have/{NW} gtf_puts_case("that'da");
[Tt]hat{WB}would{WB}have{WB}to/{NW} gtf_puts_case("that'd hafta");
[Tt]hat{WB}(had|would)/{NW} gtf_puts_case("that'd");
[Tt]hat{WB}are/{NW} gtf_puts_case("that're");
[Tt]hey{WB}(would|had)/{NW} gtf_puts_case("they'd");
[Tt]hey{WB}are/{NW} gtf_puts_case("they're");
[Tt]hey{WB}will/{NW} gtf_puts_case("they'll");
[Tt]hey{WB}would{WB}have/{NW} gtf_puts_case("they'da");
[Tt]hey{WB}would{WB}have{WB}to/{NW} gtf_puts_case("they'd hafta");
[Tt]hey{WB}wouldn't/{NW} gtf_puts_case("they wouldn'");
[Hh]e{WB}will/{NW} gtf_puts_case("he'll");
[Hh]e{WB}would/{NW} gtf_puts_case("he'd");
[Hh]e{WB}wouldn't/{NW} gtf_puts_case("he wouldn'");
[Hh]e{WB}would{WB}have/{NW} gtf_puts_case("he'da");
[Hh]e{WB}would{WB}have{WB}to/{NW} gtf_puts_case("he'd hafta");
[Hh]e{WB}(has|is)/{NW} gtf_puts_case("he's");
[Ii]{WB}will/{NW} gtf_puts_case("Ah'll");
[Ii]{WB}would/{NW} |
[Ii]{WB}had/{NW} gtf_puts_case("Ah'd");
[Ii]{WB}wouldn't/{NW} gtf_puts_case("Ah wouldn'");
[Ii]{WB}would{WB}have/{NW} gtf_puts_case("Ah'da");
[Ii]{WB}would{WB}have{WB}to/{NW} gtf_puts_case("Ah'd hafta");
[Tt]here{WB}are/{NW} gtf_puts_case("there's");
[Aa]m{WB}not/{NW} |
([Ii]s|[Aa]re)({WB}no|n')t/{NW} gtf_puts_case("ain't");
(is|are){WB}no/{NW} gtf_puts_case("ain't no");
I({WB}a|')m/{NW} gtf_puts_case("Ah'm");
I({WB}a|')m{WB}not/{NW} gtf_puts_case("Ah ain't");
[Ww]ho{WB}are/{NW} gtf_puts_case("who're");
[Ww]ho{WB}are({WB}no|n')t/{NW} gtf_puts_case("who ain't");
[Dd]oes({WB}no|n')t/{NW} gtf_puts_case("don't");
[Yy]ou{WB}will/{NW} gtf_puts_case("yew'll");
[Yy]ou{WB}would/{NW} gtf_puts_case("yew'd");
[Yy]ou({WB}a|')re/{NW} gtf_puts_case("yer");
[Hh]ave{WB}to/{NW} gtf_puts_case("gotta");
[Hh]ave{WB}been/{NW} gtf_puts_case("been");
[Yy]ou{WB}have/{NW} gtf_puts_case("yew've");
[Cc]an/{NW} gtf_puts_case("Kin");
[Dd]anc gtf_puts_case("dainc"); BEGIN(INW);
[Dd]oes/{NW} gtf_puts_case("duz"); BEGIN(INW);
[Ww]as({WB}no|n')t/{NW} gtf_puts_case("wad'n");
[Ww](as|ere)/{NW} gtf_puts_case("wuz");
[Ss]he{WB}and{WB}I/{NW} gtf_puts_case("me an' her");
[Hh]e{WB}and{WB}I/{NW} gtf_puts_case("me an' him");
and{WB}I/{NW} gtf_puts("an' me");
[Ii]f/{NW} gtf_puts_case("if'n");
[Ii]/{NW} gtf_puts_case("Ah");
E[sx]p gtf_puts_case("'Sp"); BEGIN(INW);
e[sx]p gtf_puts_case("'sp"); BEGIN(INW);
Ex[cs]? gtf_puts_case("'S"); BEGIN(INW);
ex[cs]? gtf_puts_case("'s"); BEGIN(INW);
{WC} { BEGIN(INW); gtf_echo(); }
}
<INW>{
stion/{NW} gtf_puts("schun"); BEGIN(NIW);
tion/{NW} gtf_puts("shun"); BEGIN(NIW);
ctual/{NW} gtf_puts("ckshul"); BEGIN(NIW);
ntual/{NW} gtf_puts("nchul"); BEGIN(NIW);
cious/{NW} gtf_puts("shus"); BEGIN(NIW);
ring/{NW} gtf_puts("rang"); BEGIN(NIW);
ing/{NW} gtf_puts("in'"); BEGIN(NIW);
nm gtf_puts("m");
[f]"." gtf_printf("%s *scratch, scratch*", yytext); BEGIN(NIW);
[i-j]"." gtf_printf("%s *snort*", yytext); BEGIN(NIW);
[m]"." gtf_printf("%s *burp*", yytext); BEGIN(NIW);
[q-r]"." gtf_printf("%s KnowwhutImean?", yytext); BEGIN(NIW);
[y-z]"." gtf_printf("%s *spit*", yytext); BEGIN(NIW);
'(s|re){WB}not/{NW} gtf_puts(" ain't"); BEGIN(NIW);
og/{NW} gtf_puts_case("awg"); BEGIN(NIW);
e[sx]p gtf_puts_case("'sp");
ex[cs]? gtf_puts_case("'s");
{NW} BEGIN(NIW); unput(yytext[0]);
}
{EOT} /* ignore trailing EOT character */
. gtf_echo();
%%
#ifdef LIBRARY_MODE
int gtf_filter_redneck(const char *input, char *buf, size_t bufsz)
{
gtf_databuf_t buffer;
YY_BUFFER_STATE _yybuf;
gtf_strbuf_init(&buffer, buf, bufsz);
_yybuf = yy_scan_string(input);
yylex(&buffer);
yy_delete_buffer(_yybuf);
gtf_reset();
return(buffer.overflow);
}
int __gtf_filter_redneck(const char *input, char *buf, size_t bufsz)
{
return(gtf_filter_redneck(input, buf, bufsz));
}
#else /* LIBRARY_MODE */
int main(int argc, char **argv)
{
gtf_parse_args();
yylex(NULL);
return(EXIT_SUCCESS);
}
#endif /* LIBRARY_MODE */
/* end of source file */

202
redneck.vcproj Executable file
View File

@ -0,0 +1,202 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="redneck"
ProjectGUID="{50A4205C-CFAB-401C-8F07-F5AE697709C8}"
RootNamespace="redneck"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="3"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
>
<File
RelativePath=".\common.c"
>
</File>
<File
RelativePath=".\getopt.c"
>
</File>
<File
RelativePath=".\getopt1.c"
>
</File>
<File
RelativePath=".\redneck.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
>
<File
RelativePath=".\common.h"
>
</File>
<File
RelativePath=".\getopt.h"
>
</File>
<File
RelativePath=".\talkfilters.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

132
talkfilters.c Executable file
View File

@ -0,0 +1,132 @@
/* GNU Talkfilters
Copyright (C) 1998-2003 Free Software Foundation, Inc.
This file is part of GNU Talkfilters
GNU Talkfilters is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2, or (at
your option) any later version.
This software is distributed in the hope that it will be amusing, 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 software; see the file COPYING. If not, write to the
Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stddef.h>
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include "talkfilters.h"
#ifdef WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
#ifdef _MSC_VER
#pragma warning (disable: 4996)
#define strcasecmp stricmp
#endif
static const char *__gtf_version = "GNU Talkfilters v2.3.7";
extern int __gtf_filter_austro(const char *, char *, size_t);
extern int __gtf_filter_b1ff(const char *, char *, size_t);
extern int __gtf_filter_brooklyn(const char *, char *, size_t);
extern int __gtf_filter_chef(const char *, char *, size_t);
extern int __gtf_filter_cockney(const char *, char *, size_t);
extern int __gtf_filter_drawl(const char *, char *, size_t);
extern int __gtf_filter_dubya(const char *, char *, size_t);
extern int __gtf_filter_fudd(const char *, char *, size_t);
extern int __gtf_filter_funetak(const char *, char *, size_t);
extern int __gtf_filter_jethro(const char *, char *, size_t);
extern int __gtf_filter_jive(const char *, char *, size_t);
extern int __gtf_filter_kraut(const char *, char *, size_t);
extern int __gtf_filter_pansy(const char *, char *, size_t);
extern int __gtf_filter_pirate(const char *, char *, size_t);
extern int __gtf_filter_postmodern(const char *, char *, size_t);
extern int __gtf_filter_redneck(const char *, char *, size_t);
extern int __gtf_filter_valspeak(const char *, char *, size_t);
extern int __gtf_filter_warez(const char *, char *, size_t);
static gtf_filter_t __gtf_filters[] =
{
{ "austro", "Austro", __gtf_filter_austro },
{ "b1ff", "B1FF", __gtf_filter_b1ff },
{ "brooklyn", "Brooklyn", __gtf_filter_brooklyn },
{ "chef", "Swedish Chef", __gtf_filter_chef },
{ "cockney", "London Cockney", __gtf_filter_cockney },
{ "drawl", "Southern Drawl", __gtf_filter_drawl },
{ "dubya", "George Dubya", __gtf_filter_dubya },
{ "fudd", "Elmer Fudd", __gtf_filter_fudd },
{ "funetak", "Funetak", __gtf_filter_funetak },
{ "jethro", "Jethro", __gtf_filter_jethro },
{ "jive", "Jive", __gtf_filter_jive },
{ "kraut", "Kraut", __gtf_filter_kraut },
{ "pansy", "Pansy", __gtf_filter_pansy },
{ "pirate", "Pirate", __gtf_filter_pirate },
{ "postmodern", "Postmodernist", __gtf_filter_postmodern },
{ "redneck", "Redneck", __gtf_filter_redneck },
{ "valspeak", "Valley Speak", __gtf_filter_valspeak },
{ "warez", "Warez (H4x0r)", __gtf_filter_warez },
};
static int __gtf_filter_count = sizeof(__gtf_filters) / sizeof(gtf_filter_t);
/*
*/
#ifdef WIN32
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
return(TRUE);
}
#endif
/*
*/
int gtf_filter_count(void)
{
return(__gtf_filter_count);
}
/*
*/
const gtf_filter_t *gtf_filter_list(void)
{
return(__gtf_filters);
}
/*
*/
const gtf_filter_t *gtf_filter_lookup(const char *name)
{
int i;
gtf_filter_t *f;
for(i = 0, f = __gtf_filters; i < __gtf_filter_count; i++, f++)
{
if(!strcasecmp(f->name, name))
return(f);
}
return(NULL);
}
/* end of source file */

117
talkfilters.h Executable file
View File

@ -0,0 +1,117 @@
/* GNU Talkfilters
Copyright (C) 1998-2003 Free Software Foundation, Inc.
This file is part of GNU Talkfilters
GNU Talkfilters is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2, or (at
your option) any later version.
This software is distributed in the hope that it will be amusing, 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 software; see the file COPYING. If not, write to the
Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __gnu_talkfilters_h
#define __gnu_talkfilters_h
#include <sys/types.h>
// DLL kludges
#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
#if defined(TALKFILTERS_EXPORTS)
#define TALKFILTERS_API __declspec(dllexport)
#else // ! TALKFILTERS_EXPORTS
#define TALKFILTERS_API __declspec(dllimport)
#endif // TALKFILTERS_EXPORTS
#else // ! WIN32
#define TALKFILTERS_API
#endif // WIN32
#ifdef __cplusplus
extern "C" {
#endif
// filter lookup interface
typedef struct
{
char *name;
char *desc;
int (*filter)(const char *, char *, size_t);
} gtf_filter_t;
extern TALKFILTERS_API int gtf_filter_count(void);
extern TALKFILTERS_API const gtf_filter_t *gtf_filter_list(void);
extern TALKFILTERS_API const gtf_filter_t *gtf_filter_lookup(const char *name);
// individual filters
extern TALKFILTERS_API int gtf_filter_austro(const char *input, char *buf,
size_t bufsz);
extern TALKFILTERS_API int gtf_filter_b1ff(const char *input, char *buf,
size_t bufsz);
extern TALKFILTERS_API int gtf_filter_brooklyn(const char *input, char *buf,
size_t bufsz);
extern TALKFILTERS_API int gtf_filter_chef(const char *input, char *buf,
size_t bufsz);
extern TALKFILTERS_API int gtf_filter_cockney(const char *input, char *buf,
size_t bufsz);
extern TALKFILTERS_API int gtf_filter_drawl(const char *input, char *buf,
size_t bufsz);
extern TALKFILTERS_API int gtf_filter_dubya(const char *input, char *buf,
size_t bufsz);
extern TALKFILTERS_API int gtf_filter_fudd(const char *input, char *buf,
size_t bufsz);
extern TALKFILTERS_API int gtf_filter_funetak(const char *input, char *buf,
size_t bufsz);
extern TALKFILTERS_API int gtf_filter_jethro(const char *input, char *buf,
size_t bufsz);
extern TALKFILTERS_API int gtf_filter_jive(const char *input, char *buf,
size_t bufsz);
extern TALKFILTERS_API int gtf_filter_kraut(const char *input, char *buf,
size_t bufsz);
extern TALKFILTERS_API int gtf_filter_pansy(const char *input, char *buf,
size_t bufsz);
extern TALKFILTERS_API int gtf_filter_pirate(const char *input, char *buf,
size_t bufsz);
extern TALKFILTERS_API int gtf_filter_postmodern(const char *input, char *buf,
size_t bufsz);
extern TALKFILTERS_API int gtf_filter_redneck(const char *input, char *buf,
size_t bufsz);
extern TALKFILTERS_API int gtf_filter_valspeak(const char *input, char *buf,
size_t bufsz);
extern TALKFILTERS_API int gtf_filter_warez(const char *input, char *buf,
size_t bufsz);
#ifdef __cplusplus
};
#endif
#endif /* __gnu_talkfilters_h */

890
talkfilters.info Executable file
View File

@ -0,0 +1,890 @@
This is talkfilters.info, produced by makeinfo version 4.8 from
talkfilters.texi.

File: talkfilters.info, Node: Top, Next: Introduction, Up: (dir)
talkfilters
***********
* Menu:
* Introduction::
* The Filters::
* The Talkfilters Library::
* Writing New Filters::
* Credits::
* Software License::
* Type and Function Index::

File: talkfilters.info, Node: Introduction, Next: The Filters, Prev: Top, Up: Top
1 Introduction
**************
The GNU Talk Filters are filter programs that convert English text into
text that mimics a stereotyped or otherwise humorous type of speech.
This package is not an original work but rather a collection and
integration of existing filter programs that were written by various
people and that have been in the public domain for many years. For a
list of authors, see *Note Credits::.
The filters are provided in both executable and library form. See
*Note The Filters:: for synopses of the programs, and *Note The
Talkfilters Library:: for a description of the library API.
Since the filters do word and substring substitution on the text they
process, any word-wrap formatting of the original text will not be
preserved in the output. The included `wrap' filter program may be used
to reformat the output of the other filters to fit within a specified
number of columns.
Some of these filters contain vulgarity, and thus are not appropriate
for all audiences. If you find something offensive in one or more of
these filters, please do not flame the maintainer of this package or the
original authors, or request that the filter(s) in question be censored
or removed; requests of this type will be summarily ignored.
These filters are not guaranteed to be idempotent across all inputs;
that is, repeated applications of a given filter on an input may cause
the output to differ each time. Moreover, some of the filters use
randomization techniques so a given input is not guaranteed to produce
the same output across invocations.
The `flex' lexer (or any other lexer program, for that matter) is not
required to build and use this package. However, `flex' is required to
rebuild the filters if the `.l' source files are changed.
These filters are provided for amusement only. No racial or societal
slurs are intended nor should be inferred.

File: talkfilters.info, Node: The Filters, Next: The Talkfilters Library, Prev: Introduction, Up: Top
2 The Filters
*************
The filters provided in this package are enumerated below. This chapter
describes the synopses for the individual filter programs; for a
description of the library API, see *Note The Talkfilters Library::.
`austro' Austrian (Ahhhhnold)
`b1ff' B1FF of USENET yore
`brooklyn' Brooklyn accent
`chef' Swedish Chef (from The Muppet Show)
`cockney' Londoner accent
`drawl' Southern drawl
`dubya' George "Dubya" Bush
`fudd' Elmer Fudd (from the Looney Tunes cartoons)
`funetak' Thick Asian accent
`jethro' Jethro from The Beverly Hillbillies
`jive' 1970's Jive
`kraut' German accent
`pansy' Effeminate male
`pirate' Pirate talk
`postmodern' Postmodernist talk ("Feminazi")
`redneck' Country redneck
`valspeak' Valley talk
`warez' H4x0r code
`wrap' Word-wrap filter
The filter programs read from standard input and write to standard
output. They all recognize the following switches:
`--version'
Print version information and exit.
`--help'
Print usage information and exit.
The `wrap' filter program additionally recognizes the following
switch:
`-w width'
Specify the maximum number of columns width that the text may
span. The minimum value of width is 10.
An example usage might be:
man ls | jive | wrap -w 78 | less

File: talkfilters.info, Node: The Talkfilters Library, Next: Writing New Filters, Prev: The Filters, Up: Top
3 The Talkfilters Library
*************************
All of the filters in the GNU Talk Filters are available collectively as
a C library which can be linked with other programs to provide embedded
text filtering support. While the individual filter programs filter from
standard input to standard output, the filtering functions in the
library operate on in-memory buffers instead.
This chapter describes the API to the Talkfilters library. All of the
functions and types described below are declared in the header file
`talkfilters.h'.
-- Function: int gtf_filter_count (void)
This function returns the number of filters in the library.
-- Function: gtf_filter_t * gtf_filter_list (void)
This function returns a pointer to an array of gtf_filter_t
structures which contain information about each of the filters in
the library, including the filter's symbolic name, a brief
description of the filter that is suitable for display purposes,
and a pointer to the filter function.
The following C program illustrates the use of `gtf_filter_count()'
and `gtf_filter_list()' to display information about each filter in the
library and invoke the filter on some test input:
#include <stdio.h>
#include <talkfilters.h>
int main(void)
{
int ct, i;
const gtf_filter_t *filters, *fp;
const char *inbuf = "This is a test.";
char outbuf[1024];
ct = gtf_filter_count();
printf("There are %d filters available.\n", ct);
filters = gtf_filter_list();
for(i = 0, fp = filters; i < ct; i++, fp++)
{
printf("filter #%d: %s - %s\n", i + 1, fp->name, fp->desc);
fp->filter(inbuf, outbuf, sizeof(outbuf));
puts(outbuf);
}
exit(0);
}
The type gtf_filter_t is a structure which contains the following
members:
`char *name'
The symbolic name of the filter.
`char *desc'
A brief description of the filter.
`int (*filter)(const char *, char *, size_t)'
The filter function.
-- Function: gtf_filter_t * gtf_filter_lookup (const char *NAME)
This is a lookup function for locating a specific filter. The
function searches for the filter with the symbolic name NAME, and
returns a pointer to the gtf_filter_t structure for that filter.
If a filter with the given name is not found, the function returns
`NULL'.
-- Function: int gtf_filter_austro (const char *INPUT, char *BUF,
size_t BUFSZ)
-- Function: int gtf_filter_b1ff (const char *INPUT, char *BUF,
size_t BUFSZ)
-- Function: int gtf_filter_brooklyn (const char *INPUT, char *BUF,
size_t BUFSZ)
-- Function: int gtf_filter_chef (const char *INPUT, char *BUF,
size_t BUFSZ)
-- Function: int gtf_filter_cockney (const char *INPUT, char *BUF,
size_t BUFSZ)
-- Function: int gtf_filter_drawl (const char *INPUT, char *BUF,
size_t BUFSZ)
-- Function: int gtf_filter_dubya (const char *INPUT, char *BUF,
size_t BUFSZ)
-- Function: int gtf_filter_fudd (const char *INPUT, char *BUF,
size_t BUFSZ)
-- Function: int gtf_filter_funetak (const char *INPUT, char *BUF,
size_t BUFSZ)
-- Function: int gtf_filter_jethro (const char *INPUT, char *BUF,
size_t BUFSZ)
-- Function: int gtf_filter_jive (const char *INPUT, char *BUF,
size_t BUFSZ)
-- Function: int gtf_filter_kraut (const char *INPUT, char *BUF,
size_t BUFSZ)
-- Function: int gtf_filter_pansy (const char *INPUT, char *BUF,
size_t BUFSZ)
-- Function: int gtf_filter_pirate (const char *INPUT, char *BUF,
size_t BUFSZ)
-- Function: int gtf_filter_postmodern (const char *INPUT, char *BUF,
size_t BUFSZ)
-- Function: int gtf_filter_redneck (const char *INPUT, char *BUF,
size_t BUFSZ)
-- Function: int gtf_filter_valspeak (const char *INPUT, char *BUF,
size_t BUFSZ)
-- Function: int gtf_filter_warez (const char *INPUT, char *BUF,
size_t BUFSZ)
These functions invoke the corresponding filters on the input
buffer INPUT, which must be a NUL-terminated string. At most BUFSZ
- 1 bytes of output are written to the buffer BUF. The output is
unconditionally NUL-terminated, but the text itself may be
truncated if the buffer is too small to accommodate all of the
output.
The functions return 0 on success, or 1 if a buffer overflow
occurred (signifying that the output was truncated).
Note that lexical scanners generated by `flex' are not reentrant,
so no assumptions should be made about the reentrancy of the above
functions. When this library is used in a multithreaded
environment, calls to these functions should be protected by mutex
locks.

File: talkfilters.info, Node: Writing New Filters, Next: Credits, Prev: The Talkfilters Library, Up: Top
4 Writing New Filters
*********************
Writing new filters and adding them to the library is fairly
straightforward, but certain conventions must be observed to ensure that
the filters will work properly both as standalone programs and as
library functions. The internal header file `common.h' declares some
utility functions and macros that should be used to ensure proper
behavior.
-- Macro: gtf_parse_args ()
A filter's `main()' function should make a call to this macro to
process the command line arguments. Currently, only the standard
`--help' and `--version' switches are recognized. A call to this
macro should typically be the first statement in `main()'.
-- Macro: gtf_random_seed ()
Filters which make calls to the `gtf_random()' macro (described
below), should make a call to this macro (preferably in `main()')
to seed the random number generator. This macro seeds the random
number sequence with a bitwise OR of the current system time and
the PID of the calling process.
-- Macro: gtf_random (range)
This macro returns a random integer in the range [0, RANGE).
-- Macro: gtf_printf (format, ...)
-- Macro: gtf_putc (char)
-- Macro: gtf_puts (string)
Filters must be able to function both as standalone programs and as
library functions, so the stdio library functions cannot be used to
write output. Instead, these macros should be used in place of the
stdio library functions `printf()', `putchar()', and `puts()',
respectively. When a filter is compiled to run as an executable,
these macros simply evaluate to calls to the stdio functions they
replace; when it is compiled into the library, they evaluate to
calls to internal library functions which write to a data buffer.
-- Macro: gtf_puts_case (string)
This macro is a specialized form of `gtf_puts()' which ensures that
the case of the first character in STRING matches that of the
first character in the currently matched token. For example, if
`yytext' is "Hello", calling `gtf_puts_case()' with either "howdy"
or "Howdy" as an argument will write the string "Howdy", whereas
if `yytext' is "hello", the string written will be "howdy".
-- Macro: gtf_unput_last ()
This macro "unputs" the last character of the current token. In
other words, the last character of `yytext' will be returned back
to the input stream, so that it will be the next character read by
the lexical scanner.
-- Function: void gtf_strbuf_init (gtf_databuf_t *SBUF, char *BUF,
size_t BUFSZ)
This function initializes the gtf_databuf_t structure at SBUF to
point to the buffer BUF, which is BUFSZ bytes in length; these
values specify the buffer to which the `gtf_printf()',
`gtf_putc()', `gtf_puts()', and `gtf_puts_case()' macros will
ultimately write their output when the filter is called through the
library API. The gtf_databuf_t structure contains an integer field
named `overflow' which will contain the value 1 after the call to
`yylex()' if a buffer overflow occurred during filtering; otherwise
it will contain the value 0.
-- Macro: gtf_reset ()
This macro should be called after the call to `yylex()' within the
filter API function in order to reset the state of the lexical
scanner in preparation for the next call.
The following example shows the C code that implements both the
library interface and the `main()' function for the `chef' filter.
#ifdef LIBRARY_MODE
int gtf_filter_chef(const char *input, char *buf, size_t bufsz)
{
gtf_databuf_t buffer;
YY_BUFFER_STATE _yybuf;
gtf_strbuf_init(&buffer, buf, bufsz);
_yybuf = yy_scan_string(input);
yylex(&buffer);
yy_delete_buffer(_yybuf);
gtf_reset();
return(buffer.overflow);
}
#else /* LIBRARY_MODE */
int main(int argc, char **argv)
{
gtf_parse_args();
yylex(NULL);
exit(EXIT_SUCCESS);
}
#endif /* LIBRARY_MODE */
Each filter lex file must have an introductory fragment similar to
the following:
%option prefix="chef_yy"
%option outfile="lex.yy.c"
%option noyywrap
%{
#include "common.h"
#define YY_DECL int yylex(gtf_databuf_t *buf)
%}
The `prefix' option specifies a prefix for the names of the
functions generated for this filter; the function names for each filter
must be unique so that multiple filters can coexist within the library.
The `outfile' option reverses an undesirable side effect of the
`prefix' option, which is to name the generated C source file based on
the prefix; this breaks `ylwrap' (an Automake helper program), which
expects the output file to be named `lex.yy.c'.
The `noyywrap' option specifies that no `yywrap()' function is
needed.
The macro `YY_DECL' is defined to specify that the `yylex()'
function takes a single argument, a pointer to the gtf_databuf_t
structure described above. When `yylex()' is called from `main()', no
output buffer is needed since text is written to standard output, so in
that case, it is called with a `NULL' pointer as the argument. This
function can be declared to accept additional arguments, but the BUF
argument must be present.
The file `talkfilters.c' contains a filter registry in the form of
an array of structures. Entries should be added therein for new
filters. Appropriate `extern' declarations of the API functions for new
filters should also be added to `talkfilters.h'.

File: talkfilters.info, Node: Credits, Next: Software License, Prev: Writing New Filters, Up: Top
5 Credits
*********
While all of these filters have been available in one form or another in
the public domain for many years, the original authors of some of the
filters are unknown. Reasonable attempts were made to find the authors
and obtain written permission to repackage the filters as GNU software,
but in some cases they could not be located.
The following table lists the known authors and contributors.
`austro' Tom van Nes
`b1ff' Matt Welsh, David Whitten
`brooklyn' Daniel V Klein (`nyc.l')
`chef' John Hagerman
`cockney' Stephen K Mulrine, Edward Betts (`ken.l'); unknown
(`cockney.l'); extensive enhancements by Samuel Stoddard
`drawl' Adam Hudd
`dubya' anonymous contribution
`fudd' unknown
`funetak' Eclipse Enterprises
`jethro' Duane Paulson
`jive' Daniel V Klein, Clement Cole, with enhancements by Samuel
Stoddard
`kraut' unknown
`pansy' unknown
`pirate' Original Perl/PHP version by Dougal Campbell, with
enhancements by Mark Lindner
`postmodern' unknown
`redneck' Brand Hilton
`valspeak' unknown
`warez' Ian Johnston, with enhancements by Mark Lindner
`wrap' Mark Lindner
The filters were repackaged, integrated, optimized, and documented by
Mark Lindner (<markl@gnu.org>).

File: talkfilters.info, Node: Software License, Next: Type and Function Index, Prev: Credits, Up: Top
6 Software License
******************
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it in
new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software,
and (2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains a
notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program",
below, refers to any such program or work, and a "work based on
the Program" means either the Program or any derivative work under
copyright law: that is to say, a work containing the Program or a
portion of it, either verbatim or with modifications and/or
translated into another language. (Hereinafter, translation is
included without limitation in the term "modification".) Each
licensee is addressed as "you".
Activities other than copying, distribution and modification are
not covered by this License; they are outside its scope. The act
of running the Program is not restricted, and the output from the
Program is covered only if its contents constitute a work based on
the Program (independent of having been made by running the
Program). Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any
warranty; and give any other recipients of the Program a copy of
this License along with the Program.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange
for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a. You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b. You must cause any work that you distribute or publish, that
in whole or in part contains or is derived from the Program
or any part thereof, to be licensed as a whole at no charge
to all third parties under the terms of this License.
c. If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display
an announcement including an appropriate copyright notice and
a notice that there is no warranty (or else, saying that you
provide a warranty) and that users may redistribute the
program under these conditions, and telling the user how to
view a copy of this License. (Exception: if the Program
itself is interactive but does not normally print such an
announcement, your work based on the Program is not required
to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the
Program, and can be reasonably considered independent and separate
works in themselves, then this License, and its terms, do not
apply to those sections when you distribute them as separate
works. But when you distribute the same sections as part of a
whole which is a work based on the Program, the distribution of
the whole must be on the terms of this License, whose permissions
for other licensees extend to the entire whole, and thus to each
and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or
contest your rights to work written entirely by you; rather, the
intent is to exercise the right to control the distribution of
derivative or collective works based on the Program.
In addition, mere aggregation of another work not based on the
Program with the Program (or with a work based on the Program) on
a volume of a storage or distribution medium does not bring the
other work under the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms
of Sections 1 and 2 above provided that you also do one of the
following:
a. Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of
Sections 1 and 2 above on a medium customarily used for
software interchange; or,
b. Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange; or,
c. Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with
such an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete
source code means all the source code for all modules it contains,
plus any associated interface definition files, plus the scripts
used to control compilation and installation of the executable.
However, as a special exception, the source code distributed need
not include anything that is normally distributed (in either
source or binary form) with the major components (compiler,
kernel, and so on) of the operating system on which the executable
runs, unless that component itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this
License. However, parties who have received copies, or rights,
from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify
or distribute the Program or its derivative works. These actions
are prohibited by law if you do not accept this License.
Therefore, by modifying or distributing the Program (or any work
based on the Program), you indicate your acceptance of this
License to do so, and all its terms and conditions for copying,
distributing or modifying the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program
subject to these terms and conditions. You may not impose any
further restrictions on the recipients' exercise of the rights
granted herein. You are not responsible for enforcing compliance
by third parties to this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent
issues), conditions are imposed on you (whether by court order,
agreement or otherwise) that contradict the conditions of this
License, they do not excuse you from the conditions of this
License. If you cannot distribute so as to satisfy simultaneously
your obligations under this License and any other pertinent
obligations, then as a consequence you may not distribute the
Program at all. For example, if a patent license would not permit
royalty-free redistribution of the Program by all those who
receive copies directly or indirectly through you, then the only
way you could satisfy both it and this License would be to refrain
entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable
under any particular circumstance, the balance of the section is
intended to apply and the section as a whole is intended to apply
in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of
any such claims; this section has the sole purpose of protecting
the integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is
willing to distribute software through any other system and a
licensee cannot impose that choice.
This section is intended to make thoroughly clear what is believed
to be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces,
the original copyright holder who places the Program under this
License may add an explicit geographical distribution limitation
excluding those countries, so that distribution is permitted only
in or among countries not thus excluded. In such case, this
License incorporates the limitation as if written in the body of
this License.
9. The Free Software Foundation may publish revised and/or new
versions of the General Public License from time to time. Such
new versions will be similar in spirit to the present version, but
may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies a version number of this License which applies
to it and "any later version", you have the option of following
the terms and conditions either of that version or of any later
version published by the Free Software Foundation. If the Program
does not specify a version number of this License, you may choose
any version ever published by the Free Software Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the
author to ask for permission. For software which is copyrighted
by the Free Software Foundation, write to the Free Software
Foundation; we sometimes make exceptions for this. Our decision
will be guided by the two goals of preserving the free status of
all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE
LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT
NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE
QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
SERVICING, REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE
LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU
OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY
OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
=======================================================
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these
terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES.
Copyright (C) YYYY NAME OF AUTHOR
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
Also add information on how to contact you by electronic and paper
mail.
If the program is interactive, make it output a short notice like
this when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19YY NAME OF AUTHOR
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type
`show w'. This is free software, and you are welcome to redistribute
it under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show
the appropriate parts of the General Public License. Of course, the
commands you use may be called something other than `show w' and
`show c'; they could even be mouse-clicks or menu items---whatever
suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a ``copyright disclaimer'' for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
program `Gnomovision' (which makes passes at compilers) written
by James Hacker.
SIGNATURE OF TY COON, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications
with the library. If this is what you want to do, use the GNU Library
General Public License instead of this License.

File: talkfilters.info, Node: Type and Function Index, Prev: Software License, Up: Top
Type and Function Index
***********************
[index]
* Menu:
* gtf_databuf_t: Writing New Filters. (line 63)
* gtf_filter_t: The Talkfilters Library.
(line 56)
[index]
* Menu:
* gtf_filter_austro: The Talkfilters Library.
(line 78)
* gtf_filter_b1ff: The Talkfilters Library.
(line 80)
* gtf_filter_brooklyn: The Talkfilters Library.
(line 82)
* gtf_filter_chef: The Talkfilters Library.
(line 84)
* gtf_filter_cockney: The Talkfilters Library.
(line 86)
* gtf_filter_count: The Talkfilters Library.
(line 17)
* gtf_filter_drawl: The Talkfilters Library.
(line 88)
* gtf_filter_dubya: The Talkfilters Library.
(line 90)
* gtf_filter_fudd: The Talkfilters Library.
(line 92)
* gtf_filter_funetak: The Talkfilters Library.
(line 94)
* gtf_filter_jethro: The Talkfilters Library.
(line 96)
* gtf_filter_jive: The Talkfilters Library.
(line 98)
* gtf_filter_kraut: The Talkfilters Library.
(line 100)
* gtf_filter_list: The Talkfilters Library.
(line 21)
* gtf_filter_lookup: The Talkfilters Library.
(line 69)
* gtf_filter_pansy: The Talkfilters Library.
(line 102)
* gtf_filter_pirate: The Talkfilters Library.
(line 104)
* gtf_filter_postmodern: The Talkfilters Library.
(line 106)
* gtf_filter_redneck: The Talkfilters Library.
(line 108)
* gtf_filter_valspeak: The Talkfilters Library.
(line 110)
* gtf_filter_warez: The Talkfilters Library.
(line 112)
* gtf_parse_args: Writing New Filters. (line 14)
* gtf_printf: Writing New Filters. (line 33)
* gtf_putc: Writing New Filters. (line 34)
* gtf_puts: Writing New Filters. (line 35)
* gtf_puts_case: Writing New Filters. (line 46)
* gtf_random: Writing New Filters. (line 29)
* gtf_random_seed: Writing New Filters. (line 21)
* gtf_reset: Writing New Filters. (line 75)
* gtf_strbuf_init: Writing New Filters. (line 63)
* gtf_unput_last: Writing New Filters. (line 55)

Tag Table:
Node: Top83
Node: Introduction335
Node: The Filters2319
Node: The Talkfilters Library3836
Node: Writing New Filters8775
Node: Credits14502
Node: Software License15978
Node: Type and Function Index35381

End Tag Table

80
talkfilters.man Executable file
View File

@ -0,0 +1,80 @@
.TH talkfilters 6 "8 Dec 2003" "Version 2.3"
.SH NAME
b1ff, brooklyn, chef, cockney, drawl, fudd, funetak, jethro, jive, kraut,
pansy, pirate, postmodern, redneck, valspeak, warez
\- GNU talk filters
.SH SYNOPSIS
\fIfilter\fP [\fB--version --help\fP]
.LP
.SH DESCRIPTION
.PP
The GNU Talkfilters are filter programs that convert ordinary English
text into text that mimics a stereotyped or otherwise humorous
dialect. Each program reads from standard input and writes to standard
output.
Since the filters do word and substring substitution on the text they
process, any word-wrap formatting of the original text will not be
preserved. Use the \fBwrap\fP filter to word-wrap the output of a talk
filter.
.TP
.B austro
Austrian accent (Ahhhnold)
.TP
.B b1ff
B1FF of USENET yore
.TP
.B brooklyn
Brooklyn accent
.TP
.B chef
Swedish Chef (from The Muppet Show)
.TP
.B cockney
Londoner accent
.TP
.B drawl
Southern drawl
.TP
.B dubya
George "Dubya" Bush
.TP
.B fudd
Elmer Fudd (from the Looney Tunes cartoons)
.TP
.B funetak
Thick Asian accent
.TP
.B jethro
Jethro from The Beverly Hillbillies
.TP
.B jive
1970s Jive
.TP
.B kraut
German accent
.TP
.B pansy
Effeminate male
.TP
.B pirate
Pirate talk
.TP
.B postmodern
Postmodernist talk ("Feminazi")
.TP
.B redneck
Country redneck
.TP
.B valspeak
Valley talk
.TP
.B warez
H4x0r code
.SH SEE ALSO
.BR wrap (1),
.BR less (1)
.SH AUTHORS
Edward Betts, Clement Cole, John Hagerman, Brand Hilton, Adam Hudd,
Ian Johnston, Daniel V. Klein, Mark Lindner, Stephen K. Mulrine, Duane
Paulson, Samuel Stoddard, Matt Welsh, David Whitten, et al.

14
talkfilters.pc.in Executable file
View File

@ -0,0 +1,14 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: talkfilters
Description: GNU Talk Filters
Version: @VERSION@
URL: http://www.hyperrealm.com/main.php?s=talkfilters
Requires:
Conflicts:
Libs: -L${libdir} -ltalkfilters
Libs.private: @LIBS@
Cflags: -I${includedir}

134
talkfilters.sln Executable file
View File

@ -0,0 +1,134 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual C++ Express 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "talkfilters", "talkfilters.vcproj", "{69F5DCE7-F24F-4BF5-ADB4-3EEE05A1E0B0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jive", "jive.vcproj", "{74A2018C-C70A-4BD4-B17C-CDB79C665952}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "valspeak", "valspeak.vcproj", "{4691AAF2-B8E7-43B1-B14E-C46C369939FF}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "warez", "warez.vcproj", "{69FB15FC-F7E4-45AD-AEED-8668CFAB7E9B}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "kraut", "kraut.vcproj", "{38E5F4FD-5440-4080-8261-7440CC5C7375}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "austro", "austro.vcproj", "{C793F479-D373-4984-9170-ACB1604CCAC3}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "b1ff", "b1ff.vcproj", "{D876F3A7-D38D-4ADC-8E2A-927C88363FEA}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "brooklyn", "brooklyn.vcproj", "{A02DACFE-8B71-4BCB-AE8B-381AC81C9F10}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "chef", "chef.vcproj", "{742D6591-9D39-4513-AF8D-6CB47B13C6C3}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cockney", "cockney.vcproj", "{3289D467-6173-49B4-9E7E-8098D959BBDA}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "drawl", "drawl.vcproj", "{2B81129D-CB20-4276-9300-29347A1AA220}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dubya", "dubya.vcproj", "{7CBCB0BE-8144-47CA-B697-3AA92A8BDE1E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fudd", "fudd.vcproj", "{FC23ECAB-295A-4BFD-B67A-97D25BA1BC47}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "funetak", "funetak.vcproj", "{C5A1161E-4A3F-4433-B595-A192BD851AB4}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jethro", "jethro.vcproj", "{C5BF6F5B-14CD-41D2-B870-7CC4586D5C41}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pansy", "pansy.vcproj", "{8B5CF214-2F60-4C22-B59D-0C75687B1921}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pirate", "pirate.vcproj", "{6FE67939-5755-4BCF-9FD8-39638F88600D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "postmodern", "postmodern.vcproj", "{F8C57BD5-EFD3-4A0A-8C1E-03AF02555556}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "redneck", "redneck.vcproj", "{50A4205C-CFAB-401C-8F07-F5AE697709C8}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wrap", "wrap.vcproj", "{D8F7C19C-80C3-4518-B9C3-D534AC26BAC8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{69F5DCE7-F24F-4BF5-ADB4-3EEE05A1E0B0}.Debug|Win32.ActiveCfg = Debug|Win32
{69F5DCE7-F24F-4BF5-ADB4-3EEE05A1E0B0}.Debug|Win32.Build.0 = Debug|Win32
{69F5DCE7-F24F-4BF5-ADB4-3EEE05A1E0B0}.Release|Win32.ActiveCfg = Release|Win32
{69F5DCE7-F24F-4BF5-ADB4-3EEE05A1E0B0}.Release|Win32.Build.0 = Release|Win32
{74A2018C-C70A-4BD4-B17C-CDB79C665952}.Debug|Win32.ActiveCfg = Debug|Win32
{74A2018C-C70A-4BD4-B17C-CDB79C665952}.Debug|Win32.Build.0 = Debug|Win32
{74A2018C-C70A-4BD4-B17C-CDB79C665952}.Release|Win32.ActiveCfg = Release|Win32
{74A2018C-C70A-4BD4-B17C-CDB79C665952}.Release|Win32.Build.0 = Release|Win32
{4691AAF2-B8E7-43B1-B14E-C46C369939FF}.Debug|Win32.ActiveCfg = Debug|Win32
{4691AAF2-B8E7-43B1-B14E-C46C369939FF}.Debug|Win32.Build.0 = Debug|Win32
{4691AAF2-B8E7-43B1-B14E-C46C369939FF}.Release|Win32.ActiveCfg = Release|Win32
{4691AAF2-B8E7-43B1-B14E-C46C369939FF}.Release|Win32.Build.0 = Release|Win32
{69FB15FC-F7E4-45AD-AEED-8668CFAB7E9B}.Debug|Win32.ActiveCfg = Debug|Win32
{69FB15FC-F7E4-45AD-AEED-8668CFAB7E9B}.Debug|Win32.Build.0 = Debug|Win32
{69FB15FC-F7E4-45AD-AEED-8668CFAB7E9B}.Release|Win32.ActiveCfg = Release|Win32
{69FB15FC-F7E4-45AD-AEED-8668CFAB7E9B}.Release|Win32.Build.0 = Release|Win32
{38E5F4FD-5440-4080-8261-7440CC5C7375}.Debug|Win32.ActiveCfg = Debug|Win32
{38E5F4FD-5440-4080-8261-7440CC5C7375}.Debug|Win32.Build.0 = Debug|Win32
{38E5F4FD-5440-4080-8261-7440CC5C7375}.Release|Win32.ActiveCfg = Release|Win32
{38E5F4FD-5440-4080-8261-7440CC5C7375}.Release|Win32.Build.0 = Release|Win32
{C793F479-D373-4984-9170-ACB1604CCAC3}.Debug|Win32.ActiveCfg = Debug|Win32
{C793F479-D373-4984-9170-ACB1604CCAC3}.Debug|Win32.Build.0 = Debug|Win32
{C793F479-D373-4984-9170-ACB1604CCAC3}.Release|Win32.ActiveCfg = Release|Win32
{C793F479-D373-4984-9170-ACB1604CCAC3}.Release|Win32.Build.0 = Release|Win32
{D876F3A7-D38D-4ADC-8E2A-927C88363FEA}.Debug|Win32.ActiveCfg = Debug|Win32
{D876F3A7-D38D-4ADC-8E2A-927C88363FEA}.Debug|Win32.Build.0 = Debug|Win32
{D876F3A7-D38D-4ADC-8E2A-927C88363FEA}.Release|Win32.ActiveCfg = Release|Win32
{D876F3A7-D38D-4ADC-8E2A-927C88363FEA}.Release|Win32.Build.0 = Release|Win32
{A02DACFE-8B71-4BCB-AE8B-381AC81C9F10}.Debug|Win32.ActiveCfg = Debug|Win32
{A02DACFE-8B71-4BCB-AE8B-381AC81C9F10}.Debug|Win32.Build.0 = Debug|Win32
{A02DACFE-8B71-4BCB-AE8B-381AC81C9F10}.Release|Win32.ActiveCfg = Release|Win32
{A02DACFE-8B71-4BCB-AE8B-381AC81C9F10}.Release|Win32.Build.0 = Release|Win32
{742D6591-9D39-4513-AF8D-6CB47B13C6C3}.Debug|Win32.ActiveCfg = Debug|Win32
{742D6591-9D39-4513-AF8D-6CB47B13C6C3}.Debug|Win32.Build.0 = Debug|Win32
{742D6591-9D39-4513-AF8D-6CB47B13C6C3}.Release|Win32.ActiveCfg = Release|Win32
{742D6591-9D39-4513-AF8D-6CB47B13C6C3}.Release|Win32.Build.0 = Release|Win32
{3289D467-6173-49B4-9E7E-8098D959BBDA}.Debug|Win32.ActiveCfg = Debug|Win32
{3289D467-6173-49B4-9E7E-8098D959BBDA}.Debug|Win32.Build.0 = Debug|Win32
{3289D467-6173-49B4-9E7E-8098D959BBDA}.Release|Win32.ActiveCfg = Release|Win32
{3289D467-6173-49B4-9E7E-8098D959BBDA}.Release|Win32.Build.0 = Release|Win32
{2B81129D-CB20-4276-9300-29347A1AA220}.Debug|Win32.ActiveCfg = Debug|Win32
{2B81129D-CB20-4276-9300-29347A1AA220}.Debug|Win32.Build.0 = Debug|Win32
{2B81129D-CB20-4276-9300-29347A1AA220}.Release|Win32.ActiveCfg = Release|Win32
{2B81129D-CB20-4276-9300-29347A1AA220}.Release|Win32.Build.0 = Release|Win32
{7CBCB0BE-8144-47CA-B697-3AA92A8BDE1E}.Debug|Win32.ActiveCfg = Debug|Win32
{7CBCB0BE-8144-47CA-B697-3AA92A8BDE1E}.Debug|Win32.Build.0 = Debug|Win32
{7CBCB0BE-8144-47CA-B697-3AA92A8BDE1E}.Release|Win32.ActiveCfg = Release|Win32
{7CBCB0BE-8144-47CA-B697-3AA92A8BDE1E}.Release|Win32.Build.0 = Release|Win32
{FC23ECAB-295A-4BFD-B67A-97D25BA1BC47}.Debug|Win32.ActiveCfg = Debug|Win32
{FC23ECAB-295A-4BFD-B67A-97D25BA1BC47}.Debug|Win32.Build.0 = Debug|Win32
{FC23ECAB-295A-4BFD-B67A-97D25BA1BC47}.Release|Win32.ActiveCfg = Release|Win32
{FC23ECAB-295A-4BFD-B67A-97D25BA1BC47}.Release|Win32.Build.0 = Release|Win32
{C5A1161E-4A3F-4433-B595-A192BD851AB4}.Debug|Win32.ActiveCfg = Debug|Win32
{C5A1161E-4A3F-4433-B595-A192BD851AB4}.Debug|Win32.Build.0 = Debug|Win32
{C5A1161E-4A3F-4433-B595-A192BD851AB4}.Release|Win32.ActiveCfg = Release|Win32
{C5A1161E-4A3F-4433-B595-A192BD851AB4}.Release|Win32.Build.0 = Release|Win32
{C5BF6F5B-14CD-41D2-B870-7CC4586D5C41}.Debug|Win32.ActiveCfg = Debug|Win32
{C5BF6F5B-14CD-41D2-B870-7CC4586D5C41}.Debug|Win32.Build.0 = Debug|Win32
{C5BF6F5B-14CD-41D2-B870-7CC4586D5C41}.Release|Win32.ActiveCfg = Release|Win32
{C5BF6F5B-14CD-41D2-B870-7CC4586D5C41}.Release|Win32.Build.0 = Release|Win32
{8B5CF214-2F60-4C22-B59D-0C75687B1921}.Debug|Win32.ActiveCfg = Debug|Win32
{8B5CF214-2F60-4C22-B59D-0C75687B1921}.Debug|Win32.Build.0 = Debug|Win32
{8B5CF214-2F60-4C22-B59D-0C75687B1921}.Release|Win32.ActiveCfg = Release|Win32
{8B5CF214-2F60-4C22-B59D-0C75687B1921}.Release|Win32.Build.0 = Release|Win32
{6FE67939-5755-4BCF-9FD8-39638F88600D}.Debug|Win32.ActiveCfg = Debug|Win32
{6FE67939-5755-4BCF-9FD8-39638F88600D}.Debug|Win32.Build.0 = Debug|Win32
{6FE67939-5755-4BCF-9FD8-39638F88600D}.Release|Win32.ActiveCfg = Release|Win32
{6FE67939-5755-4BCF-9FD8-39638F88600D}.Release|Win32.Build.0 = Release|Win32
{F8C57BD5-EFD3-4A0A-8C1E-03AF02555556}.Debug|Win32.ActiveCfg = Debug|Win32
{F8C57BD5-EFD3-4A0A-8C1E-03AF02555556}.Debug|Win32.Build.0 = Debug|Win32
{F8C57BD5-EFD3-4A0A-8C1E-03AF02555556}.Release|Win32.ActiveCfg = Release|Win32
{F8C57BD5-EFD3-4A0A-8C1E-03AF02555556}.Release|Win32.Build.0 = Release|Win32
{50A4205C-CFAB-401C-8F07-F5AE697709C8}.Debug|Win32.ActiveCfg = Debug|Win32
{50A4205C-CFAB-401C-8F07-F5AE697709C8}.Debug|Win32.Build.0 = Debug|Win32
{50A4205C-CFAB-401C-8F07-F5AE697709C8}.Release|Win32.ActiveCfg = Release|Win32
{50A4205C-CFAB-401C-8F07-F5AE697709C8}.Release|Win32.Build.0 = Release|Win32
{D8F7C19C-80C3-4518-B9C3-D534AC26BAC8}.Debug|Win32.ActiveCfg = Debug|Win32
{D8F7C19C-80C3-4518-B9C3-D534AC26BAC8}.Debug|Win32.Build.0 = Debug|Win32
{D8F7C19C-80C3-4518-B9C3-D534AC26BAC8}.Release|Win32.ActiveCfg = Release|Win32
{D8F7C19C-80C3-4518-B9C3-D534AC26BAC8}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

527
talkfilters.texi Executable file
View File

@ -0,0 +1,527 @@
\input texinfo.tex @c -*-texinfo-*-
@c
@c %**start of header
@c All text is ignored before the setfilename.
@setfilename talkfilters.info
@settitle talkfilters @value{edition}
@set edition 2.3
@set update-month December 2003
@set update-date 8 @value{update-month}
@comment %**end of header
@tex
\global\emergencystretch = .3\hsize
@end tex
@setchapternewpage odd
@titlepage
@title GNU Talk Filters
@subtitle Amusing Text Translators
@subtitle Version @value{edition}
@subtitle @value{update-date}
@author Mark A. Lindner, et. al.
@page
@vskip 0pt plus 1filll
Copyright @copyright{} 1998-2003 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.
Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided that the entire
resulting derived work is distributed under the terms of a permission
notice identical to this one.
@end titlepage
@contents
@ifnottex
@node Top
@comment node-name, next, previous, up
@top talkfilters
@end ifnottex
@menu
* Introduction::
* The Filters::
* The Talkfilters Library::
* Writing New Filters::
* Credits::
* Software License::
* Type and Function Index::
@end menu
@node Introduction, The Filters, Top, Top
@comment node-name, next, previous, up
@chapter Introduction
The GNU Talk Filters are filter programs that convert English text into
text that mimics a stereotyped or otherwise humorous type of
speech. This package is not an original work but rather a collection and
integration of existing filter programs that were written by various
people and that have been in the public domain for many years. For a
list of authors, see @ref{Credits}.
The filters are provided in both executable and library form. See @ref{The
Filters} for synopses of the programs, and @ref{The Talkfilters Library}
for a description of the library API.
Since the filters do word and substring substitution on the text they
process, any word-wrap formatting of the original text will not be
preserved in the output. The included @code{wrap} filter program may be
used to reformat the output of the other filters to fit within a
specified number of columns.
Some of these filters contain vulgarity, and thus are not appropriate
for all audiences. If you find something offensive in one or more of
these filters, please do not flame the maintainer of this package or the
original authors, or request that the filter(s) in question be censored
or removed; requests of this type will be summarily ignored.
These filters are not guaranteed to be idempotent across all inputs;
that is, repeated applications of a given filter on an input may cause
the output to differ each time. Moreover, some of the filters use
randomization techniques so a given input is not guaranteed to produce
the same output across invocations.
The `flex' lexer (or any other lexer program, for that matter) is not
required to build and use this package. However, `flex' @i{is} required
to rebuild the filters if the @file{.l} source files are changed.
@b{These filters are provided for amusement only. No racial or societal
slurs are intended nor should be inferred.}
@node The Filters, The Talkfilters Library, Introduction, Top
@comment node-name, next, previous, up
@chapter The Filters
The filters provided in this package are enumerated below. This chapter
describes the synopses for the individual filter programs; for a
description of the library API, see @ref{The Talkfilters Library}.
@sp 1
@multitable @columnfractions .20 .80
@item @code{austro} @tab Austrian (Ahhhhnold)
@item @code{b1ff} @tab B1FF of U@sc{senet} yore
@item @code{brooklyn} @tab Brooklyn accent
@item @code{chef} @tab Swedish Chef (from @i{The Muppet Show})
@item @code{cockney} @tab Londoner accent
@item @code{drawl} @tab Southern drawl
@item @code{dubya} @tab George "Dubya" Bush
@item @code{fudd} @tab Elmer Fudd (from the Looney Tunes cartoons)
@item @code{funetak} @tab Thick Asian accent
@item @code{jethro} @tab Jethro from @i{The Beverly Hillbillies}
@item @code{jive} @tab 1970's Jive
@item @code{kraut} @tab German accent
@item @code{pansy} @tab Effeminate male
@item @code{pirate} @tab Pirate talk
@item @code{postmodern} @tab Postmodernist talk (``Feminazi'')
@item @code{redneck} @tab Country redneck
@item @code{valspeak} @tab Valley talk
@item @code{warez} @tab H4x0r code
@item @code{wrap} @tab Word-wrap filter
@end multitable
@sp 1
The filter programs read from standard input and write to
standard output. They all recognize the following switches:
@table @code
@item --version
Print version information and exit.
@item --help
Print usage information and exit.
@end table
@sp 1
The @code{wrap} filter program additionally recognizes the following
switch:
@table @code
@item -w @i{width}
Specify the maximum number of columns @i{width} that the text may
span. The minimum value of @i{width} is 10.
@end table
@sp 1
An example usage might be:
@example
man ls | jive | wrap -w 78 | less
@end example
@node The Talkfilters Library, Writing New Filters, The Filters, Top
@comment node-name, next, previous, up
@chapter The Talkfilters Library
All of the filters in the GNU Talk Filters are available collectively as
a C library which can be linked with other programs to provide embedded
text filtering support. While the individual filter programs filter from
standard input to standard output, the filtering functions in the
library operate on in-memory buffers instead.
This chapter describes the API to the Talkfilters library. All of the
functions and types described below are declared in the header file
@file{talkfilters.h}.
@deftypefun int gtf_filter_count (void)
This function returns the number of filters in the library.
@end deftypefun
@deftypefun {gtf_filter_t *} gtf_filter_list (void)
This function returns a pointer to an array of @i{gtf_filter_t}
structures which contain information about each of the filters in the
library, including the filter's symbolic name, a brief description of
the filter that is suitable for display purposes, and a pointer to the
filter function.
@end deftypefun
The following C program illustrates the use of
@code{gtf_filter_count()} and @code{gtf_filter_list()} to display
information about each filter in the library and invoke the filter
on some test input:
@sp 1
@cartouche
@example
#include <stdio.h>
#include <talkfilters.h>
int main(void)
@{
int ct, i;
const gtf_filter_t *filters, *fp;
const char *inbuf = "This is a test.";
char outbuf[1024];
ct = gtf_filter_count();
printf("There are %d filters available.\n", ct);
filters = gtf_filter_list();
for(i = 0, fp = filters; i < ct; i++, fp++)
@{
printf("filter #%d: %s - %s\n", i + 1, fp->name, fp->desc);
fp->filter(inbuf, outbuf, sizeof(outbuf));
puts(outbuf);
@}
exit(0);
@}
@end example
@end cartouche
@page
@tindex gtf_filter_t
The type @i{gtf_filter_t} is a structure which contains the following
members:
@table @code
@item char *name
The symbolic name of the filter.
@item char *desc
A brief description of the filter.
@item int (*filter)(const char *, char *, size_t)
The filter function.
@end table
@deftypefun {gtf_filter_t *} gtf_filter_lookup (@w{const char *@var{name}})
This is a lookup function for locating a specific filter. The function
searches for the filter with the symbolic name @var{name}, and returns a
pointer to the @i{gtf_filter_t} structure for that filter. If a filter
with the given name is not found, the function returns @code{NULL}.
@end deftypefun
@deftypefun int gtf_filter_austro (@w{const char *@var{input}}, @w{char *@var{buf}}, @w{size_t @var{bufsz}})
@deftypefunx int gtf_filter_b1ff (@w{const char *@var{input}}, @w{char *@var{buf}}, @w{size_t @var{bufsz}})
@deftypefunx int gtf_filter_brooklyn (@w{const char *@var{input}}, @w{char *@var{buf}}, @w{size_t @var{bufsz}})
@deftypefunx int gtf_filter_chef (@w{const char *@var{input}}, @w{char *@var{buf}}, @w{size_t @var{bufsz}})
@deftypefunx int gtf_filter_cockney (@w{const char *@var{input}}, @w{char *@var{buf}}, @w{size_t @var{bufsz}})
@deftypefunx int gtf_filter_drawl (@w{const char *@var{input}}, @w{char *@var{buf}}, @w{size_t @var{bufsz}})
@deftypefunx int gtf_filter_dubya (@w{const char *@var{input}}, @w{char *@var{buf}}, @w{size_t @var{bufsz}})
@deftypefunx int gtf_filter_fudd (@w{const char *@var{input}}, @w{char *@var{buf}}, @w{size_t @var{bufsz}})
@deftypefunx int gtf_filter_funetak (@w{const char *@var{input}}, @w{char *@var{buf}}, @w{size_t @var{bufsz}})
@deftypefunx int gtf_filter_jethro (@w{const char *@var{input}}, @w{char *@var{buf}}, @w{size_t @var{bufsz}})
@deftypefunx int gtf_filter_jive (@w{const char *@var{input}}, @w{char *@var{buf}}, @w{size_t @var{bufsz}})
@deftypefunx int gtf_filter_kraut (@w{const char *@var{input}}, @w{char *@var{buf}}, @w{size_t @var{bufsz}})
@deftypefunx int gtf_filter_pansy (@w{const char *@var{input}}, @w{char *@var{buf}}, @w{size_t @var{bufsz}})
@deftypefunx int gtf_filter_pirate (@w{const char *@var{input}}, @w{char *@var{buf}}, @w{size_t @var{bufsz}})
@deftypefunx int gtf_filter_postmodern (@w{const char *@var{input}}, @w{char *@var{buf}}, @w{size_t @var{bufsz}})
@deftypefunx int gtf_filter_redneck (@w{const char *@var{input}}, @w{char *@var{buf}}, @w{size_t @var{bufsz}})
@deftypefunx int gtf_filter_valspeak (@w{const char *@var{input}}, @w{char *@var{buf}}, @w{size_t @var{bufsz}})
@deftypefunx int gtf_filter_warez (@w{const char *@var{input}}, @w{char *@var{buf}}, @w{size_t @var{bufsz}})
These functions invoke the corresponding filters on the input buffer
@var{input}, which must be a NUL-terminated string. At most @var{bufsz}
- 1 bytes of output are written to the buffer @var{buf}. The output is
unconditionally NUL-terminated, but the text itself may be truncated if
the buffer is too small to accommodate all of the output.
The functions return 0 on success, or 1 if a buffer overflow occurred
(signifying that the output was truncated).
Note that lexical scanners generated by `flex' are not reentrant, so no
assumptions should be made about the reentrancy of the above
functions. When this library is used in a multithreaded environment,
calls to these functions should be protected by mutex locks.
@end deftypefun
@node Writing New Filters, Credits, The Talkfilters Library, Top
@comment node-name, next, previous, up
@chapter Writing New Filters
Writing new filters and adding them to the library is fairly
straightforward, but certain conventions must be observed to ensure that
the filters will work properly both as standalone programs and as
library functions. The internal header file @file{common.h} declares
some utility functions and macros that should be used to ensure proper
behavior.
@defmac gtf_parse_args ()
A filter's @code{main()} function should make a call to this macro to
process the command line arguments. Currently, only the standard
@samp{--help} and @samp{--version} switches are recognized. A call to
this macro should typically be the first statement in @code{main()}.
@end defmac
@defmac gtf_random_seed ()
Filters which make calls to the @code{gtf_random()} macro (described
below), should make a call to this macro (preferably in @code{main()})
to seed the random number generator. This macro seeds the random number
sequence with a bitwise @sc{or} of the current system time and the
@sc{pid} of the calling process.
@end defmac
@defmac gtf_random (range)
This macro returns a random integer in the range [0, @var{range}).
@end defmac
@defmac gtf_printf (format, ...)
@defmacx gtf_putc (char)
@defmacx gtf_puts (string)
Filters must be able to function both as standalone programs and as
library functions, so the stdio library functions cannot be used to
write output. Instead, these macros should be used in place of the stdio
library functions @code{printf()}, @code{putchar()}, and @code{puts()},
respectively. When a filter is compiled to run as an executable, these
macros simply evaluate to calls to the stdio functions they replace;
when it is compiled into the library, they evaluate to calls to internal
library functions which write to a data buffer.
@end defmac
@defmac gtf_puts_case (string)
This macro is a specialized form of @code{gtf_puts()} which ensures that
the case of the first character in @var{string} matches that of the
first character in the currently matched token. For example, if
@code{yytext} is ``Hello'', calling @code{gtf_puts_case()} with either
``howdy'' or ``Howdy'' as an argument will write the string ``Howdy'',
whereas if @code{yytext} is ``hello'', the string written will be
``howdy''.
@end defmac
@defmac gtf_unput_last ()
This macro ``unputs'' the last character of the current token. In other
words, the last character of @code{yytext} will be returned back to the
input stream, so that it will be the next character read by the lexical
scanner.
@end defmac
@deftypefun void gtf_strbuf_init (@w{gtf_databuf_t *@var{sbuf}}, @w{char *@var{buf}}, @w{size_t @var{bufsz}})
@tindex gtf_databuf_t
This function initializes the @i{gtf_databuf_t} structure at @var{sbuf}
to point to the buffer @var{buf}, which is @var{bufsz} bytes in length;
these values specify the buffer to which the @code{gtf_printf()},
@code{gtf_putc()}, @code{gtf_puts()}, and @code{gtf_puts_case()} macros
will ultimately write their output when the filter is called through the
library API. The @i{gtf_databuf_t} structure contains an integer field
named @code{overflow} which will contain the value 1 after the call to
@code{yylex()} if a buffer overflow occurred during filtering; otherwise
it will contain the value 0.
@end deftypefun
@defmac gtf_reset ()
This macro should be called after the call to @code{yylex()} within the
filter API function in order to reset the state of the lexical scanner
in preparation for the next call.
@end defmac
The following example shows the C code that implements both the library
interface and the @code{main()} function for the @code{chef} filter.
@sp 1
@cartouche
@example
#ifdef LIBRARY_MODE
int gtf_filter_chef(const char *input, char *buf, size_t bufsz)
@{
gtf_databuf_t buffer;
YY_BUFFER_STATE _yybuf;
gtf_strbuf_init(&buffer, buf, bufsz);
_yybuf = yy_scan_string(input);
yylex(&buffer);
yy_delete_buffer(_yybuf);
gtf_reset();
return(buffer.overflow);
@}
#else /* LIBRARY_MODE */
int main(int argc, char **argv)
@{
gtf_parse_args();
yylex(NULL);
exit(EXIT_SUCCESS);
@}
#endif /* LIBRARY_MODE */
@end example
@end cartouche
@page
Each filter lex file must have an introductory fragment similar to
the following:
@sp 1
@cartouche
@example
%option prefix="chef_yy"
%option outfile="lex.yy.c"
%option noyywrap
%@{
#include "common.h"
#define YY_DECL int yylex(gtf_databuf_t *buf)
%@}
@end example
@end cartouche
The @code{prefix} option specifies a prefix for the names of the
functions generated for this filter; the function names for each filter
must be unique so that multiple filters can coexist within the
library.
The @code{outfile} option reverses an undesirable side effect of the
@code{prefix} option, which is to name the generated C source file based
on the prefix; this breaks @code{ylwrap} (an Automake helper program),
which expects the output file to be named @code{lex.yy.c}.
The @code{noyywrap} option specifies that no @code{yywrap()} function is
needed.
The macro @code{YY_DECL} is defined to specify that the @code{yylex()}
function takes a single argument, a pointer to the @i{gtf_databuf_t}
structure described above. When @code{yylex()} is called from
@code{main()}, no output buffer is needed since text is written to
standard output, so in that case, it is called with a @code{NULL}
pointer as the argument. This function can be declared to accept
additional arguments, but the @var{buf} argument @i{must} be present.
The file @file{talkfilters.c} contains a filter registry in the form of
an array of structures. Entries should be added therein for new
filters. Appropriate @code{extern} declarations of the API functions for
new filters should also be added to @file{talkfilters.h}.
@node Credits, Software License, Writing New Filters, Top
@comment node-name, next, previous, up
@chapter Credits
While all of these filters have been available in one form or another in
the public domain for many years, the original authors of some of the
filters are unknown. Reasonable attempts were made to find the authors
and obtain written permission to repackage the filters as GNU software,
but in some cases they could not be located.
The following table lists the known authors and contributors.
@sp 1
@multitable @columnfractions .20 .80
@item @code{austro} @tab Tom van Nes
@item @code{b1ff} @tab Matt Welsh, David Whitten
@item @code{brooklyn} @tab Daniel V Klein (@file{nyc.l})
@item @code{chef} @tab John Hagerman
@item @code{cockney} @tab Stephen K Mulrine, Edward Betts (@file{ken.l}); @i{unknown} (@file{cockney.l}); extensive enhancements by Samuel Stoddard
@item @code{drawl} @tab Adam Hudd
@item @code{dubya} @tab @i{anonymous contribution}
@item @code{fudd} @tab @i{unknown}
@item @code{funetak} @tab Eclipse Enterprises
@item @code{jethro} @tab Duane Paulson
@item @code{jive} @tab Daniel V Klein, Clement Cole, with enhancements by Samuel Stoddard
@item @code{kraut} @tab @i{unknown}
@item @code{pansy} @tab @i{unknown}
@item @code{pirate} @tab Original Perl/PHP version by Dougal Campbell, with enhancements by Mark Lindner
@item @code{postmodern} @tab @i{unknown}
@item @code{redneck} @tab Brand Hilton
@item @code{valspeak} @tab @i{unknown}
@item @code{warez} @tab Ian Johnston, with enhancements by Mark Lindner
@item @code{wrap} @tab Mark Lindner
@end multitable
@sp 1
The filters were repackaged, integrated, optimized, and documented by
Mark Lindner (@email{markl@@gnu.org}).
@node Software License, Type and Function Index, Credits, Top
@comment node-name, next, previous, up
@chapter Software License
@include gpl.texi
@node Type and Function Index, , Software License, Top
@comment node-name, next, previous, up
@unnumbered Type and Function Index
@printindex tp
@printindex fn
@bye

269
talkfilters.vcproj Executable file
View File

@ -0,0 +1,269 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="talkfilters"
ProjectGUID="{69F5DCE7-F24F-4BF5-ADB4-3EEE05A1E0B0}"
RootNamespace="libtalkfilters"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;TALKFILTERS_EXPORTS;YY_NO_UNISTD_H;LIBRARY_MODE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="3"
CompileAs="1"
DisableSpecificWarnings="4996"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
GenerateMapFile="true"
MapExports="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="TALKFILTERS_EXPORTS;YY_NO_UNISTD_H;_CRT_SECURE_NO_DEPRECATE;LIBRARY_MODE"
RuntimeLibrary="2"
CompileAs="1"
DisableSpecificWarnings="4996"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
>
<File
RelativePath=".\austro.c"
>
</File>
<File
RelativePath=".\b1ff.c"
>
</File>
<File
RelativePath=".\brooklyn.c"
>
</File>
<File
RelativePath=".\chef.c"
>
</File>
<File
RelativePath=".\cockney.c"
>
</File>
<File
RelativePath=".\common.c"
>
</File>
<File
RelativePath=".\drawl.c"
>
</File>
<File
RelativePath=".\dubya.c"
>
</File>
<File
RelativePath=".\fudd.c"
>
</File>
<File
RelativePath=".\funetak.c"
>
</File>
<File
RelativePath=".\getopt.c"
>
</File>
<File
RelativePath=".\getopt1.c"
>
</File>
<File
RelativePath=".\jethro.c"
>
</File>
<File
RelativePath=".\jive.c"
>
</File>
<File
RelativePath=".\kraut.c"
>
</File>
<File
RelativePath=".\pansy.c"
>
</File>
<File
RelativePath=".\pirate.c"
>
</File>
<File
RelativePath=".\postmodern.c"
>
</File>
<File
RelativePath=".\redneck.c"
>
</File>
<File
RelativePath=".\talkfilters.c"
>
</File>
<File
RelativePath=".\valspeak.c"
>
</File>
<File
RelativePath=".\warez.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
>
<File
RelativePath=".\common.h"
>
</File>
<File
RelativePath=".\getopt.h"
>
</File>
<File
RelativePath=".\talkfilters.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

6947
texinfo.tex Executable file

File diff suppressed because it is too large Load Diff

2328
valspeak.c Executable file

File diff suppressed because it is too large Load Diff

219
valspeak.l Executable file
View File

@ -0,0 +1,219 @@
/* GNU Talkfilters
Copyright (C) 1998-2003 Free Software Foundation, Inc.
This file is part of GNU Talkfilters
GNU Talkfilters is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2, or (at
your option) any later version.
This software is distributed in the hope that it will be amusing, 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 software; see the file COPYING. If not, write to the
Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
%option prefix="valspeak_yy"
%option outfile="lex.yy.c"
%option noyywrap
%{
#include "common.h"
#include "talkfilters.h"
#define YY_DECL int yylex(gtf_databuf_t *buf)
%}
WB [\n\t ]
WC [A-Za-z'0-9]
NW [^A-Za-z'0-9]
EOT \4
%s NIW INW
%%
<NIW,INITIAL>{
\<(\/)?[A-Za-z][^\>]*\> gtf_echo(); // don't damage HTML tags
[Bb]ad gtf_puts_case("mean"); BEGIN(INW);
[Bb]ig/{NW} gtf_puts_case("bitchin'est");
[Bb]ody/{NW} gtf_puts_case("bod");
[Bb]ore/{NW} gtf_puts_case("drag");
([Cc]ar|[Aa]utomobile)/{NW} gtf_puts_case("rod");
[Dd]irty/{NW} gtf_puts_case("grodie");
[Ff]ilthy/{NW} gtf_puts_case("grodie to thuh max");
[Ff]ood/{NW} gtf_puts_case("munchies");
[Gg]irl/{NW} gtf_puts_case("chick");
[Gg]ood/{NW} gtf_puts_case("bitchin'");
[Gg]reat/{NW} gtf_puts_case("awesum");
[Gg]ross/{NW} gtf_puts_case("grodie");
[Gg]uy gtf_puts_case("dude"); BEGIN(INW);
her/{NW} gtf_puts_case("that chick");
him/{NW} gtf_puts_case("that dude");
can('t)?{WB}be/{NW} |
should(n't)?{WB}have{WB}been/{NW} |
should(n't)?{WB}be/{NW} |
was(n't)?|(will|won't){WB}be/{NW} |
is/{NW} { gtf_echo();
switch(gtf_random(6))
{
case 0:
gtf_puts_case(" like, ya know,");
break;
case 1:
gtf_puts_case(" like wow!");
break;
case 2:
gtf_puts_case(" ya know, like,");
break;
}
}
[Hh]ouse/{NW} gtf_puts_case("pad");
[Ii]nteresting/{NW} gtf_puts_case("cool");
[Ll]arge/{NW} gtf_puts_case("awesum");
[Ll]eave/{NW} gtf_puts_case("blow");
[Mm]an/{NW} gtf_puts_case("nerd");
[Mm]aybe/{NW} { switch(gtf_random(6))
{
case 0:
gtf_puts_case("if you're a Pisces");
break;
case 1:
gtf_puts_case("if the moon is full");
break;
case 2:
gtf_puts_case("if the vibes are right");
break;
case 3:
gtf_puts_case("when you get the feeling");
break;
case 4:
case 5:
gtf_echo();
break;
}
}
[Mm]eeting/{NW} gtf_puts_case("party");
[Mm]ovie/{NW} gtf_puts_case("flick");
[Mm]usic/{NW} gtf_puts_case("tunes");
[Nn]eat/{NW} gtf_puts_case("keen");
[Nn]ice/{NW} gtf_puts_case("class");
[Nn]o{WB}way/{NW} gtf_puts_case("just no way");
[Pp]eople/{NW} gtf_puts_case("guys");
[Rr]eally/{NW} gtf_puts_case("totally");
[Ss]trange/{NW} gtf_puts_case("freaky");
[Tt]he/{NW} gtf_puts_case("thuh");
[Vv]ery/{NW} gtf_puts_case("super");
[Ww]ant/{NW} gtf_puts_case("wanna");
[Ww]eird/{NW} gtf_puts_case("far out");
[Yy]es/{NW} gtf_puts_case("fer shure");
But/{NW} gtf_puts_case("Man,");
[Hh]e/{NW} gtf_puts_case("that dude");
I{WB}like/{NW} gtf_puts_case("I can dig");
No, gtf_puts_case("Like, no way,");
[Ss]ir/{NW} gtf_puts_case("Man");
[Ss]he/{NW} gtf_puts_case("That fox");
[Tt]his/{NW} gtf_puts_case("Like, ya know, this");
[Tt]here/{NW} gtf_puts_case("Like, there");
[Ww]e/{NW} gtf_puts_case("Us guys");
Yes, gtf_puts_case("Like,");
,/{WB} { switch(gtf_random(6))
{
case 0:
gtf_puts_case(", like");
break;
case 1:
gtf_puts_case(", fer shure");
break;
case 2:
gtf_puts_case(", like, wow");
break;
case 3:
gtf_puts_case(", oh, baby");
break;
case 4:
gtf_puts_case(", man");
break;
case 5:
gtf_puts_case(", mostly");
break;
}
}
! { switch(gtf_random(6))
{
case 0:
gtf_puts_case("! Gag me with a SPOOOOON!");
break;
case 1:
gtf_puts_case("! Gag me with a pitchfork!");
break;
case 2:
gtf_puts_case("! Oh, wow!");
break;
}
}
{WC} { BEGIN(INW); gtf_echo(); }
}
<INW>{
inging/{NW} gtf_puts_case("ingin'"); BEGIN(NIW);
ing/{NW} gtf_puts_case("in'"); BEGIN(NIW);
{NW} BEGIN(NIW); unput(yytext[0]);
}
{EOT} /* ignore trailing EOT character */
. gtf_echo();
%%
#ifdef LIBRARY_MODE
int gtf_filter_valspeak(const char *input, char *buf, size_t bufsz)
{
gtf_databuf_t buffer;
YY_BUFFER_STATE _yybuf;
gtf_strbuf_init(&buffer, buf, bufsz);
_yybuf = yy_scan_string(input);
yylex(&buffer);
yy_delete_buffer(_yybuf);
gtf_reset();
return(buffer.overflow);
}
int __gtf_filter_valspeak(const char *input, char *buf, size_t bufsz)
{
return(gtf_filter_valspeak(input, buf, bufsz));
}
#else /* LIBRARY_MODE */
int main(int argc, char **argv)
{
gtf_parse_args();
gtf_random_seed();
yylex(NULL);
return(EXIT_SUCCESS);
}
#endif /* LIBRARY_MODE */
/* end of source file */

202
valspeak.vcproj Executable file
View File

@ -0,0 +1,202 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="valspeak"
ProjectGUID="{4691AAF2-B8E7-43B1-B14E-C46C369939FF}"
RootNamespace="valspeak"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="3"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
>
<File
RelativePath=".\common.c"
>
</File>
<File
RelativePath=".\getopt.c"
>
</File>
<File
RelativePath=".\getopt1.c"
>
</File>
<File
RelativePath=".\valspeak.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
>
<File
RelativePath=".\common.h"
>
</File>
<File
RelativePath=".\getopt.h"
>
</File>
<File
RelativePath=".\talkfilters.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

2075
warez.c Executable file

File diff suppressed because it is too large Load Diff

234
warez.l Executable file
View File

@ -0,0 +1,234 @@
/* GNU Talkfilters
Copyright (C) 1998-2003 Free Software Foundation, Inc.
This file is part of GNU Talkfilters
GNU Talkfilters is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2, or (at
your option) any later version.
This software is distributed in the hope that it will be amusing, 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 software; see the file COPYING. If not, write to the
Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* This is the w4r3z filter, written by Ian Johnston, reaper@muppetlabs.com.
*
* Copyright (C) 1998 Ian Johnston
*
* GNU Talkfilters 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 software is distributed in the hope that it will be amusing,
* 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 software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* or copies are available at the GNU website: http://www.gnu.org/
*
* Ian Johnston can be reached as reaper@speakeasy.org
*/
%option prefix="warez_yy"
%option outfile="lex.yy.c"
%option noyywrap
%option nounput
%e 2000
%p 5000
%n 1000
%k 500
%a 4000
%o 2000
BW [ \t]
EW [ \t.,;!?]
EOT \4
%{
#include "common.h"
#include "talkfilters.h"
#define YY_DECL int yylex(gtf_databuf_t *buf)
static const char *a_array[] = {"4", "4", "4", "a", "a", "A", "@"};
#define A_LEN (sizeof(a_array) / sizeof(a_array[0]))
static const char *b_array[] = {"8", "b", "b", "B"};
#define B_LEN (sizeof(b_array) / sizeof(b_array[0]))
static const char *c_array[] = {"c", "c", "C", "k", "k" /*, "<" */};
#define C_LEN (sizeof(c_array) / sizeof(c_array[0]))
static const char *d_array[] = {"d", "d", "D", "|)"};
#define D_LEN (sizeof(d_array) / sizeof(d_array[0]))
static const char *e_array[] = {"3", "3", "3", "e", "E"};
#define E_LEN (sizeof(e_array) / sizeof(e_array[0]))
static const char *f_array[] = {"f", "f", "F", "ph", "ph"};
#define F_LEN (sizeof(f_array) / sizeof(f_array[0]))
static const char *g_array[] = {"6", "g", "g", "G"};
#define G_LEN (sizeof(g_array) / sizeof(g_array[0]))
static const char *h_array[] = {"h", "h", "H", "]-["};
#define H_LEN (sizeof(h_array) / sizeof(h_array[0]))
static const char *i_array[] = {"1", "i", "I", "!", "Y", "|"};
#define I_LEN (sizeof(i_array) / sizeof(i_array[0]))
static const char *j_array[] = {"j", "j", "J", ";"};
#define J_LEN (sizeof(j_array) / sizeof(j_array[0]))
static const char *k_array[] = {"k", "K", "c", "C"};
#define K_LEN (sizeof(k_array) / sizeof(k_array[0]))
static const char *l_array[] = {"1", "l", "l", "L"};
#define L_LEN (sizeof(l_array) / sizeof(l_array[0]))
static const char *m_array[] = {"m", "m", "M", "]\\/["};
#define M_LEN (sizeof(m_array) / sizeof(m_array[0]))
static const char *n_array[] = {"n", "n", "n", "n", "N", "N", "|\\|", "]\\[", "gn"};
#define N_LEN (sizeof(n_array) / sizeof(n_array[0]))
static const char *o_array[] = {"0", "o", "O", "()", "0", "0"};
#define O_LEN (sizeof(o_array) / sizeof(o_array[0]))
static const char *p_array[] = {"p", "P"};
#define P_LEN (sizeof(p_array) / sizeof(p_array[0]))
static const char *q_array[] = {"q", "Q"};
#define Q_LEN (sizeof(q_array) / sizeof(q_array[0]))
static const char *r_array[] = {"r", "R"};
#define R_LEN (sizeof(r_array) / sizeof(r_array[0]))
static const char *s_array[] = {"5", "z", "Z", "s", "S"};
#define S_LEN (sizeof(s_array) / sizeof(s_array[0]))
static const char *t_array[] = {"7", "t", "T"};
#define T_LEN (sizeof(t_array) / sizeof(t_array[0]))
static const char *u_array[] = {"u", "U"};
#define U_LEN (sizeof(u_array) / sizeof(u_array[0]))
static const char *v_array[] = {"v", "v", "V", "\\/"};
#define V_LEN (sizeof(v_array) / sizeof(v_array[0]))
static const char *w_array[] = {"w", "w", "W", "W", "\\/\\/"};
#define W_LEN (sizeof(w_array) / sizeof(w_array[0]))
static const char *x_array[] = {"x", "X", /*"><",*/ "kz" };
#define X_LEN (sizeof(x_array) / sizeof(x_array[0]))
static const char *y_array[] = {"y", "Y"};
#define Y_LEN (sizeof(y_array) / sizeof(y_array[0]))
static const char *z_array[] = {"s", "S", "z", "z", "Z"};
#define Z_LEN (sizeof(z_array) / sizeof(z_array[0]))
static const char *__warez_rand(const char **array, int length)
{
int i = gtf_random(length);
return(array[i]);
}
%}
%%
\<(\/)?[A-Za-z][^\>]*\> gtf_echo(); // don't damage HTML tags
[aA] gtf_puts(__warez_rand(a_array, A_LEN));
[bB] gtf_puts(__warez_rand(b_array, B_LEN));
[cC] gtf_puts(__warez_rand(c_array, C_LEN));
[dD] gtf_puts(__warez_rand(d_array, D_LEN));
[eE] gtf_puts(__warez_rand(e_array, E_LEN));
[fF] gtf_puts(__warez_rand(f_array, F_LEN));
[gG] gtf_puts(__warez_rand(g_array, G_LEN));
[hH] gtf_puts(__warez_rand(h_array, H_LEN));
[iI] gtf_puts(__warez_rand(i_array, I_LEN));
[jJ] gtf_puts(__warez_rand(j_array, J_LEN));
[kK] gtf_puts(__warez_rand(k_array, K_LEN));
[lL] gtf_puts(__warez_rand(l_array, L_LEN));
[mM] gtf_puts(__warez_rand(m_array, M_LEN));
[nN] gtf_puts(__warez_rand(n_array, N_LEN));
[oO] gtf_puts(__warez_rand(o_array, O_LEN));
[pP] gtf_puts(__warez_rand(p_array, P_LEN));
[qQ] gtf_puts(__warez_rand(q_array, Q_LEN));
[rR] gtf_puts(__warez_rand(r_array, R_LEN));
[sS] gtf_puts(__warez_rand(s_array, S_LEN));
[tT] gtf_puts(__warez_rand(t_array, T_LEN));
[uU] gtf_puts(__warez_rand(u_array, U_LEN));
[vV] gtf_puts(__warez_rand(v_array, V_LEN));
[wW] gtf_puts(__warez_rand(w_array, W_LEN));
[xX] gtf_puts(__warez_rand(x_array, X_LEN));
[yY] gtf_puts(__warez_rand(y_array, Y_LEN));
[zZ] gtf_puts(__warez_rand(z_array, Z_LEN));
" the " gtf_puts(" d4 ");
"The " gtf_puts("D4 ");
" you" gtf_puts(" j00");
You gtf_puts("U");
" see" gtf_puts(" C");
See gtf_puts("c");
" are" gtf_puts(" r");
Are gtf_puts("R");
[Ss]mart |
[Gg]ood |
[Ee]xpert |
[Tt]alented |
[Ee]xperienced gtf_puts("1337");
[Yy]our gtf_puts_case("j00r");
[Hh]acker |
[Pp]rogrammer |
[Dd]eveloper gtf_puts_case("h4x0r");
[Ee]lite gtf_puts("31337");
[Pp]ornography gtf_puts_case("pr0n");
[Pp]orn(o)? gtf_puts_case("pr0n");
[Dd]ude |
[Pp]erson |
[Gg]uy gtf_puts_case("d00d");
[Ss]oftware gtf_puts_case("warez");
[Pp]irate gtf_puts_case("piR8");
[Aa]pplications gtf_puts_case("appz");
[Mm]usic gtf_puts_case("mp3z");
"broke." |
"crashed." gtf_puts("g0t fux0red.");
[Ff]ucked |
[Bb]roke(n)? |
[Mm]alfunctioning |
[Bb]uggy gtf_puts_case("fux0red");
[Ss]uckers gtf_puts_case("sux0rz");
{EOT} /* ignore trailing EOT character */
. gtf_echo();
\n gtf_puts("\n");
%%
#ifdef LIBRARY_MODE
int gtf_filter_warez(const char *input, char *buf, size_t bufsz)
{
gtf_databuf_t buffer;
YY_BUFFER_STATE _yybuf;
gtf_strbuf_init(&buffer, buf, bufsz);
_yybuf = yy_scan_string(input);
yylex(&buffer);
yy_delete_buffer(_yybuf);
gtf_reset();
return(buffer.overflow);
}
int __gtf_filter_warez(const char *input, char *buf, size_t bufsz)
{
return(gtf_filter_warez(input, buf, bufsz));
}
#else /* LIBRARY_MODE */
int main(int argc, char **argv)
{
gtf_parse_args();
gtf_random_seed();
yylex(NULL);
return(EXIT_SUCCESS);
}
#endif /* LIBRARY_MODE */
/* end of source file */

202
warez.vcproj Executable file
View File

@ -0,0 +1,202 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="warez"
ProjectGUID="{69FB15FC-F7E4-45AD-AEED-8668CFAB7E9B}"
RootNamespace="warez"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="3"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".\win32"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
>
<File
RelativePath=".\common.c"
>
</File>
<File
RelativePath=".\getopt.c"
>
</File>
<File
RelativePath=".\getopt1.c"
>
</File>
<File
RelativePath=".\warez.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
>
<File
RelativePath=".\common.h"
>
</File>
<File
RelativePath=".\getopt.h"
>
</File>
<File
RelativePath=".\talkfilters.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

1
win32/unistd.h Executable file
View File

@ -0,0 +1 @@
/* dummy header */

158
wrap.c Executable file
View File

@ -0,0 +1,158 @@
/* GNU TalkFilters
Copyright (C) 1998-2003 Free Software Foundation, Inc.
This file is part of GNU Talkfilters
GNU Talkfilters is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Talkfilters is distributed in the hope that it will be amusing,
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 GNU Talkfilters; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* --- System Headers --- */
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
/* --- Local Headers --- */
/* --- Macros --- */
#define DFL_WIDTH 78
#define MIN_WIDTH 10
#include "getopt.h"
#define HELP_OPTION 0
#define VERSION_OPTION 1
#define USAGE "%s: Usage: %s [-w width] [--help --version]\n"
#define VERSION "GNU wrap v1.3"
static const struct option options[] = { { "help", 0, NULL, 0 },
{ "version", 0, NULL, 0 },
{ NULL, 0, NULL, 0 } };
/* --- Functions --- */
int main(int argc, char **argv)
{
char *wbuf = (char *)malloc((DFL_WIDTH + 1) * sizeof(char)), *wp = wbuf,
prevc = 0, errf = 0;
int c, wl = 0, ll = 0, width = DFL_WIDTH, option_index;
extern char *optarg;
while((c = getopt_long(argc, argv, "w:", options, &option_index)) != EOF)
{
switch(c)
{
case 'w':
width = atoi(optarg);
if(width < MIN_WIDTH)
{
fprintf(stderr,
"%s: Width must be at least %i (defaulting to %i)\n",
*argv, MIN_WIDTH, DFL_WIDTH);
width = DFL_WIDTH;
}
break;
case 0:
if(option_index == HELP_OPTION)
fprintf(stderr, USAGE, *argv, *argv);
else if(option_index == VERSION_OPTION)
{
fputs(VERSION, stderr);
fputc('\n', stderr);
}
exit(EXIT_SUCCESS);
break;
default:
errf++;
}
}
if(errf)
{
fprintf(stderr, USAGE, *argv, *argv);
free(wbuf);
exit(EXIT_FAILURE);
}
/* now do the actual formatting */
while((c = getchar()) != EOF)
{
if(!isspace(c))
{
if(wl < width)
{
*wp = (char)c;
wl++, wp++;
}
else /* word is full, so output it */
{
*wp = 0;
putchar('\n');
fputs(wbuf, stdout);
putchar(c);
putchar('\n');
wp = wbuf, ll = wl = 0;
}
}
else /* isspace(c) */
{
if(prevc == '\n')
{
if(prevc == '\n' && c == '\n')
ll = 0, putchar('\n'), putchar('\n');
else if(ll > 0) ll++;
}
else if(wl && ((ll + wl + (ll > 0)) <= width))
{
*wp = 0;
if(ll) putchar(' '), ll++;
fputs(wbuf, stdout);
ll += wl;
wl = 0, wp = wbuf;
}
else if(wl)
{
*wp = 0;
putchar('\n');
fputs(wbuf, stdout);
ll = wl;
wl = 0, wp = wbuf;
}
}
prevc = c;
}
/* if text remains in word buffer, process it */
if(wl)
{
*wp = 0;
if((ll + wl + (ll > 0)) <= width)
{
if(ll) putchar(' ');
}
else putchar('\n');
fputs(wbuf, stdout);
}
putchar('\n');
free(wbuf);
exit(EXIT_SUCCESS);
}
/* end of source file */

33
wrap.man Executable file
View File

@ -0,0 +1,33 @@
.TH wrap 1 "15 Dec 1998" "Version 1.3"
.SH NAME
wrap
\- filter to word-wrap text
.SH SYNOPSIS
\fBwrap\fP [\fB-w\fP \fIwidth\fP] [\fB--version --help\fP]
.SH DESCRIPTION
.PP
This program reads text from standard input, word-wraps it, and writes
the result to standard output. The text is formatted to fit a
specified number of columns. Extraneous whitespace is removed and
lines are only broken on word boundaries.
.SH OPTIONS
.TP 5
.B --help
Display a command synopsis and exit.
.TP 5
.B --version
Display the program's version information and exit.
.TP 5
\fB-w\fP \fIwidth\fP
Specify the maximum number of columns \fIwidth\fP that the text may
span. The minimum value of \fIwidth\fP is 10.
.SH SEE ALSO
.BR less (1),
.BR fold (1)
.SH NOTES
If \fBwrap\fP encounters a word that is longer than the specified
column width, the word is broken across two or more lines to fit
within that number of columns.
.SH AUTHOR
Mark Lindner

190
wrap.vcproj Executable file
View File

@ -0,0 +1,190 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="wrap"
ProjectGUID="{D8F7C19C-80C3-4518-B9C3-D534AC26BAC8}"
RootNamespace="wrap"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="."
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="3"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="."
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
>
<File
RelativePath=".\getopt.c"
>
</File>
<File
RelativePath=".\getopt1.c"
>
</File>
<File
RelativePath=".\wrap.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
>
<File
RelativePath=".\getopt.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

160
ylwrap Executable file
View File

@ -0,0 +1,160 @@
#! /bin/sh
# ylwrap - wrapper for lex/yacc invocations.
#
# Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002 Free Software
# Foundation, Inc.
#
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Usage:
# ylwrap INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]...
# * INPUT is the input file
# * OUTPUT is file PROG generates
# * DESIRED is file we actually want
# * PROGRAM is program to run
# * ARGS are passed to PROG
# Any number of OUTPUT,DESIRED pairs may be used.
# The input.
input="$1"
shift
case "$input" in
[\\/]* | ?:[\\/]*)
# Absolute path; do nothing.
;;
*)
# Relative path. Make it absolute.
input="`pwd`/$input"
;;
esac
pairlist=
while test "$#" -ne 0; do
if test "$1" = "--"; then
shift
break
fi
pairlist="$pairlist $1"
shift
done
# The program to run.
prog="$1"
shift
# Make any relative path in $prog absolute.
case "$prog" in
[\\/]* | ?:[\\/]*) ;;
*[\\/]*) prog="`pwd`/$prog" ;;
esac
# FIXME: add hostname here for parallel makes that run commands on
# other machines. But that might take us over the 14-char limit.
dirname=ylwrap$$
trap "cd `pwd`; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15
mkdir $dirname || exit 1
cd $dirname
case $# in
0) $prog "$input" ;;
*) $prog "$@" "$input" ;;
esac
status=$?
if test $status -eq 0; then
set X $pairlist
shift
first=yes
# Since DOS filename conventions don't allow two dots,
# the DOS version of Bison writes out y_tab.c instead of y.tab.c
# and y_tab.h instead of y.tab.h. Test to see if this is the case.
y_tab_nodot="no"
if test -f y_tab.c || test -f y_tab.h; then
y_tab_nodot="yes"
fi
# The directory holding the input.
input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'`
# Quote $INPUT_DIR so we can use it in a regexp.
# FIXME: really we should care about more than `.' and `\'.
input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'`
while test "$#" -ne 0; do
from="$1"
# Handle y_tab.c and y_tab.h output by DOS
if test $y_tab_nodot = "yes"; then
if test $from = "y.tab.c"; then
from="y_tab.c"
else
if test $from = "y.tab.h"; then
from="y_tab.h"
fi
fi
fi
if test -f "$from"; then
# If $2 is an absolute path name, then just use that,
# otherwise prepend `../'.
case "$2" in
[\\/]* | ?:[\\/]*) target="$2";;
*) target="../$2";;
esac
# Edit out `#line' or `#' directives.
#
# We don't want the resulting debug information to point at
# an absolute srcdir; it is better for it to just mention the
# .y file with no path.
#
# We want to use the real output file name, not yy.lex.c for
# instance.
#
# We want the include guards to be adjusted too.
FROM=`echo "$from" | sed \
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
-e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
TARGET=`echo "$2" | sed \
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
-e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
sed "/^#/{s,$input_rx,,;s,$from,$2,;s,$FORM,$TO,;}" "$from" >"$target" ||
status=$?
else
# A missing file is only an error for the first file. This
# is a blatant hack to let us support using "yacc -d". If -d
# is not specified, we don't want an error when the header
# file is "missing".
if test $first = yes; then
status=1
fi
fi
shift
shift
first=no
done
else
status=$?
fi
# Remove the directory.
cd ..
rm -rf $dirname
exit $status