2
0
mirror of https://github.com/xcat2/xcat-dep.git synced 2025-08-21 02:30:21 +00:00

Ok, cleaned up.

This commit is contained in:
datajerk
2008-04-10 19:42:20 +00:00
parent b020fc5d3d
commit bd73ee14fe
77 changed files with 0 additions and 23583 deletions

View File

@@ -1,131 +0,0 @@
The "Artistic License"
Preamble
The intent of this document is to state the conditions under which a
Package may be copied, such that the Copyright Holder maintains some
semblance of artistic control over the development of the package,
while giving the users of the package the right to use and distribute
the Package in a more-or-less customary fashion, plus the right to make
reasonable modifications.
Definitions:
"Package" refers to the collection of files distributed by the
Copyright Holder, and derivatives of that collection of files
created through textual modification.
"Standard Version" refers to such a Package if it has not been
modified, or has been modified in accordance with the wishes
of the Copyright Holder as specified below.
"Copyright Holder" is whoever is named in the copyright or
copyrights for the package.
"You" is you, if you're thinking about copying or distributing
this Package.
"Reasonable copying fee" is whatever you can justify on the
basis of media cost, duplication charges, time of people involved,
and so on. (You will not be required to justify it to the
Copyright Holder, but only to the computing community at large
as a market that must bear the fee.)
"Freely Available" means that no fee is charged for the item
itself, though there may be fees involved in handling the item.
It also means that recipients of the item may redistribute it
under the same conditions they received it.
1. You may make and give away verbatim copies of the source form of the
Standard Version of this Package without restriction, provided that you
duplicate all of the original copyright notices and associated disclaimers.
2. You may apply bug fixes, portability fixes and other modifications
derived from the Public Domain or from the Copyright Holder. A Package
modified in such a way shall still be considered the Standard Version.
3. You may otherwise modify your copy of this Package in any way, provided
that you insert a prominent notice in each changed file stating how and
when you changed that file, and provided that you do at least ONE of the
following:
a) place your modifications in the Public Domain or otherwise make them
Freely Available, such as by posting said modifications to Usenet or
an equivalent medium, or placing the modifications on a major archive
site such as uunet.uu.net, or by allowing the Copyright Holder to include
your modifications in the Standard Version of the Package.
b) use the modified Package only within your corporation or organization.
c) rename any non-standard executables so the names do not conflict
with standard executables, which must also be provided, and provide
a separate manual page for each non-standard executable that clearly
documents how it differs from the Standard Version.
d) make other distribution arrangements with the Copyright Holder.
4. You may distribute the programs of this Package in object code or
executable form, provided that you do at least ONE of the following:
a) distribute a Standard Version of the executables and library files,
together with instructions (in the manual page or equivalent) on where
to get the Standard Version.
b) accompany the distribution with the machine-readable source of
the Package with your modifications.
c) give non-standard executables non-standard names, and clearly
document the differences in manual pages (or equivalent), together
with instructions on where to get the Standard Version.
d) make other distribution arrangements with the Copyright Holder.
5. You may charge a reasonable copying fee for any distribution of this
Package. You may charge any fee you choose for support of this
Package. You may not charge a fee for this Package itself. However,
you may distribute this Package in aggregate with other (possibly
commercial) programs as part of a larger (possibly commercial) software
distribution provided that you do not advertise this Package as a
product of your own. You may embed this Package's interpreter within
an executable of yours (by linking); this shall be construed as a mere
form of aggregation, provided that the complete Standard Version of the
interpreter is so embedded.
6. The scripts and library files supplied as input to or produced as
output from the programs of this Package do not automatically fall
under the copyright of this Package, but belong to whomever generated
them, and may be sold commercially, and may be aggregated with this
Package. If such scripts or library files are aggregated with this
Package via the so-called "undump" or "unexec" methods of producing a
binary executable image, then distribution of such an image shall
neither be construed as a distribution of this Package nor shall it
fall under the restrictions of Paragraphs 3 and 4, provided that you do
not represent such an executable image as a Standard Version of this
Package.
7. C subroutines (or comparably compiled subroutines in other
languages) supplied by you and linked into this Package in order to
emulate subroutines and variables of the language defined by this
Package shall not be considered part of this Package, but are the
equivalent of input as in Paragraph 6, provided these subroutines do
not change the language in any way that would cause it to fail the
regression tests for the language.
8. Aggregation of this Package with a commercial distribution is always
permitted provided that the use of this Package is embedded; that is,
when no overt attempt is made to make this Package's interfaces visible
to the end user of the commercial distribution. Such use shall not be
construed as a distribution of this Package.
9. The name of the Copyright Holder may not be used to endorse or promote
products derived from this software without specific prior written permission.
10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
The End

View File

@@ -1,248 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 1, February 1989
Copyright (C) 1989 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 license agreements of most software companies try to keep users
at the mercy of those companies. By contrast, our 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. The
General Public License applies to the Free Software Foundation's
software and to any other program whose authors commit to using it.
You can use it for your programs, too.
When we speak of free software, we are referring to freedom, not
price. Specifically, the General Public License is designed to make
sure that you have the freedom to give away or sell copies of free
software, 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 a 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 tell them 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.
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 Agreement 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 work containing the
Program or a portion of it, either verbatim or with modifications. Each
licensee is addressed as "you".
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
General Public License and to the absence of any warranty; and give any
other recipients of the Program a copy of this General Public License
along with the Program. You may charge a fee for the physical act of
transferring a copy.
2. You may modify your copy or copies of the Program or any portion of
it, and copy and distribute such modifications under the terms of Paragraph
1 above, provided that you also do the following:
a) cause the modified files to carry prominent notices stating that
you changed the files and the date of any change; and
b) cause the whole of any work that you distribute or publish, that
in whole or in part contains the Program or any part thereof, either
with or without modifications, to be licensed at no charge to all
third parties under the terms of this General Public License (except
that you may choose to grant warranty protection to some or all
third parties, at your option).
c) If the modified program normally reads commands interactively when
run, you must cause it, when started running for such interactive use
in the simplest and most usual 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 General
Public License.
d) 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.
Mere aggregation of another independent work with the Program (or its
derivative) on a volume of a storage or distribution medium does not bring
the other work under the scope of these terms.
3. You may copy and distribute the Program (or a portion or derivative of
it, under Paragraph 2) in object code or executable form under the terms of
Paragraphs 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
Paragraphs 1 and 2 above; or,
b) accompany it with a written offer, valid for at least three
years, to give any third party free (except for a nominal charge
for the cost of distribution) a complete machine-readable copy of the
corresponding source code, to be distributed under the terms of
Paragraphs 1 and 2 above; or,
c) accompany it with the information you received as to where the
corresponding source code may be obtained. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form alone.)
Source code for a work means the preferred form of the work for making
modifications to it. For an executable file, complete source code means
all the source code for all modules it contains; but, as a special
exception, it need not include source code for modules which are standard
libraries that accompany the operating system on which the executable
file runs, or for standard header files or definitions files that
accompany that operating system.
4. You may not copy, modify, sublicense, distribute or transfer the
Program except as expressly provided under this General Public License.
Any attempt otherwise to copy, modify, sublicense, distribute or transfer
the Program is void, and will automatically terminate your rights to use
the Program under this License. However, parties who have received
copies, or rights to use copies, from you under this General Public
License will not have their licenses terminated so long as such parties
remain in full compliance.
5. By copying, distributing or modifying 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.
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.
7. 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 the 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
the license, you may choose any version ever published by the Free Software
Foundation.
8. 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
9. 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.
10. 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 humanity, the best way to achieve this is to make it
free software which everyone can redistribute and change under these
terms.
To do so, attach the following notices to the program. It is safest to
attach them to the start of each source file to most effectively convey
the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, 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) 19xx 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 a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
program `Gnomovision' (a program to direct compilers to make passes
at assemblers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
That's all there is to it!

View File

@@ -1,393 +0,0 @@
/* Curses.c
**
** Copyright (c) 1994-2000 William Setzer
**
** You may distribute under the terms of either the Artistic License
** or the GNU General Public License, as specified in the README file.
*/
#include "CursesDef.h"
#include "CursesTyp.h"
#include "c-config.h"
/* c-config.h above includes Ncurses header files that define macro
'instr'. Unfortunately, perl.h (below) also defines 'instr'.
Fortunately, we don't need the Curses version -- we use
winstr(stdscr, ...) instead. So we undef instr here to avoid a compiler
warning about the redeclaration.
Similarly, c-config.h may define a macro "tab", while the word
"tab" is used in perl.h another way, so we undefine it to avoid
a nasty syntax error.
"term.h" pollutes the name space with hundreds of other macros too.
We'll probably have to add to this list; maybe someday we should
just undef them all, since we don't use them.
"bool" is another, and is more problematic. Sometimes, ncurses.h
defines that explicitly and that's bad, but sometimes it does it
by including <stdbool.h>, and that's fine. In the former case,
we should undefine it now, but in the latter we can't, because then
a subsequent #include <stdbool.h> (by something we #include below)
won't define bool because stdbool.h has already been included.
We're going to leave bool alone now and wait for someone to report
that it breaks something. With a real example, we can then plan how
to work around this unfortunate ncurses.h behavior. We once had a
#undef bool.h in the Mac OSX hints file, so someone presumably found
it necessary. But we have also had a Mac OSX system on which compile
failed _because_ of that undef, for the reason described above.
*/
#undef instr
#undef tab
#include <EXTERN.h> /* Needed by <perl.h> */
#include <perl.h>
#include <XSUB.h>
/* I don't know why NEED_sv_2pv_flags is necessary, but ppport.h doesn't
work right without it. Maybe a bug in Devel::PPPort? */
#define NEED_sv_2pv_flags
#include "ppport.h"
#ifndef C_PANELSUPPORT
# define PANEL int
#endif
#ifndef C_MENUSUPPORT
# define MENU int
# define ITEM int
#endif
#ifndef C_FORMSUPPORT
# define FORM int
# define FIELD int
#endif
/* Before 1.17 (September 2007), we undefined macro 'SP' here, for
the Pdcurses case only. I don't know why, but it caused the build
with Pdcurses to fail, so we took it out. 'SP' is
defined in Perl's CORE/pp.h via our inclusion of perl.h above.
*/
/* What a mess. :( */
#ifndef PERL_VERSION
# define PL_sv_undef sv_undef
# define PL_sv_yes sv_yes
#endif
/*
** Begin support variables and functions
*/
static char *c_function;
static int c_win, c_x, c_arg;
static void
c_countargs(fn, nargs, base)
char *fn;
int nargs;
int base;
{
switch (nargs - base)
{
case 0: c_win = 0; c_x = 0; c_arg = 0; break;
case 1: c_win = 1; c_x = 0; c_arg = 1; break;
case 2: c_win = 0; c_x = 1; c_arg = 2; break;
case 3: c_win = 1; c_x = 2; c_arg = 3; break;
default:
croak("Curses function '%s' called with too %s arguments", fn,
nargs < base ? "few" : "many");
}
c_function = fn;
}
static void
c_exactargs(fn, nargs, base)
char *fn;
int nargs;
int base;
{
if (nargs != base)
croak("Curses function '%s' called with too %s arguments", fn,
nargs < base ? "few" : "many" );
c_function = fn;
}
static int
c_domove(win, sv_y, sv_x)
WINDOW *win;
SV *sv_y;
SV *sv_x;
{
int y = (int)SvIV(sv_y);
int x = (int)SvIV(sv_x);
return wmove(win, y, x);
}
static void
c_fun_not_there(fn)
char *fn;
{
croak("Curses function '%s' is not defined by your vendor", fn);
}
static void
c_var_not_there(fn)
char *fn;
{
croak("Curses variable '%s' is not defined by your vendor", fn);
}
static void
c_con_not_there(fn)
char *fn;
{
croak("Curses constant '%s' is not defined by your vendor", fn);
}
/*
** Begin complex type conversion routines
*/
static chtype
c_sv2chtype(sv)
SV *sv;
{
if (SvPOK(sv)) {
char *tmp = SvPV_nolen(sv);
return (chtype)(unsigned char)tmp[0];
}
return (chtype)SvIV(sv);
}
static void
c_chtype2sv(sv, ch)
SV *sv;
chtype ch;
{
if (ch == ERR || ch > 255) { sv_setiv(sv, (I32)ch); }
else {
char tmp[2];
tmp[0] = (char)ch;
tmp[1] = (char)0;
sv_setpv(sv, tmp);
}
}
static FIELD *
c_sv2field(sv, argnum)
SV *sv;
int argnum;
{
if (sv_derived_from(sv, "Curses::Field"))
return (FIELD *)SvIV((SV*)SvRV(sv));
if (argnum >= 0)
croak("argument %d to Curses function '%s' is not a Curses field",
argnum, c_function);
else
croak("argument is not a Curses field");
}
static void
c_field2sv(SV * const svP,
FIELD * const fieldP) {
/*----------------------------------------------------------------------------
Make *svP a reference to a scalar whose value is the numerical
equivalent of 'fieldP' and which is blessed into the hypothetical
package "Curses::Field".
-----------------------------------------------------------------------------*/
sv_setref_pv(svP, "Curses::Field", (void*)fieldP);
}
static FORM *
c_sv2form(sv, argnum)
SV *sv;
int argnum;
{
if (sv_derived_from(sv, "Curses::Form"))
return (FORM *)SvIV((SV*)SvRV(sv));
if (argnum >= 0)
croak("argument %d to Curses function '%s' is not a Curses form",
argnum, c_function);
else
croak("argument is not a Curses form");
}
static void
c_form2sv(sv, val)
SV *sv;
FORM *val;
{
sv_setref_pv(sv, "Curses::Form", (void*)val);
}
static ITEM *
c_sv2item(sv, argnum)
SV *sv;
int argnum;
{
if (sv_derived_from(sv, "Curses::Item"))
return (ITEM *)SvIV((SV*)SvRV(sv));
if (argnum >= 0)
croak("argument %d to Curses function '%s' is not a Curses item",
argnum, c_function);
else
croak("argument is not a Curses item");
}
static void
c_item2sv(sv, val)
SV *sv;
ITEM *val;
{
sv_setref_pv(sv, "Curses::Item", (void*)val);
}
static MENU *
c_sv2menu(sv, argnum)
SV *sv;
int argnum;
{
if (sv_derived_from(sv, "Curses::Menu"))
return (MENU *)SvIV((SV*)SvRV(sv));
if (argnum >= 0)
croak("argument %d to Curses function '%s' is not a Curses menu",
argnum, c_function);
else
croak("argument is not a Curses menu");
}
static void
c_menu2sv(sv, val)
SV *sv;
MENU *val;
{
sv_setref_pv(sv, "Curses::Menu", (void*)val);
}
static PANEL *
c_sv2panel(sv, argnum)
SV *sv;
int argnum;
{
if (sv_derived_from(sv, "Curses::Panel"))
return (PANEL *)SvIV((SV*)SvRV(sv));
if (argnum >= 0)
croak("argument %d to Curses function '%s' is not a Curses panel",
argnum, c_function);
else
croak("argument is not a Curses panel");
}
static void
c_panel2sv(sv, val)
SV *sv;
PANEL *val;
{
sv_setref_pv(sv, "Curses::Panel", (void*)val);
}
static SCREEN *
c_sv2screen(sv, argnum)
SV *sv;
int argnum;
{
if (sv_derived_from(sv, "Curses::Screen"))
return (SCREEN *)SvIV((SV*)SvRV(sv));
if (argnum >= 0)
croak("argument %d to Curses function '%s' is not a Curses screen",
argnum, c_function);
else
croak("argument is not a Curses screen");
}
static void
c_screen2sv(sv, val)
SV *sv;
SCREEN *val;
{
sv_setref_pv(sv, "Curses::Screen", (void*)val);
}
static WINDOW *
c_sv2window(sv, argnum)
SV *sv;
int argnum;
{
if (sv_derived_from(sv, "Curses::Window")) {
WINDOW *ret = (WINDOW *)SvIV((SV*)SvRV(sv));
return ret;
}
if (argnum >= 0)
croak("argument %d to Curses function '%s' is not a Curses window",
argnum, c_function);
else
croak("argument is not a Curses window");
}
static void
c_window2sv(sv, val)
SV *sv;
WINDOW *val;
{
sv_setref_pv(sv, "Curses::Window", (void*)val);
}
static void
c_setchar(sv, name)
SV *sv;
char *name;
{
int len = SvLEN(sv);
if (len > 0) {
name[len - 1] = 0;
SvCUR(sv) = strlen(name);
SvPOK_only(sv);
*SvEND(sv) = 0;
}
}
static void
c_setchtype(sv, name)
SV *sv;
chtype *name;
{
int n = 0;
int rs = sizeof(chtype);
int len = SvLEN(sv);
if (len - len % rs > rs) { /* find even multiple of rs */
name[len - len % rs - rs] = 0;
while (*name++) { n++; }
SvCUR(sv) = n;
SvPOK_only(sv);
*(chtype *)SvEND(sv) = 0;
}
}
static void
c_setmevent(sv)
SV *sv;
{
SvCUR(sv) = sizeof(MEVENT);
SvPOK_only(sv);
}
/*
** Cheesy, I know. But it works.
*/
#include "CursesFun.c"
#include "CursesVar.c"
#include "CursesCon.c"
#include "CursesBoot.c"

View File

@@ -1,899 +0,0 @@
## CursesFun.c -- the functions
##
## Copyright (c) 1994-2000 William Setzer
##
## You may distribute under the terms of either the Artistic License
## or the GNU General Public License, as specified in the README file.
###
## For the brave object-using person
#
package Curses::Window;
@ISA = qw(Curses);
package Curses::Screen;
@ISA = qw(Curses);
sub new { newterm(@_) }
sub DESTROY { }
package Curses::Panel;
@ISA = qw(Curses);
sub new { new_panel(@_) }
sub DESTROY { }
package Curses::Menu;
@ISA = qw(Curses);
sub new { new_menu(@_) }
sub DESTROY { }
package Curses::Item;
@ISA = qw(Curses);
sub new { new_item(@_) }
sub DESTROY { }
package Curses::Form;
@ISA = qw(Curses);
sub new { new_form(@_) }
sub DESTROY { }
package Curses::Field;
@ISA = qw(Curses);
sub new { new_field(@_) }
sub DESTROY { }
package Curses;
$VERSION = '1.23'; # Makefile.PL picks this up
use Carp;
require Exporter;
require DynaLoader;
@ISA = qw(Exporter DynaLoader);
bootstrap Curses;
sub new {
my $pkg = shift;
my ($nl, $nc, $by, $bx) = (@_,0,0,0,0);
unless ($_initscr++) { initscr() }
return newwin($nl, $nc, $by, $bx);
}
sub DESTROY { }
sub AUTOLOAD {
my $N = $AUTOLOAD;
$N =~ s/^.*:://;
croak "Curses constant '$N' is not defined by your vendor";
}
sub printw { addstr(sprintf shift, @_) }
tie $LINES, Curses::Vars, 1;
tie $COLS, Curses::Vars, 2;
tie $stdscr, Curses::Vars, 3;
tie $curscr, Curses::Vars, 4;
tie $COLORS, Curses::Vars, 5;
tie $COLOR_PAIRS, Curses::Vars, 6;
@EXPORT = qw(
printw
LINES $LINES COLS $COLS stdscr $stdscr curscr $curscr COLORS $COLORS
COLOR_PAIRS $COLOR_PAIRS
addch echochar addchstr addchnstr addstr addnstr attroff attron attrset
standend standout attr_get attr_off attr_on attr_set chgat COLOR_PAIR
PAIR_NUMBER beep flash bkgd bkgdset getbkgd border box hline vline
erase clear clrtobot clrtoeol start_color init_pair init_color
has_colors can_change_color color_content pair_content delch deleteln
insdelln insertln getch ungetch has_key KEY_F getstr getnstr getyx
getparyx getbegyx getmaxyx inch inchstr inchnstr initscr endwin
isendwin newterm set_term delscreen cbreak nocbreak echo noecho
halfdelay intrflush keypad meta nodelay notimeout raw noraw qiflush
noqiflush timeout typeahead insch insstr insnstr instr innstr
def_prog_mode def_shell_mode reset_prog_mode reset_shell_mode resetty
savetty getsyx setsyx curs_set napms move clearok idlok idcok immedok
leaveok setscrreg scrollok nl nonl overlay overwrite copywin newpad
subpad prefresh pnoutrefresh pechochar refresh noutrefresh doupdate
redrawwin redrawln scr_dump scr_restore scr_init scr_set scroll scrl
slk_init slk_set slk_refresh slk_noutrefresh slk_label slk_clear
slk_restore slk_touch slk_attron slk_attrset slk_attr slk_attroff
slk_color baudrate erasechar has_ic has_il killchar longname termattrs
termname touchwin touchline untouchwin touchln is_linetouched
is_wintouched unctrl keyname filter use_env putwin getwin delay_output
flushinp newwin delwin mvwin subwin derwin mvderwin dupwin syncup
syncok cursyncup syncdown getmouse ungetmouse mousemask enclose
mouse_trafo mouseinterval BUTTON_RELEASE BUTTON_PRESS BUTTON_CLICK
BUTTON_DOUBLE_CLICK BUTTON_TRIPLE_CLICK BUTTON_RESERVED_EVENT
use_default_colors assume_default_colors define_key keybound keyok
resizeterm resize getmaxy getmaxx flusok getcap touchoverlap new_panel
bottom_panel top_panel show_panel update_panels hide_panel panel_window
replace_panel move_panel panel_hidden panel_above panel_below
set_panel_userptr panel_userptr del_panel set_menu_fore menu_fore
set_menu_back menu_back set_menu_grey menu_grey set_menu_pad menu_pad
pos_menu_cursor menu_driver set_menu_format menu_format set_menu_items
menu_items item_count set_menu_mark menu_mark new_menu free_menu
menu_opts set_menu_opts menu_opts_on menu_opts_off set_menu_pattern
menu_pattern post_menu unpost_menu set_menu_userptr menu_userptr
set_menu_win menu_win set_menu_sub menu_sub scale_menu set_current_item
current_item set_top_row top_row item_index item_name item_description
new_item free_item set_item_opts item_opts_on item_opts_off item_opts
item_userptr set_item_userptr set_item_value item_value item_visible
menu_request_name menu_request_by_name set_menu_spacing menu_spacing
pos_form_cursor data_ahead data_behind form_driver set_form_fields
form_fields field_count move_field new_form free_form set_new_page
new_page set_form_opts form_opts_on form_opts_off form_opts
set_current_field current_field set_form_page form_page field_index
post_form unpost_form set_form_userptr form_userptr set_form_win
form_win set_form_sub form_sub scale_form set_field_fore field_fore
set_field_back field_back set_field_pad field_pad set_field_buffer
field_buffer set_field_status field_status set_max_field field_info
dynamic_field_info set_field_just field_just new_field dup_field
link_field free_field set_field_opts field_opts_on field_opts_off
field_opts set_field_userptr field_userptr field_arg form_request_name
form_request_by_name
ERR OK ACS_BLOCK ACS_BOARD ACS_BTEE ACS_BULLET ACS_CKBOARD ACS_DARROW
ACS_DEGREE ACS_DIAMOND ACS_HLINE ACS_LANTERN ACS_LARROW ACS_LLCORNER
ACS_LRCORNER ACS_LTEE ACS_PLMINUS ACS_PLUS ACS_RARROW ACS_RTEE ACS_S1
ACS_S9 ACS_TTEE ACS_UARROW ACS_ULCORNER ACS_URCORNER ACS_VLINE
A_ALTCHARSET A_ATTRIBUTES A_BLINK A_BOLD A_CHARTEXT A_COLOR A_DIM
A_INVIS A_NORMAL A_PROTECT A_REVERSE A_STANDOUT A_UNDERLINE COLOR_BLACK
COLOR_BLUE COLOR_CYAN COLOR_GREEN COLOR_MAGENTA COLOR_RED COLOR_WHITE
COLOR_YELLOW KEY_A1 KEY_A3 KEY_B2 KEY_BACKSPACE KEY_BEG KEY_BREAK
KEY_BTAB KEY_C1 KEY_C3 KEY_CANCEL KEY_CATAB KEY_CLEAR KEY_CLOSE
KEY_COMMAND KEY_COPY KEY_CREATE KEY_CTAB KEY_DC KEY_DL KEY_DOWN KEY_EIC
KEY_END KEY_ENTER KEY_EOL KEY_EOS KEY_EXIT KEY_F0 KEY_FIND KEY_HELP
KEY_HOME KEY_IC KEY_IL KEY_LEFT KEY_LL KEY_MARK KEY_MAX KEY_MESSAGE
KEY_MIN KEY_MOVE KEY_NEXT KEY_NPAGE KEY_OPEN KEY_OPTIONS KEY_PPAGE
KEY_PREVIOUS KEY_PRINT KEY_REDO KEY_REFERENCE KEY_REFRESH KEY_REPLACE
KEY_RESET KEY_RESTART KEY_RESUME KEY_RIGHT KEY_SAVE KEY_SBEG
KEY_SCANCEL KEY_SCOMMAND KEY_SCOPY KEY_SCREATE KEY_SDC KEY_SDL
KEY_SELECT KEY_SEND KEY_SEOL KEY_SEXIT KEY_SF KEY_SFIND KEY_SHELP
KEY_SHOME KEY_SIC KEY_SLEFT KEY_SMESSAGE KEY_SMOVE KEY_SNEXT
KEY_SOPTIONS KEY_SPREVIOUS KEY_SPRINT KEY_SR KEY_SREDO KEY_SREPLACE
KEY_SRESET KEY_SRIGHT KEY_SRSUME KEY_SSAVE KEY_SSUSPEND KEY_STAB
KEY_SUNDO KEY_SUSPEND KEY_UNDO KEY_UP KEY_MOUSE BUTTON1_RELEASED
BUTTON1_PRESSED BUTTON1_CLICKED BUTTON1_DOUBLE_CLICKED
BUTTON1_TRIPLE_CLICKED BUTTON1_RESERVED_EVENT BUTTON2_RELEASED
BUTTON2_PRESSED BUTTON2_CLICKED BUTTON2_DOUBLE_CLICKED
BUTTON2_TRIPLE_CLICKED BUTTON2_RESERVED_EVENT BUTTON3_RELEASED
BUTTON3_PRESSED BUTTON3_CLICKED BUTTON3_DOUBLE_CLICKED
BUTTON3_TRIPLE_CLICKED BUTTON3_RESERVED_EVENT BUTTON4_RELEASED
BUTTON4_PRESSED BUTTON4_CLICKED BUTTON4_DOUBLE_CLICKED
BUTTON4_TRIPLE_CLICKED BUTTON4_RESERVED_EVENT BUTTON_CTRL BUTTON_SHIFT
BUTTON_ALT ALL_MOUSE_EVENTS REPORT_MOUSE_POSITION NCURSES_MOUSE_VERSION
E_OK E_SYSTEM_ERROR E_BAD_ARGUMENT E_POSTED E_CONNECTED E_BAD_STATE
E_NO_ROOM E_NOT_POSTED E_UNKNOWN_COMMAND E_NO_MATCH E_NOT_SELECTABLE
E_NOT_CONNECTED E_REQUEST_DENIED E_INVALID_FIELD E_CURRENT
REQ_LEFT_ITEM REQ_RIGHT_ITEM REQ_UP_ITEM REQ_DOWN_ITEM REQ_SCR_ULINE
REQ_SCR_DLINE REQ_SCR_DPAGE REQ_SCR_UPAGE REQ_FIRST_ITEM REQ_LAST_ITEM
REQ_NEXT_ITEM REQ_PREV_ITEM REQ_TOGGLE_ITEM REQ_CLEAR_PATTERN
REQ_BACK_PATTERN REQ_NEXT_MATCH REQ_PREV_MATCH MIN_MENU_COMMAND
MAX_MENU_COMMAND O_ONEVALUE O_SHOWDESC O_ROWMAJOR O_IGNORECASE
O_SHOWMATCH O_NONCYCLIC O_SELECTABLE REQ_NEXT_PAGE REQ_PREV_PAGE
REQ_FIRST_PAGE REQ_LAST_PAGE REQ_NEXT_FIELD REQ_PREV_FIELD
REQ_FIRST_FIELD REQ_LAST_FIELD REQ_SNEXT_FIELD REQ_SPREV_FIELD
REQ_SFIRST_FIELD REQ_SLAST_FIELD REQ_LEFT_FIELD REQ_RIGHT_FIELD
REQ_UP_FIELD REQ_DOWN_FIELD REQ_NEXT_CHAR REQ_PREV_CHAR REQ_NEXT_LINE
REQ_PREV_LINE REQ_NEXT_WORD REQ_PREV_WORD REQ_BEG_FIELD REQ_END_FIELD
REQ_BEG_LINE REQ_END_LINE REQ_LEFT_CHAR REQ_RIGHT_CHAR REQ_UP_CHAR
REQ_DOWN_CHAR REQ_NEW_LINE REQ_INS_CHAR REQ_INS_LINE REQ_DEL_CHAR
REQ_DEL_PREV REQ_DEL_LINE REQ_DEL_WORD REQ_CLR_EOL REQ_CLR_EOF
REQ_CLR_FIELD REQ_OVL_MODE REQ_INS_MODE REQ_SCR_FLINE REQ_SCR_BLINE
REQ_SCR_FPAGE REQ_SCR_BPAGE REQ_SCR_FHPAGE REQ_SCR_BHPAGE REQ_SCR_FCHAR
REQ_SCR_BCHAR REQ_SCR_HFLINE REQ_SCR_HBLINE REQ_SCR_HFHALF
REQ_SCR_HBHALF REQ_VALIDATION REQ_NEXT_CHOICE REQ_PREV_CHOICE
MIN_FORM_COMMAND MAX_FORM_COMMAND NO_JUSTIFICATION JUSTIFY_LEFT
JUSTIFY_CENTER JUSTIFY_RIGHT O_VISIBLE O_ACTIVE O_PUBLIC O_EDIT O_WRAP
O_BLANK O_AUTOSKIP O_NULLOK O_PASSOK O_STATIC O_NL_OVERLOAD
O_BS_OVERLOAD
);
if ($OldCurses)
{
@_OLD = qw(
wprintw mvprintw wmvprintw
waddch mvaddch mvwaddch wechochar waddchstr mvaddchstr
mvwaddchstr waddchnstr mvaddchnstr mvwaddchnstr waddstr
mvaddstr mvwaddstr waddnstr mvaddnstr mvwaddnstr wattroff
wattron wattrset wstandend wstandout wattr_get wattr_off wattr_on
wattr_set wchgat mvchgat mvwchgat wbkgd wbkgdset wborder whline
mvhline mvwhline wvline mvvline mvwvline werase wclear
wclrtobot wclrtoeol wdelch mvdelch mvwdelch wdeleteln winsdelln
winsertln wgetch mvgetch mvwgetch wgetstr mvgetstr mvwgetstr
wgetnstr mvgetnstr mvwgetnstr winch mvinch mvwinch winchstr
mvinchstr mvwinchstr winchnstr mvinchnstr mvwinchnstr wtimeout
winsch mvinsch mvwinsch winsstr mvinsstr mvwinsstr winsnstr
mvinsnstr mvwinsnstr winstr mvinstr mvwinstr winnstr mvinnstr
mvwinnstr wmove wsetscrreg wrefresh wnoutrefresh wredrawln wscrl
wtouchln wsyncup wcursyncup wsyncdown wenclose wmouse_trafo wresize
);
push (@EXPORT, @_OLD);
for (@_OLD)
{
/^(?:mv)?(?:w)?(.*)/;
eval "sub $_ { $1(\@_); }";
}
eval <<EOS;
sub wprintw { addstr(shift, sprintf shift, @_) }
sub mvprintw { addstr(shift, shift, sprintf shift, @_) }
sub mvwprintw { addstr(shift, shift, shift, sprintf shift, @_) }
EOS
}
1;
__END__
=head1 NAME
Curses - terminal screen handling and optimization
=head1 SYNOPSIS
use Curses;
initscr;
...
endwin;
Curses::supports_function($function);
Curses::supports_constant($constant);
=head1 DESCRIPTION
C<Curses> is the interface between Perl and your system's curses(3)
library. For descriptions on the usage of a given function, variable,
or constant, consult your system's documentation, as such information
invariably varies (:-) between different curses(3) libraries and
operating systems. This document describes the interface itself, and
assumes that you already know how your system's curses(3) library
works.
=head2 Unified Functions
Many curses(3) functions have variants starting with the prefixes
I<w->, I<mv->, and/or I<wmv->. These variants differ only in the
explicit addition of a window, or by the addition of two coordinates
that are used to move the cursor first. For example, C<addch()> has
three other variants: C<waddch()>, C<mvaddch()>, and C<mvwaddch()>.
The variants aren't very interesting; in fact, we could roll all of
the variants into original function by allowing a variable number
of arguments and analyzing the argument list for which variant the
user wanted to call.
Unfortunately, curses(3) predates varargs(3), so in C we were stuck
with all the variants. However, C<Curses> is a Perl interface, so we
are free to "unify" these variants into one function. The section
L<"Supported Functions"> below lists all curses(3) function supported
by C<Curses>, along with a column listing if it is I<unified>. If
so, it takes a varying number of arguments as follows:
=over 4
C<function( [win], [y, x], args );>
I<win> is an optional window argument, defaulting to C<stdscr> if not
specified.
I<y, x> is an optional coordinate pair used to move the cursor,
defaulting to no move if not specified.
I<args> are the required arguments of the function. These are the
arguments you would specify if you were just calling the base function
and not any of the variants.
=back
This makes the variants obsolete, since their functionality has been
merged into a single function, so C<Curses> does not define them by
default. You can still get them if you want, by setting the
variable C<$Curses::OldCurses> to a non-zero value before using the
C<Curses> package. See L<"Perl 4.X C<cursperl> Compatibility">
for an example of this.
=head2 Objects
Objects are supported. Example:
$win = new Curses;
$win->addstr(10, 10, 'foo');
$win->refresh;
...
Any function that has been marked as I<unified> (see
L<"Supported Functions"> below and L<"Unified Functions"> above)
can be called as a method for a Curses object.
Do not use C<initscr()> if using objects, as the first call to get
a C<new Curses> will do it for you.
=head2 Security Concerns
It has always been the case with the curses functions, but please note
that the following functions:
getstr() (and optional wgetstr(), mvgetstr(), and mvwgetstr())
inchstr() (and optional winchstr(), mvinchstr(), and mvwinchstr())
instr() (and optional winstr(), mvinstr(), and mvwinstr())
are subject to buffer overflow attack. This is because you pass in
the buffer to be filled in, which has to be of finite length, but
there is no way to stop a bad guy from typing.
In order to avoid this problem, use the alternate functions:
getnstr()
inchnstr()
innstr()
which take an extra "size of buffer" argument.
=head1 COMPATIBILITY
=head2 Perl 4.X C<cursperl> Compatibility
C<Curses> has been written to take advantage of the new features of
Perl. I felt it better to provide an improved curses programming
environment rather than to be 100% compatible. However, many old
C<curseperl> applications will probably still work by starting the
script with:
BEGIN { $Curses::OldCurses = 1; }
use Curses;
Any old application that still does not work should print an
understandable error message explaining the problem.
Some functions and variables are not supported by C<Curses>, even with
the C<BEGIN> line. They are listed under
L<"curses(3) items not supported by Curses">.
The variables C<$stdscr> and C<$curscr> are also available as
functions C<stdscr> and C<curscr>. This is because of a Perl bug.
See the L<BUGS> section for details.
=head2 Incompatibilities with previous versions of C<Curses>
In previous versions of this software, some Perl functions took a
different set of parameters than their C counterparts. This is no
longer true. You should now use C<getstr($str)> and C<getyx($y, $x)>
instead of C<$str = getstr()> and C<($y, $x) = getyx()>.
=head2 Incompatibilities with other Perl programs
menu.pl, v3.0 and v3.1
There were various interaction problems between these two
releases and Curses. Please upgrade to the latest version
(v3.3 as of 3/16/96).
=head1 DIAGNOSTICS
=over 4
=item * Curses function '%s' called with too %s arguments at ...
You have called a C<Curses> function with a wrong number of
arguments.
=item * argument %d to Curses function '%s' is not a Curses %s at ...
=item * argument is not a Curses %s at ...
The argument you gave to the function wasn't what it wanted.
This probably means that you didn't give the right arguments to a
I<unified> function. See the DESCRIPTION section on L<Unified
Functions> for more information.
=item * Curses function '%s' is not defined by your vendor at ...
You have a C<Curses> function in your code that your system's curses(3)
library doesn't define.
=item * Curses variable '%s' is not defined by your vendor at ...
You have a C<Curses> variable in your code that your system's curses(3)
library doesn't define.
=item * Curses constant '%s' is not defined by your vendor at ...
You have a C<Curses> constant in your code that your system's curses(3)
library doesn't define.
=item * Curses::Vars::FETCH called with bad index at ...
=item * Curses::Vars::STORE called with bad index at ...
You've been playing with the C<tie> interface to the C<Curses>
variables. Don't do that. :-)
=item * Anything else
Check out the F<perldiag> man page to see if the error is in there.
=back
=head1 BUGS
If you use the variables C<$stdscr> and C<$curscr> instead of their
functional counterparts (C<stdscr> and C<curscr>), you might run into
a bug in Perl where the "magic" isn't called early enough. This is
manifested by the C<Curses> package telling you C<$stdscr> isn't a
window. One workaround is to put a line like C<$stdscr = $stdscr>
near the front of your program.
Probably many more.
=head1 AUTHOR
William Setzer <William_Setzer@ncsu.edu>
=head1 SYNOPSIS OF PERL CURSES SUPPORT
=head2 Supported Functions
Supported Unified? Supported via $OldCurses[*]
--------- -------- ------------------------
addch Yes waddch mvaddch mvwaddch
echochar Yes wechochar
addchstr Yes waddchstr mvaddchstr mvwaddchstr
addchnstr Yes waddchnstr mvaddchnstr mvwaddchnstr
addstr Yes waddstr mvaddstr mvwaddstr
addnstr Yes waddnstr mvaddnstr mvwaddnstr
attroff Yes wattroff
attron Yes wattron
attrset Yes wattrset
standend Yes wstandend
standout Yes wstandout
attr_get Yes wattr_get
attr_off Yes wattr_off
attr_on Yes wattr_on
attr_set Yes wattr_set
chgat Yes wchgat mvchgat mvwchgat
COLOR_PAIR No
PAIR_NUMBER No
beep No
flash No
bkgd Yes wbkgd
bkgdset Yes wbkgdset
getbkgd Yes
border Yes wborder
box Yes
hline Yes whline mvhline mvwhline
vline Yes wvline mvvline mvwvline
erase Yes werase
clear Yes wclear
clrtobot Yes wclrtobot
clrtoeol Yes wclrtoeol
start_color No
init_pair No
init_color No
has_colors No
can_change_color No
color_content No
pair_content No
delch Yes wdelch mvdelch mvwdelch
deleteln Yes wdeleteln
insdelln Yes winsdelln
insertln Yes winsertln
getch Yes wgetch mvgetch mvwgetch
ungetch No
has_key No
KEY_F No
getstr Yes wgetstr mvgetstr mvwgetstr
getnstr Yes wgetnstr mvgetnstr mvwgetnstr
getyx Yes
getparyx Yes
getbegyx Yes
getmaxyx Yes
inch Yes winch mvinch mvwinch
inchstr Yes winchstr mvinchstr mvwinchstr
inchnstr Yes winchnstr mvinchnstr mvwinchnstr
initscr No
endwin No
isendwin No
newterm No
set_term No
delscreen No
cbreak No
nocbreak No
echo No
noecho No
halfdelay No
intrflush Yes
keypad Yes
meta Yes
nodelay Yes
notimeout Yes
raw No
noraw No
qiflush No
noqiflush No
timeout Yes wtimeout
typeahead No
insch Yes winsch mvinsch mvwinsch
insstr Yes winsstr mvinsstr mvwinsstr
insnstr Yes winsnstr mvinsnstr mvwinsnstr
instr Yes winstr mvinstr mvwinstr
innstr Yes winnstr mvinnstr mvwinnstr
def_prog_mode No
def_shell_mode No
reset_prog_mode No
reset_shell_mode No
resetty No
savetty No
getsyx No
setsyx No
curs_set No
napms No
move Yes wmove
clearok Yes
idlok Yes
idcok Yes
immedok Yes
leaveok Yes
setscrreg Yes wsetscrreg
scrollok Yes
nl No
nonl No
overlay No
overwrite No
copywin No
newpad No
subpad No
prefresh No
pnoutrefresh No
pechochar No
refresh Yes wrefresh
noutrefresh Yes wnoutrefresh
doupdate No
redrawwin Yes
redrawln Yes wredrawln
scr_dump No
scr_restore No
scr_init No
scr_set No
scroll Yes
scrl Yes wscrl
slk_init No
slk_set No
slk_refresh No
slk_noutrefresh No
slk_label No
slk_clear No
slk_restore No
slk_touch No
slk_attron No
slk_attrset No
slk_attr No
slk_attroff No
slk_color No
baudrate No
erasechar No
has_ic No
has_il No
killchar No
longname No
termattrs No
termname No
touchwin Yes
touchline Yes
untouchwin Yes
touchln Yes wtouchln
is_linetouched Yes
is_wintouched Yes
unctrl No
keyname No
filter No
use_env No
putwin No
getwin No
delay_output No
flushinp No
newwin No
delwin Yes
mvwin Yes
subwin Yes
derwin Yes
mvderwin Yes
dupwin Yes
syncup Yes wsyncup
syncok Yes
cursyncup Yes wcursyncup
syncdown Yes wsyncdown
getmouse No
ungetmouse No
mousemask No
enclose Yes wenclose
mouse_trafo Yes wmouse_trafo
mouseinterval No
BUTTON_RELEASE No
BUTTON_PRESS No
BUTTON_CLICK No
BUTTON_DOUBLE_CLICK No
BUTTON_TRIPLE_CLICK No
BUTTON_RESERVED_EVENT No
use_default_colors No
assume_default_colors No
define_key No
keybound No
keyok No
resizeterm No
resize Yes wresize
getmaxy Yes
getmaxx Yes
flusok Yes
getcap No
touchoverlap No
new_panel No
bottom_panel No
top_panel No
show_panel No
update_panels No
hide_panel No
panel_window No
replace_panel No
move_panel No
panel_hidden No
panel_above No
panel_below No
set_panel_userptr No
panel_userptr No
del_panel No
set_menu_fore No
menu_fore No
set_menu_back No
menu_back No
set_menu_grey No
menu_grey No
set_menu_pad No
menu_pad No
pos_menu_cursor No
menu_driver No
set_menu_format No
menu_format No
set_menu_items No
menu_items No
item_count No
set_menu_mark No
menu_mark No
new_menu No
free_menu No
menu_opts No
set_menu_opts No
menu_opts_on No
menu_opts_off No
set_menu_pattern No
menu_pattern No
post_menu No
unpost_menu No
set_menu_userptr No
menu_userptr No
set_menu_win No
menu_win No
set_menu_sub No
menu_sub No
scale_menu No
set_current_item No
current_item No
set_top_row No
top_row No
item_index No
item_name No
item_description No
new_item No
free_item No
set_item_opts No
item_opts_on No
item_opts_off No
item_opts No
item_userptr No
set_item_userptr No
set_item_value No
item_value No
item_visible No
menu_request_name No
menu_request_by_name No
set_menu_spacing No
menu_spacing No
pos_form_cursor No
data_ahead No
data_behind No
form_driver No
set_form_fields No
form_fields No
field_count No
move_field No
new_form No
free_form No
set_new_page No
new_page No
set_form_opts No
form_opts_on No
form_opts_off No
form_opts No
set_current_field No
current_field No
set_form_page No
form_page No
field_index No
post_form No
unpost_form No
set_form_userptr No
form_userptr No
set_form_win No
form_win No
set_form_sub No
form_sub No
scale_form No
set_field_fore No
field_fore No
set_field_back No
field_back No
set_field_pad No
field_pad No
set_field_buffer No
field_buffer No
set_field_status No
field_status No
set_max_field No
field_info No
dynamic_field_info No
set_field_just No
field_just No
new_field No
dup_field No
link_field No
free_field No
set_field_opts No
field_opts_on No
field_opts_off No
field_opts No
set_field_userptr No
field_userptr No
field_arg No
form_request_name No
form_request_by_name No
[*] To use any functions in this column, the variable
C<$Curses::OldCurses> must be set to a non-zero value before using the
C<Curses> package. See L<"Perl 4.X cursperl Compatibility"> for an
example of this.
=head2 Supported Variables
LINES COLS stdscr
curscr COLORS COLOR_PAIRS
=head2 Supported Constants
ERR OK ACS_BLOCK
ACS_BOARD ACS_BTEE ACS_BULLET
ACS_CKBOARD ACS_DARROW ACS_DEGREE
ACS_DIAMOND ACS_HLINE ACS_LANTERN
ACS_LARROW ACS_LLCORNER ACS_LRCORNER
ACS_LTEE ACS_PLMINUS ACS_PLUS
ACS_RARROW ACS_RTEE ACS_S1
ACS_S9 ACS_TTEE ACS_UARROW
ACS_ULCORNER ACS_URCORNER ACS_VLINE
A_ALTCHARSET A_ATTRIBUTES A_BLINK
A_BOLD A_CHARTEXT A_COLOR
A_DIM A_INVIS A_NORMAL
A_PROTECT A_REVERSE A_STANDOUT
A_UNDERLINE COLOR_BLACK COLOR_BLUE
COLOR_CYAN COLOR_GREEN COLOR_MAGENTA
COLOR_RED COLOR_WHITE COLOR_YELLOW
KEY_A1 KEY_A3 KEY_B2
KEY_BACKSPACE KEY_BEG KEY_BREAK
KEY_BTAB KEY_C1 KEY_C3
KEY_CANCEL KEY_CATAB KEY_CLEAR
KEY_CLOSE KEY_COMMAND KEY_COPY
KEY_CREATE KEY_CTAB KEY_DC
KEY_DL KEY_DOWN KEY_EIC
KEY_END KEY_ENTER KEY_EOL
KEY_EOS KEY_EXIT KEY_F0
KEY_FIND KEY_HELP KEY_HOME
KEY_IC KEY_IL KEY_LEFT
KEY_LL KEY_MARK KEY_MAX
KEY_MESSAGE KEY_MIN KEY_MOVE
KEY_NEXT KEY_NPAGE KEY_OPEN
KEY_OPTIONS KEY_PPAGE KEY_PREVIOUS
KEY_PRINT KEY_REDO KEY_REFERENCE
KEY_REFRESH KEY_REPLACE KEY_RESET
KEY_RESTART KEY_RESUME KEY_RIGHT
KEY_SAVE KEY_SBEG KEY_SCANCEL
KEY_SCOMMAND KEY_SCOPY KEY_SCREATE
KEY_SDC KEY_SDL KEY_SELECT
KEY_SEND KEY_SEOL KEY_SEXIT
KEY_SF KEY_SFIND KEY_SHELP
KEY_SHOME KEY_SIC KEY_SLEFT
KEY_SMESSAGE KEY_SMOVE KEY_SNEXT
KEY_SOPTIONS KEY_SPREVIOUS KEY_SPRINT
KEY_SR KEY_SREDO KEY_SREPLACE
KEY_SRESET KEY_SRIGHT KEY_SRSUME
KEY_SSAVE KEY_SSUSPEND KEY_STAB
KEY_SUNDO KEY_SUSPEND KEY_UNDO
KEY_UP KEY_MOUSE BUTTON1_RELEASED
BUTTON1_PRESSED BUTTON1_CLICKED BUTTON1_DOUBLE_CLICKED
BUTTON1_TRIPLE_CLICKED BUTTON1_RESERVED_EVENT BUTTON2_RELEASED
BUTTON2_PRESSED BUTTON2_CLICKED BUTTON2_DOUBLE_CLICKED
BUTTON2_TRIPLE_CLICKED BUTTON2_RESERVED_EVENT BUTTON3_RELEASED
BUTTON3_PRESSED BUTTON3_CLICKED BUTTON3_DOUBLE_CLICKED
BUTTON3_TRIPLE_CLICKED BUTTON3_RESERVED_EVENT BUTTON4_RELEASED
BUTTON4_PRESSED BUTTON4_CLICKED BUTTON4_DOUBLE_CLICKED
BUTTON4_TRIPLE_CLICKED BUTTON4_RESERVED_EVENT BUTTON_CTRL
BUTTON_SHIFT BUTTON_ALT ALL_MOUSE_EVENTS
REPORT_MOUSE_POSITION NCURSES_MOUSE_VERSION E_OK
E_SYSTEM_ERROR E_BAD_ARGUMENT E_POSTED
E_CONNECTED E_BAD_STATE E_NO_ROOM
E_NOT_POSTED E_UNKNOWN_COMMAND E_NO_MATCH
E_NOT_SELECTABLE E_NOT_CONNECTED E_REQUEST_DENIED
E_INVALID_FIELD E_CURRENT REQ_LEFT_ITEM
REQ_RIGHT_ITEM REQ_UP_ITEM REQ_DOWN_ITEM
REQ_SCR_ULINE REQ_SCR_DLINE REQ_SCR_DPAGE
REQ_SCR_UPAGE REQ_FIRST_ITEM REQ_LAST_ITEM
REQ_NEXT_ITEM REQ_PREV_ITEM REQ_TOGGLE_ITEM
REQ_CLEAR_PATTERN REQ_BACK_PATTERN REQ_NEXT_MATCH
REQ_PREV_MATCH MIN_MENU_COMMAND MAX_MENU_COMMAND
O_ONEVALUE O_SHOWDESC O_ROWMAJOR
O_IGNORECASE O_SHOWMATCH O_NONCYCLIC
O_SELECTABLE REQ_NEXT_PAGE REQ_PREV_PAGE
REQ_FIRST_PAGE REQ_LAST_PAGE REQ_NEXT_FIELD
REQ_PREV_FIELD REQ_FIRST_FIELD REQ_LAST_FIELD
REQ_SNEXT_FIELD REQ_SPREV_FIELD REQ_SFIRST_FIELD
REQ_SLAST_FIELD REQ_LEFT_FIELD REQ_RIGHT_FIELD
REQ_UP_FIELD REQ_DOWN_FIELD REQ_NEXT_CHAR
REQ_PREV_CHAR REQ_NEXT_LINE REQ_PREV_LINE
REQ_NEXT_WORD REQ_PREV_WORD REQ_BEG_FIELD
REQ_END_FIELD REQ_BEG_LINE REQ_END_LINE
REQ_LEFT_CHAR REQ_RIGHT_CHAR REQ_UP_CHAR
REQ_DOWN_CHAR REQ_NEW_LINE REQ_INS_CHAR
REQ_INS_LINE REQ_DEL_CHAR REQ_DEL_PREV
REQ_DEL_LINE REQ_DEL_WORD REQ_CLR_EOL
REQ_CLR_EOF REQ_CLR_FIELD REQ_OVL_MODE
REQ_INS_MODE REQ_SCR_FLINE REQ_SCR_BLINE
REQ_SCR_FPAGE REQ_SCR_BPAGE REQ_SCR_FHPAGE
REQ_SCR_BHPAGE REQ_SCR_FCHAR REQ_SCR_BCHAR
REQ_SCR_HFLINE REQ_SCR_HBLINE REQ_SCR_HFHALF
REQ_SCR_HBHALF REQ_VALIDATION REQ_NEXT_CHOICE
REQ_PREV_CHOICE MIN_FORM_COMMAND MAX_FORM_COMMAND
NO_JUSTIFICATION JUSTIFY_LEFT JUSTIFY_CENTER
JUSTIFY_RIGHT O_VISIBLE O_ACTIVE
O_PUBLIC O_EDIT O_WRAP
O_BLANK O_AUTOSKIP O_NULLOK
O_PASSOK O_STATIC O_NL_OVERLOAD
O_BS_OVERLOAD
=head2 curses(3) functions not supported by C<Curses>
tstp _putchar fullname scanw wscanw mvscanw mvwscanw ripoffline
setupterm setterm set_curterm del_curterm restartterm tparm tputs
putp vidputs vidattr mvcur tigetflag tigetnum tigetstr tgetent
tgetflag tgetnum tgetstr tgoto tputs
=head2 menu(3) functions not supported by C<Curses>
set_item_init item_init set_item_term item_term set_menu_init
menu_init set_menu_term menu_term
=head2 form(3) functions not supported by C<Curses>
new_fieldtype free_fieldtype set_fieldtype_arg
set_fieldtype_choice link_fieldtype set_form_init form_init
set_form_term form_term set_field_init field_init set_field_term
field_term set_field_type field_type

File diff suppressed because it is too large Load Diff

View File

@@ -1,436 +0,0 @@
/* This file can be automatically generated; changes may be lost.
**
**
** CursesCon.c -- non-trivial constants
**
** Copyright (c) 1994-2000 William Setzer
**
** You may distribute under the terms of either the Artistic License
** or the GNU General Public License, as specified in the README file.
*/
XS(XS_Curses_ACS_BLOCK)
{
dXSARGS;
#ifdef ACS_BLOCK
{
int ret = ACS_BLOCK;
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
XSRETURN(1);
#else
c_con_not_there("ACS_BLOCK");
XSRETURN(0);
#endif
}
XS(XS_Curses_ACS_BOARD)
{
dXSARGS;
#ifdef ACS_BOARD
{
int ret = ACS_BOARD;
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
XSRETURN(1);
#else
c_con_not_there("ACS_BOARD");
XSRETURN(0);
#endif
}
XS(XS_Curses_ACS_BTEE)
{
dXSARGS;
#ifdef ACS_BTEE
{
int ret = ACS_BTEE;
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
XSRETURN(1);
#else
c_con_not_there("ACS_BTEE");
XSRETURN(0);
#endif
}
XS(XS_Curses_ACS_BULLET)
{
dXSARGS;
#ifdef ACS_BULLET
{
int ret = ACS_BULLET;
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
XSRETURN(1);
#else
c_con_not_there("ACS_BULLET");
XSRETURN(0);
#endif
}
XS(XS_Curses_ACS_CKBOARD)
{
dXSARGS;
#ifdef ACS_CKBOARD
{
int ret = ACS_CKBOARD;
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
XSRETURN(1);
#else
c_con_not_there("ACS_CKBOARD");
XSRETURN(0);
#endif
}
XS(XS_Curses_ACS_DARROW)
{
dXSARGS;
#ifdef ACS_DARROW
{
int ret = ACS_DARROW;
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
XSRETURN(1);
#else
c_con_not_there("ACS_DARROW");
XSRETURN(0);
#endif
}
XS(XS_Curses_ACS_DEGREE)
{
dXSARGS;
#ifdef ACS_DEGREE
{
int ret = ACS_DEGREE;
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
XSRETURN(1);
#else
c_con_not_there("ACS_DEGREE");
XSRETURN(0);
#endif
}
XS(XS_Curses_ACS_DIAMOND)
{
dXSARGS;
#ifdef ACS_DIAMOND
{
int ret = ACS_DIAMOND;
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
XSRETURN(1);
#else
c_con_not_there("ACS_DIAMOND");
XSRETURN(0);
#endif
}
XS(XS_Curses_ACS_HLINE)
{
dXSARGS;
#ifdef ACS_HLINE
{
int ret = ACS_HLINE;
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
XSRETURN(1);
#else
c_con_not_there("ACS_HLINE");
XSRETURN(0);
#endif
}
XS(XS_Curses_ACS_LANTERN)
{
dXSARGS;
#ifdef ACS_LANTERN
{
int ret = ACS_LANTERN;
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
XSRETURN(1);
#else
c_con_not_there("ACS_LANTERN");
XSRETURN(0);
#endif
}
XS(XS_Curses_ACS_LARROW)
{
dXSARGS;
#ifdef ACS_LARROW
{
int ret = ACS_LARROW;
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
XSRETURN(1);
#else
c_con_not_there("ACS_LARROW");
XSRETURN(0);
#endif
}
XS(XS_Curses_ACS_LLCORNER)
{
dXSARGS;
#ifdef ACS_LLCORNER
{
int ret = ACS_LLCORNER;
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
XSRETURN(1);
#else
c_con_not_there("ACS_LLCORNER");
XSRETURN(0);
#endif
}
XS(XS_Curses_ACS_LRCORNER)
{
dXSARGS;
#ifdef ACS_LRCORNER
{
int ret = ACS_LRCORNER;
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
XSRETURN(1);
#else
c_con_not_there("ACS_LRCORNER");
XSRETURN(0);
#endif
}
XS(XS_Curses_ACS_LTEE)
{
dXSARGS;
#ifdef ACS_LTEE
{
int ret = ACS_LTEE;
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
XSRETURN(1);
#else
c_con_not_there("ACS_LTEE");
XSRETURN(0);
#endif
}
XS(XS_Curses_ACS_PLMINUS)
{
dXSARGS;
#ifdef ACS_PLMINUS
{
int ret = ACS_PLMINUS;
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
XSRETURN(1);
#else
c_con_not_there("ACS_PLMINUS");
XSRETURN(0);
#endif
}
XS(XS_Curses_ACS_PLUS)
{
dXSARGS;
#ifdef ACS_PLUS
{
int ret = ACS_PLUS;
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
XSRETURN(1);
#else
c_con_not_there("ACS_PLUS");
XSRETURN(0);
#endif
}
XS(XS_Curses_ACS_RARROW)
{
dXSARGS;
#ifdef ACS_RARROW
{
int ret = ACS_RARROW;
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
XSRETURN(1);
#else
c_con_not_there("ACS_RARROW");
XSRETURN(0);
#endif
}
XS(XS_Curses_ACS_RTEE)
{
dXSARGS;
#ifdef ACS_RTEE
{
int ret = ACS_RTEE;
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
XSRETURN(1);
#else
c_con_not_there("ACS_RTEE");
XSRETURN(0);
#endif
}
XS(XS_Curses_ACS_S1)
{
dXSARGS;
#ifdef ACS_S1
{
int ret = ACS_S1;
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
XSRETURN(1);
#else
c_con_not_there("ACS_S1");
XSRETURN(0);
#endif
}
XS(XS_Curses_ACS_S9)
{
dXSARGS;
#ifdef ACS_S9
{
int ret = ACS_S9;
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
XSRETURN(1);
#else
c_con_not_there("ACS_S9");
XSRETURN(0);
#endif
}
XS(XS_Curses_ACS_TTEE)
{
dXSARGS;
#ifdef ACS_TTEE
{
int ret = ACS_TTEE;
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
XSRETURN(1);
#else
c_con_not_there("ACS_TTEE");
XSRETURN(0);
#endif
}
XS(XS_Curses_ACS_UARROW)
{
dXSARGS;
#ifdef ACS_UARROW
{
int ret = ACS_UARROW;
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
XSRETURN(1);
#else
c_con_not_there("ACS_UARROW");
XSRETURN(0);
#endif
}
XS(XS_Curses_ACS_ULCORNER)
{
dXSARGS;
#ifdef ACS_ULCORNER
{
int ret = ACS_ULCORNER;
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
XSRETURN(1);
#else
c_con_not_there("ACS_ULCORNER");
XSRETURN(0);
#endif
}
XS(XS_Curses_ACS_URCORNER)
{
dXSARGS;
#ifdef ACS_URCORNER
{
int ret = ACS_URCORNER;
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
XSRETURN(1);
#else
c_con_not_there("ACS_URCORNER");
XSRETURN(0);
#endif
}
XS(XS_Curses_ACS_VLINE)
{
dXSARGS;
#ifdef ACS_VLINE
{
int ret = ACS_VLINE;
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
XSRETURN(1);
#else
c_con_not_there("ACS_VLINE");
XSRETURN(0);
#endif
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,52 +0,0 @@
/*=============================================================================
CursesTyp.h
===============================================================================
Define types that are missing from the Curses library, which other Curses
libraries define. This way, we'll have a set of types that we can use
regardless of which Curses library we have.
=============================================================================*/
/* The C_xxx macros are defined by CursesDef.h, which was generated by
the build system based on its analysis of the Curses library on this
system.
C_xxx defined means the Curses library header files define type 'xxx'.
*/
#ifndef C_TYPATTR_T
#define attr_t int
#endif
#if 0
/* Disabled this in Curses.pm 1.21. Why would we want 'bool' defined? */
#ifndef C_TYPBOOL
#define bool int
#endif
#endif
#ifndef C_TYPCHTYPE
#define chtype int
#endif
#ifndef C_TYPMEVENT
#define MEVENT int
#endif
#ifndef C_TYPMMASK_T
#define mmask_t int
#endif
#ifndef C_TYPSCREEN
#define SCREEN int
#endif
/*
**
** Copyright (c) 1994-2001 William Setzer
**
** You may distribute under the terms of either the Artistic License
** or the GNU General Public License, as specified in the README file.
*/

View File

@@ -1,248 +0,0 @@
/* This file can be automatically generated; changes may be lost.
**
**
** CursesVar.c -- the variables
**
** Copyright (c) 1994-2000 William Setzer
**
** You may distribute under the terms of either the Artistic License
** or the GNU General Public License, as specified in the README file.
*/
XS(XS_Curses_LINES)
{
dXSARGS;
#ifdef C_LINES
c_exactargs("LINES", items, 0);
{
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)LINES);
}
XSRETURN(1);
#else
c_var_not_there("LINES");
XSRETURN(0);
#endif
}
XS(XS_Curses_COLS)
{
dXSARGS;
#ifdef C_COLS
c_exactargs("COLS", items, 0);
{
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)COLS);
}
XSRETURN(1);
#else
c_var_not_there("COLS");
XSRETURN(0);
#endif
}
XS(XS_Curses_stdscr)
{
dXSARGS;
#ifdef C_STDSCR
c_exactargs("stdscr", items, 0);
{
ST(0) = sv_newmortal();
c_window2sv(ST(0), stdscr);
}
XSRETURN(1);
#else
c_var_not_there("stdscr");
XSRETURN(0);
#endif
}
XS(XS_Curses_curscr)
{
dXSARGS;
#ifdef C_CURSCR
c_exactargs("curscr", items, 0);
{
ST(0) = sv_newmortal();
c_window2sv(ST(0), curscr);
}
XSRETURN(1);
#else
c_var_not_there("curscr");
XSRETURN(0);
#endif
}
XS(XS_Curses_COLORS)
{
dXSARGS;
#ifdef C_COLORS
c_exactargs("COLORS", items, 0);
{
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)COLORS);
}
XSRETURN(1);
#else
c_var_not_there("COLORS");
XSRETURN(0);
#endif
}
XS(XS_Curses_COLOR_PAIRS)
{
dXSARGS;
#ifdef C_COLOR_PAIRS
c_exactargs("COLOR_PAIRS", items, 0);
{
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)COLOR_PAIRS);
}
XSRETURN(1);
#else
c_var_not_there("COLOR_PAIRS");
XSRETURN(0);
#endif
}
XS(XS_Curses_Vars_TIESCALAR)
{
dXSARGS;
c_exactargs("TIESCALAR", items, 2);
{
char * pack = (char *)SvPV_nolen(ST(0));
int n = (int)SvIV(ST(1));
ST(0) = sv_newmortal();
sv_setref_iv(ST(0), pack, n);
}
XSRETURN(1);
}
XS(XS_Curses_Vars_FETCH)
{
dXSARGS;
{
int num = (int)SvIV(SvRV((SV*)ST(0)));
ST(0) = sv_newmortal();
switch (num) {
case 1:
#ifdef C_LINES
sv_setiv(ST(0), (IV)LINES);
#else
c_var_not_there("LINES");
#endif
break;
case 2:
#ifdef C_COLS
sv_setiv(ST(0), (IV)COLS);
#else
c_var_not_there("COLS");
#endif
break;
case 3:
#ifdef C_STDSCR
c_window2sv(ST(0), stdscr);
#else
c_var_not_there("stdscr");
#endif
break;
case 4:
#ifdef C_CURSCR
c_window2sv(ST(0), curscr);
#else
c_var_not_there("curscr");
#endif
break;
case 5:
#ifdef C_COLORS
sv_setiv(ST(0), (IV)COLORS);
#else
c_var_not_there("COLORS");
#endif
break;
case 6:
#ifdef C_COLOR_PAIRS
sv_setiv(ST(0), (IV)COLOR_PAIRS);
#else
c_var_not_there("COLOR_PAIRS");
#endif
break;
default:
croak("Curses::Vars::FETCH called with bad index");
/* NOTREACHED */
}
}
XSRETURN(1);
}
XS(XS_Curses_Vars_STORE)
{
dXSARGS;
{
int num = (int)SvIV((SV*)SvRV(ST(0)));
switch (num) {
case 1:
#ifdef C_LINES
LINES = (int)SvIV(ST(1));
#else
c_var_not_there("LINES");
#endif
break;
case 2:
#ifdef C_COLS
COLS = (int)SvIV(ST(1));
#else
c_var_not_there("COLS");
#endif
break;
case 3:
#ifdef C_STDSCR
stdscr = c_sv2window(ST(1), -1);
#else
c_var_not_there("stdscr");
#endif
break;
case 4:
#ifdef C_CURSCR
curscr = c_sv2window(ST(1), -1);
#else
c_var_not_there("curscr");
#endif
break;
case 5:
#ifdef C_COLORS
COLORS = (int)SvIV(ST(1));
#else
c_var_not_there("COLORS");
#endif
break;
case 6:
#ifdef C_COLOR_PAIRS
COLOR_PAIRS = (int)SvIV(ST(1));
#else
c_var_not_there("COLOR_PAIRS");
#endif
break;
default:
croak("Curses::Vars::STORE called with bad index");
/* NOTREACHED */
}
ST(0) = &PL_sv_yes;
}
XSRETURN(1);
}
XS(XS_Curses_Vars_DESTROY)
{
dXSARGS;
{
SV * rv = ST(0);
ST(0) = &PL_sv_yes;
}
XSRETURN(1);
}

View File

@@ -1,219 +0,0 @@
The Curses Perl module was created by William Setzer (William_Setzer
at ncsu.edu) in 1994. William maintained it up until July 2001, when he
stopped having time to do so.
In September 2004, Bryan Henderson (bryanh@giraffe-data.com) took over
maintainership of it, after confirming with William that he did not
plan to continue.
The module has always been distributed via CPAN.
Curses itself is much older than the Perl implementation. Curses was
originally only a C programming library.
New in 1.23 (Released March 9, 2008)
Fix crash of Makefile.PL on Windows.
New in 1.22 (Released February 29, 2008)
Nothing. Just a packaging fix.
New in 1.21 (Released February 15, 2008)
Don't undefine 'bool' macro in c-darwin hints file.
New in 1.20 (Released November 19, 2007)
Fix missing comment delimiter.
New in 1.19 (Released November 18, 2007)
Make it work on 5.005 again, using ppport.h (Devel::PPPort).
From Slaven Rezic - slaven <at> rezic <dot> de .
Fix uninitialized value in Makefile.PL on a system without BSD Curses or
Ncurses in a common place.
Reverse change to chgat() in 1.16. Make expected argument count 4.
There was never a 1.18 release; problems with PAUSE prevent using that
release number.
New in 1.17 (Released October 14, 2007)
Fix bug - can't find c-config.h on a system with ncursesw.
Make cdemo work on Windows.
Don't undefine SP macro with Pdcurses. (Otherwise it won't compile;
don't know why we used to undefine SP).
In Windows hints file, #include curses.h instead of pdcurses.h. It
seems to be called curses.h these days.
New in 1.16 (August 7, 2007)
Use Ncursesw (Ncurses with wide character functions) instead of
Ncurses if available.
Undefine "tab" macro, defined by Curses header file. It interferes
with perl.h.
Fix demo.form to use L! instead of J in the pack template that generates
the new_form() argument. Apparently, J is something from older Perl
and doesn't exist in current Perl.
Put some documentation of the library in comments in demo.form.
Use L! instead of I in the pack template in demo.menu.
Change SvPV(X,PL_na) to SvPV_nolen(X) to get with the times.
Change #!/usr/local/bin/perl to #! /usr/bin/perl .
Fix bug: chgat() requires an extra, meaningless, argument. Fix changes
expected argument count from 4 to 3.
New in 1.15 (October 8, 2006)
Add a simple load test 00-load.t.
Makefile.PL: use cdemo.obj instead of cdemo.o on Windows.
Makefile.PL: Guess ncurses/bsd based on what .h files exist.
Fix bug in Makefile.PL: doesn't use curses type in guess at c-config.h
(e.g. tries to use c-freebsd.h when it should use c-freebsd.bsd.h).
Change all sv_isa() to sv_derived_from() so you can use subclasses.
Thanks Leigh <leighbrown@hsbc.com>.
Rename default Darwin (Mac OS X) hints file (ca 2001) to c-darwin.old, and
the newer one ca 2004) to c-darwin.old so as to be the default. We're
guessing that the newer one applies to more systems today.
New in 1.14 (June 3, 2006)
Make demo.form work on 64 bit machine.
Add some narration to Makefile.PL to help with diagnosis.
Move undef of 'instr' from individual hint files to Curses.c and add
explanation.
Use perl -w instead of 'use warnings' in Makefile.PL so it works with
older Perl.
New in 1.13 (October 10, 2005)
Fix so it builds on current Cygwin.
Some kind of build fix to get panels, forms, and menu functions to build.
New in 1.12 (March 17, 2005)
Build bug fixed: panel, forms, menu libs not found in build.
Build bug fixed: Curses.pm treats version as number, so 1.10 == 1.1 .
New in 1.11 (March 12, 2005)
Various cleanup and improved diagnostics in the build.
New in 1.10 (March 11, 2005)
Build bug fixed: Makefile has undefined variable $libtyp.
Build bug fixed: Makefile computes wrong guess hint file name.
New in 1.09 (March 6, 2005)
- Makefile.PL searches for curses header files instead of assuming
based on $OSNAME.
- Makefile.PL warns user to reconfigure environment when form.h is
in /usr/include rather than just add -I/usr/include to the compile
(this concerns the problem with the conflicting Perl form.h file).
New in 1.08 (November 2004)
- perl.syms more verbose so you can diagnose failures.
- You can use environment variables instead of modifying Makefile.PL
to set your -I, -L, etc. options for the Curses libraries.
- c-linux.ncurses.h hints file includes ncurses.h, not curses.h.
- New c-darwin-thread-multi-2level.h hints file.
New in 1.07 (September 2004)
- Call to Perl_isa_sv() changed to isa_sv() because the former doesn't
work on some systems (causes a build failure).
New in 1.06 (July 2001)
o Now requires perl5.005 or better to run. (You can probably run it
in perl5.002-perl5.004 by grabbing newCONSTSUB out of the IO
distribution on CPAN and editing all uses of "foreach my $var" in
my perl scripts.)
o Did lots of fiddling with the file generation in an effort to make
it more comprehensible. In doing so, I moved around the way some
things were done and probably broke it on some systems with weird
compilers. Please let me know.
o changed the "Curses->new()" function to be a bit less clever.
o Support for libmenu! Many thanks to Yury Pshenichny <yura at zp.ua>
who did most of the actual work.
Update: Well, sort of support. For some reason beyond my ken, it
doesn't work with Solaris (2.6) libmenu. (The items won't attach to
the menu.) ncurses menu, both 1.9.9 and 5.2, seem to work fine.
o libform support added, too. Ho hum. ;) This one does appear to
work with Solaris libform.
o Added the following ncurses extension functions:
use_default_colors()
assume_default_colors()
define_key()
keybound()
keyok()
resizeterm()
(Thanks to neild at misago.org, hans at kolej.mff.cuni.cz)
o Re-enabled the functions:
attr_get()
attr_off()
attr_on()
attr_set()
o Between the functions supported and the functions listed in the
pod as not supported, those are all the ones I know about.
Got any more? Let me know.
o Fixed 64 bit issue with getch() and possibly others, truncating
returns of `chtype' to 32 bits. Note that this could possibly
break some OSes. Please let me know.
(Thanks to Randall.G.Steiner at bankofamerica.com)
o Fixed bug where @ARGV was always being cleared, and so no arguments
ever got to MakeMaker.
(Thanks to bdlow at nortelnetworks.com)
o Added hints for Darwin/Mac OS X system.
(Thanks to sdietrich at emlab.com)
o Added note to NETBSD users at the bottom of this README.
o Added a security notice to the README and pod.
(Thanks to connor at ing.umu.se)
o Has anyone successfully used the mouse event stuff?

View File

@@ -1,280 +0,0 @@
This package requires at least perl5.005. You're on your own before
then.
1) Make sure you've got the prerequisites
1.1) Make sure perl has been built.
1.2) Make sure you have a Curses C library installed. Either original
BSD Curses or newer Ncurses will do. Pdcurses (public domain Curses
code that works in DOS, Windows, and X11) almost works. See
PDCURSES section below.
2) Chdir into the Curses source directory (which you unpacked from the
.tgz file you downloaded from CPAN)
3) Want to see if maybe the package can autoconfigure itself? It's
pretty dumb about it, but give it a try and skip to (5).
4) Configure the build for your system.
4.1)
Look in the "hints" directory to see if any of the hint files are
appropriate to your machine's OS. If so, symlink or copy it to the
file "c-config.h" in the current ("Curses") directory. If not,
copy "hints/c-none.h" to "c-config.h" in the current directory.
Then edit "c-config.h" and follow the directions. If you have to
"roll your own", be sure and save a copy. A "make clean" will
delete "c-config.h". If you "rolled your own", please send me a
copy so I can include it in future distributions (see
"hints/c-isc.h" for an example of a user-contributed "c-config.h").
4.2)
Curses has an interface header file named form.h. If on your system
this is in a system header file directory such as /usr/include, you
have a problem. That's because Perl also has a file named form.h
in a directory that is searched before the system directories in the
compile of the Perl Curses module.
So you'll have to fix that. It's better to have your Curses stuff
in its own directory. /usr/include/ncurses is conventional. Move
all your Curses header files (curses.h, ncurses.h, form.h, menu.h,
panel.h) into this directory. If you use /usr/include/ncurses,
Makefile.PL will find them there. Otherwise, set the _CFLAGS
environment variables below accordingly.
Alternatively, you can just edit c-config.h, after running
Makefile.PL. Replace the line
#include <form.h>
with something like
#include "/usr/include/form.h"
explicitly specifying the Ncurses version of form.h.
You can ignore all this if you're not building forms capability
into the Perl Curses module (by specifying "FORMS" as an option to
Makefile.PL below).
4.3)
Set environment variables telling the compiler and linker where your
Curses C libraries are:
CURSES_CFLAGS: -I and -D options needed at compile time for access to
the basic Curses library (libcurses).
CURSES_LDFLAGS: -L and -l options needed at link time for access to
the basic Curses library (libcurses). (this really
must be only -L and -l options; Makefile.PL parses it. Furthermore,
there can't be any space between the -L or -l and its value).
CURSES_PANEL_CFLAGS
CURSES_PANEL_LDFLAGS
CURSES_MENU_CFLAGS
CURSES_MENU_LDFLAGS
CURSES_FORM_CFLAGS
CURSES_FORM_LDFLAGS
These are analogous, but for the panel, menu, and form specialty
Curses libraries, respectively.
You can set these in your shell and export them, e.g.
export CURSES_CFLAGS="-I/usr/include/ncurses"
export CURSES_LDFLAGS="-L/usr/lib/ncurses -lncurses"
Or you can set them right on the 'perl Makefile.PL' command.
5) perl Makefile.PL [PANELS] [MENUS] [FORMS] [options]
PANELS means to include Curses panel function.
MENUS means to include Curses menu functions.
FORMS means to include Curses form function.
For PANELS, MENUS, and FORMS, you must have the associated C library on
your system (libpanel, libmenu, libform). Choosing one of these options
without having the library will prevent this package from compiling.
Currently, PANELS, MENUS, and FORMS don't work for the BSD
hints files (c-*.bsd.h), because I'm not aware of any panel, menu,
or form libraries for BSD curses.
This package needs the perl header files. If you've already
installed perl, the "Makefile.PL" will magically know where they
are. If you haven't installed perl, you may need to tell the
"Makefile.PL" where the header files are. You can do this with the
"PERL_SRC=<source directory>" option.
perl Makefile.PL PERL_SRC=/local/src/perl
The "Makefile.PL", as with just about every other perl module, uses
the "ExtUtils::MakeMaker" package to generate a make file (named
"Makefile"). I highly recommend reading the "ExtUtils::MakeMaker"
man page, as there are lots of neat options you can specify.
If Makefile.PL tells you that it can't do something (it prints out
"I'm sorry" and some more stuff), then you'll need to go back to
step (4) and try configuring by hand.
6) make
`make' will first run a perl script called `test.syms' that investigates
what the Curses libraries are like on your system and records the
results in the file "CursesDef.h".
test.syms is very brittle -- it works via test compiles, and if any
number of things goes wrong with the test compile, it makes bad
assumptions, usually that you don't have a certain function in your
Curses library. If test.syms tells you it can't find functions that
you think you have, run test.syms manually with the -v (verbose) option.
That will show you the error messages from the test compiles and you
can figure out what's going wrong and fix it. Typically, you'll find
that you need to do better on your CURSES_* environment variables
(see above).
Alternatively, if you see that test.syms is picking the wrong
values, you can edit "CursesDef.h" by hand and follow the
directions. If you have to "roll your own", be sure and save a
copy. A "make clean" will delete "CursesDef.h".
`make' will then try to compile "Curses.c". If you get any
undefined curses symbols, it means that your curses really doesn't
have those functions, and you should edit "CursesDef.h" and/or
"c-config.h" and change the #define to #undef for that function.
If you get other compile errors, it is probably because the curses
include file and the perl include files are conflicting. You'll
have to figure out what's wrong and add proper C code to
"c-config.h". See "hints/c-sunos.sysv.h" for an example of how to
do this.
7) Test the distribution:
perl demo
perl gdc
perl demo2 [stuff that has a 50/50 chance of showing up right]
perl demo.panel [if you enabled panel support]
perl demo.menu [if you enabled menu support]
perl demo.form [if you enabled form support]
"gdc" is a digital clock ported from the "ncurses" distribution.
As mentioned in the "README", the demo is not intended to be an
exhaustive test of all the possible Curses functions. If it
doesn't do all the functions correctly, it may be a Curses bug or
it may be a problem with your system's "libcurses.a". There's no
getting around the fact that you need to be conversant in how your
system's "libcurses.a" works to be able to use Curses most
effectively.
For "demo", you can try:
make cdemo
This will try to compile a pure-C version of the "demo". If you
see the same errors in it that you see in "demo", it means there's
a bug in your libcurses.
8) Doing a :
make install
will install everything in the "standard" perl places, just like
stuff from the base perl distribution.
9) Enjoy!
If your enjoyment is ruined (:-) because the module doesn't work
right, peruse the Curses pod document (located at the end of
"Curses.pm") for incompatibilities with other Perl programs. Also
check the end of the "README" for problems that may exist for your
particular libcurses.a or operating system.
HP-UX
-----
HP-UX has two Curses libraries. According to HP:
Libraries libcur_colr.a and libcur_colr.sl, and commands
captoinfo_colr, infocmp_colr, tput_colr, and tic_colr are
part of HP-UX Color-Curses package used for color-management.
And there is apparently also a library with the standard names.
The Curses Perl module builds using the standard library by default.
If you want to use the "color" versions, set the CURSES_CFLAGS and
CURSES_LDFLAGS environment variables accordingly.
HP recommends using the HP ANSI C compiler for everything but
compiling the kernel, but the one for compling the kernel is the
default. (Seems ridiculous, but an HP user said so). I don't know
what difference it makes for the Perl Curses module, but if you
want to use the ANSI compiler, add this to Makefile.PL's arguments:
CC=/opt/ansic/bin/cc
PDCURSES
--------
Pdcurses is a public domain Curses implementation that works on DOS,
OS/2, Win32, and X11. http://pdcurses.sourceforge.net .
Dave C reported success using Perl Curses with Pdcurses on Windows
in September 2007. He gave these notes:
Environment:
Perl Version 5.8.1 built for MSWin32-x86-multi-thread
MSVS 2003 Visual C++ 7
Windows XP
Perl module Curses-1.16
Pdcurses 3.3
Instructions:
- Set environment variables (for Perl Curses Makefile.PL):
CURSES_CFLAGS=-Ic:\dev\pdc33
CURSES_LDFLAGS=-Lc:\dev\pdc33 pdcurses.lib
- Build and Test
> Makefile.PL
> nmake test
ignore MOUSE_MOVED redefined warning
MOUSE_MOVED is never used in Curses 1.16
- Install:
> nmake install
- Test:
demo, demo2, demo.panel scripts successfully run
> nmake cdemo
> cdemo
Alexandr Ciornii on September 22, 2006, reported that he had some success
using Perl Curses with Pdcurses, with these notes:
I've encountered several problems with it:
1. 'pdcurses.h' does not exist; only 'curses.h'. Renamed it.
2. 'curses.h' also defines chtype and attr_t. Commented out there.
3. 'curses.h' also defines SCREEN. Commented out in 'CursesTyp.h'.
4. `perl demo` fails
Curses function 'TIESCALAR' called with too few arguments at
C:\cpan\Curses-1.14\blib\lib/Curses.pm line 82.
Compilation failed in require at demo line 11.

View File

@@ -1,73 +0,0 @@
These are notes for the maintainer.
Steps to release:
- Test the build:
make realclean
Set up environment variables, c-config.h if required.
perl Makefile.PL PANELS MENUS FORMS
make
perl -Mblib -MCurses -e1
- make realclean
- Update HISTORY file with description of new stuff and release date.
- Update version number in Curses.pm (search for VERSION).
- Make a tarball with something like this:
tar --file=/tmp/Curses-1.07.tgz --gzip --create Curses-1.07
- Upload via pause.perl.org. Use "upload a file to CPAN" link.
You have to login to make that link appear.
It goes into CPAN in the directory belonging to the user who
uploaded it. PAUSE gives you various options for uploading, tells
you how to follow the progress of the uploading and indexing, and
sends you emails about it.
- PAUSE will automatically extract the README file from the tarball
and install it as e.g. Curses-1.07.readme
- PAUSE will open the tarball automatically and index the packages it finds
in there by name (Curses::Window, Curses::Screen, etc.).
It will find and index the package "Gen" and extract its README too. I'm
pretty sure this is wrong -- this looks like it's just supposed to be a
private thing used in the build. Someday, we should find a way to stop
this.
For Bryan's test system:
export CURSES_LDFLAGS="-L/usr/link/ncurses -lncurses -ldl"
export CURSES_CFLAGS="-I/usr/include/ncurses"
GEN
---
The package is designed to have all the distributed code files
(Curses.pm, CursesFun.c, etc.) generated by the programs in gen/ .
This is supposed to handle the myriad Ncurses functions with less
tedium than manually editing the files.
However, Bryan doesn't know how the Gen stuff works, so he has been
making the small updates necessary directly to the distributed files.
But the changes are modest, so it should be possible some day to
generate new files, diff to see what changed, and put those changes
into the Gen programs.
ppport.h
--------
You generate this by running the function Devel::PPPort::WriteFile().
There shouldn't be any need to generate a new one unless there are
updates to the Devel::PPPort package.
A comment in ppport.h says it was generated by Perl 5.006002. That's
a lie.

View File

@@ -1,70 +0,0 @@
Artistic
Copying
Curses.c
Curses.pm
CursesBoot.c
CursesCon.c
CursesFun.c
CursesTyp.h
CursesVar.c
INSTALL
MANIFEST
Makefile.PL
README
cdemo.c
demo
demo.form
demo.menu
demo.panel
demo2
gdc
gen/Gen.pm
gen/README
gen/increase-version
gen/list.con
gen/list.fun
gen/list.typ
gen/list.var
gen/make.Curses.pm
gen/make.CursesBoot.c
gen/make.CursesCon.c
gen/make.CursesFun.c
gen/make.CursesTyp.h
gen/make.CursesVar.c
gen/make.list.syms
hints/c-MSWin32.borland.h
hints/c-MSWin32.visualc.h
hints/c-aix.h
hints/c-bsd386.h
hints/c-bsdos.h
hints/c-cygwin.h
hints/c-darwin.h
hints/c-dec_osf.h
hints/c-dgux.h
hints/c-dynixptx.h
hints/c-freebsd.bsd.h
hints/c-freebsd.ncurses.h
hints/c-hpux.h
hints/c-irix.bsd.h
hints/c-irix.ncurses.h
hints/c-isc.h
hints/c-linux.bsd.h
hints/c-linux.ncurses.h
hints/c-netbsd.h
hints/c-next.h
hints/c-none.h
hints/c-openbsd.h
hints/c-os2.ncurses.h
hints/c-sco.h
hints/c-solaris.h
hints/c-sunos.bsd.h
hints/c-sunos.ncurses.h
hints/c-sunos.sysv.h
hints/c-svr4.h
hints/c-vms.h
list.syms
ppport.h
test.syms
testint.c
testsym.c
testtyp.c

View File

@@ -1,629 +0,0 @@
#! /usr/bin/perl -w
##
## Makefile.PL
##
## Copyright (c) 1994-2000 William Setzer
##
## You may distribute under the terms of either the Artistic License
## or the GNU General Public License, as specified in the README file.
require 5.005;
use strict;
#use warnings; Can't use; new since Perl 5.005; use perl -w instead
use ExtUtils::MakeMaker;
use English;
# Here are the arguments defined for this file:
#
# PANELS -- enable panel functions
# MENUS -- enable menus functions
# FORMS -- enable forms functions
# GEN -- add generation function to Makefile (developers only!)
#
# Ex: "perl Makefile.PL PANELS MENUS GEN"
# Environment variables tell us how one accesses the Curses library
# on this system.
#
# CURSES_LIBTYPE
# 'bsd', 'ncurses', or 'ncursesw' on most systems.
# In some environments, there are other possibilities.
#
# CURSES_CFLAGS
# CURSES_PANEL_CFLAGS
# CURSES_MENUS_CFLAGS
# CURSES_FORMS_CFLAGS
# contains any includes or defines (-I or -D) that are
# needed to compile libcurses applications
#
# CURSES_LDFLAGS
# CURSES_PANEL_LDFLAGS
# CURSES_MENUS_LDFLAGS
# CURSES_FORMS_LDFLAGS
# contains any libraries or library paths (-l or -L) that are
# needed to compile libcurses applications. This must be
# -l and -L options only -- we parse it. Note that if you
# specify something that doesn't result in MakeMaker finding
# a library, your value just gets silently ignored -- it
# won't show up in the make file.
# If these environment variables aren't set, we try in a fairly
# stupid fashion to pick them for you, along with a "c-config.h" file.
my $libType = $ENV{'CURSES_LIBTYPE'};
my $inc = $ENV{'CURSES_CFLAGS'};
my $libs = $ENV{'CURSES_LDFLAGS'};
my $panel_inc = $ENV{'CURSES_PANEL_CFLAGS'} || '';
my $panel_libs = $ENV{'CURSES_PANEL_LDFLAGS'} || '';
my $menu_inc = $ENV{'CURSES_MENU_CFLAGS'} || '';
my $menu_libs = $ENV{'CURSES_MENU_LDFLAGS'} || '';
my $form_inc = $ENV{'CURSES_FORM_CFLAGS'} || '';
my $form_libs = $ENV{'CURSES_FORM_LDFLAGS'} || '';
# If you want to see examples of what needs to go in the $inc and
# $libs variables, check out the `guess_cfg' tables of values below.
# In fact, one way to set the variables would be to add or modify an
# entry for your 'osname'. If you're not sure what the osname is for
# your machine, you can use the following at your command line to
# print it out:
#
# perl -MConfig -le 'print $^O'
#
# Some lines have multiple versions (such as `freebsd' and `linux'),
# representing different versions of curses that an OS might have.
# You can pick the version you want by setting the `default' entry.
# Here are some notes provided by the hint providers for certain of the
# OSes. You should scan them first to see if they apply to you.
#
# Notes for FreeBSD ncurses:
# [Courtesy of "Andrew V. Stesin" <stesin@elvisti.kiev.ua>]
# FreeBSD-2.0.5 ncurses + mytinfo NOTE! Straight curses works much
# better for me!
#
# Notes for Solaris:
# Under 2.3, it was reported that to get the module to compile properly
# with gcc, you must add `-DSYSV=1' to $inc. This will disable the
# redefinition of memcpy to bcopy that is present in /usr/include/curses.h.
# [Courtesy of Dave Blaszyk <dvb@ycc.Kodak.COM>]
#
# $inc also contained "-I/usr/include", but this seems to cause a great
# deal of trouble for gcc under perl5.002, so I removed it by default.
# I have tested Curses-a9 with perl5.002 and gcc263 and Sun's unbundled
# cc on Solaris 2.4 with an empty $inc and had no problems, but your
# mileage may vary.
#
# If you are having trouble compiling under Solaris, try various
# combinations of "-I/usr/include" and "-DSYSV=1" in $inc to see if
# it fixes things.
## OS default guess for $inc default guess for $libs
#
my $guess_cfg = {
'aix' => [ '' , '-lcurses -ltermcap' ],
'bsd386' => [ '' , '-lcurses -ltermcap' ],
'bsdos' => [ '' , '-lcurses -ltermcap' ],
'cygwin' => [ '-I/usr/include/ncurses' , '-lncurses' ],
'darwin' => [ '' , '-lcurses' ],
'dec_osf' => [ '' , '-lcurses -ltermcap' ],
'dgux' => [ '' , '-lcurses -ltermcap' ],
'dynixptx' => [ '' , '-lcurses -lc' ],
'freebsd' => {
'bsd' => [ '' , '-lcurses -ltermcap' ],
'ncurses' => [ '' , '-lncurses' ],
'default' => 'bsd'
},
'hpux' => [ '' , '-lcurses -ltermcap' ],
# See INSTALL file for information about a different Curses library on HPUX.
'irix' => {
'bsd' => [ '' , '-lcurses -ltermcap' ],
'ncurses' => [ '' , '-lncurses' ],
'default' => 'bsd'
},
'isc' => [ '' , '-lcurses -ltermcap' ],
'linux' => {
'bsd' => [ '' , '-lcurses -ltermcap' ],
'ncurses' => [ '-I/usr/include/ncurses' , '-lncurses' ],
'default' => 'ncurses'
},
'netbsd' => [ '' , '-lcurses -ltermcap' ],
'next' => [ '' , '-lcurses -ltermcap' ],
'openbsd' => [ '' , '-lcurses -ltermcap' ],
'os2' => {
'bsd' => [ '' , '-lcurses -ltermcap' ],
'ncurses' => [ '' , '-lncurses' ],
'default' => 'ncurses'
},
'sco' => [ '' , '-lcurses -ltermcap' ],
'solaris' => [ '' , '-L/usr/ccs/lib -lcurses' ],
'sunos' => {
'bsd' => [ '' , '-lcurses -ltermcap' ],
'sysv' => [ '-I/usr/5include' , '-L/usr/5lib -lcurses' ],
'ncurses' => [ '' , '-lncurses' ],
'default' => 'sysv'
},
'VMS' => [ '' , 'sys$library:vaxccurse.olb' ],
'svr4' => [ '' , '-lcurses' ],
'MSWin32' => {
'borland' => [ '-w- -Id:\bc5\include' , '-Ld:\bc5\lib pdcurses.lib' ],
'visualc' => [ '' , 'pdcurses' ],
'default' => 'visualc'
},
'' => undef
};
###
## You shouldn't need to change anything below
#
my $TRUE = 1; my $FALSE = 0;
sub nCursesIsInstalled() {
if (-f('/usr/include/ncurses/ncurses.h')) {
return $TRUE;
} elsif (-f('/usr/include/ncurses.h')) {
return $TRUE;
} else {
return $FALSE;
}
}
sub bsdIsInstalled() {
if (-f('/usr/include/curses/curses.h')) {
return $TRUE;
} elsif (-f('/usr/include/curses.h')) {
return $TRUE;
} else {
return $FALSE;
}
}
sub chooseLibraryType($$) {
my ($typeList, $libtypR) = @_;
#-----------------------------------------------------------------------------
# Assuming this is a platform on which there may be multiple versions of
# Curses, choose one.
#
# Return the choice as $$libtypR.
#
# We prefer Ncurses, so choose that if it appears to be installed.
# If it doesn't, but BSD appears to be installed, we choose that. If
# we don't see either, we choose $libtypDefault.
#-----------------------------------------------------------------------------
if (0) {
} elsif ($typeList->{'ncurses'} && nCursesIsInstalled()) {
$$libtypR = 'ncurses';
} elsif ($typeList->{'bsd'} && bsdIsInstalled()) {
$$libtypR = 'bsd';
} else {
$$libtypR = $typeList->{'default'};
}
}
sub guessAtCursesLocation($$$) {
my ($libtypR, $incR, $libsR) = @_;
#-----------------------------------------------------------------------------
# Return as $$libtypR the type of Curses library we should use, e.g.
# 'ncurses', 'ncursesw' or 'bsd'. May be undefined if we don't think
# we have to choose between those on this system.
#
# Return as $$incR the -I option we think is appropriate to get the
# Curses interface header files.
#
# Return as $$libsR the -L and -l options we think are needed to link
# the main Curses library (doesn't cover panels/menus/forms).
#-----------------------------------------------------------------------------
print qq{Making a guess for -I and -L/-l options...\n};
# We need to move away from the inflexible $guess_cfg thing. For
# starters, we don't use it when the system looks like one with
# wide-character Ncurses.
if (-f('/usr/include/ncursesw/ncurses.h')) {
$$incR = '-I/usr/include/ncursesw';
$$libsR = '-lncursesw';
$$libtypR = 'ncursesw';
} else {
my $guess1 = $guess_cfg->{$OSNAME};
my $libtyp;
# typically 'bsd' or 'ncurses'. Undefined if we think
# there's no choice of Curses version on this platform.
my $guess;
if (ref $guess1 eq 'HASH') {
# For this platform, we have a choice of Curses library.
chooseLibraryType($guess1, \$libtyp);
$guess = $guess1->{$libtyp};
} else {
$guess = $guess1;
}
if (not defined $guess) {
print STDERR <<"EOW";
I'm sorry, but I could not make a good guess for the includes and
libraries that are needed. You will need to set the CURSES_
environment variables as described in the INSTALL file.
OSNAME=$OSNAME
EOW
exit 1;
}
if (ref $guess ne 'ARRAY') {
die "FATAL: internal error: guess_cfg is bad";
}
if (!defined($libtyp)) {
if (0) {
} elsif (-f('/usr/include/ncurses/ncurses.h')) {
$inc = '-I/usr/include/ncurses';
} elsif (-f('/usr/include/curses/curses.h')) {
$inc = '-I/usr/include/curses';
} elsif (-f('/usr/include/ncurses.h')) {
$inc = '';
} elsif (-f('/usr/include/curses.h')) {
$inc = '';
} else {
$inc = $guess->[0];
}
} else {
if ($libtyp eq 'ncurses') {
if (-f('/usr/include/ncurses/ncurses.h')) {
$inc = '-I/usr/include/ncurses';
} elsif (-f('/usr/include/ncurses.h')) {
$inc = '';
} else {
$inc = $guess->[0];
}
} else {
if (-f('/usr/include/curses/curses.h')) {
$inc = '-I/usr/include/curses';
} elsif (-f('/usr/include/curses.h')) {
$inc = '';
} else {
$inc = $guess->[0];
}
}
}
$libs = $guess->[1];
$$libtypR = $libtyp;
$$incR = $inc;
$$libsR = $libs;
}
print("Guesses:\n");
print(" includes: '$$incR'\n");
print(" libs: '$$libsR'\n");
if (defined($$libtypR)) {
print(" Curses type: $$libtypR");
} else {
print(" Curses type: irrelevant");
}
print("\n");
}
sub defaultLibTypeForOs($) {
my ($osname) = @_;
#-----------------------------------------------------------------------------
# Return the default library type for OS named '$osname'; if we don't think
# there is a choice of library type on this OS, return undef.
#-----------------------------------------------------------------------------
my $libType;
my $guess = $guess_cfg->{$OSNAME};
if (ref $guess eq 'HASH') {
# For this platform, we have a choice of Curses library.
$libType = $guess->{'default'};
}
return $libType;
}
# A "library class" is a more abstract categorization than a "library type."
# The difference between two library types is just compiler and linker
# options to choose the right library, but different library classes
# have bigger differences and can have different hints files. The
# library class is part of the hint file name.
my %libClass = (
'bsd' => 'bsd',
'ncurses' => 'ncurses',
'ncursesw' => 'ncurses',
'sysv' => 'sysv',
'visualc' => 'visualc',
'borland' => 'borland',
);
sub makeConfigH($) {
my ($libType) = @_;
#-----------------------------------------------------------------------------
# $libType is the kind of Curses library we are using - e.g. 'bsd',
# 'ncurses', or 'ncursesw'. It may be undefined if there is no
# choice on this system.
#-----------------------------------------------------------------------------
print qq{Making a guess for "c-config.h"...\n};
my $libClass;
if (defined($libType)) {
$libClass = $libClass{$libType};
if (!defined($libClass)) {
print STDERR ("Internal error: invalid library type '$libType' " .
"in makeConfigH()\n");
exit 1;
}
}
my $hintsfile;
if (defined($libType) && -f("hints/c-$OSNAME.$libType.h")) {
$hintsfile = "hints/c-$OSNAME.$libType.h";
} elsif (defined($libClass) && -f("hints/c-$OSNAME.$libClass.h")) {
$hintsfile = "hints/c-$OSNAME.$libClass.h";
} else {
my $candidate = "hints/c-$OSNAME.h";
if (-f($candidate)) {
$hintsfile = $candidate;
} else {
print STDERR <<"EOW";
I'm sorry, but I couldn't find a hints file that was configured for
your OS (named $candidate). You will need to create and configure a
"c-config.h" file for yourself. Please see the "INSTALL" directions
for pointers on how to do this.
EOW
exit 1;
}
}
print("Choosing hints file '$hintsfile'\n");
eval "require File::Copy;";
if (! $@) {
&File::Copy::copy($hintsfile, "c-config.h");
} else {
my $cp;
if ($OSNAME eq 'MSWin32') { $cp = "perl -MExtUtils::Command -e cp" }
elsif ($OSNAME eq 'VMS') { $cp = "copy/log" }
else { $cp = "cp" }
my $sys = "$cp $hintsfile c-config.h";
if ($sys =~ m!([^\\:\w/. -])!) {
print STDERR <<"EOW";
I'm sorry. I was going to try to create a "c-config.h" for you, but it
looks like there are some non-standard characters in the exec string.
I'm feeling rather paranoid, so I'll let you look at the line and do
it by hand if it looks OK. I wanted to execute a copy and thought I
might be able to use:
$sys
but it has the (possibly) naughty character '$1' in it. '
EOW
exit 1;
} else {
system($sys);
}
}
}
sub guessPanelMenuFormLibs($$$$$) {
my ($ncursesLibSearch, $libType, $panelLibsR, $menuLibsR, $formLibsR) = @_;
my ($panelLibGuess, $menuLibGuess, $formLibGuess);
if (defined($libType) && $libType eq "ncursesw") {
$panelLibGuess = -lpanelw;
$menuLibGuess = -lmenuw;
$formLibGuess = -lformw;
} else {
$panelLibGuess = -lpanel;
$menuLibGuess = -lmenu;
$formLibGuess = -lform;
}
$$panelLibsR = "$ncursesLibSearch $panelLibGuess";
$$menuLibsR = "$ncursesLibSearch $menuLibGuess";
$$formLibsR = "$ncursesLibSearch $formLibGuess";
}
my $gen;
my $panels;
my $menus;
my $forms;
my @argv;
while (@ARGV) {
my $arg = shift;
if ($arg eq 'GEN') { $gen = $arg }
elsif ($arg eq 'PANELS') { $panels = $arg }
elsif ($arg eq 'MENUS') { $menus = $arg }
elsif ($arg eq 'FORMS') { $forms = $arg }
else { push @argv, $arg }
}
@ARGV = @argv; # pass non-Curses arguments to MakeMaker
print "GEN function: ", ($gen ? "enabled" : "not applicable"), "\n";
print "PANELS functions: ", ($panels ? "enabled" : "not enabled"), "\n";
print "MENUS functions: ", ($menus ? "enabled" : "not enabled"), "\n";
print "FORMS functions: ", ($forms ? "enabled" : "not enabled"), "\n";
print "\n";
if (defined($inc) && defined($libs)) {
# We have the info we need
if (!defined($libType)) {
$libType = defaultLibTypeForOs($OSNAME);
}
} elsif (defined($inc) || defined($libs) || defined($libType)) {
die("You must specify both CURSES_LDFLAGS and CURSES_CFLAGS " .
"environment variables or neither. ");
} else {
guessAtCursesLocation(\$libType, \$inc, \$libs);
}
if (not -e "c-config.h") {
makeConfigH($libType);
}
# Major cheese alert. Any -L for the curses library is probably
# also needed for the panels library.
#
my $ncursesLibSearch;
$ncursesLibSearch = ''; # initial value
while ($libs =~ m{(-L\S+)}g) {
$ncursesLibSearch .= $1 . ' ';
}
guessPanelMenuFormLibs($ncursesLibSearch, $libType,
\my $panelGuess, \my $menuGuess, \my $formGuess);
if ($panels and not $panel_libs) {
$panel_libs = $panelGuess;
}
if ($menus and not $menu_libs) {
$menu_libs = $menuGuess;
}
if ($forms and not $form_libs) {
$form_libs = $formGuess;
}
# Both Perl and Ncurses have a form.h. We have to include the Perl
# header files in our search path, but don't need form.h itself.
# Because the Curses form library header directory comes before the
# perl header directory in our search path, that isn't normally a
# problem. EXCEPT: when there is no specific Curses form library
# directory, and the Curses form.h is instead in the general system
# search path, e.g. /usr/include/form.h. The system directories come
# after the Perl directory in the search. There used to be a
# workaround here where we would simply add /usr/include to the front
# of the search path, but that is not only gross, but ineffective with
# some compilers, which ignore a -I option that adds a directory that
# is a system directory (e.g. gcc 3).
# To deal with this, we make a rough check for the problem, and if it
# appears to exist, we tell the user to fix it.
if ($forms and $form_inc !~ m{-I} and -f('/usr/include/form.h')) {
print("WARNING: Your Curses form.h file appears to be in the default\n");
print("system search path, which will not work for us because of\n");
print("the conflicting Perl form.h file. This means your 'make' will\n");
print("probably fail unless you fix this, as described in the INSTALL\n");
print("file.\n");
}
my $clean = 'CursesDef.h c-config.h cdemo testsym testint testtyp';
my $realc = $gen
? 'list.syms Curses.pm ' .
'CursesFun.c CursesVar.c CursesCon.c CursesTyp.h CursesBoot.c'
: "";
my $components =
($panels ? " PANELS " : "") .
($menus ? " MENUS " : "") .
($forms ? " FORMS " : "");
WriteMakefile(NAME => 'Curses',
INC => "$panel_inc $menu_inc $form_inc $inc",
LIBS => [ "$panel_libs $menu_libs $form_libs $libs" ],
H => [ 'CursesDef.h' ],
clean => { FILES => $clean },
realclean => { FILES => $realc },
dist => { COMPRESS => 'gzip -9f' },
postamble => { COMPONENTS => $components },
VERSION_FROM => 'Curses.pm',
);
sub MY::postamble {
my ($this, %args) = @_;
my $echo = $OSNAME eq 'VMS' ? 'write sys$output' : 'echo';
my $objext = $OSNAME eq 'MSWin32' ? 'obj' : 'o';
my $mf = <<EOM;
CursesDef.h: c-config.h Makefile.PL list.syms
\$(PERL) test.syms $args{COMPONENTS}
c-config.h:
@ $echo "You need to make a c-config.h. See the INSTALL document.";
@ exit 1
cdemo: cdemo.$objext c-config.h
EOM
if ($OSNAME eq 'VMS') {
$mf .= <<EOM;
\$(CC) \$(INC) cdemo.c
\$(LD) cdemo\$(OBJ_EXT), \$(LDLOADLIBS), CURSES2.OPT/opt
EOM
}
else {
$mf .= <<EOM;
\$(CC) \$(INC) -o cdemo cdemo.c \$(LDLOADLIBS)
EOM
}
if ($gen) {
$mf .= <<EOM;
Curses.c :: CursesFun.c CursesVar.c CursesCon.c CursesTyp.h CursesBoot.c
@\$(NOOP)
config :: list.syms Curses.pm \\
CursesFun.c CursesVar.c CursesCon.c CursesTyp.h CursesBoot.c
list.syms : gen/make.list.syms gen/list.fun gen/list.var gen/list.typ
\$(PERL) gen/make.list.syms
Curses.pm : gen/make.Curses.pm gen/list.fun gen/list.var gen/list.con
\$(PERL) gen/make.Curses.pm
CursesFun.c : gen/make.CursesFun.c gen/list.fun
\$(PERL) gen/make.CursesFun.c
CursesVar.c : gen/make.CursesVar.c gen/list.var
\$(PERL) gen/make.CursesVar.c
CursesCon.c : gen/make.CursesCon.c gen/list.con
\$(PERL) gen/make.CursesCon.c
CursesTyp.h : gen/make.CursesTyp.h gen/list.typ
\$(PERL) gen/make.CursesTyp.h
CursesBoot.c : gen/make.CursesBoot.c gen/list.fun gen/list.var gen/list.con
\$(PERL) gen/make.CursesBoot.c
EOM
}
return $mf;
}
__END__

View File

@@ -1,144 +0,0 @@
The Curses Perl Module
============================================================
COPYRIGHT AND LICENSE INFORMATION IS AT THE END OF THIS FILE
============================================================
This is a dynamic loadable curses module for perl. You can get this
package at any CPAN archive.
Please see the INSTALL document for how to install it on your system,
the Curses pod (located at the end of "Curses.pm") for known
incompatibilities with other Perl programs, and the end of this
document for known compile or install problems.
RECENT CHANGES
--------------
The change history is in the file HISTORY.
BINARY DISTRIBUTIONS
--------------------
There is a binary package for Cygwin at
ftp://sunsite.dk/projects/cygwinports/release/perl/perl-Curses
The maintainer of this CPAN source package doesn't know of any others,
but if you do, let him know and he will add them here.
DEMO PROGRAMS
-------------
The "demo" program is for demonstration purposes only. If it
references a function your version of curses doesn't have, wrap it in
an "eval" and try again. Same goes double for the "gdc" program.
You can type "make cdemo" to make a C language version of the demo.
If you get the same results via "demo" and "cdemo", but they don't
look right, then it's a bug in your libcurses, not in Curses.
MAINTENANCE
-----------
Bryan Henderson maintains the Perl Curses module. Bryan doesn't actually
know much about it, and is functioning mainly as a coordinator. Go ahead
and report bugs to and ask technical questions of Bryan, but don't hold
your breath. If you should have a fix or enhancement, though, Bryan will
incorporate it into the package promptly.
Email Bryan at bryanh@giraffe-data.com. Do not use the CPAN bug
database to report a bug. It's more work for both parties and Bryan
doesn't know a bug has been opened except when he occasionally goes to
look.
*** SECURITY NOTICE ***
It has always been the case with the curses functions, but please note
that the following functions:
getstr() (and optional wgetstr(), mvgetstr(), and mvwgetstr())
inchstr() (and optional winchstr(), mvinchstr(), and mvwinchstr())
instr() (and optional winstr(), mvinstr(), and mvwinstr())
are subject to buffer overflow attack. This is because you pass in
the buffer to be filled in, which has to be of finite length, but
there is no way to stop a bad guy from typing.
In order to avoid this problem, use the alternate functions:
getnstr()
inchnstr()
innstr()
which take an extra "size of buffer" argument.
Known Problems
--------------
Wide characters
Screen positions get calculated wrong, i.e. based on the number of
bytes in a string instead of the number of characters.
You should debug this, fix it, and submit the fix for inclusion in
the next release of Perl Curses.
Note that unless you have and build for the wide-character-capable
Ncurses (named 'ncursesw'), wide characters won't work even this much.
NCurses
getch() and getstr() don't work right under very old versions of
ncurses (around v1.8.5). Please upgrade to a newer version.
panel_hidden() test is reversed in v1.9.9g. Please upgrade to
a newer version.
Actually, there are several problems in v1.9.9g. Please upgrade
to a newer version.
NETBSD
William reported as of 2001: I continue to get conflicting reports
about the correct number of arguments for longname() and
touchline(), controlled via the file `hints/c-netbsd.h'. Before
compiling, you may want to look them up yourself, confirm them, and
then editing `hints/c-netbsd.h'.
Solaris 2.6
The menu stuff doesn't appear to work. I have no idea why.
COPYRIGHT AND LICENSE INFORMATION
---------------------------------
Copyright (c) 1994-2000 William Setzer
All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the same terms as perl, specifically:
a) the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any
later version, or
b) the "Artistic License" which comes with this Kit.
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
Artistic License for more details.
You should have received a copy of the Artistic License with this
Kit, in the file named "Artistic". If not, I'll be glad to provide one.
You should also 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.

View File

@@ -1,135 +0,0 @@
/* cdemo.c
**
** Copyright (c) 1994-2000 William Setzer
**
** You may distribute under the terms of either the Artistic License
** or the GNU General Public License, as specified in the README file.
*/
#include "CursesDef.h"
#include "c-config.h"
#ifdef VMS
#include <unistd.h> /* not in perl.h ??? */
#endif
#ifdef WIN32
#include <Windows.h>
#endif
static void
sleepSeconds(unsigned int seconds) {
#ifdef WIN32
Sleep(seconds * 1000);
#else
sleep(seconds);
#endif
}
int
main(unsigned int const argc,
const char ** const argv) {
WINDOW *b;
chtype ch;
char str[250];
int m, n;
initscr();
b = subwin(stdscr, 10, 20, 3, 3);
noecho();
cbreak();
move(0, 0);
addstr("ref b = <something C won't do>");
move(1, 1);
addstr("fooalpha");
#ifdef C_ATTRON
# ifdef A_BOLD
attron(A_BOLD);
# endif
#endif
move(2, 5);
addstr("bold ");
#ifdef C_ATTRON
# ifdef A_REVERSE
attron(A_REVERSE);
# endif
#endif
addstr("bold+reverse");
#ifdef C_ATTRSET
# ifdef A_NORMAL
attrset(A_NORMAL);
# endif
#endif
addstr(" normal (if your curses can do these modes)");
move(6, 1);
addstr("do12345678901234567890n't worry be happy");
#ifdef C_BOX
box(b, '|', '-');
#endif
wstandout(b);
move(2, 2);
waddstr(b, "ping");
wstandend(b);
move(4, 4);
waddstr(b, "pong");
wmove(b, 3, 3);
move(6, 3);
wdeleteln(b);
insertln();
move(4, 5);
wdelch(b);
move(7, 8);
insch('a');
#ifdef C_KEYPAD
keypad(stdscr, 1);
#endif
move(14, 0);
addstr("hit a key: ");
refresh();
ch = getch();
move(15, 0);
printw("you typed: >>%c<<", ch);
move(17, 0);
addstr("enter string: ");
refresh();
getstr(str);
move(18, 0);
printw("you typed: >>%s<<", str);
getyx(stdscr, m, n);
move(19, 4);
printw("y == %d (should be 18), x == %d", m, n);
ch = mvinch(19, 7);
move(20, 0);
printw("The character at (19,7) is an '%c' (should be an '=')", ch);
move(21, 0);
addstr("testing KEY_*. Hit the up arrow on your keyboard: ");
refresh();
ch = getch();
#ifdef KEY_UP
if (ch == KEY_UP) { mvaddstr(22, 0, "KEY_UP was pressed!"); }
else { mvaddstr(22, 0, "Something else was pressed."); }
#else
move(22, 0);
addstr("You don't seem to have the KEY_UP macro");
#endif
move(LINES - 1, 0);
refresh();
sleepSeconds(5);
endwin();
}

View File

@@ -1,79 +0,0 @@
#! /usr/bin/perl
##
## demo -- do some curses stuff
##
## Copyright (c) 1994-2000 William Setzer
##
## You may distribute under the terms of either the Artistic License
## or the GNU General Public License, as specified in the README file.
use ExtUtils::testlib;
use Curses;
initscr();
$b = subwin(10, 20, 3, 3);
noecho();
cbreak();
addstr(0, 0, "ref b = " . ref $b);
addstr(1, 1, "fooalpha");
eval { attron(A_BOLD) };
addstr(2, 5, "bold ");
eval { attron(A_REVERSE) };
addstr("bold+reverse");
eval { attrset(A_NORMAL) };
addstr(" normal (if your curses supports these modes)");
addstr(6, 1, "do12345678901234567890n't worry be happy");
eval { box($b, '|', '-') };
standout($b);
addstr($b, 2, 2, "ping");
standend($b);
addstr($b, 4, 4, "pong");
move($b, 3, 3);
move(6, 3);
deleteln($b);
insertln();
delch($b, 4, 5);
insch(7, 8, ord(a));
eval { keypad(1) };
addstr(14, 0, "hit a key: ");
refresh();
$ch = getch();
addstr(15, 0, "you typed: >>");
addch($ch);
addstr("<< and perl thinks you typed: >>$ch<<");
addstr(17, 0, "enter string: ");
refresh();
getstr($str);
addstr(18, 0, "you typed: >>$str<<");
getyx($m, $n);
addstr(19, 4, "y == $m (should be 18), x == $n (should be "
. (15 + length $str) . ")");
$ch = inch(19, 7);
addstr(20, 0, "The character at (19,7) is an '$ch' (should be an '=')");
addstr(21, 0, "testing KEY_*. Hit the up arrow on your keyboard: ");
refresh();
$ch = getch();
eval
{
if ($ch == KEY_UP) { addstr(22, 0, "KEY_UP was pressed!") }
else { addstr(22, 0, "Something else was pressed.") }
1;
} || addstr(22, 0, "You don't seem to have the KEY_UP macro");
move($LINES - 1, 0);
refresh();
sleep 2;
endwin();

View File

@@ -1,199 +0,0 @@
#! /usr//bin/perl
##
use ExtUtils::testlib;
use Curses;
sub fatal {
clrtobot(0, 0);
addstr(0, 0, "@_\n");
refresh();
sleep 2;
exit 1;
}
sub driveForm($$) {
my ($fwin, $form) = @_;
while (1) {
my $ch = getch($fwin);
if ($ch == KEY_UP) {
form_driver($form, REQ_PREV_FIELD);
} elsif ($ch == KEY_DOWN or $ch eq "\t" or
$ch eq "\r" or $ch eq "\n") {
form_driver($form, REQ_NEXT_FIELD);
} elsif ($ch == KEY_LEFT) {
form_driver($form, REQ_LEFT_CHAR);
} elsif ($ch == KEY_RIGHT) {
form_driver($form, REQ_RIGHT_CHAR);
} elsif ($ch == KEY_NPAGE) {
form_driver($form, REQ_NEXT_PAGE);
} elsif ($ch == KEY_PPAGE) {
form_driver($form, REQ_PREV_PAGE);
} elsif ($ch == KEY_DC or ord($ch) == 8 or ord($ch) == 127) {
form_driver($form, REQ_DEL_PREV);
} elsif ($ch == KEY_F(1)) {
last;
} elsif ($ch =~ /^\S$/) {
form_driver($form, ord($ch));
} else {
beep();
}
}
}
sub makeFields() {
my $flist = [
[ 'L', 0, 0, 0, 8, "Form" ],
[ 'L', 0, 0, 2, 0, "First Name" ],
[ 'F', 1, 15, 2, 12, "F Name" ],
[ 'L', 0, 0, 3, 0, "Last Name" ],
[ 'F', 1, 15, 3, 12, "L Name" ],
[ 'L', 0, 0, 5, 8, "Form (pt 2)" ],
[ 'L', 0, 0, 7, 0, "# Tuits" ],
[ 'F', 1, 5, 7, 12, "Tuits" ],
[ 'L', 0, 0, 8, 0, "# Bleems" ],
[ 'F', 1, 5, 8, 12, "Bleems" ]
];
my @fl;
foreach my $F (@$flist) {
my $field;
# This is a Perl reference to a scalar number variable. The
# number is the numerical equivalent (cast) of the C pointer to the
# executable-Curses FIELD object. The reference is blessed into
# package "Curses::Field", but don't confuse it with a Perl
# object.
if ($F->[0] eq 'L') {
$field = new_field(1, length($F->[5]), $F->[3], $F->[4], 0, 0);
if ($field eq '') {
fatal("new_field $F->[5] failed");
}
set_field_buffer($field, 0, $F->[5]);
field_opts_off($field, O_ACTIVE);
field_opts_off($field, O_EDIT);
} elsif ($F->[0] eq 'F') {
$field = new_field($F->[1], $F->[2], $F->[3], $F->[4], 0, 0);
if ($field eq '') {
fatal("new_field $F->[5] failed");
}
if ($F->[5] eq "Tuits") {
set_field_buffer($field, 0, $F->[5]);
}
set_field_back($field, A_UNDERLINE);
}
push(@fl, $field);
}
return @fl;
}
sub makeForm(@) {
my @fl = @_;
my @pack;
foreach $fieldR (@fl) {
push(@pack, $ {$fieldR});
}
push(@pack, 0);
# new_form()'s argument is a list of fields. Its form is amazingly
# complex:
# The argument is a string whose ASCII encoding is an array of C
# pointers. Each pointer is to a FIELD object of the
# executable-Curses library, except the last is NULL to mark the
# end of the list. For example, assume there are two fields and
# the executable-Curses library represents them with FIELD objects
# whose addresses (pointers) are 0x11223344 and 0x0004080C. The
# argument to Curses::new_form() is a 12 character string whose
# ASCII encoding is 0x112233440004080C00000000 .
# Maybe some day we can provide an alternative where there is an
# actual Perl field object class and the argument is a reference to
# a Perl list of them.
my $form = new_form(pack('L!*', @pack));
if ($form eq '') {
fatal("new_form failed");
}
return $form;
}
sub demo() {
noecho();
eval { new_form() };
if ($@ =~ m{not defined by your vendor}) {
print STDERR "Curses was not compiled with form function.\n";
exit 1;
}
my @fl = makeFields();
my $form = makeForm(@fl);
my $rows;
my $cols;
scale_form($form, $rows, $cols);
my $fwin = newwin($rows + 2, $cols + 4, 4, 0);
my $fsub = derwin($fwin, $rows, $cols, 1, 2);
set_form_win($form, $fwin);
set_form_sub($form, $fsub);
box($fwin, 0, 0);
keypad($fwin, 1);
post_form($form);
addstr(0, 0, "Use KEY_UP/KEY_DOWN/KEY_PPAGE/KEY_NPAGE to navigate");
addstr(1, 0, "Press 'ENTER' to select item, or 'F1' to exit");
addstr(2, 0, "Other alphanumeric characters will enter data");
refresh();
driveForm($fwin, $form);
unpost_form($form);
delwin($fwin);
free_form($form);
map { free_field($_) } @fl;
}
##############################################################################
# MAINLINE
##############################################################################
initscr();
# The eval makes sure if it croaks, we have a chance to restore the
# terminal.
eval { demo() };
endwin();
if ($@) {
print STDERR "Failed. $@\n";
exit(1);
}
exit(0);

View File

@@ -1,121 +0,0 @@
#! /usr/bin/perl
##
## This code contributed by Yury Pshenichny <yura@zp.ua>
## based on demo.panel by Chris Leach <leachcj@bp.com>
## and pretty much redone by me
use ExtUtils::testlib;
use Curses;
eval { new_menu() };
if ($@ =~ /not defined by your vendor/) {
print STDERR "Curses was not compiled with menu support.\n";
exit 1;
}
my $ilist = [
[ "AAA" => "A descr" ],
[ "BBB" => "B descr" ],
[ "CCC" => "C descr" ],
[ "DDD" => "D descr" ],
[ "EEE" => "E descr" ],
[ "FFF" => "F descr" ],
[ "GGG" => "G descr" ],
[ "HHH" => "H descr (This item has a very long descr) "]
];
initscr;
noecho;
my @il;
my @pack;
foreach my $I (@$ilist) {
my $item = new_item($I->[0], $I->[1]);
if ($item eq '') { fatal("new_item($I->[0], $I->[1]) failed: $item") }
push @il, $item;
push @pack, ${$item};
}
push @pack, 0;
my $menu = new_menu(pack "L!*", @pack);
if ($menu eq '') { fatal("new_menu failed") }
my $rows;
my $cols;
set_menu_mark($menu, '->');
set_menu_format($menu, 3, 1);
scale_menu($menu, $rows, $cols);
my $mwin = newwin($rows + 2, $cols + 2, 8, 15);
my $msub = derwin($mwin, $rows, $cols, 1, 1);
set_menu_win($menu, $mwin);
set_menu_sub($menu, $msub);
box($mwin, 0, 0);
keypad($mwin, 1);
post_menu($menu);
addstr(0, 0, "Use KEY_UP/KEY_DOWN/KEY_PPAGE/KEY_NPAGE to navigate");
addstr(1, 0, "Press 'ENTER' to select item, or 'F1' to exit");
refresh();
my $ci;
while(1) {
my $ch = getch($mwin);
if ($ch == KEY_UP) {
menu_driver($menu, REQ_UP_ITEM);
}
elsif ($ch == KEY_DOWN) {
menu_driver($menu, REQ_DOWN_ITEM);
}
elsif ($ch == KEY_PPAGE) {
menu_driver($menu, REQ_SCR_UPAGE);
}
elsif ($ch == KEY_NPAGE) {
menu_driver($menu, REQ_SCR_DPAGE);
}
elsif ($ch == KEY_F(1)) {
last;
}
elsif ($ch eq "\r" or $ch eq "\n") {
$ci = current_item($menu);
last;
}
elsif ($ch =~ /^\S$/) {
menu_driver($menu, $ch);
}
else {
beep();
}
}
if ($ci) {
addstr(0, 0, "You selected " . item_name($ci) . "\n");
}
else {
addstr(0, 0, "You didn't select anything\n");
}
clrtoeol(1,0);
refresh();
sleep 2;
unpost_menu($menu);
delwin($mwin);
free_menu($menu);
map { free_item($_) } @il;
endwin();
exit 0;
sub fatal {
clrtobot(0, 0);
addstr(0, 0, "@_\n");
refresh();
sleep 2;
exit 1;
}

View File

@@ -1,80 +0,0 @@
#! /usr/bin/perl
##
## This code contributed by Chris Leach <leachcj@bp.com>
use ExtUtils::testlib;
use Curses;
eval { new_panel() };
if ($@ =~ /not defined by your vendor/) {
print STDERR "Curses was not compiled with panel support.\n";
exit 1;
}
my $p1 = mkpanel("000");
message("New Panel with 000's");
my $p2 = mkpanel("+++");
move_panel($p1, 8, 20);
message("New Panel with +++'s");
hide_panel($p1);
message("Hiding 000's");
message("000's hidden? ", panel_hidden($p1) ? "Yes" : "No");
show_panel($p1);
message("Showing 000's");
my $p3 = mkpanel("XXX");
move_panel($p3, 7, 34);
message("New Panel with XXX's");
top_panel(panel_above(panel_above(undef)));
message("Moving the panel above the bottom panel to the top");
bottom_panel(panel_below(panel_below(undef)));
message("Moving the panel below the top panel to the bottom");
my $w3 = panel_window($p3);
del_panel($p3);
message("Deleting panel with XXX's saving window");
replace_panel($p1, $w3);
message("Replacing 000's window");
del_panel($p2);
del_panel($p1);
endwin();
sub mkpanel {
my $s = shift;
my $w = Curses->new(10, 26, 12, 25);
die unless $w;
box($w, 0, 0);
my $p = new_panel($w);
if ($p) {
set_panel_userptr($p, $s);
foreach my $r (1..8) {
addstr($w, $r, 3*$r-2, $s);
}
}
else {
fatal("new_panel failed");
}
$p;
}
sub message {
addstr(stdscr, 0, 0, "@_\n");
update_panels();
doupdate();
sleep 2;
}
sub fatal {
message("@_");
exit 1;
}

View File

@@ -1,78 +0,0 @@
#! /usr/bin/perl
##
## demo2 -- play around with some weird stuff, use object model
##
## Copyright (c) 2000 William Setzer
##
## You may distribute under the terms of either the Artistic License
## or the GNU General Public License, as specified in the README file.
use ExtUtils::testlib;
use Curses;
sub message {
my $win = shift;
$win->addstr(0, 0, "@_\n");
$win->addstr(3, 4, "-->");
$win->move($LINES - 1, 0);
$win->refresh();
sleep 2;
}
my $win = Curses->new or die "Can't get new window\n";
## You have to pack chtypes. Be sure to get that trailing zero.
#
eval {
my $chstr = pack "I*",
ACS_BLOCK, ord(A), ACS_CKBOARD, ord(B), ACS_PLMINUS, 0;
$win->addchstr(3, 8, $chstr);
message $win, "addchstr: block, A, checkerboard, B, plus/minus";
};
$win->clrtoeol(3, 8);
## Attrs
#
eval {
$win->attron(A_BOLD|A_UNDERLINE);
$win->addstr(3, 8, "hello");
$win->attrset(0);
message $win, "attr: BOLD|UNDERLINE";
$win->attron(A_BOLD|A_UNDERLINE);
$win->attroff(A_BOLD);
$win->addstr(3, 8, "hello");
$win->attrset(0);
message $win, "attr: UNDERLINE";
};
$win->clrtoeol(3, 8);
## Color
#
eval {
start_color;
init_pair 1, COLOR_GREEN, COLOR_BLACK;
init_pair 2, COLOR_RED, COLOR_BLACK;
my $GREEN = COLOR_PAIR(1);
my $RED = COLOR_PAIR(2);
$win->attron($RED);
$win->addstr(3, 8, "hello");
$win->attroff($RED);
message $win, "color: red";
$win->attron($GREEN);
$win->addstr(3, 8, "hello");
$win->attroff($GREEN);
message $win, "color: green";
my $chstr = $RED | ACS_CKBOARD;
$win->clrtoeol(3, 8);
$win->addch(3, 8, $chstr);
message $win, "addch: red checkerboard";
};
endwin();

View File

@@ -1,150 +0,0 @@
#! /usr/bin/perl
# This file a port from test/gdc.c in the ncurses-1.9.8a distribution.
# No copyright license is publicly offered, but I don't think the
# writer would mind the port. It's not exact, because I was
# simplifying things to find a bug in my port.
#
# Also note that this is basically a direct port. If it looks like C
# written in perl, that's because it is. :-)
#
# /*
# * Grand digital clock for curses compatible terminals
# * Usage: gdc [-s] [n] -- run for n seconds (default infinity)
# * Flags: -s: scroll
# *
# * modified 10-18-89 for curses (jrl)
# * 10-18-89 added signal handling
# */
use ExtUtils::testlib;
use Curses;
$YBASE = 10;
$XBASE = 10;
$YDEPTH = 5;
$XLENGTH = 54;
@disp = (075557, 011111, 071747, 071717, 055711, 074717,
074757, 071111, 075757, 075717, 002020);
$SIG{INT} = \&sighndl;
$SIG{TERM} = \&sighndl;
initscr();
cbreak();
noecho();
clear();
refresh();
$n = -1;
for (@ARGV) {
/-s/ and $scroll = 1;
$n = $_;
}
$hascolor = eval { has_colors() };
if ($hascolor) {
start_color();
init_pair(1, COLOR_BLACK, COLOR_RED);
init_pair(2, COLOR_RED, COLOR_BLACK);
init_pair(3, COLOR_WHITE, COLOR_BLACK);
attrset(COLOR_PAIR(3));
addch($YBASE - 1, $XBASE - 1, ACS_ULCORNER);
hline(ACS_HLINE, $XLENGTH);
addch($YBASE - 1, $XBASE + $XLENGTH, ACS_URCORNER);
addch($YBASE + $YDEPTH, $XBASE - 1, ACS_LLCORNER);
hline(ACS_HLINE, $XLENGTH);
addch($YBASE + $YDEPTH, $XBASE + $XLENGTH, ACS_LRCORNER);
move($YBASE, $XBASE - 1);
vline(ACS_VLINE, $YDEPTH);
move($YBASE, $XBASE + $XLENGTH);
vline(ACS_VLINE, $YDEPTH);
attrset(COLOR_PAIR(2));
}
while ($n--) {
$mask = 0;
$time = time;
my($sec, $min, $hour) = localtime $time;
set($sec % 10, 0);
set($sec / 10, 4);
set($min % 10, 10);
set($min / 10, 14);
set($hour % 10, 20);
set($hour / 10, 24);
set(10, 7);
set(10, 17);
foreach $k (0..5) {
if($scroll) {
foreach $i (0..4) {
$new[$i] = ($new[$i] & ~$mask) | ($new[$i+1] & $mask);
}
$new[5] = ($new[5] & ~$mask) | ($next[$k] & $mask);
}
else { $new[$k] = ($new[$k] & ~$mask) | ($next[$k] & $mask) }
$next[$k] = 0;
for($s = 1; $s >= 0; $s--) {
standt($s);
foreach $i (0..5) {
if($a = (($new[$i] ^ $old[$i]) & ($s ? $new[$i] : $old[$i]))) {
for ($j = 0, $t = 1 << 26; $t; $t >>= 1, $j++) {
if($a & $t) {
if(!($a & ($t << 1))) {
move($YBASE + $i, $XBASE + 2*$j);
}
addstr(" ");
}
}
}
if(!$s) { $old[$i] = $new[$i]; }
}
}
refresh();
}
# /* this depends on the detailed format of ctime(3) */
my($ctime) = scalar localtime $time;
addstr(16, 30, substr($ctime, 0, 10) . substr($ctime, 19));
move(0, 0);
refresh();
sleep(1);
if ($sigtermed) {
last;
}
}
standend();
clear();
refresh();
endwin();
print STDERR "gdc terminated by signal $sigtermed\n" if $sigtermed;
sub set {
my($t, $n) = @_;
my($m) = 7 << $n;
foreach $i (0..4) {
$next[$i] |= (($disp[$t] >> (4-$i)*3) & 07) << $n;
$mask |= ($next[$i] ^ $old[$i]) & $m;
}
if ($mask & $m) { $mask |= $m }
}
sub standt {
my($on) = @_;
if ($on) { $hascolor ? attron(COLOR_PAIR(1)) : standout() }
else { $hascolor ? attron(COLOR_PAIR(2)) : standend() }
}
sub sighndl {
local($sig) = @_;
$sigtermed = $sig;
}

View File

@@ -1,468 +0,0 @@
package Gen;
@ISA = qw(Exporter);
@EXPORT = qw(lookup Q process_DATA_chunk
process_functions process_variables process_constants
process_typedefs);
my $list_fun = "gen/list.fun";
my $list_var = "gen/list.var";
my $list_con = "gen/list.con";
my $list_typ = "gen/list.typ";
###
## Declaration entries
#
my $MAP = {
'attr_t' => {
'DECL_NOR' => '(attr_t)SvIV($A)',
'RETN_NOR' => 'sv_setiv($A, (IV)$N)',
'TEST_NOR' => '0',
'DECL_OUT' => '0',
'RETN_OUT' => 'sv_setiv($A, (IV)$N);',
'TEST_OUT' => 'LINES',
'RETN_NUL' => 'ERR',
},
'bool' => {
'DECL_NOR' => '(int)SvIV($A)',
'RETN_NOR' => 'sv_setiv($A, (IV)$N)',
'TEST_NOR' => '0',
'RETN_NUL' => 'ERR',
},
'char' => {
'RETN_NOR' => 'sv_setpvn($A, (char *)&$N, 1)',
'RETN_NUL' => 'ERR',
},
'char *' => {
'DECL_NOR' => '(char *)SvPV($A,PL_na)',
'RETN_NOR' => 'sv_setpv((SV*)$A, $N)',
'TEST_NOR' => '0',
'DECL_OUT' => '(char *)sv_grow($A, $B)',
'RETN_OUT' => 'c_setchar($A, $N)',
'TEST_OUT' => '0',
'DECL_OPT' => '$A != &PL_sv_undef ? (char *)SvPV($A,PL_na) : NULL',
'TEST_OPT' => '0',
'RETN_NUL' => 'NULL',
},
'chtype' => {
'DECL_NOR' => 'c_sv2chtype($A)',
'RETN_NOR' => 'c_chtype2sv($A, $N)',
'TEST_NOR' => '0',
'RETN_NUL' => 'ERR',
},
'chtype *' => {
'DECL_NOR' => '(chtype *)SvPV($A,PL_na)',
'TEST_NOR' => '0',
'DECL_OUT' => '(chtype *)sv_grow($A, ($B)*sizeof(chtype))',
'RETN_OUT' => 'c_setchtype($A, $N)',
'TEST_OUT' => '0',
},
'FIELD *' => {
'DECL_NOR' => 'c_sv2field($A, $B)',
'RETN_NOR' => 'c_field2sv($A, $N)',
'TEST_NOR' => '0',
'RETN_NUL' => 'NULL',
},
'FIELD **' => {
'DECL_NOR' => '(FIELD **)SvPV($A,PL_na)',
'RETN_NOR' => 'sv_setpv((SV*)$A, (char *)$N)',
'TEST_NOR' => '0',
'RETN_NUL' => '0',
},
'FILE *' => {
'DECL_NOR' => 'IoIFP(sv_2io($A))',
'TEST_NOR' => '0',
},
'FORM *' => {
'DECL_NOR' => 'c_sv2form($A, $B)',
'RETN_NOR' => 'c_form2sv($A, $N)',
'TEST_NOR' => '0',
'RETN_NUL' => 'NULL',
},
'int' => {
'DECL_NOR' => '(int)SvIV($A)',
'RETN_NOR' => 'sv_setiv($A, (IV)$N)',
'TEST_NOR' => '0',
'DECL_OUT' => '0',
'RETN_OUT' => 'sv_setiv($A, (IV)$N);',
'TEST_OUT' => 'LINES',
'RETN_NUL' => 'ERR',
},
'ITEM *' => {
'DECL_NOR' => 'c_sv2item($A, $B)',
'RETN_NOR' => 'c_item2sv($A, $N)',
'TEST_NOR' => '0',
'RETN_NUL' => 'NULL',
},
'ITEM **' => {
'DECL_NOR' => '(ITEM **)SvPV($A,PL_na)',
'RETN_NOR' => 'sv_setpv((SV*)$A, (char *)$N)',
'TEST_NOR' => '0',
'RETN_NUL' => '0',
},
'MENU *' => {
'DECL_NOR' => 'c_sv2menu($A, $B)',
'RETN_NOR' => 'c_menu2sv($A, $N)',
'TEST_NOR' => '0',
'RETN_NUL' => 'NULL',
},
'MEVENT *' => {
'DECL_NOR' => '(MEVENT *)SvPV($A,PL_na)',
'TEST_NOR' => '0',
'DECL_OUT' => '(MEVENT *)sv_grow($A, 2 * sizeof(MEVENT))',
'RETN_OUT' => 'c_setmevent($A, $N)',
'TEST_OUT' => '0',
},
'mmask_t' => {
'DECL_NOR' => '(mmask_t)SvIV($A)',
'RETN_NOR' => 'sv_setiv($A, (IV)$N)',
'TEST_NOR' => '0',
'DECL_OUT' => '0',
'RETN_OUT' => 'sv_setiv($A, (IV)$N);',
'TEST_OUT' => 'LINES',
'RETN_NUL' => 'ERR',
},
'PANEL *' => {
'DECL_NOR' => 'c_sv2panel($A, $B)',
'RETN_NOR' => 'c_panel2sv($A, $N)',
'TEST_NOR' => '0',
'DECL_OPT' => '$A != &PL_sv_undef ? c_sv2panel($A, $B) : NULL',
'TEST_OPT' => '0',
'RETN_NUL' => 'NULL',
},
'SCREEN *' => {
'DECL_NOR' => 'c_sv2screen($A, $B)',
'RETN_NOR' => 'c_screen2sv($A, $N)',
'TEST_NOR' => '0',
'RETN_NUL' => 'NULL',
},
'short' => {
'DECL_NOR' => '(short)SvIV($A)',
'TEST_NOR' => '0',
'DECL_OUT' => '0',
'RETN_OUT' => 'sv_setiv($A, (IV)$N);',
'TEST_OUT' => 'LINES',
},
'void' => {
'RETN_NOR' => 'not gonna happen',
'RETN_NUL' => 'not gonna happen',
},
'void *' => {
'DECL_NOR' => '0',
'TEST_NOR' => '0',
},
'WINDOW *' => {
'DECL_NOR' => 'c_sv2window($A, $B)',
'RETN_NOR' => 'c_window2sv($A, $N)',
'TEST_NOR' => 'stdscr',
'RETN_NUL' => 'NULL',
}
};
## Allow us to put some quoting around here documents to make them stand out
#
sub Q {
my $text = shift;
$text =~ s/^#{16}\n//mg;
$text =~ s/^#\t?//mg;
$text;
}
## Print a chunk of data, 'til we hit PAUSE
#
sub process_DATA_chunk {
my $proc = shift;
my ($pkg) = (caller)[0];
*DATA = *{"${pkg}::DATA"};
while (<DATA>) {
last if /^PAUSE$/;
&{$proc}($_);
}
}
my $pattern = '^\s* (?:const \s+)? ( (?:[{<|] [^}>|]+ [}>|])* )' .
'\s* (\S+ (?: \s+ \*+)?) \s* ( [{<|] \w+ [}>|] )* \s* (\w+)';
sub process_functions {
my $proc = shift;
my $numf = 1;
open INF, $list_fun or die "Can't open $list_fun: $!\n";
FCN:
while (<INF>) {
next if /^!/;
while (s/\\\n//) {
$_ .= <INF>;
die "$list_fun: Unterminated backslash\n" if eof;
}
my $fun = {
LINE => $_,
DOIT => 0
};
if (/^> (.+) \( (.+) \) ; /x) {
my $lhs = $1;
my $args = $2;
unless ($lhs =~ /$pattern/xo) {
warn "$lhs($args): bad function prototype\n";
next FCN;
}
$fun->{SPEC} = $1;
$fun->{DECL} = $2;
$fun->{UNI} = $3;
$fun->{NAME} = $4;
$fun->{DOIT} = 1;
$fun->{NUM} = $numf++;
$fun->{ARGV} = [ ];
$fun->{SPEC} = { map { uc($_) => 1 } $fun->{SPEC} =~ /{(.+?)}/g };
$fun->{W} = $fun->{UNI} && $fun->{UNI} =~ /[{|]/ ? 'w' : '';
my $argc = 0;
foreach my $entry (split /\s*,\s*/, $args) {
next if $entry eq 'void';
unless ($entry =~ /$pattern/xo) {
warn "$fun->{NAME}( $entry ): bad arg prototype\n";
next FCN;
}
my $arg = $fun->{ARGV}[$argc] = { };
$arg->{SPEC} = $1;
$arg->{DECL} = $2;
$arg->{NAME} = $4;
$arg->{SPEC} = { map { /=/ ? (uc($`) => $') : (uc($_) => 1) }
$arg->{SPEC} =~ /{(.+?(?:=.+?)?)}/g };
$arg->{MAP} = { };
$arg->{NUM} = $argc++;
my $typ = 'NOR';
if ($arg->{SPEC}{OUT}) { $typ = 'OUT' }
elsif ($arg->{SPEC}{OPT}) { $typ = 'OPT' }
my $decl = $MAP->{$arg->{DECL}}{"DECL_$typ"};
if (not defined $decl) {
warn "$fun->{NAME}( $arg->{DECL} $arg->{NAME} ): " .
"no map rewrite for DECL_$typ\n";
next FCN;
}
$arg->{M_DECL} = $decl;
if ($typ eq 'OUT') {
my $retn = $MAP->{$arg->{DECL}}{"RETN_$typ"};
if (not defined $retn) {
warn "$fun->{NAME}( $arg->{DECL} $arg->{NAME} ): " .
"no map rewrite for RETN_$typ\n";
next FCN;
}
$arg->{M_RETN} = $retn;
}
my $test = $MAP->{$arg->{DECL}}{"TEST_$typ"};
if (not defined $test) {
warn "$fun->{NAME}( $arg->{DECL} $arg->{NAME} ): " .
"no map rewrite for TEST_$typ\n";
next FCN;
}
$arg->{M_TEST} = $test;
}
my $retn = $MAP->{$fun->{DECL}}{RETN_NOR};
if (not defined $retn) {
warn "$fun->{DECL} $fun->{NAME}( ): " .
"no map rewrite for RETN_NOR\n";
next FCN;
}
my $null = $MAP->{$fun->{DECL}}{RETN_NUL};
if (not defined $null) {
warn "$fun->{DECL} $fun->{NAME}( ): " .
"no map rewrite for RETN_NUL\n";
next FCN;
}
$fun->{M_RETN} = $retn;
$fun->{M_NULL} = $null;
$fun->{ARGC} = $argc;
}
&{$proc}($fun);
}
close INF;
}
sub process_variables {
my $proc = shift;
my $numv = 1;
open INV, $list_var or die "Can't open $list_var: $!\n";
while (<INV>) {
next if /^!/;
while (s/\\\n//) {
$_ .= <INV>;
die "$list_var: Unterminated backslash\n" if eof;
}
my $var = {
LINE => $_,
DOIT => 0
};
if (/^> (.+) ; /x) {
my $lhs = $1;
unless ($lhs =~ /$pattern/xo) {
warn "$lhs: bad variable prototype\n";
next;
}
$var->{SPEC} = $1;
$var->{DECL} = $2;
$var->{NAME} = $4;
$var->{DOIT} = 1;
$var->{NUM} = $numv++;
$var->{SPEC} = { map { uc($_) => 1 } $var->{SPEC} =~ /{(.+?)}/g };
my $decl = $MAP->{$var->{DECL}}{DECL_NOR};
if (not defined $decl) {
warn "$var->{DECL} $var->{NAME}: " .
"no map rewrite for DECL_$typ\n";
next;
}
my $retn = $MAP->{$var->{DECL}}{RETN_NOR};
if (not defined $retn) {
warn "$var->{DECL} $var->{NAME}: " .
"no map rewrite for RETN_NOR\n";
next;
}
$var->{M_DECL} = $decl;
$var->{M_RETN} = $retn;
}
&{$proc}($var);
}
close INV;
}
sub process_constants {
my $proc = shift;
my $numc = 1;
open INC, $list_con or die "Can't open $list_con: $!\n";
while (<INC>) {
next if /^!/;
while (s/\\\n//) {
$_ .= <INC>;
die "$list_con: Unterminated backslash\n" if eof;
}
my $con = {
LINE => $_,
DOIT => 0
};
if (/^> (.+) ; /x) {
my $lhs = $1;
unless ($lhs =~ /$pattern/xo) {
warn "$lhs: bad variable prototype\n";
next;
}
$con->{SPEC} = $1;
$con->{DECL} = $2;
$con->{NAME} = $4;
$con->{DOIT} = 1;
$con->{NUM} = $numc++;
$con->{SPEC} = { map { uc($_) => 1 } $con->{SPEC} =~ /{(.+?)}/g };
}
&{$proc}($con);
}
close INC;
}
sub process_typedefs {
my $proc = shift;
my $numt = 1;
open INT, $list_typ or die "Can't open $list_typ: $!\n";
while (<INT>) {
next if /^!/;
while (s/\\\n//) {
$_ .= <INT>;
die "$list_typ: Unterminated backslash\n" if eof;
}
my $typ = {
LINE => $_,
DOIT => 0
};
if (/^> \s+ (.+) /x) {
my $lhs = $1;
unless ($lhs =~ /$pattern/xo) {
warn "$lhs: bad typedef prototype\n";
next;
}
$typ->{SPEC} = $1;
$typ->{DECL} = $2;
$typ->{NAME} = $4;
$typ->{DOIT} = 1;
$typ->{NUM} = $numt++;
$typ->{SPEC} = { map { uc($_) => 1 } $typ->{SPEC} =~ /{(.+?)}/g };
}
&{$proc}($typ);
}
close INT;
}
1;

View File

@@ -1,5 +0,0 @@
The files in this directory do all the real work. Someday I might
document them, but for now you'll just have to "read the source, Luke".
William

View File

@@ -1,22 +0,0 @@
#!/bin/sh
##
## incrase-version -- Increases version number everywhere
##
## Copyright (c) 2000 William Setzer
##
## You may distribute under the terms of either the Artistic License
## or the GNU General Public License, as specified in the README file.
##
## (but why would you want to?)
if [ "$1" = "" ]; then
echo "Usage: $0 <version>"
exit 1
fi
vers=$1
perl="/usr/local/bin/perl -p -i.bak -e"
$perl "s/^(.VERSION = )\d+\.\d+/\${1}$vers/" gen/make.Curses.pm
$perl "s/(Curses-)\d+\.\d+/\${1}$vers/" INSTALL
$perl "s/(VERSION\s+=>\s+')\d+\.\d+/\${1}$vers/" Makefile.PL

View File

@@ -1,304 +0,0 @@
> int ERR;
> int OK;
!! These aren't really constants, but act like them. They don't exist
!! until initscr()/newterm() have been called, so I'm gonna make functions
!! out of them.
!!
> {defer} int ACS_BLOCK;
> {defer} int ACS_BOARD;
> {defer} int ACS_BTEE;
> {defer} int ACS_BULLET;
> {defer} int ACS_CKBOARD;
> {defer} int ACS_DARROW;
> {defer} int ACS_DEGREE;
> {defer} int ACS_DIAMOND;
> {defer} int ACS_HLINE;
> {defer} int ACS_LANTERN;
> {defer} int ACS_LARROW;
> {defer} int ACS_LLCORNER;
> {defer} int ACS_LRCORNER;
> {defer} int ACS_LTEE;
> {defer} int ACS_PLMINUS;
> {defer} int ACS_PLUS;
> {defer} int ACS_RARROW;
> {defer} int ACS_RTEE;
> {defer} int ACS_S1;
> {defer} int ACS_S9;
> {defer} int ACS_TTEE;
> {defer} int ACS_UARROW;
> {defer} int ACS_ULCORNER;
> {defer} int ACS_URCORNER;
> {defer} int ACS_VLINE;
> int A_ALTCHARSET;
> int A_ATTRIBUTES;
> int A_BLINK;
> int A_BOLD;
> int A_CHARTEXT;
> int A_COLOR;
> int A_DIM;
> int A_INVIS;
> int A_NORMAL;
> int A_PROTECT;
> int A_REVERSE;
> int A_STANDOUT;
> int A_UNDERLINE;
> int COLOR_BLACK;
> int COLOR_BLUE;
> int COLOR_CYAN;
> int COLOR_GREEN;
> int COLOR_MAGENTA;
> int COLOR_RED;
> int COLOR_WHITE;
> int COLOR_YELLOW;
> int KEY_A1;
> int KEY_A3;
> int KEY_B2;
> int KEY_BACKSPACE;
> int KEY_BEG;
> int KEY_BREAK;
> int KEY_BTAB;
> int KEY_C1;
> int KEY_C3;
> int KEY_CANCEL;
> int KEY_CATAB;
> int KEY_CLEAR;
> int KEY_CLOSE;
> int KEY_COMMAND;
> int KEY_COPY;
> int KEY_CREATE;
> int KEY_CTAB;
> int KEY_DC;
> int KEY_DL;
> int KEY_DOWN;
> int KEY_EIC;
> int KEY_END;
> int KEY_ENTER;
> int KEY_EOL;
> int KEY_EOS;
> int KEY_EXIT;
> int KEY_F0;
> int KEY_FIND;
> int KEY_HELP;
> int KEY_HOME;
> int KEY_IC;
> int KEY_IL;
> int KEY_LEFT;
> int KEY_LL;
> int KEY_MARK;
> int KEY_MAX;
> int KEY_MESSAGE;
> int KEY_MIN;
> int KEY_MOVE;
> int KEY_NEXT;
> int KEY_NPAGE;
> int KEY_OPEN;
> int KEY_OPTIONS;
> int KEY_PPAGE;
> int KEY_PREVIOUS;
> int KEY_PRINT;
> int KEY_REDO;
> int KEY_REFERENCE;
> int KEY_REFRESH;
> int KEY_REPLACE;
> int KEY_RESET;
> int KEY_RESTART;
> int KEY_RESUME;
> int KEY_RIGHT;
> int KEY_SAVE;
> int KEY_SBEG;
> int KEY_SCANCEL;
> int KEY_SCOMMAND;
> int KEY_SCOPY;
> int KEY_SCREATE;
> int KEY_SDC;
> int KEY_SDL;
> int KEY_SELECT;
> int KEY_SEND;
> int KEY_SEOL;
> int KEY_SEXIT;
> int KEY_SF;
> int KEY_SFIND;
> int KEY_SHELP;
> int KEY_SHOME;
> int KEY_SIC;
> int KEY_SLEFT;
> int KEY_SMESSAGE;
> int KEY_SMOVE;
> int KEY_SNEXT;
> int KEY_SOPTIONS;
> int KEY_SPREVIOUS;
> int KEY_SPRINT;
> int KEY_SR;
> int KEY_SREDO;
> int KEY_SREPLACE;
> int KEY_SRESET;
> int KEY_SRIGHT;
> int KEY_SRSUME;
> int KEY_SSAVE;
> int KEY_SSUSPEND;
> int KEY_STAB;
> int KEY_SUNDO;
> int KEY_SUSPEND;
> int KEY_UNDO;
> int KEY_UP;
> int KEY_MOUSE;
> int BUTTON1_RELEASED;
> int BUTTON1_PRESSED;
> int BUTTON1_CLICKED;
> int BUTTON1_DOUBLE_CLICKED;
> int BUTTON1_TRIPLE_CLICKED;
> int BUTTON1_RESERVED_EVENT;
> int BUTTON2_RELEASED;
> int BUTTON2_PRESSED;
> int BUTTON2_CLICKED;
> int BUTTON2_DOUBLE_CLICKED;
> int BUTTON2_TRIPLE_CLICKED;
> int BUTTON2_RESERVED_EVENT;
> int BUTTON3_RELEASED;
> int BUTTON3_PRESSED;
> int BUTTON3_CLICKED;
> int BUTTON3_DOUBLE_CLICKED;
> int BUTTON3_TRIPLE_CLICKED;
> int BUTTON3_RESERVED_EVENT;
> int BUTTON4_RELEASED;
> int BUTTON4_PRESSED;
> int BUTTON4_CLICKED;
> int BUTTON4_DOUBLE_CLICKED;
> int BUTTON4_TRIPLE_CLICKED;
> int BUTTON4_RESERVED_EVENT;
> int BUTTON_CTRL;
> int BUTTON_SHIFT;
> int BUTTON_ALT;
> int ALL_MOUSE_EVENTS;
> int REPORT_MOUSE_POSITION;
> int NCURSES_MOUSE_VERSION;
> int E_OK;
> int E_SYSTEM_ERROR;
> int E_BAD_ARGUMENT;
> int E_POSTED;
> int E_CONNECTED;
> int E_BAD_STATE;
> int E_NO_ROOM;
> int E_NOT_POSTED;
> int E_UNKNOWN_COMMAND;
> int E_NO_MATCH;
> int E_NOT_SELECTABLE;
> int E_NOT_CONNECTED;
> int E_REQUEST_DENIED;
> int E_INVALID_FIELD;
> int E_CURRENT;
> int REQ_LEFT_ITEM;
> int REQ_RIGHT_ITEM;
> int REQ_UP_ITEM;
> int REQ_DOWN_ITEM;
> int REQ_SCR_ULINE;
> int REQ_SCR_DLINE;
> int REQ_SCR_DPAGE;
> int REQ_SCR_UPAGE;
> int REQ_FIRST_ITEM;
> int REQ_LAST_ITEM;
> int REQ_NEXT_ITEM;
> int REQ_PREV_ITEM;
> int REQ_TOGGLE_ITEM;
> int REQ_CLEAR_PATTERN;
> int REQ_BACK_PATTERN;
> int REQ_NEXT_MATCH;
> int REQ_PREV_MATCH;
> int MIN_MENU_COMMAND;
> int MAX_MENU_COMMAND;
> int O_ONEVALUE;
> int O_SHOWDESC;
> int O_ROWMAJOR;
> int O_IGNORECASE;
> int O_SHOWMATCH;
> int O_NONCYCLIC;
> int O_SELECTABLE;
> int REQ_NEXT_PAGE;
> int REQ_PREV_PAGE;
> int REQ_FIRST_PAGE;
> int REQ_LAST_PAGE;
> int REQ_NEXT_FIELD;
> int REQ_PREV_FIELD;
> int REQ_FIRST_FIELD;
> int REQ_LAST_FIELD;
> int REQ_SNEXT_FIELD;
> int REQ_SPREV_FIELD;
> int REQ_SFIRST_FIELD;
> int REQ_SLAST_FIELD;
> int REQ_LEFT_FIELD;
> int REQ_RIGHT_FIELD;
> int REQ_UP_FIELD;
> int REQ_DOWN_FIELD;
> int REQ_NEXT_CHAR;
> int REQ_PREV_CHAR;
> int REQ_NEXT_LINE;
> int REQ_PREV_LINE;
> int REQ_NEXT_WORD;
> int REQ_PREV_WORD;
> int REQ_BEG_FIELD;
> int REQ_END_FIELD;
> int REQ_BEG_LINE;
> int REQ_END_LINE;
> int REQ_LEFT_CHAR;
> int REQ_RIGHT_CHAR;
> int REQ_UP_CHAR;
> int REQ_DOWN_CHAR;
> int REQ_NEW_LINE;
> int REQ_INS_CHAR;
> int REQ_INS_LINE;
> int REQ_DEL_CHAR;
> int REQ_DEL_PREV;
> int REQ_DEL_LINE;
> int REQ_DEL_WORD;
> int REQ_CLR_EOL;
> int REQ_CLR_EOF;
> int REQ_CLR_FIELD;
> int REQ_OVL_MODE;
> int REQ_INS_MODE;
> int REQ_SCR_FLINE;
> int REQ_SCR_BLINE;
> int REQ_SCR_FPAGE;
> int REQ_SCR_BPAGE;
> int REQ_SCR_FHPAGE;
> int REQ_SCR_BHPAGE;
> int REQ_SCR_FCHAR;
> int REQ_SCR_BCHAR;
> int REQ_SCR_HFLINE;
> int REQ_SCR_HBLINE;
> int REQ_SCR_HFHALF;
> int REQ_SCR_HBHALF;
> int REQ_VALIDATION;
> int REQ_NEXT_CHOICE;
> int REQ_PREV_CHOICE;
> int MIN_FORM_COMMAND;
> int MAX_FORM_COMMAND;
> int NO_JUSTIFICATION;
> int JUSTIFY_LEFT;
> int JUSTIFY_CENTER;
> int JUSTIFY_RIGHT;
> int O_VISIBLE;
> int O_ACTIVE;
> int O_PUBLIC;
> int O_EDIT;
> int O_WRAP;
> int O_BLANK;
> int O_AUTOSKIP;
> int O_NULLOK;
> int O_PASSOK;
> int O_STATIC;
> int O_NL_OVERLOAD;
> int O_BS_OVERLOAD;

View File

@@ -1,645 +0,0 @@
!! Note 1: "void *" declarations are always set to zero.
!! Note 2: "void *"s meant to handle real pointers were made "{cast} char *".
!! Note 3: "{out}{amp} <decl> <var>" were all originally "decl *var".
!! Note 4: "{cast}"ing a function is usually to shut up the compiler
!! complaining about discarding const from pointer.
!! Note 5: Some insane curses return "char *" for standout()/standend().
!! I don't feel like handling it, hence the "{cast}".
!
/* curs_addch */
> int {mvw}addch(chtype ch);
> int {w}echochar(chtype ch);
/* curs_addchstr */
> int {mvw}addchstr(const chtype *str);
> int {mvw}addchnstr(const chtype *str, int n);
/* curs_addstr */
> int {mvw}addstr(const char *str);
> int {mvw}addnstr(const char *str, int n);
/* curs_attr */
> int {w}attroff(int attrs);
> int {w}attron(int attrs);
> int {w}attrset(int attrs);
> {cast} int {w}standend(void);
> {cast} int {w}standout(void);
> int {w}attr_get({out}{amp} attr_t attrs, {out}{amp} short color, void *opts);
> int {w}attr_off(attr_t attrs, void *opts);
> int {w}attr_on(attr_t attrs, void *opts);
> int {w}attr_set(attr_t attrs, short color, void *opts);
> int {mvw}chgat(int n, attr_t attrs, short color, \
const void *opts);
> int COLOR_PAIR(int n);
> int PAIR_NUMBER(int attrs);
/* curs_beep */
> int beep(void);
> int flash(void);
/* curs_bkgd */
> int {w}bkgd(chtype ch);
> void {w}bkgdset(chtype ch);
> chtype <w>getbkgd(void);
/* curs_border */
> int {w}border(chtype ls, chtype rs_, chtype ts, chtype bs, \
chtype tl, chtype tr, chtype bl, chtype br);
> int <w>box(chtype verch, chtype horch);
> int {mvw}hline(chtype ch, int n);
> int {mvw}vline(chtype ch, int n);
/* curs_clear */
> int {w}erase(void);
> int {w}clear(void);
> int {w}clrtobot(void);
> int {w}clrtoeol(void);
/* curs_color */
> int start_color(void);
> int init_pair(short pair, short f, short b);
> int init_color(short color, short r, short g, short b);
> bool has_colors(void);
> bool can_change_color(void);
> int color_content(short color, {out}{amp} short r, {out}{amp} short g, \
{out}{amp} short b);
> int pair_content(short pair, {out}{amp} short f, {out}{amp} short b);
/* curs_delch */
> int {mvw}delch(void);
/* curs_deleteln */
> int {w}deleteln(void);
> int {w}insdelln(int n);
> int {w}insertln(void);
/* curs_getch */
> chtype {mvw}getch(void);
> int ungetch(chtype ch);
> int has_key(int ch);
> chtype KEY_F(int n);
/* curs_getstr */
> int {mvw}getstr({b=250}{out} char *str);
> int {mvw}getnstr({b=n+1}{out} char *str, {shift=-1} int n);
/* curs_getyx */
> void <w>getyx({out} int y, {out} int x);
> void <w>getparyx({out} int y, {out} int x);
> void <w>getbegyx({out} int y, {out} int x);
> void <w>getmaxyx({out} int y, {out} int x);
/* curs_inch */
> chtype {mvw}inch(void);
/* curs_inchstr */
> int {mvw}inchstr({b=250}{out} chtype *str);
> int {mvw}inchnstr({b=n+1}{out} chtype *str, {shift=-1} int n);
/* curs_initscr */
> WINDOW *initscr(void);
> int endwin(void);
> int isendwin(void);
> SCREEN *newterm({opt} char *type, FILE *outfd, FILE *infd);
> SCREEN *set_term(SCREEN *new);
> void delscreen(SCREEN *sp);
/* curs_inopts */
#ifdef C_INTCBREAK
> {itest} int cbreak(void);
#else
> {dup} void cbreak(void);
#endif
#ifdef C_INTNOCBREAK
> {itest} int nocbreak(void);
#else
> {dup} void nocbreak(void);
#endif
#ifdef C_INTECHO
> {itest} int echo(void);
#else
> {dup} void echo(void);
#endif
#ifdef C_INTNOECHO
> {itest} int noecho(void);
#else
> {dup} void noecho(void);
#endif
> int halfdelay(int tenths);
> int <w>intrflush(bool bf);
> int <w>keypad(bool bf);
> int <w>meta(bool bf);
> int <w>nodelay(bool bf);
> int <w>notimeout(bool bf);
#ifdef C_INTRAW
> {itest} int raw(void);
#else
> {dup} void raw(void);
#endif
#ifdef C_INTNORAW
> {itest} int noraw(void);
#else
> {dup} void noraw(void);
#endif
> void qiflush(void);
> void noqiflush(void);
> void {w}timeout(int delay);
> int typeahead(int fd);
/* curs_insch */
> int {mvw}insch(chtype ch);
/* curs_insstr */
> int {mvw}insstr(const char *str);
> int {mvw}insnstr(const char *str, int n);
/* curs_instr */
> int {mvw}instr({b=250}{out} char *str);
> int {mvw}innstr({b=n+1}{out} char *str, {shift=-1} int n);
/* curs_kernel */
> int def_prog_mode(void);
> int def_shell_mode(void);
> int reset_prog_mode(void);
> int reset_shell_mode(void);
> int resetty(void);
> int savetty(void);
#ifdef C_INTGETSYX
> {itest} int getsyx({out} int y, {out} int x);
#else
> {dup} void getsyx({out} int y, {out} int x);
#endif
#ifdef C_INTSETSYX
> {itest} int setsyx(int y, int x);
#else
> {dup} void setsyx(int y, int x);
#endif
> int curs_set(int visibility);
> int napms(int ms);
/* curs_move */
> int {w}move(int y, int x);
/* curs_outopts */
> int <w>clearok(bool bf);
#ifdef C_INTIDLOK
> {itest} int <w>idlok(bool bf);
#else
> {dup} void <w>idlok(bool bf);
#endif
> void <w>idcok(bool bf);
> void <w>immedok(bool bf);
> int <w>leaveok(bool bf);
> int {w}setscrreg(int top, int bot);
> int <w>scrollok(bool bf);
#ifdef C_INTNL
> {itest} int nl(void);
#else
> {dup} void nl(void);
#endif
#ifdef C_INTNONL
> {itest} int nonl(void);
#else
> {dup} void nonl(void);
#endif
/* curs_overlay */
> int overlay(WINDOW *srcwin, WINDOW *dstwin);
> int overwrite(WINDOW *srcwin, WINDOW *dstwin);
> int copywin(WINDOW *srcwin, WINDOW *dstwin, int sminrow, int smincol, \
int dminrow, int dmincol, int dmaxrow, int dmaxcol, \
int overlay);
/* curs_pad */
> WINDOW *newpad(int lines_, int cols);
> WINDOW *subpad(WINDOW *orig, int lines_, int cols, int beginy, int beginx);
> int prefresh(WINDOW *pad, int pminrow, int pmincol, int sminrow, \
int smincol, int smaxrow, int smaxcol);
> int pnoutrefresh(WINDOW *pad, int pminrow, int pmincol, int sminrow, \
int smincol, int smaxrow, int smaxcol);
> int pechochar(WINDOW *pad, chtype ch);
/* curs_printw */
/* done in perl */
/* curs_refresh */
> int {w}refresh(void);
> int |w|noutrefresh(void);
> int doupdate(void);
> int <w>redrawwin(void);
> int |w|redrawln(int beg_line, int num_lines);
/* curs_scanw */
/* done in perl */
/* curs_scr_dump */
> int scr_dump(const char *filename);
> int scr_restore(const char *filename);
> int scr_init(const char *filename);
> int scr_set(const char *filename);
/* curs_scroll */
> int <w>scroll(void);
> int {w}scrl(int n);
/* curs_slk */
> int slk_init(int fmt);
> int slk_set(int labnum, char *label, int fmt);
> int slk_refresh(void);
> int slk_noutrefresh(void);
> char *slk_label(int labnum);
> int slk_clear(void);
> int slk_restore(void);
> int slk_touch(void);
> int slk_attron(chtype attrs);
> int slk_attrset(chtype attrs);
> attr_t slk_attr(void);
> int slk_attroff(chtype attrs);
> int slk_color(short color_pair_number);
/* curs_termattrs */
> int baudrate(void);
> char erasechar(void);
> int has_ic(void);
> int has_il(void);
> char killchar(void);
#ifdef C_LONG0ARGS
> {notest} char *longname(void);
#else
> {dup} char *longname(char *a, char *b);
#endif
> chtype termattrs(void);
> char *termname(void);
/* curs_touch */
> int <w>touchwin(void);
#ifdef C_TOUCH3ARGS
> {notest} int <w>touchline(int start, int count);
#else
> {dup} int <w>touchline(int y, int sx, int ex);
#endif
> int <w>untouchwin(void);
> int |w|touchln(int y, int n, int changed);
> int <w>is_linetouched(int line);
> int <w>is_wintouched(void);
/* curs_util */
> char *unctrl(chtype ch);
> {cast} char *keyname(int k);
#ifdef C_INTFILTER
> {itest} int filter(void);
#else
> {dup} void filter(void);
#endif
> void use_env(bool bf);
> int putwin(WINDOW *win, FILE *filep);
> WINDOW *getwin(FILE *filep);
> int delay_output(int ms);
> int flushinp(void);
/* curs_window */
> WINDOW *newwin(int nlines, int ncols, int beginy, int beginx);
> int <w>delwin(void);
> int <w>mvwin(int y, int x);
> WINDOW *<w>subwin(int nlines, int ncols, int beginy, int beginx);
> WINDOW *<w>derwin(int nlines, int ncols, int beginy, int beginx);
> int <w>mvderwin(int par_y, int par_x);
> WINDOW *<w>dupwin(void);
> void |w|syncup(void);
> int <w>syncok(bool bf);
> void |w|cursyncup(void);
> void |w|syncdown(void);
/* ncurses extension functions */
> int getmouse({out} MEVENT *event);
> int ungetmouse(MEVENT *event);
> mmask_t mousemask(mmask_t newmask, {out}{amp} mmask_t oldmask);
> bool |w|enclose(int y, int x);
> bool |w|mouse_trafo({out}{amp} int pY, {out}{amp} int pX, bool to_screen);
> int mouseinterval(int erval);
> int BUTTON_RELEASE(mmask_t e, int x);
> int BUTTON_PRESS(mmask_t e, int x);
> int BUTTON_CLICK(mmask_t e, int x);
> int BUTTON_DOUBLE_CLICK(mmask_t e, int x);
> int BUTTON_TRIPLE_CLICK(mmask_t e, int x);
> int BUTTON_RESERVED_EVENT(mmask_t e, int x);
> int use_default_colors(void);
> int assume_default_colors(int fg, int bg);
> int define_key(char *definition, int keycode);
> char *keybound(int keycode, int count);
> int keyok(int keycode, bool enable);
> int resizeterm(int lines, int cols);
> int {w}resize(int lines_, int columns);
/* DEC curses, I think */
> int <w>getmaxy(void);
> int <w>getmaxx(void);
/* old BSD curses calls */
> void <w>flusok(bool bf);
> {cast} char *getcap(char *term);
> int touchoverlap(WINDOW *src, WINDOW *dst);
/* Panel support */
> PANEL *new_panel(WINDOW *win);
> int bottom_panel(PANEL *pan);
> int top_panel(PANEL *pan);
> int show_panel(PANEL *pan);
> void update_panels(void);
> int hide_panel(PANEL *pan);
> WINDOW *panel_window(const PANEL *pan);
> int replace_panel(PANEL *pan, WINDOW *window);
> int move_panel(PANEL *pan, int starty, int startx);
> int panel_hidden(const PANEL *pan);
> PANEL *panel_above(const {opt} PANEL *pan);
> PANEL *panel_below(const {opt} PANEL *pan);
> int set_panel_userptr(PANEL *pan, const {cast} char *ptr);
> const {cast} char *panel_userptr(const PANEL *pan);
> int del_panel(PANEL *pan);
/* Menu support */
/* menu_attributes */
> int set_menu_fore(MENU *menu, chtype attr);
> chtype menu_fore(MENU *menu);
> int set_menu_back(MENU *menu, chtype attr);
> chtype menu_back(MENU *menu);
> int set_menu_grey(MENU *menu, chtype attr);
> chtype menu_grey(MENU *menu);
> int set_menu_pad(MENU *menu, int pad);
> int menu_pad(MENU *menu);
/* menu_cursor */
> int pos_menu_cursor(MENU *menu);
/* menu_driver */
> int menu_driver(MENU *menu, int c);
/* menu_format */
> int set_menu_format(MENU *menu, int rows, int cols);
> void menu_format(MENU *menu, {out}{amp} int rows, {out}{amp} int cols);
/* menu_items */
> int set_menu_items(MENU *menu, ITEM **items);
> ITEM **menu_items(MENU *menu);
> int item_count(MENU *menu);
/* menu_mark */
> int set_menu_mark(MENU *menu, char *mark);
> const {cast} char *menu_mark( const MENU *menu);
/* menu_new */
> MENU *new_menu(ITEM **items);
> int free_menu(MENU *menu);
/* menu_opts */
> int menu_opts(MENU *menu);
> int set_menu_opts(MENU *menu, int opts);
> int menu_opts_on(MENU *menu, int opts);
> int menu_opts_off(MENU *menu, int opts);
/* menu_pattern */
> int set_menu_pattern(MENU *menu, const char *pattern);
> char *menu_pattern(const MENU *menu);
/* menu_post */
> int post_menu(MENU *menu);
> int unpost_menu(MENU *menu);
/* menu_userptr */
> int set_menu_userptr(MENU *item, char *userptr);
> char *menu_userptr(MENU *item);
/* menu_win */
> int set_menu_win(MENU *menu, WINDOW *win);
> WINDOW *menu_win(MENU *menu);
> int set_menu_sub(MENU *menu, WINDOW *win);
> WINDOW *menu_sub(MENU *menu);
> int scale_menu(MENU *menu, {out}{amp} int rows, {out}{amp} int cols);
/* menu_item_current */
> int set_current_item(MENU *menu, const ITEM *item);
> ITEM *current_item(const MENU *menu);
> int set_top_row(MENU *menu, int row);
> int top_row(const MENU *menu);
> int item_index(const ITEM *item);
/* menu_item_name */
> const {cast} char *item_name( const ITEM *item);
> const {cast} char *item_description( const ITEM *item);
/* menu_item_new */
> ITEM *new_item(const char *name, const char *descr);
> int free_item(ITEM *item);
/* menu_item_opts */
> int set_item_opts(ITEM *item, int opts);
> int item_opts_on(ITEM *item, int opts);
> int item_opts_off(ITEM *item, int opts);
> int item_opts(ITEM *item);
/* menu_item_userptr */
> const {cast} char *item_userptr(const ITEM *item);
> int set_item_userptr(ITEM *item, const {cast} char *ptr);
/* menu_item_value */
> int set_item_value(ITEM *item, bool val);
> bool item_value(ITEM *item);
/* menu_item_visible */
> bool item_visible(ITEM *item);
/* ncurses menu extension functions */
> const {cast} char *menu_request_name(int request);
> int menu_request_by_name(const char *name);
> int set_menu_spacing(MENU *menu, int descr, int rows, int cols);
> int menu_spacing(const MENU *menu, {out}{amp} int descr, \
{out}{amp} int rows, {out}{amp} int cols);
/* Form support */
/* form_cursor */
> int pos_form_cursor(FORM *form);
/* form_data */
> bool data_ahead(const FORM *form);
> bool data_behind(const FORM *form);
/* form_driver */
> int form_driver(FORM *form, int c);
/* form_field */
> int set_form_fields(FORM *form, FIELD **fields);
> FIELD **form_fields(const FORM *form);
> int field_count(const FORM *form);
> int move_field(FIELD *field, int frow, int fcol);
/* form_new */
> FORM *new_form(FIELD **fields);
> int free_form(FORM *form);
/* form_new_page */
> int set_new_page(FIELD *field, bool new_page_flag);
> bool new_page(const FIELD *field);
/* form_opts */
> int set_form_opts(FORM *form, int opts);
> int form_opts_on(FORM *form, int opts);
> int form_opts_off(FORM *form, int opts);
> int form_opts(const FORM *form);
/* form_page */
> int set_current_field(FORM *form, FIELD *field);
> FIELD *current_field(const FORM *form);
> int set_form_page(FORM *form, int n);
> int form_page(const FORM *form);
> int field_index(const FIELD *field);
/* form_post */
> int post_form(FORM *form);
> int unpost_form(FORM *form);
/* form_userptr */
> int set_form_userptr(FORM *form, char *userptr);
> char *form_userptr(const FORM *form);
/* form_win */
> int set_form_win(FORM *form, WINDOW *win);
> WINDOW *form_win(const FORM *form);
> int set_form_sub(FORM *form, WINDOW *sub);
> WINDOW *form_sub(const FORM *form);
> int scale_form(const FORM *form, {out}{amp} int rows, {out}{amp} int cols);
/* form_field_attributes */
> int set_field_fore(FIELD *field, chtype attr);
> chtype field_fore(const FIELD *field);
> int set_field_back(FIELD *field, chtype attr);
> chtype field_back(const FIELD *field);
> int set_field_pad(FIELD *field, int pad);
> chtype field_pad(const FIELD *field);
/* form_field_buffer */
> int set_field_buffer(FIELD *field, int buf, const char *value);
> char *field_buffer(const FIELD *field, int buffer);
> int set_field_status(FIELD *field, bool status);
> bool field_status(const FIELD *field);
> int set_max_field(FIELD *field, int max);
/* form_field_info */
> int field_info(const FIELD *field, {out}{amp} int rows, \
{out}{amp} int cols, {out}{amp} int frow, \
{out}{amp} int fcol, {out}{amp} int nrow, \
{out}{amp} int nbuf);
> int dynamic_field_info(const FIELD *field, {out}{amp} int rows, \
{out}{amp} int cols, {out}{amp} int max);
/* form_field_just */
> int set_field_just(FIELD *field, int justif);
> int field_just(const FIELD *field);
/* form_field_new */
> FIELD *new_field(int height, int width, int toprow, int leftcol, \
int offscreen, int nbuffers);
> FIELD *dup_field(FIELD *field, int toprow, int leftcol);
> FIELD *link_field(FIELD *field, int toprow, int leftcol);
> int free_field(FIELD *field);
/* form_field_opts */
> int set_field_opts(FIELD *field, int opts);
> int field_opts_on(FIELD *field, int opts);
> int field_opts_off(FIELD *field, int opts);
> int field_opts(const FIELD *field);
/* form_field_userptr */
> int set_field_userptr(FIELD *field, char *userptr);
> char *field_userptr(const FIELD *field);
/* form_field_validation */
> char *field_arg(const FIELD *field);
/* ncurses form extension functions */
> const {cast} char *form_request_name(int request);
> int form_request_by_name(const char *name);

View File

@@ -1,6 +0,0 @@
> attr_t sym;
> bool sym;
> chtype sym;
> MEVENT sym;
> mmask_t sym;
> SCREEN sym;

View File

@@ -1,9 +0,0 @@
> int LINES;
> int COLS;
> WINDOW *stdscr;
> WINDOW *curscr;
> int COLORS;
> int COLOR_PAIRS;
/* char *ttytype; */
/* char *Def_term; */
/* bool My_term; */

View File

@@ -1,559 +0,0 @@
#!/usr/local/bin/perl
##
## make.Curses.pm -- make Curses.pm
##
## Copyright (c) 2000 William Setzer
##
## You may distribute under the terms of either the Artistic License
## or the GNU General Public License, as specified in the README file.
require 5.005;
use lib 'gen';
use Gen;
my $roff = 0;
open OUT, "> Curses.pm" or die "Can't open Curses.pm: $!\n";
process_DATA_chunk \&print_line;
process_variables \&print_variable1;
process_DATA_chunk \&print_line;
process_variables \&print_variable2; print OUT "\n"; $roff = 0;
process_DATA_chunk \&print_line;
process_functions \&print_function1; print OUT "\n"; $roff = 0;
process_DATA_chunk \&print_line;
process_constants \&print_constant1; print OUT "\n"; $roff = 0;
process_DATA_chunk \&print_line;
process_functions \&print_function2; print OUT "\n"; $roff = 0;
process_DATA_chunk \&print_line;
process_functions \&print_function3;
process_DATA_chunk \&print_line;
process_variables \&print_variable3; print OUT "\n"; $roff = 0;
process_DATA_chunk \&print_line;
process_constants \&print_constant2; print OUT "\n"; $roff = 0;
process_DATA_chunk \&print_line;
close OUT;
###
## Helpers
#
sub print_line { print OUT @_ }
sub print_function1 {
my $fun = shift;
return unless $fun->{DOIT};
return if $fun->{SPEC}{DUP};
my $L = 1 + length $fun->{NAME};
if ($roff < 4) { print OUT " "; $roff = 4 }
if ($roff + $L > 76) { print OUT "\n "; $roff = 4 }
print OUT ' ', $fun->{NAME};
$roff += $L;
}
sub print_function2 {
my $fun = shift;
return unless $fun->{DOIT};
return if $fun->{SPEC}{DUP};
return unless $fun->{W};
my $L = 2 + length $fun->{NAME};
if ($roff < 8) { print OUT " "; $roff = 8 }
if ($roff + $L > 76) { print OUT "\n "; $roff = 8 }
print OUT ' w', $fun->{NAME};
$roff += $L;
if ($fun->{UNI} =~ /mv/) {
$L += 2;
if ($roff < 8) { print OUT " "; $roff = 8 }
if ($roff + $L > 76) { print OUT "\n "; $roff = 8 }
print OUT ' mv', $fun->{NAME};
$roff += $L;
$L ++;
if ($roff < 8) { print OUT " "; $roff = 8 }
if ($roff + $L > 76) { print OUT "\n "; $roff = 8 }
print OUT ' mvw', $fun->{NAME};
$roff += $L;
}
}
sub print_function3 {
my $fun = shift;
return unless $fun->{DOIT};
return if $fun->{SPEC}{DUP};
my $S = " " x (23 - length $fun->{NAME});
print OUT " ", $fun->{NAME}, $S, $fun->{UNI} ? "Yes" : " No";
if ($fun->{W}) {
print OUT " w$fun->{NAME}";
if ($fun->{UNI} =~ /mv/) {
print OUT " mv$fun->{NAME} mvw$fun->{NAME}";
}
}
print OUT "\n";
}
sub print_variable1 {
my $var = shift;
return unless $var->{DOIT};
my $S = " " x (12 - length $var->{NAME});
print OUT qq{tie \$$var->{NAME},}, $S, qq{Curses::Vars, $var->{NUM};\n};
}
sub print_variable2 {
my $var = shift;
return unless $var->{DOIT};
my $L = 1 + length $var->{NAME};
if ($roff < 4) { print OUT " "; $roff = 4 }
if ($roff + $L > 76) { print OUT "\n "; $roff = 4 }
print OUT ' ', $var->{NAME};
$roff += $L;
$L++;
if ($roff < 4) { print OUT " "; $roff = 4 }
if ($roff + $L > 76) { print OUT "\n "; $roff = 4 }
print OUT ' $', $var->{NAME};
$roff += $L;
}
sub print_variable3 {
my $var = shift;
return unless $var->{DOIT};
my $L = length $var->{NAME};
my $M = 24 - $L % 24;
if ($roff < 4) { print OUT " "; $roff = 4 }
if ($roff > 52) { print OUT "\n "; $roff = 4 }
print OUT $var->{NAME};
$roff += $L;
if ($M < 2) { $M += 24 }
if ($roff + $M <= 52) { print OUT " " x $M }
$roff += $M;
}
sub print_constant1 {
my $con = shift;
return unless $con->{DOIT};
my $L = 1 + length $con->{NAME};
if ($roff < 4) { print OUT " "; $roff = 4 }
if ($roff + $L > 76) { print OUT "\n "; $roff = 4 }
print OUT ' ', $con->{NAME};
$roff += $L;
}
sub print_constant2 {
my $con = shift;
return unless $con->{DOIT};
my $L = length $con->{NAME};
my $M = 24 - $L % 24;
if ($roff < 4) { print OUT " "; $roff = 4 }
if ($roff > 52) { print OUT "\n "; $roff = 4 }
print OUT $con->{NAME};
$roff += $L;
if ($M < 2) { $M += 24 }
if ($roff + $M <= 52) { print OUT " " x $M }
$roff += $M;
}
__END__
## This file can be automatically generated; changes may be lost.
##
##
## CursesFun.c -- the functions
##
## Copyright (c) 1994-2000 William Setzer
##
## You may distribute under the terms of either the Artistic License
## or the GNU General Public License, as specified in the README file.
###
## For the brave object-using person
#
package Curses::Window;
@ISA = qw(Curses);
package Curses::Screen;
@ISA = qw(Curses);
sub new { newterm(@_) }
sub DESTROY { }
package Curses::Panel;
@ISA = qw(Curses);
sub new { new_panel(@_) }
sub DESTROY { }
package Curses::Menu;
@ISA = qw(Curses);
sub new { new_menu(@_) }
sub DESTROY { }
package Curses::Item;
@ISA = qw(Curses);
sub new { new_item(@_) }
sub DESTROY { }
package Curses::Form;
@ISA = qw(Curses);
sub new { new_form(@_) }
sub DESTROY { }
package Curses::Field;
@ISA = qw(Curses);
sub new { new_field(@_) }
sub DESTROY { }
package Curses;
$VERSION = 1.06;
use Carp;
require Exporter;
require DynaLoader;
@ISA = qw(Exporter DynaLoader);
bootstrap Curses;
sub new {
my $pkg = shift;
my ($nl, $nc, $by, $bx) = (@_,0,0,0,0);
unless ($_initscr++) { initscr() }
return newwin($nl, $nc, $by, $bx);
}
sub DESTROY { }
sub AUTOLOAD {
my $N = $AUTOLOAD;
$N =~ s/^.*:://;
croak "Curses constant '$N' is not defined by your vendor";
}
sub printw { addstr(sprintf shift, @_) }
PAUSE
@EXPORT = qw(
printw
PAUSE
PAUSE
PAUSE
);
if ($OldCurses)
{
@_OLD = qw(
wprintw mvprintw wmvprintw
PAUSE
);
push (@EXPORT, @_OLD);
for (@_OLD)
{
/^(?:mv)?(?:w)?(.*)/;
eval "sub $_ { $1(\@_); }";
}
eval <<EOS;
sub wprintw { addstr(shift, sprintf shift, @_) }
sub mvprintw { addstr(shift, shift, sprintf shift, @_) }
sub mvwprintw { addstr(shift, shift, shift, sprintf shift, @_) }
EOS
}
1;
__END__
=head1 NAME
Curses - terminal screen handling and optimization
=head1 SYNOPSIS
use Curses;
initscr;
...
endwin;
Curses::supports_function($function);
Curses::supports_contsant($constant);
=head1 DESCRIPTION
C<Curses> is the interface between Perl and your system's curses(3)
library. For descriptions on the usage of a given function, variable,
or constant, consult your system's documentation, as such information
invariably varies (:-) between different curses(3) libraries and
operating systems. This document describes the interface itself, and
assumes that you already know how your system's curses(3) library
works.
=head2 Unified Functions
Many curses(3) functions have variants starting with the prefixes
I<w->, I<mv->, and/or I<wmv->. These variants differ only in the
explicit addition of a window, or by the addition of two coordinates
that are used to move the cursor first. For example, C<addch()> has
three other variants: C<waddch()>, C<mvaddch()>, and C<mvwaddch()>.
The variants aren't very interesting; in fact, we could roll all of
the variants into original function by allowing a variable number
of arguments and analyzing the argument list for which variant the
user wanted to call.
Unfortunately, curses(3) predates varargs(3), so in C we were stuck
with all the variants. However, C<Curses> is a Perl interface, so we
are free to "unify" these variants into one function. The section
L<"Supported Functions"> below lists all curses(3) function supported
by C<Curses>, along with a column listing if it is I<unified>. If
so, it takes a varying number of arguments as follows:
=over 4
C<function( [win], [y, x], args );>
I<win> is an optional window argument, defaulting to C<stdscr> if not
specified.
I<y, x> is an optional coordinate pair used to move the cursor,
defaulting to no move if not specified.
I<args> are the required arguments of the function. These are the
arguments you would specify if you were just calling the base function
and not any of the variants.
=back
This makes the variants obsolete, since their functionality has been
merged into a single function, so C<Curses> does not define them by
default. You can still get them if you want, by setting the
variable C<$Curses::OldCurses> to a non-zero value before using the
C<Curses> package. See L<"Perl 4.X C<cursperl> Compatibility">
for an example of this.
=head2 Objects
Objects are supported. Example:
$win = new Curses;
$win->addstr(10, 10, 'foo');
$win->refresh;
...
Any function that has been marked as I<unified> (see
L<"Supported Functions"> below and L<"Unified Functions"> above)
can be called as a method for a Curses object.
Do not use C<initscr()> if using objects, as the first call to get
a C<new Curses> will do it for you.
=head2 Security Concerns
It has always been the case with the curses functions, but please note
that the following functions:
getstr() (and optional wgetstr(), mvgetstr(), and mvwgetstr())
inchstr() (and optional winchstr(), mvinchstr(), and mvwinchstr())
instr() (and optional winstr(), mvinstr(), and mvwinstr())
are subject to buffer overflow attack. This is because you pass in
the buffer to be filled in, which has to be of finite length, but
there is no way to stop a bad guy from typing.
In order to avoid this problem, use the alternate functions:
getnstr()
inchnstr()
innstr()
which take an extra "size of buffer" argument.
=head1 COMPATIBILITY
=head2 Perl 4.X C<cursperl> Compatibility
C<Curses> has been written to take advantage of the new features of
Perl. I felt it better to provide an improved curses programming
environment rather than to be 100% compatible. However, many old
C<curseperl> applications will probably still work by starting the
script with:
BEGIN { $Curses::OldCurses = 1; }
use Curses;
Any old application that still does not work should print an
understandable error message explaining the problem.
Some functions and variables are not supported by C<Curses>, even with
the C<BEGIN> line. They are listed under
L<"curses(3) items not supported by Curses">.
The variables C<$stdscr> and C<$curscr> are also available as
functions C<stdscr> and C<curscr>. This is because of a Perl bug.
See the L<BUGS> section for details.
=head2 Incompatibilities with previous versions of C<Curses>
In previous versions of this software, some Perl functions took a
different set of parameters than their C counterparts. This is no
longer true. You should now use C<getstr($str)> and C<getyx($y, $x)>
instead of C<$str = getstr()> and C<($y, $x) = getyx()>.
=head2 Incompatibilities with other Perl programs
menu.pl, v3.0 and v3.1
There were various interaction problems between these two
releases and Curses. Please upgrade to the latest version
(v3.3 as of 3/16/96).
=head1 DIAGNOSTICS
=over 4
=item * Curses function '%s' called with too %s arguments at ...
You have called a C<Curses> function with a wrong number of
arguments.
=item * argument %d to Curses function '%s' is not a Curses %s at ...
=item * argument is not a Curses %s at ...
The argument you gave to the function wasn't what it wanted.
This probably means that you didn't give the right arguments to a
I<unified> function. See the DESCRIPTION section on L<Unified
Functions> for more information.
=item * Curses function '%s' is not defined by your vendor at ...
You have a C<Curses> function in your code that your system's curses(3)
library doesn't define.
=item * Curses variable '%s' is not defined by your vendor at ...
You have a C<Curses> variable in your code that your system's curses(3)
library doesn't define.
=item * Curses constant '%s' is not defined by your vendor at ...
You have a C<Curses> constant in your code that your system's curses(3)
library doesn't define.
=item * Curses::Vars::FETCH called with bad index at ...
=item * Curses::Vars::STORE called with bad index at ...
You've been playing with the C<tie> interface to the C<Curses>
variables. Don't do that. :-)
=item * Anything else
Check out the F<perldiag> man page to see if the error is in there.
=back
=head1 BUGS
If you use the variables C<$stdscr> and C<$curscr> instead of their
functional counterparts (C<stdscr> and C<curscr>), you might run into
a bug in Perl where the "magic" isn't called early enough. This is
manifested by the C<Curses> package telling you C<$stdscr> isn't a
window. One workaround is to put a line like C<$stdscr = $stdscr>
near the front of your program.
Probably many more.
=head1 AUTHOR
William Setzer <William_Setzer@ncsu.edu>
=head1 SYNOPSIS OF PERL CURSES SUPPORT
=head2 Supported Functions
Supported Unified? Supported via $OldCurses[*]
--------- -------- ------------------------
PAUSE
[*] To use any functions in this column, the variable
C<$Curses::OldCurses> must be set to a non-zero value before using the
C<Curses> package. See L<"Perl 4.X cursperl Compatibility"> for an
example of this.
=head2 Supported Variables
PAUSE
=head2 Supported Constants
PAUSE
=head2 curses(3) functions not supported by C<Curses>
tstp _putchar fullname scanw wscanw mvscanw mvwscanw ripoffline
setupterm setterm set_curterm del_curterm restartterm tparm tputs
putp vidputs vidattr mvcur tigetflag tigetnum tigetstr tgetent
tgetflag tgetnum tgetstr tgoto tputs
=head2 menu(3) functions not supported by C<Curses>
set_item_init item_init set_item_term item_term set_menu_init
menu_init set_menu_term menu_term
=head2 form(3) functions not supported by C<Curses>
new_fieldtype free_fieldtype set_fieldtype_arg
set_fieldtype_choice link_fieldtype set_form_init form_init
set_form_term form_term set_field_init field_init set_field_term
field_term set_field_type field_type

View File

@@ -1,128 +0,0 @@
#!/usr/local/bin/perl
##
## make.CursesBoot.c -- make CursesBoot.c
##
## Copyright (c) 2000 William Setzer
##
## You may distribute under the terms of either the Artistic License
## or the GNU General Public License, as specified in the README file.
use lib 'gen';
use Gen;
open OUT, "> CursesBoot.c" or die "Can't open CursesBoot.c: $!\n";
process_DATA_chunk \&print_line;
process_functions \&print_function;
process_DATA_chunk \&print_line;
process_variables \&print_variable;
process_DATA_chunk \&print_line;
process_constants \&print_constant;
process_DATA_chunk \&print_line;
close OUT;
###
## Helpers
#
sub print_line { print OUT @_ }
sub print_function {
my $fun = shift;
if (not $fun->{DOIT}) {
print OUT $fun->{LINE} if $fun->{LINE} =~ /^#/; # cpp directives
return;
}
my $S = " " x (22 - length $fun->{NAME});
print OUT qq{ C_NEWXS("Curses::$fun->{NAME}", } . $S .
qq{XS_Curses_$fun->{NAME});\n};
}
sub print_variable {
my $var = shift;
return unless $var->{DOIT};
my $S = " " x (22 - length $var->{NAME});
print OUT qq{ C_NEWXS("Curses::$var->{NAME}", } . $S .
qq{XS_Curses_$var->{NAME});\n};
}
sub print_constant {
my $con = shift;
return unless $con->{DOIT};
if ($con->{SPEC}{DEFER}) {
my $S = " " x (22 - length $con->{NAME});
print OUT qq{ C_NEWXS("Curses::$con->{NAME}", } . $S .
qq{XS_Curses_$con->{NAME});\n};
}
else {
my $S = " " x (30 - length $con->{NAME});
print OUT "#ifdef $con->{NAME}\n";
print OUT qq{ C_NEWCS("$con->{NAME}", } . $S .
qq{$con->{NAME});\n};
print OUT "#endif\n";
}
}
__END__
/* This file can be automatically generated; changes may be lost.
**
**
** CursesBoot.c -- the bootstrap function
**
** Copyright (c) 1994-2000 William Setzer
**
** You may distribute under the terms of either the Artistic License
** or the GNU General Public License, as specified in the README file.
*/
#define C_NEWXS(A,B) newXS(A,B,file)
#define C_NEWCS(A,B) newCONSTSUB(stash,A,newSViv(B))
XS(boot_Curses)
{
int i;
dXSARGS;
char *file = __FILE__;
HV *stash = gv_stashpv("Curses", TRUE);
IV tmp;
SV *t2;
XS_VERSION_BOOTCHECK;
/* Functions */
PAUSE
/* Variables masquerading as functions */
PAUSE
/* Variables masquerading as variables */
C_NEWXS("Curses::Vars::DESTROY", XS_Curses_Vars_DESTROY);
C_NEWXS("Curses::Vars::FETCH", XS_Curses_Vars_FETCH);
C_NEWXS("Curses::Vars::STORE", XS_Curses_Vars_STORE);
C_NEWXS("Curses::Vars::TIESCALAR", XS_Curses_Vars_TIESCALAR);
/* Constants */
PAUSE
/* traceon(); */
ST(0) = &PL_sv_yes;
XSRETURN(1);
}

View File

@@ -1,69 +0,0 @@
#!/usr/local/bin/perl
##
## make.CursesFun.c -- make CursesFun.c
##
## Copyright (c) 2000 William Setzer
##
## You may distribute under the terms of either the Artistic License
## or the GNU General Public License, as specified in the README file.
use lib 'gen';
use Gen;
use Data::Dumper;
open OUT, "> CursesCon.c" or die "Can't open CursesCon.c: $!\n";
process_DATA_chunk \&print_line;
process_constants \&print_constant;
close OUT;
###
## The helpers
#
sub print_line { print OUT @_ }
sub print_constant {
my $con = shift;
return unless $con->{DOIT};
return unless $con->{SPEC}{DEFER};
print OUT Q<<AAA;
################
# XS(XS_Curses_$con->{NAME})
# {
# dXSARGS;
# #ifdef $con->{NAME}
# {
# int ret = $con->{NAME};
#
# ST(0) = sv_newmortal();
# sv_setiv(ST(0), (IV)ret);
# }
# XSRETURN(1);
# #else
# c_con_not_there("$con->{NAME}");
# XSRETURN(0);
# #endif
# }
#
################
AAA
}
__END__
/* This file can be automatically generated; changes may be lost.
**
**
** CursesCon.c -- non-trivial constants
**
** Copyright (c) 1994-2000 William Setzer
**
** You may distribute under the terms of either the Artistic License
** or the GNU General Public License, as specified in the README file.
*/
PAUSE

View File

@@ -1,150 +0,0 @@
#!/usr/local/bin/perl
##
## make.CursesFun.c -- make CursesFun.c
##
## Copyright (c) 2000 William Setzer
##
## You may distribute under the terms of either the Artistic License
## or the GNU General Public License, as specified in the README file.
use lib 'gen';
use Gen;
open OUT, "> CursesFun.c" or die "Can't open CursesFun.c: $!\n";
process_DATA_chunk \&print_line;
process_functions \&print_function;
close OUT;
###
## The helpers
#
sub print_line { print OUT @_ }
sub print_function {
my $fun = shift;
unless ($fun->{DOIT}) {
print OUT $fun->{LINE};
return;
}
my @decl;
my @retn;
my @argv;
if ($fun->{UNI}) {
push @decl, "WINDOW *win\t= c_win ? c_sv2window(ST(0), 0) : stdscr;";
push @decl, "int\tc_mret\t= c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK;";
push @argv, "win";
}
foreach my $arg (@{$fun->{ARGV}}) {
my $pos = $fun->{UNI} ? $arg->{NUM} ? "c_arg+$arg->{NUM}" : "c_arg"
: $arg->{NUM};
my $A = "ST($pos)";
my $B = $arg->{SPEC}{B} || $pos;
my $N = $arg->{NAME};
my $T = length($arg->{DECL}) < 8 ? "\t" : "";
my $D = eval qq("$arg->{DECL}$T$arg->{NAME}\t= $arg->{M_DECL};");
if ($arg->{SPEC}{SHIFT}) {
splice @decl, $arg->{SPEC}{SHIFT}, 0, $D;
}
else {
push @decl, $D;
}
if ($arg->{M_RETN}) {
push @retn, eval qq("$arg->{M_RETN};");
}
push @argv, $arg->{SPEC}{AMP} ? "&" . $arg->{NAME} : $arg->{NAME};
}
my $pref = $fun->{SPEC}{CAST} ? "($fun->{DECL})" . $fun->{W} : $fun->{W};
my $call = $pref . $fun->{NAME} . "(" . join(", ", @argv) . ");";
if ($fun->{UNI}) {
if ($fun->{DECL} eq 'void') {
$call = "if (c_mret == OK) { $call }";
}
else {
$call = eval qq("c_mret == ERR ? $fun->{M_NULL} : $call");
}
}
if ($fun->{DECL} eq 'void') {
unshift @retn, $call;
}
else {
my $A = "ST(0)";
my $N = "ret";
push @decl, "$fun->{DECL}\tret\t= $call";
push @retn, "ST(0) = sv_newmortal();";
push @retn, eval qq("$fun->{M_RETN};");
}
push @decl, '' if @decl;
my $count = $fun->{UNI} ? "count" : "exact";
my $body = join "\n\t", @decl, @retn;
my $xsret = $fun->{DECL} ne 'void' ? 1 : 0;
print OUT Q<<AAA;
################
# XS(XS_Curses_$fun->{NAME})
# {
# dXSARGS;
# #ifdef C_\U$fun->{NAME}\E
# c_${count}args("$fun->{NAME}", items, $fun->{ARGC});
# {
# $body
# }
# XSRETURN($xsret);
# #else
# c_fun_not_there("$fun->{NAME}");
# XSRETURN(0);
# #endif
# }
#
################
AAA
}
sub print_function2 {
my $fun = shift;
return unless $fun->{DOIT};
return if $fun->{SPEC}{DUP};
my $S = " " x (3 - length $fun->{NUM});
print OUT Q<<AAA;
################
# #ifdef C_\U$fun->{NAME}\E
# case $S$fun->{NUM}: ret = 1; break;
# #endif
################
AAA
}
__END__
/* This file can be automatically generated; changes may be lost.
**
**
** CursesFun.c -- the functions
**
** Copyright (c) 1994-2000 William Setzer
**
** You may distribute under the terms of either the Artistic License
** or the GNU General Public License, as specified in the README file.
*/
PAUSE

View File

@@ -1,54 +0,0 @@
#!/usr/local/bin/perl
##
## make.CursesTyp.h -- make CursesTyp.h
##
## Copyright (c) 2001 William Setzer
##
## You may distribute under the terms of either the Artistic License
## or the GNU General Public License, as specified in the README file.
use lib 'gen';
use Gen;
open OUT, "> CursesTyp.h" or die "Can't open CursesTyp.h: $!\n";
process_DATA_chunk \&print_line;
process_typedefs \&print_typedef;
close OUT;
###
## Helpers
#
sub print_line { print OUT @_ }
sub print_typedef {
my $typ = shift;
return unless $typ->{DOIT};
print OUT Q<<AAA;
################
# #ifndef \UC_TYP$typ->{DECL}\E
# #define $typ->{DECL} int
# #endif
#
################
AAA
}
__END__
/* This file can be automatically generated; changes may be lost.
**
**
** CursesTyp.c -- typedef handlers
**
** Copyright (c) 1994-2001 William Setzer
**
** You may distribute under the terms of either the Artistic License
** or the GNU General Public License, as specified in the README file.
*/
PAUSE

View File

@@ -1,182 +0,0 @@
#!/usr/local/bin/perl
##
## make.CursesVar.c -- make CursesVar.c
##
## Copyright (c) 2000 William Setzer
##
## You may distribute under the terms of either the Artistic License
## or the GNU General Public License, as specified in the README file.
use lib 'gen';
use Gen;
open OUT, "> CursesVar.c" or die "Can't open CursesVar.c: $!\n";
process_DATA_chunk \&print_line;
process_variables \&print_function;
process_DATA_chunk \&print_line;
process_variables \&print_fetch;
process_DATA_chunk \&print_line;
process_variables \&print_store;
process_DATA_chunk \&print_line;
close OUT;
###
## Helpers
#
sub print_line { print OUT @_ }
sub print_function {
my $var = shift;
return unless $var->{DOIT};
my $A = "ST(0)";
my $N = $var->{NAME};
my $body = eval qq("$var->{M_RETN}");
print OUT Q<<AAA;
################
# XS(XS_Curses_$var->{NAME})
# {
# dXSARGS;
# #ifdef \UC_$var->{NAME}\E
# c_exactargs("$var->{NAME}", items, 0);
# {
# ST(0) = sv_newmortal();
# $body;
# }
# XSRETURN(1);
# #else
# c_var_not_there("$var->{NAME}");
# XSRETURN(0);
# #endif
# }
#
################
AAA
}
sub print_fetch {
my $var = shift;
return unless $var->{DOIT};
my $A = "ST(0)";
my $N = $var->{NAME};
my $body = eval qq("$var->{M_RETN}");
print OUT Q<<AAA;
################
# case $var->{NUM}:
# #ifdef \UC_$var->{NAME}\E
# $body;
# #else
# c_var_not_there("$var->{NAME}");
# #endif
# break;
################
AAA
}
sub print_store {
my $var = shift;
return unless $var->{DOIT};
my $A = "ST(1)";
my $B = -1;
my $N = $var->{NAME};
my $body = eval qq("$var->{M_DECL}");
print OUT Q<<AAA;
################
# case $var->{NUM}:
# #ifdef \UC_$var->{NAME}\E
# $var->{NAME} = $body;
# #else
# c_var_not_there("$var->{NAME}");
# #endif
# break;
################
AAA
}
###
## Templates
#
__END__
/* This file can be automatically generated; changes may be lost.
**
**
** CursesVar.c -- the variables
**
** Copyright (c) 1994-2000 William Setzer
**
** You may distribute under the terms of either the Artistic License
** or the GNU General Public License, as specified in the README file.
*/
PAUSE
XS(XS_Curses_Vars_TIESCALAR)
{
dXSARGS;
c_exactargs("TIESCALAR", items, 2);
{
char * pack = (char *)SvPV(ST(0),PL_na);
int n = (int)SvIV(ST(1));
ST(0) = sv_newmortal();
sv_setref_iv(ST(0), pack, n);
}
XSRETURN(1);
}
XS(XS_Curses_Vars_FETCH)
{
dXSARGS;
{
int num = (int)SvIV(SvRV((SV*)ST(0)));
ST(0) = sv_newmortal();
switch (num) {
PAUSE
default:
croak("Curses::Vars::FETCH called with bad index");
/* NOTREACHED */
}
}
XSRETURN(1);
}
XS(XS_Curses_Vars_STORE)
{
dXSARGS;
{
int num = (int)SvIV((SV*)SvRV(ST(0)));
switch (num) {
PAUSE
default:
croak("Curses::Vars::STORE called with bad index");
/* NOTREACHED */
}
ST(0) = &PL_sv_yes;
}
XSRETURN(1);
}
XS(XS_Curses_Vars_DESTROY)
{
dXSARGS;
{
SV * rv = ST(0);
ST(0) = &PL_sv_yes;
}
XSRETURN(1);
}

View File

@@ -1,67 +0,0 @@
#!/usr/local/bin/perl
##
## make.list.syms -- make list.syms
##
## Copyright (c) 2000 William Setzer
##
## You may distribute under the terms of either the Artistic License
## or the GNU General Public License, as specified in the README file.
use lib 'gen';
use Gen;
open OUT, "> list.syms" or die "Can't open list.syms: $!\n";
process_DATA_chunk \&print_line;
process_functions \&print_function;
process_variables \&print_variable;
process_typedefs \&print_typedef;
close OUT;
###
## The helpers
#
sub print_line { print OUT @_ }
sub print_function {
my $fun = shift;
return unless $fun->{DOIT};
return if $fun->{SPEC}{DUP};
return if $fun->{SPEC}{NOTEST};
my @argv = map { $_->{SPEC}{AMP} ? '&' . $_->{M_TEST} : $_->{M_TEST} }
@{$fun->{ARGV}};
unshift @argv, "stdscr" if $fun->{UNI};
my $call = $fun->{W} . $fun->{NAME} . "(" . join(',', @argv) . ")";
print OUT "E $call\n";
print OUT "I $call\n" if $fun->{SPEC}{ITEST};
}
sub print_variable {
my $var = shift;
return unless $var->{DOIT};
print OUT "V $var->{NAME}\n";
}
sub print_typedef {
my $typ = shift;
return unless $typ->{DOIT};
print OUT "T $typ->{DECL}\n";
}
__END__
## This file is automatically generated; changes will be lost.
##
## V = variable existence check
## E = function existence check,
## I = function "returns int?" check
## T = typedef existence check

View File

@@ -1,38 +0,0 @@
/* Hint file for the MSWin32 platform, Borland compiler.
*
* If this configuration doesn't work, look at the file "c-none.h"
* for how to set the configuration options.
*/
/* These hints thanks to Gurusamy Sarathy <gsar@engin.umich.edu> */
/* We used to include <pdcurses.h>, but users found it is actually
installed as <curses.h>. Maybe it changed at some point.
2007.09.29
*/
/* We used to undef macro SP, (which is defined by perl.h), but in September
2007, we found that a) SP is needed; and 2) SP doesn't hurt
the #includes below.
*/
#include <curses.h>
#ifdef C_PANELSUPPORT
#include <panel.h>
#endif
#ifdef C_MENUSUPPORT
#include <menu.h>
#endif
#ifdef C_FORMSUPPORT
#include <form.h>
#endif
#define C_LONGNAME
#define C_LONG0ARGS
#undef C_LONG2ARGS
#define C_TOUCHLINE
#define C_TOUCH3ARGS
#undef C_TOUCH4ARGS

View File

@@ -1,38 +0,0 @@
/* Hint file for the MSWin32 platform, Visual C compiler.
*
* If this configuration doesn't work, look at the file "c-none.h"
* for how to set the configuration options.
*/
/* These hints thanks to Gurusamy Sarathy <gsar@engin.umich.edu> */
/* We used to include <pdcurses.h>, but users found it is actually
installed as <curses.h>. Maybe it changed at some point.
2007.09.29
*/
/* We used to undef macro SP, (which is defined by perl.h), but in September
2007, we found that a) SP is needed; and 2) SP doesn't hurt
the #includes below.
*/
#include <curses.h>
#ifdef C_PANELSUPPORT
#include <panel.h>
#endif
#ifdef C_MENUSUPPORT
#include <menu.h>
#endif
#ifdef C_FORMSUPPORT
#include <form.h>
#endif
#define C_LONGNAME
#define C_LONG0ARGS
#undef C_LONG2ARGS
#define C_TOUCHLINE
#define C_TOUCH3ARGS
#undef C_TOUCH4ARGS

View File

@@ -1,27 +0,0 @@
/* Hint file for the AIX platform.
*
* If this configuration doesn't work, look at the file "c-none.h"
* for how to set the configuration options.
*/
#include <curses.h>
#ifdef C_PANELSUPPORT
#include <panel.h>
#endif
#ifdef C_MENUSUPPORT
#include <menu.h>
#endif
#ifdef C_FORMSUPPORT
#include <form.h>
#endif
#define C_LONGNAME
#define C_LONG0ARGS
#undef C_LONG2ARGS
#define C_TOUCHLINE
#define C_TOUCH3ARGS
#undef C_TOUCH4ARGS

View File

@@ -1,30 +0,0 @@
/* Hint file for the BSD386 platform.
* (Copy of the hint file for the FreeBSD platform, BSD version of libcurses.)
*
* If this configuration doesn't work, look at the file "c-none.h"
* for how to set the configuration options.
*/
/* These hints thanks to "Andrew V. Stesin" <stesin@elvisti.kiev.ua> */
#include <curses.h>
#ifdef C_PANELSUPPORT
#include <panel.h>
#endif
#ifdef C_MENUSUPPORT
#include <menu.h>
#endif
#ifdef C_FORMSUPPORT
#include <form.h>
#endif
#define C_LONGNAME
#undef C_LONG0ARGS
#define C_LONG2ARGS
#define C_TOUCHLINE
#undef C_TOUCH3ARGS
#define C_TOUCH4ARGS

View File

@@ -1,29 +0,0 @@
/* Hint file for the BSDOS platform.
*
* If this configuration doesn't work, look at the file "c-none.h"
* for how to set the configuration options.
*/
/* These hints thanks to Dean Karres <karres@southwind.net> */
#include <curses.h>
#ifdef C_PANELSUPPORT
#include <panel.h>
#endif
#ifdef C_MENUSUPPORT
#include <menu.h>
#endif
#ifdef C_FORMSUPPORT
#include <form.h>
#endif
#define C_LONGNAME
#undef C_LONG0ARGS
#define C_LONG2ARGS
#define C_TOUCHLINE
#undef C_TOUCH3ARGS
#define C_TOUCH4ARGS

View File

@@ -1,31 +0,0 @@
/* Hint file for the Cygwin platform.
*
* If this configuration doesn't work, look at the file "c-none.h"
* for how to set the configuration options.
*/
/* These hints thanks to Federico Spinazzi <spinazzi@databankgroup.it>
(2001) and yselkowitz@users.sourceforge.net (October 2005)
*/
#include <ncurses.h>
#ifdef C_PANELSUPPORT
#include <panel.h>
#endif
#ifdef C_MENUSUPPORT
#include <menu.h>
#endif
#ifdef C_FORMSUPPORT
#include <form.h>
#endif
#undef C_LONGNAME
#undef C_LONG0ARGS
#undef C_LONG2ARGS
#undef C_TOUCHLINE
#undef C_TOUCH3ARGS
#undef C_TOUCH4ARGS

View File

@@ -1,29 +0,0 @@
/* Hint file for Darwin Kernel Version 7.5.0, ncurses version of
libcurses. Based in FreeBSD, ncurses hints file
This file came from gene03@smalltime.com, September 2004.
*/
#include <ncurses.h>
#ifdef C_PANELSUPPORT
#include <panel.h>
#endif
#ifdef C_MENUSUPPORT
#include <menu.h>
#endif
#ifdef C_FORMSUPPORT
#include <form.h>
#endif
#define C_LONGNAME
#define C_LONG0ARGS
#undef C_LONG2ARGS
#define C_TOUCHLINE
#define C_TOUCH3ARGS
#undef C_TOUCH4ARGS

View File

@@ -1,29 +0,0 @@
/* Hint file for the darwin platform.
*
* If this configuration doesn't work, look at the file "c-none.h"
* for how to set the configuration options.
*/
/* These hints thanks to Scott Dietrich <sdietrich@emlab.com> */
#include <curses.h>
#ifdef C_PANELSUPPORT
#include <panel.h>
#endif
#ifdef C_MENUSUPPORT
#include <menu.h>
#endif
#ifdef C_FORMSUPPORT
#include <form.h>
#endif
#define C_LONGNAME
#undef C_LONG0ARGS
#define C_LONG2ARGS
#define C_TOUCHLINE
#undef C_TOUCH3ARGS
#define C_TOUCH4ARGS

View File

@@ -1,30 +0,0 @@
/* Hint file for the OSF1 platform.
*
* If this configuration doesn't work, look at the file "c-none.h"
* for how to set the configuration options.
*/
/* These hints thanks to Lamont Granquist <lamontg@becker1.u.washington.edu> */
#include <curses.h>
/* #include <term.h> */
#ifdef C_PANELSUPPORT
#include <panel.h>
#endif
#ifdef C_MENUSUPPORT
#include <menu.h>
#endif
#ifdef C_FORMSUPPORT
#include <form.h>
#endif
#define C_LONGNAME
#define C_LONG0ARGS
#undef C_LONG2ARGS
#undef C_TOUCHLINE
#undef C_TOUCH3ARGS
#undef C_TOUCH4ARGS

View File

@@ -1,29 +0,0 @@
/* Hint file for the DGUX platform.
*
* If this configuration doesn't work, look at the file "c-none.h"
* for how to set the configuration options.
*/
/* These hints thanks to Shreeniwas N Sapre <sns@cs.unipune.ernet.in> */
#include <curses.h>
#ifdef C_PANELSUPPORT
#include <panel.h>
#endif
#ifdef C_MENUSUPPORT
#include <menu.h>
#endif
#ifdef C_FORMSUPPORT
#include <form.h>
#endif
#define C_LONGNAME
#define C_LONG0ARGS
#undef C_LONG2ARGS
#define C_TOUCHLINE
#define C_TOUCH3ARGS
#undef C_TOUCH4ARGS

View File

@@ -1,29 +0,0 @@
/* Hint file for the DYNIX/ptx platform.
*
* If this configuration doesn't work, look at the file "c-none.h"
* for how to set the configuration options.
*/
/* These hints thanks to Carson Wilson <carson@Mcs.Net> */
#include <curses.h>
#ifdef C_PANELSUPPORT
#include <panel.h>
#endif
#ifdef C_MENUSUPPORT
#include <menu.h>
#endif
#ifdef C_FORMSUPPORT
#include <form.h>
#endif
#define C_LONGNAME
#define C_LONG0ARGS
#undef C_LONG2ARGS
#define C_TOUCHLINE
#define C_TOUCH3ARGS
#undef C_TOUCH4ARGS

View File

@@ -1,17 +0,0 @@
/* Hint file for the FreeBSD platform, BSD version of libcurses.
*
* If this configuration doesn't work, look at the file "c-none.h"
* for how to set the configuration options.
*/
/* These hints thanks to "Andrew V. Stesin" <stesin@elvisti.kiev.ua> */
#include <curses.h>
#define C_LONGNAME
#undef C_LONG0ARGS
#define C_LONG2ARGS
#define C_TOUCHLINE
#undef C_TOUCH3ARGS
#define C_TOUCH4ARGS

View File

@@ -1,29 +0,0 @@
/* Hint file for the FreeBSD platform, ncurses version of libcurses.
*
* If this configuration doesn't work, look at the file "c-none.h"
* for how to set the configuration options.
*/
/* These hints thanks to "Andrew V. Stesin" <stesin@elvisti.kiev.ua> */
#include <ncurses.h>
#ifdef C_PANELSUPPORT
#include <panel.h>
#endif
#ifdef C_MENUSUPPORT
#include <menu.h>
#endif
#ifdef C_FORMSUPPORT
#include <form.h>
#endif
#define C_LONGNAME
#define C_LONG0ARGS
#undef C_LONG2ARGS
#define C_TOUCHLINE
#define C_TOUCH3ARGS
#undef C_TOUCH4ARGS

View File

@@ -1,27 +0,0 @@
/* Hint file for the Debian GNU/kfreebsd platform
*
* If this configuration doesn't work, look at the file "c-none.h"
* for how to set the configuration options.
*/
#include <ncurses.h>
#ifdef C_PANELSUPPORT
#include <panel.h>
#endif
#ifdef C_MENUSUPPORT
#include <menu.h>
#endif
#ifdef C_FORMSUPPORT
#include <form.h>
#endif
#define C_LONGNAME
#define C_LONG0ARGS
#undef C_LONG2ARGS
#define C_TOUCHLINE
#define C_TOUCH3ARGS
#undef C_TOUCH4ARGS

View File

@@ -1,27 +0,0 @@
/* Hint file for the HP-UX platform.
*
* If this configuration doesn't work, look at the file "c-none.h"
* for how to set the configuration options.
*/
#include <curses.h>
#ifdef C_PANELSUPPORT
#include <panel.h>
#endif
#ifdef C_MENUSUPPORT
#include <menu.h>
#endif
#ifdef C_FORMSUPPORT
#include <form.h>
#endif
#define C_LONGNAME
#define C_LONG0ARGS
#undef C_LONG2ARGS
#define C_TOUCHLINE
#define C_TOUCH3ARGS
#undef C_TOUCH4ARGS

View File

@@ -1,17 +0,0 @@
/* Hint file for the IRIX platform, tested for IRIX 5.3.
*
* If this configuration doesn't work, look at the file "c-none.h"
* for how to set the configuration options.
*/
/* These hints thanks to Sven Heinicke <sven@wired.com> */
#include <curses.h>
#define C_LONGNAME
#define C_LONG0ARGS
#undef C_LONG2ARGS
#define C_TOUCHLINE
#define C_TOUCH3ARGS
#undef C_TOUCH4ARGS

View File

@@ -1,30 +0,0 @@
/* Hint file for the IRIX platform, ncurses version of libncurses,
* tested for IRIX 6.2.
*
* If this configuration doesn't work, look at the file "c-none.h"
* for how to set the configuration options.
*/
/* Roland Walker <walker@ncbi.nlm.nih.gov> Feb 1999*/
#include <ncurses.h>
#ifdef C_PANELSUPPORT
#include <panel.h>
#endif
#ifdef C_MENUSUPPORT
#include <menu.h>
#endif
#ifdef C_FORMSUPPORT
#include <form.h>
#endif
#define C_LONGNAME
#define C_LONG0ARGS
#undef C_LONG2ARGS
#define C_TOUCHLINE
#define C_TOUCH3ARGS
#undef C_TOUCH4ARGS

View File

@@ -1,29 +0,0 @@
/* c-isc.h: Hint file for curses on Interactive System V, release 3.2.
This was tested on version 3.01, but probably will work for most
generic SysV curses.
Andy Dougherty doughera@lafcol.lafayette.edu
*/
#include <curses.h>
#ifdef C_PANELSUPPORT
#include <panel.h>
#endif
#ifdef C_MENUSUPPORT
#include <menu.h>
#endif
#ifdef C_FORMSUPPORT
#include <form.h>
#endif
#define C_LONGNAME
#define C_LONG0ARGS
#undef C_LONG2ARGS
#define C_TOUCHLINE
#define C_TOUCH3ARGS
#undef C_TOUCH4ARGS

View File

@@ -1,15 +0,0 @@
/* Hint file for the Linux platform, BSD version of libcurses.
*
* If this configuration doesn't work, look at the file "c-none.h"
* for how to set the configuration options.
*/
#include <curses.h>
#undef C_LONGNAME
#define C_LONG0ARGS
#undef C_LONG2ARGS
#define C_TOUCHLINE
#undef C_TOUCH3ARGS
#define C_TOUCH4ARGS

View File

@@ -1,27 +0,0 @@
/* Hint file for the Linux platform, ncurses version of libcurses.
*
* If this configuration doesn't work, look at the file "c-none.h"
* for how to set the configuration options.
*/
#include <ncurses.h>
#ifdef C_PANELSUPPORT
#include <panel.h>
#endif
#ifdef C_MENUSUPPORT
#include <menu.h>
#endif
#ifdef C_FORMSUPPORT
#include <form.h>
#endif
#define C_LONGNAME
#define C_LONG0ARGS
#undef C_LONG2ARGS
#define C_TOUCHLINE
#define C_TOUCH3ARGS
#undef C_TOUCH4ARGS

View File

@@ -1,35 +0,0 @@
/* Hint file for the NETBSD platform.
*
* If this configuration doesn't work, look at the file "c-none.h"
* for how to set the configuration options.
*/
/* These hints thanks to matthew green <mrg@mame.mu.oz.au> */
/* Note to NETBSD users: I have gotten several conflicting reports
* about the correct number of arguments for longname() and
* touchline(). You may have to look them up and edit this file to
* reflect the reality for your system.
*/
#include <curses.h>
#ifdef C_PANELSUPPORT
#include <panel.h>
#endif
#ifdef C_MENUSUPPORT
#include <menu.h>
#endif
#ifdef C_FORMSUPPORT
#include <form.h>
#endif
#define C_LONGNAME /* Does longname() exist? */
#define C_LONG0ARGS /* Does longname() take 0 arguments? */
#undef C_LONG2ARGS /* Does longname() take 2 arguments? */
#define C_TOUCHLINE /* Does touchline() exist? */
#define C_TOUCH3ARGS /* Does touchline() take 3 arguments? */
#undef C_TOUCH4ARGS /* Does touchline() take 4 arguments? */

View File

@@ -1,29 +0,0 @@
/* Hint file for the NeXT platform.
*
* If this configuration doesn't work, look at the file "c-none.h"
* for how to set the configuration options.
*/
/* These hints thanks to Anno Siegel <anno4000@w172zrz.zrz.tu-berlin.d400.de>*/
#include <curses.h>
#ifdef C_PANELSUPPORT
#include <panel.h>
#endif
#ifdef C_MENUSUPPORT
#include <menu.h>
#endif
#ifdef C_FORMSUPPORT
#include <form.h>
#endif
#define C_LONGNAME
#undef C_LONG0ARGS
#define C_LONG2ARGS
#define C_TOUCHLINE
#undef C_TOUCH3ARGS
#define C_TOUCH4ARGS

View File

@@ -1,40 +0,0 @@
/* Change <curses.h> below to the proper "include" file for curses. */
#include <curses.h>
/* Change <panel.h> below to the proper "include" file for panels. */
#ifdef C_PANELSUPPORT
#include <panel.h>
#endif
/* Change <menu.h> below to the proper "include" file for menus. */
#ifdef C_MENUSUPPORT
#include <menu.h>
#endif
/* Change <form.h> below to the proper "include" file for forms. */
#ifdef C_FORMSUPPORT
#include <form.h>
#endif
/* Change each #undef below to #define if the answer to the question
* beside it is "yes".
*/
#undef C_LONGNAME /* Does longname() exist? */
#undef C_LONG0ARGS /* Does longname() take 0 arguments? */
#undef C_LONG2ARGS /* Does longname() take 2 arguments? */
#undef C_TOUCHLINE /* Does touchline() exist? */
#undef C_TOUCH3ARGS /* Does touchline() take 3 arguments? */
#undef C_TOUCH4ARGS /* Does touchline() take 4 arguments? */
/* Some Curses include files have problems interacting with perl,
* some are missing basic functionality, and some just plain do
* weird things. Unfortunately, there's no way to anticipate all
* of the problems the curses include file + "perl.h" might create.
*
* If you find that you can't compile Curses.c because of these
* conflicts, you should insert C code before and after the "include"
* file above to try and fix the problems. "See c-sunos.sysv.h"
* for an example of this.
*/

View File

@@ -1,29 +0,0 @@
/* Hint file for the OpenBSD platform.
*
* If this configuration doesn't work, look at the file "c-none.h"
* for how to set the configuration options.
*/
/* These hints thanks to Stanislav Grozev <sgrozev@orbitel.bg> */
#include <curses.h>
#ifdef C_PANELSUPPORT
#include <panel.h>
#endif
#ifdef C_MENUSUPPORT
#include <menu.h>
#endif
#ifdef C_FORMSUPPORT
#include <form.h>
#endif
#define C_LONGNAME
#define C_LONG0ARGS
#undef C_LONG2ARGS
#define C_TOUCHLINE
#define C_TOUCH3ARGS
#undef C_TOUCH4ARGS

View File

@@ -1,29 +0,0 @@
/* Hint file for the OS/2 platform, ncurses version of libcurses.
*
* If this configuration doesn't work, look at the file "c-none.h"
* for how to set the configuration options.
*/
/* These hints thanks to "Andrew V. Stesin" <stesin@elvisti.kiev.ua> */
#include <curses.h>
#ifdef C_PANELSUPPORT
#include <panel.h>
#endif
#ifdef C_MENUSUPPORT
#include <menu.h>
#endif
#ifdef C_FORMSUPPORT
#include <form.h>
#endif
#define C_LONGNAME
#define C_LONG0ARGS
#undef C_LONG2ARGS
#define C_TOUCHLINE
#define C_TOUCH3ARGS
#undef C_TOUCH4ARGS

View File

@@ -1,29 +0,0 @@
/* Hint file for the SCO Unix (3.2 and 4.2) platform.
*
* If this configuration doesn't work, look at the file "c-none.h"
* for how to set the configuration options.
*/
/* These hints thanks to Han Holl <100327.1632@compuserve.com> */
#include <curses.h>
#ifdef C_PANELSUPPORT
#include <panel.h>
#endif
#ifdef C_MENUSUPPORT
#include <menu.h>
#endif
#ifdef C_FORMSUPPORT
#include <form.h>
#endif
#define C_LONGNAME
#define C_LONG0ARGS
#undef C_LONG2ARGS
#define C_TOUCHLINE
#define C_TOUCH3ARGS
#undef C_TOUCH4ARGS

View File

@@ -1,29 +0,0 @@
/* Hint file for the Solaris platform.
*
* If this configuration doesn't work, look at the file "c-none.h"
* for how to set the configuration options.
*/
/* These hints thanks to Douglas Acker <acker@se01.wg2.waii.com> */
#include <curses.h>
#ifdef C_PANELSUPPORT
#include <panel.h>
#endif
#ifdef C_MENUSUPPORT
#include <menu.h>
#endif
#ifdef C_FORMSUPPORT
#include <form.h>
#endif
#define C_LONGNAME
#define C_LONG0ARGS
#undef C_LONG2ARGS
#define C_TOUCHLINE
#define C_TOUCH3ARGS
#undef C_TOUCH4ARGS

View File

@@ -1,15 +0,0 @@
/* Hint file for the SunOS platform, BSD version of libcurses.
*
* If this configuration doesn't work, look at the file "c-none.h"
* for how to set the configuration options.
*/
#include <curses.h>
#define C_LONGNAME
#define C_LONG0ARGS
#undef C_LONG2ARGS
#define C_TOUCHLINE
#define C_TOUCH3ARGS
#undef C_TOUCH4ARGS

View File

@@ -1,29 +0,0 @@
/* Hint file for the SunOS platform, ncurses version of libcurses.
*
* If this configuration doesn't work, look at the file "c-none.h"
* for how to set the configuration options.
*/
/* These hints thanks to Ivan Kohler <ivan@voicenet.com> */
#include <ncurses.h> /* or curses.h */
#ifdef C_PANELSUPPORT
#include <panel.h>
#endif
#ifdef C_MENUSUPPORT
#include <menu.h>
#endif
#ifdef C_FORMSUPPORT
#include <form.h>
#endif
#define C_LONGNAME
#define C_LONG0ARGS
#undef C_LONG2ARGS
#define C_TOUCHLINE
#define C_TOUCH3ARGS
#undef C_TOUCH4ARGS

View File

@@ -1,52 +0,0 @@
/* Hint file for the SunOS platform, SysV version of libcurses.
*
* If this configuration doesn't work, look at the file "c-none.h"
* for how to set the configuration options.
*/
/* The combined set of lines below between * vvvv * and * ^^^^ *
* below is one example of how to fix compiler errors between the
* curses include file and the perl include files. It turns out that
* for the SunOS platform, SysV curses, there were these problems:
*
* 1) sprintf() was declared as returning different types in <curses.h>
* and "perl.h"
* 3) Lots of redefined warnings, because <sys/ioctl.h> was included by
* both <curses.h> and "perl.h"
*
* You can see by looking at the fixes how each problem was resolved.
*
* Note that "perl.h" is always included after this file when deciding
* how to fix the conflicts.
*/
/* vvvv */
#define sprintf stupid_stupid_stupid
/* ^^^^ */
#include <curses.h>
#ifdef C_PANELSUPPORT
#include <panel.h>
#endif
#ifdef C_MENUSUPPORT
#include <menu.h>
#endif
#ifdef C_FORMSUPPORT
#include <form.h>
#endif
/* vvvv */
#undef sprintf
#define _sys_ioctl_h
/* ^^^^ */
#define C_LONGNAME
#define C_LONG0ARGS
#undef C_LONG2ARGS
#define C_TOUCHLINE
#define C_TOUCH3ARGS
#undef C_TOUCH4ARGS

View File

@@ -1,30 +0,0 @@
/* Hint file for the NCR UNIX MP_RAS 3.02 platform.
*
* If this configuration doesn't work, look at the file "c-none.h"
* for how to set the configuration options.
*/
/* These hints thanks to James Bailey <James.Bailey@AtlantaGA.NCR.COM> */
#include <curses.h>
#ifdef C_PANELSUPPORT
#include <panel.h>
#endif
#ifdef C_MENUSUPPORT
#include <menu.h>
#endif
#ifdef C_FORMSUPPORT
#include <form.h>
#endif
#define C_LONGNAME
#define C_LONG0ARGS
#undef C_LONG2ARGS
#define C_TOUCHLINE
#define C_TOUCH3ARGS
#undef C_TOUCH4ARGS

View File

@@ -1,32 +0,0 @@
/* Hint file for VMS.
*
* If this configuration doesn't work, look at the file "c-none.h"
* for how to set the configuration options.
*/
/* These hints thanks to Peter Prymmer <pvhp@forte.com> */
#include <curses.h>
#ifdef C_PANELSUPPORT
#include <panel.h>
#endif
#ifdef C_MENUSUPPORT
#include <menu.h>
#endif
#ifdef C_FORMSUPPORT
#include <form.h>
#endif
#define C_LONGNAME
#undef C_LONG0ARGS
#define C_LONG2ARGS
#undef C_TOUCHLINE
#undef C_TOUCH3ARGS
#undef C_TOUCH4ARGS
#define cbreak() crmode()
#define nocbreak() nocrmode()

View File

@@ -1,349 +0,0 @@
## This file is automatically generated; changes will be lost.
##
## V = variable existence check
## E = function existence check,
## I = function "returns int?" check
## T = typedef existence check
E waddch(stdscr,0)
E wechochar(stdscr,0)
E waddchstr(stdscr,0)
E waddchnstr(stdscr,0,0)
E waddstr(stdscr,0)
E waddnstr(stdscr,0,0)
E wattroff(stdscr,0)
E wattron(stdscr,0)
E wattrset(stdscr,0)
E wstandend(stdscr)
E wstandout(stdscr)
E wattr_get(stdscr,&LINES,&LINES,0)
E wattr_off(stdscr,0,0)
E wattr_on(stdscr,0,0)
E wattr_set(stdscr,0,0,0)
E wchgat(stdscr,0,0,0,0)
E COLOR_PAIR(0)
E PAIR_NUMBER(0)
E beep()
E flash()
E wbkgd(stdscr,0)
E wbkgdset(stdscr,0)
E getbkgd(stdscr)
E wborder(stdscr,0,0,0,0,0,0,0,0)
E box(stdscr,0,0)
E whline(stdscr,0,0)
E wvline(stdscr,0,0)
E werase(stdscr)
E wclear(stdscr)
E wclrtobot(stdscr)
E wclrtoeol(stdscr)
E start_color()
E init_pair(0,0,0)
E init_color(0,0,0,0)
E has_colors()
E can_change_color()
E color_content(0,&LINES,&LINES,&LINES)
E pair_content(0,&LINES,&LINES)
E wdelch(stdscr)
E wdeleteln(stdscr)
E winsdelln(stdscr,0)
E winsertln(stdscr)
E wgetch(stdscr)
E ungetch(0)
E has_key(0)
E KEY_F(0)
E wgetstr(stdscr,0)
E wgetnstr(stdscr,0,0)
E getyx(stdscr,LINES,LINES)
E getparyx(stdscr,LINES,LINES)
E getbegyx(stdscr,LINES,LINES)
E getmaxyx(stdscr,LINES,LINES)
E winch(stdscr)
E winchstr(stdscr,0)
E winchnstr(stdscr,0,0)
E initscr()
E endwin()
E isendwin()
E newterm(0,0,0)
E set_term(0)
E delscreen(0)
E cbreak()
I cbreak()
E nocbreak()
I nocbreak()
E echo()
I echo()
E noecho()
I noecho()
E halfdelay(0)
E intrflush(stdscr,0)
E keypad(stdscr,0)
E meta(stdscr,0)
E nodelay(stdscr,0)
E notimeout(stdscr,0)
E raw()
I raw()
E noraw()
I noraw()
E qiflush()
E noqiflush()
E wtimeout(stdscr,0)
E typeahead(0)
E winsch(stdscr,0)
E winsstr(stdscr,0)
E winsnstr(stdscr,0,0)
E winstr(stdscr,0)
E winnstr(stdscr,0,0)
E def_prog_mode()
E def_shell_mode()
E reset_prog_mode()
E reset_shell_mode()
E resetty()
E savetty()
E getsyx(LINES,LINES)
I getsyx(LINES,LINES)
E setsyx(0,0)
I setsyx(0,0)
E curs_set(0)
E napms(0)
E wmove(stdscr,0,0)
E clearok(stdscr,0)
E idlok(stdscr,0)
I idlok(stdscr,0)
E idcok(stdscr,0)
E immedok(stdscr,0)
E leaveok(stdscr,0)
E wsetscrreg(stdscr,0,0)
E scrollok(stdscr,0)
E nl()
I nl()
E nonl()
I nonl()
E overlay(stdscr,stdscr)
E overwrite(stdscr,stdscr)
E copywin(stdscr,stdscr,0,0,0,0,0,0,0)
E newpad(0,0)
E subpad(stdscr,0,0,0,0)
E prefresh(stdscr,0,0,0,0,0,0)
E pnoutrefresh(stdscr,0,0,0,0,0,0)
E pechochar(stdscr,0)
E wrefresh(stdscr)
E wnoutrefresh(stdscr)
E doupdate()
E redrawwin(stdscr)
E wredrawln(stdscr,0,0)
E scr_dump(0)
E scr_restore(0)
E scr_init(0)
E scr_set(0)
E scroll(stdscr)
E wscrl(stdscr,0)
E slk_init(0)
E slk_set(0,0,0)
E slk_refresh()
E slk_noutrefresh()
E slk_label(0)
E slk_clear()
E slk_restore()
E slk_touch()
E slk_attron(0)
E slk_attrset(0)
E slk_attr()
E slk_attroff(0)
E slk_color(0)
E baudrate()
E erasechar()
E has_ic()
E has_il()
E killchar()
E termattrs()
E termname()
E touchwin(stdscr)
E untouchwin(stdscr)
E wtouchln(stdscr,0,0,0)
E is_linetouched(stdscr,0)
E is_wintouched(stdscr)
E unctrl(0)
E keyname(0)
E filter()
I filter()
E use_env(0)
E putwin(stdscr,0)
E getwin(0)
E delay_output(0)
E flushinp()
E newwin(0,0,0,0)
E delwin(stdscr)
E mvwin(stdscr,0,0)
E subwin(stdscr,0,0,0,0)
E derwin(stdscr,0,0,0,0)
E mvderwin(stdscr,0,0)
E dupwin(stdscr)
E wsyncup(stdscr)
E syncok(stdscr,0)
E wcursyncup(stdscr)
E wsyncdown(stdscr)
E getmouse(0)
E ungetmouse(0)
E mousemask(0,&LINES)
E wenclose(stdscr,0,0)
E wmouse_trafo(stdscr,&LINES,&LINES,0)
E mouseinterval(0)
E BUTTON_RELEASE(0,0)
E BUTTON_PRESS(0,0)
E BUTTON_CLICK(0,0)
E BUTTON_DOUBLE_CLICK(0,0)
E BUTTON_TRIPLE_CLICK(0,0)
E BUTTON_RESERVED_EVENT(0,0)
E use_default_colors()
E assume_default_colors(0,0)
E define_key(0,0)
E keybound(0,0)
E keyok(0,0)
E resizeterm(0,0)
E wresize(stdscr,0,0)
E getmaxy(stdscr)
E getmaxx(stdscr)
E flusok(stdscr,0)
E getcap(0)
E touchoverlap(stdscr,stdscr)
E new_panel(stdscr)
E bottom_panel(0)
E top_panel(0)
E show_panel(0)
E update_panels()
E hide_panel(0)
E panel_window(0)
E replace_panel(0,stdscr)
E move_panel(0,0,0)
E panel_hidden(0)
E panel_above(0)
E panel_below(0)
E set_panel_userptr(0,0)
E panel_userptr(0)
E del_panel(0)
E set_menu_fore(0,0)
E menu_fore(0)
E set_menu_back(0,0)
E menu_back(0)
E set_menu_grey(0,0)
E menu_grey(0)
E set_menu_pad(0,0)
E menu_pad(0)
E pos_menu_cursor(0)
E menu_driver(0,0)
E set_menu_format(0,0,0)
E menu_format(0,&LINES,&LINES)
E set_menu_items(0,0)
E menu_items(0)
E item_count(0)
E set_menu_mark(0,0)
E menu_mark(0)
E new_menu(0)
E free_menu(0)
E menu_opts(0)
E set_menu_opts(0,0)
E menu_opts_on(0,0)
E menu_opts_off(0,0)
E set_menu_pattern(0,0)
E menu_pattern(0)
E post_menu(0)
E unpost_menu(0)
E set_menu_userptr(0,0)
E menu_userptr(0)
E set_menu_win(0,stdscr)
E menu_win(0)
E set_menu_sub(0,stdscr)
E menu_sub(0)
E scale_menu(0,&LINES,&LINES)
E set_current_item(0,0)
E current_item(0)
E set_top_row(0,0)
E top_row(0)
E item_index(0)
E item_name(0)
E item_description(0)
E new_item(0,0)
E free_item(0)
E set_item_opts(0,0)
E item_opts_on(0,0)
E item_opts_off(0,0)
E item_opts(0)
E item_userptr(0)
E set_item_userptr(0,0)
E set_item_value(0,0)
E item_value(0)
E item_visible(0)
E menu_request_name(0)
E menu_request_by_name(0)
E set_menu_spacing(0,0,0,0)
E menu_spacing(0,&LINES,&LINES,&LINES)
E pos_form_cursor(0)
E data_ahead(0)
E data_behind(0)
E form_driver(0,0)
E set_form_fields(0,0)
E form_fields(0)
E field_count(0)
E move_field(0,0,0)
E new_form(0)
E free_form(0)
E set_new_page(0,0)
E new_page(0)
E set_form_opts(0,0)
E form_opts_on(0,0)
E form_opts_off(0,0)
E form_opts(0)
E set_current_field(0,0)
E current_field(0)
E set_form_page(0,0)
E form_page(0)
E field_index(0)
E post_form(0)
E unpost_form(0)
E set_form_userptr(0,0)
E form_userptr(0)
E set_form_win(0,stdscr)
E form_win(0)
E set_form_sub(0,stdscr)
E form_sub(0)
E scale_form(0,&LINES,&LINES)
E set_field_fore(0,0)
E field_fore(0)
E set_field_back(0,0)
E field_back(0)
E set_field_pad(0,0)
E field_pad(0)
E set_field_buffer(0,0,0)
E field_buffer(0,0)
E set_field_status(0,0)
E field_status(0)
E set_max_field(0,0)
E field_info(0,&LINES,&LINES,&LINES,&LINES,&LINES,&LINES)
E dynamic_field_info(0,&LINES,&LINES,&LINES)
E set_field_just(0,0)
E field_just(0)
E new_field(0,0,0,0,0,0)
E dup_field(0,0,0)
E link_field(0,0,0)
E free_field(0)
E set_field_opts(0,0)
E field_opts_on(0,0)
E field_opts_off(0,0)
E field_opts(0)
E set_field_userptr(0,0)
E field_userptr(0)
E field_arg(0)
E form_request_name(0)
E form_request_by_name(0)
V LINES
V COLS
V stdscr
V curscr
V COLORS
V COLOR_PAIRS
T attr_t
T bool
T chtype
T MEVENT
T mmask_t
T SCREEN

View File

@@ -1,69 +0,0 @@
%define _use_internal_dependency_generator 0
%define debug_package %nil
Name: perl-Curses
Version: 1.23
Release: 1
Summary: Terminal screen handling and optimization
License: Perl/Artistic License?
Group: Applications/CPAN
URL: http://cpan.org/modules/by-module/Curses/Curses-1.23.tar.gz
BuildRoot: %{_tmppath}/%{name}-root
Requires: perl >= 0:5.002
Buildarch: noarch
Source: Curses-%{version}.tar.gz
%description
"Curses" is the interface between Perl and your systems curses(3) library.
For descriptions on the usage of a given function, variable, or constant,
consult your systems documentation, as such information invariably varies
(:-) between different curses(3) libraries and operating systems. This
document describes the interface itself, and assumes that you already know
how your systems c.
%prep
%setup -q -n Curses-%{version}
%build
umask 022
CFLAGS="$RPM_OPT_FLAGS" perl Makefile.PL PREFIX=$RPM_BUILD_ROOT/usr INSTALLDIRS=vendor
make
make test
%install
umask 022
if [ "$RPM_BUILD_ROOT" != "/" ]; then
%{__rm} -rf $RPM_BUILD_ROOT
fi
make install
[ -x /usr/lib/rpm/brp-compress ] && /usr/lib/rpm/brp-compress
find $RPM_BUILD_ROOT \( -name perllocal.pod -o -name .packlist \) -exec rm -v {} \;
find $RPM_BUILD_ROOT/usr -type f -print | \
sed "s@^$RPM_BUILD_ROOT@@g" | \
grep -v perllocal.pod | \
grep -v "\.packlist" > %{name}-%{version}-filelist
if [ "$(cat %{name}-%{version}-filelist)X" = "X" ] ; then
echo "ERROR: EMPTY FILE LIST"
exit -1
fi
%clean
if [ "$RPM_BUILD_ROOT" != "/" ]; then
%{__rm} -rf $RPM_BUILD_ROOT
fi
%files -f %{name}-%{version}-filelist
%defattr(-,root,root)
%changelog
* Thu Apr 10 2008 Egan Ford <datajerk@gmail.com>
+ perl-Curses-1.23-1
- First cut for xCAT 2.0.
* Tue Jan 09 2007 Daryl W. Grunau <dwg@lanl.gov>
+ xcat-perl-Curses-1.23-1
- First cut.

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +0,0 @@
#!perl
use Test::More tests => 1;
BEGIN {
use_ok( 'Curses' );
}
diag( "Testing Curses $Curses::VERSION, Perl $]" );

View File

@@ -1,310 +0,0 @@
#!../../perl
##
## test.syms -- test for function/variable symbols
##
## Set the environment variable CURSES_VERBOSE to see the details of the
## testing.
## Copyright (c) 1994-2000 William Setzer
##
## You may distribute under the terms of either the Artistic License
## or the GNU General Public License, as specified in the README file.
##
## This program is modelled after parts of the dist-3.0 distribution.
## In many cases I just hand-converted the sh script to perl, so this
## program probably falls under the Artistic license. At the very least,
## it has the "look and feel". Will I be sued? :-)
##
## Thanks to Raphael Manfredi and the other contributors of dist-3.0.
##
## VMS patches thanks to Peter Prymmer <pvhp@forte.com>
use strict;
use warnings;
use English;
my $verbose;
sub makeCompileCommand($) {
my ($compileR) = @_;
# Get a compile command so we can test for curses symbols.
# (There has got to be an easier way. Blech.)
#
my $compile = '#CC# #DEFS# #INCS# #CFLAGS# #FILE# #LFLAGS# #LIBS#' .
($verbose ? '' : '#NULL#');
my $makefile = ($OSNAME =~ /VMS/) ? "Descrip.MMS" : "Makefile";
my ($cc, $inc, $ccflags, $ldloadlibs, $lddlflags);
open MAKEFILE, "< $makefile" or
die "Can't open make file '$makefile' errno=$ERRNO";
while (<MAKEFILE>) {
if (/^CC\s*=\s*(.*)/) {
$cc = $1;
} elsif (/^INC\s*=\s*(.*)/) {
$inc = $1;
} elsif (/^CCFLAGS\s*=\s*(.*)/) {
$ccflags = $1;
} elsif (/^LDLOADLIBS\s*=\s*(.*)/) {
$ldloadlibs = $1;
} elsif (/^LDDLFLAGS\s*=\s*(.*)/) {
$lddlflags = $1;
}
}
if (defined($cc)) {
$compile =~ s{#CC#}{$cc};
}
if (defined($inc)) {
$compile =~ s{#INCS#}{$inc};
}
if (defined($ccflags)) {
$compile =~ s{#CFLAGS#}{$ccflags};
}
if (defined($ldloadlibs)) {
$compile =~ s{#LIBS#}{$ldloadlibs};
} else {
$compile =~ s{#LIBS#}{};
}
if (defined($lddlflags)) {
## Only get -L's. Other options can cause strange link behavior.
## (I shoulda stayed in bed.)
#
my $lflags;
$lflags = ''; # initial value
while ($lddlflags =~ m{(-L\S+)}g) {
$lflags .= " $1";
}
$compile =~ s{#LFLAGS#}{$lflags};
}
close MAKEFILE;
# Left to handle: DEFS/FILE/NULL
# DEFS => "cc" define of "SYM" to "_C_SYM_"
# FILE => "cc" compile of file _C_FILE_.c into executable _C_FILE_
# NULL => output of system call to dev null
#
# _C_SYM_ and _C_FILE_ will be filled in later
if ($OSNAME =~ m{VMS}i) {
$compile =~ s{#DEFS#}{DEFINE=SYM="_C_SYM_"};
$compile =~ s{#FILE#}{_C_FILE_.c};
$compile =~ s{#NULL#}{}; # no non-verbose way
}
elsif ($OSNAME eq 'MSWin32') {
$compile =~ s{#DEFS#}{-DSYM="_C_SYM_"};
$compile =~ s{#FILE#}{_C_FILE_.c};
$compile =~ s{#NULL#}{>nul 2>&1};
}
else {
$compile =~ s{#DEFS#}{-DSYM="_C_SYM_"};
$compile =~ s{#FILE#}{-o _C_FILE_ _C_FILE_.c};
$compile =~ s{#NULL#}{>/dev/null 2>&1};
}
if ($compile =~ m{#.+#}) {
die "OOPS: internal error constructing a compile command. " .
"We failed to substitute for a #xxx# substitution variable " .
"and thus ended up with this: '$compile'\n";
}
$$compileR = $compile;
}
###############################################################################
# MAINLINE #
###############################################################################
print("Checking capabilities of the Ncurses libraries.\n");
print("Set CURSES_VERBOSE environment variable to see the details of the " .
"tests.\n");
print("\n");
my $panels;
my $menus;
my $forms;
if ($ENV{CURSES_VERBOSE}) {
$verbose = 1;
} else {
$verbose = 0;
}
open IN, "list.syms" or die "Can't open list.syms: $!\n";
open(OUTH, ">CursesDef.h") or die "Can't open CursesDef.h: $!\n";
open LOG, ">&STDERR" or die "Can't redirect to STDERR: $!\n";
while (@ARGV) {
my $arg = shift;
$arg eq 'PANELS' and ++$panels and next;
$arg eq 'MENUS' and ++$menus and next;
$arg eq 'FORMS' and ++$forms and next;
$arg =~ /^-h/ and Usage();
$arg =~ /^-v/ and ++$verbose and next;
$arg =~ /^-l/ and do {
my $logfile = shift or Usage("<-l> needs a filename");
open LOG, ">$logfile" or die "Can't open file '$logfile': $!\n";
open STDERR, ">&LOG" or die "Can't redirect STDERR: $!\n";
next;
};
$arg =~ /^-/ and Usage("Unknown option: $arg");
Usage("Unknown argument: $arg");
}
if (@ARGV) { Usage() }
select LOG;
$| = 1;
# Prep compile stage
makeCompileCommand(\my $compile);
print STDOUT "Doing test compiles with the compile command '$compile'\n";
###
## Now generate the .h file
#
print OUTH <<'EOHDR';
/* This file is automatically generated; changes will be lost.
**
** If you need to edit this file because "test.syms" didn't do a good
** job, be sure to save a copy of your changes.
**
** The "define"s below are simply educated guesses. If you are
** having problems compiling, check the appropriate symbol to see if
** it was set correctly: For each line, if the answer to the question
** is "no", that line should start with "#undef"; if the answer is
** yes, it should start with "#define".
*/
EOHDR
print OUTH
$panels ? "#define " : "#undef ",
"C_PANELSUPPORT /* Add in panel library support? */",
"\n\n";
print OUTH
$menus ? "#define " : "#undef ",
"C_MENUSUPPORT /* Add in menu library support? */",
"\n\n";
print OUTH
$forms ? "#define " : "#undef ",
"C_FORMSUPPORT /* Add in form library support? */",
"\n\n";
# Some functions return either int or void, depending on what compiler
# and libcurses.a you are using. For the int/void test, if the
# compiler doesn't complain about assigning the sym to an int
# variable, we assume the function returns int. Otherwise, we assume
# it returns void.
my %tstfile = qw( E testsym
I testint
V testsym
T testtyp);
while (<IN>) {
next if /^\S*#/;
next unless /\S/;
my ($action, $sym, $args) = /^([A-Z])\s+(\w+)\s*(\(.*\))?/;
my $file = $tstfile{$action};
unless (defined $sym and defined $file) {
warn "WARNING: internal error on symbol $_\n";
}
my $cmd;
$cmd = $compile; # initial value
my $symargs = $sym . (defined($args) ? $args : '');
$cmd =~ s{_C_SYM_}{$symargs}ge;
$cmd =~ s{_C_FILE_}{$file}g;
print LOG $cmd, "\n" if $verbose;
my $ret = `$cmd`;
my $rc = $?;
print LOG $ret if $verbose;
print LOG "(rc = $rc)\n" if $verbose;
my $ssym = $sym;
$ssym =~ s/^w//;
my $c_sym;
my $comment;
if ($action eq 'E') {
print LOG "function '$sym' ", ($rc ? "NOT " : ""), "found\n";
$c_sym = uc "C_$ssym";
$comment = "Does function '$ssym' exist?";
}
elsif ($action eq 'I') {
print LOG "function '$sym' returns ", ($rc ? "void" : "int"), "\n";
$c_sym = uc "C_INT$ssym";
$comment = "Does function '$ssym' return 'int'?";
}
elsif ($action eq 'V') {
print LOG "variable '$sym' ", ($rc ? "NOT " : ""), "found\n";
$c_sym = uc "C_$ssym";
$comment = "Does variable '$ssym' exist?";
}
elsif ($action eq 'T') {
print LOG "typedef '$sym' ", ($rc ? "NOT " : ""), "found\n";
$c_sym = uc "C_TYP$ssym";
$comment = "Does typedef '$ssym' exist?";
}
else {
warn "WARNING: internal error on symbol $_\n";
}
print OUTH
$rc ? "#undef " : "#define ",
$c_sym, " " x (24 - length $c_sym),
"/* ",
$comment, " " x (42 - length $comment),
"*/\n";
}
unlink "testsym";
unlink "testint";
unlink "testtyp";
1 while unlink "testsym.obj"; # Possibly pointless VMSism
1 while unlink "testint.obj"; # Possibly pointless VMSism
1 while unlink "testtyp.obj"; # Possibly pointless VMSism
close IN;
close OUTH;
close LOG;
exit 0;
###
## Helper functions
#
sub Usage {
print LOG @_, "\n";
print LOG <<EOM;
Usage: find_syms [options]
where options include:
-h This message.
-v Verbose. Tell you more than you want to know about
how the Curses symbols are being determined.
-l <file> Create file <file> and dump output into it.
EOM
}
__END__

View File

@@ -1,7 +0,0 @@
#include "c-config.h"
main() {
int ret;
ret = SYM;
}

View File

@@ -1,5 +0,0 @@
#include "c-config.h"
main() {
SYM;
}

View File

@@ -1,5 +0,0 @@
#include "c-config.h"
main() {
typedef SYM c_sym_t;
}

Binary file not shown.