diff --git a/Curses-1.23/Artistic b/Curses-1.23/Artistic new file mode 100644 index 0000000..11f4d82 --- /dev/null +++ b/Curses-1.23/Artistic @@ -0,0 +1,131 @@ + + + + + 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 diff --git a/Curses-1.23/Copying b/Curses-1.23/Copying new file mode 100644 index 0000000..43cd72c --- /dev/null +++ b/Curses-1.23/Copying @@ -0,0 +1,248 @@ + 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. + + + Copyright (C) 19yy + + 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. + + , 1 April 1989 + Ty Coon, President of Vice + +That's all there is to it! diff --git a/Curses-1.23/Curses.c b/Curses-1.23/Curses.c new file mode 100644 index 0000000..4c184a7 --- /dev/null +++ b/Curses-1.23/Curses.c @@ -0,0 +1,393 @@ +/* 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 , 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 (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 /* Needed by */ +#include +#include +/* 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" diff --git a/Curses-1.23/Curses.pm b/Curses-1.23/Curses.pm new file mode 100644 index 0000000..a5b1a6a --- /dev/null +++ b/Curses-1.23/Curses.pm @@ -0,0 +1,899 @@ +## 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 < 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, I, and/or I. 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 has +three other variants: C, C, and C. +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 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, along with a column listing if it is I. If +so, it takes a varying number of arguments as follows: + +=over 4 + +C + +I is an optional window argument, defaulting to C if not +specified. + +I is an optional coordinate pair used to move the cursor, +defaulting to no move if not specified. + +I 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 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 package. See L<"Perl 4.X C 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 (see +L<"Supported Functions"> below and L<"Unified Functions"> above) +can be called as a method for a Curses object. + +Do not use C if using objects, as the first call to get +a C 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 Compatibility + +C 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 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, even with +the C 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 and C. This is because of a Perl bug. +See the L section for details. + +=head2 Incompatibilities with previous versions of C + +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 and C +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 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 function. See the DESCRIPTION section on L for more information. + +=item * Curses function '%s' is not defined by your vendor at ... + +You have a C 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 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 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 interface to the C +variables. Don't do that. :-) + +=item * Anything else + +Check out the F 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 and C), you might run into +a bug in Perl where the "magic" isn't called early enough. This is +manifested by the C 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 + +=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 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 + + 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 + + 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 + + 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 diff --git a/Curses-1.23/CursesBoot.c b/Curses-1.23/CursesBoot.c new file mode 100644 index 0000000..8bbee0c --- /dev/null +++ b/Curses-1.23/CursesBoot.c @@ -0,0 +1,1236 @@ +/* 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 */ + + C_NEWXS("Curses::addch", XS_Curses_addch); + C_NEWXS("Curses::echochar", XS_Curses_echochar); + C_NEWXS("Curses::addchstr", XS_Curses_addchstr); + C_NEWXS("Curses::addchnstr", XS_Curses_addchnstr); + C_NEWXS("Curses::addstr", XS_Curses_addstr); + C_NEWXS("Curses::addnstr", XS_Curses_addnstr); + C_NEWXS("Curses::attroff", XS_Curses_attroff); + C_NEWXS("Curses::attron", XS_Curses_attron); + C_NEWXS("Curses::attrset", XS_Curses_attrset); + C_NEWXS("Curses::standend", XS_Curses_standend); + C_NEWXS("Curses::standout", XS_Curses_standout); + C_NEWXS("Curses::attr_get", XS_Curses_attr_get); + C_NEWXS("Curses::attr_off", XS_Curses_attr_off); + C_NEWXS("Curses::attr_on", XS_Curses_attr_on); + C_NEWXS("Curses::attr_set", XS_Curses_attr_set); + C_NEWXS("Curses::chgat", XS_Curses_chgat); + C_NEWXS("Curses::COLOR_PAIR", XS_Curses_COLOR_PAIR); + C_NEWXS("Curses::PAIR_NUMBER", XS_Curses_PAIR_NUMBER); + C_NEWXS("Curses::beep", XS_Curses_beep); + C_NEWXS("Curses::flash", XS_Curses_flash); + C_NEWXS("Curses::bkgd", XS_Curses_bkgd); + C_NEWXS("Curses::bkgdset", XS_Curses_bkgdset); + C_NEWXS("Curses::getbkgd", XS_Curses_getbkgd); + C_NEWXS("Curses::border", XS_Curses_border); + C_NEWXS("Curses::box", XS_Curses_box); + C_NEWXS("Curses::hline", XS_Curses_hline); + C_NEWXS("Curses::vline", XS_Curses_vline); + C_NEWXS("Curses::erase", XS_Curses_erase); + C_NEWXS("Curses::clear", XS_Curses_clear); + C_NEWXS("Curses::clrtobot", XS_Curses_clrtobot); + C_NEWXS("Curses::clrtoeol", XS_Curses_clrtoeol); + C_NEWXS("Curses::start_color", XS_Curses_start_color); + C_NEWXS("Curses::init_pair", XS_Curses_init_pair); + C_NEWXS("Curses::init_color", XS_Curses_init_color); + C_NEWXS("Curses::has_colors", XS_Curses_has_colors); + C_NEWXS("Curses::can_change_color", XS_Curses_can_change_color); + C_NEWXS("Curses::color_content", XS_Curses_color_content); + C_NEWXS("Curses::pair_content", XS_Curses_pair_content); + C_NEWXS("Curses::delch", XS_Curses_delch); + C_NEWXS("Curses::deleteln", XS_Curses_deleteln); + C_NEWXS("Curses::insdelln", XS_Curses_insdelln); + C_NEWXS("Curses::insertln", XS_Curses_insertln); + C_NEWXS("Curses::getch", XS_Curses_getch); + C_NEWXS("Curses::ungetch", XS_Curses_ungetch); + C_NEWXS("Curses::has_key", XS_Curses_has_key); + C_NEWXS("Curses::KEY_F", XS_Curses_KEY_F); + C_NEWXS("Curses::getstr", XS_Curses_getstr); + C_NEWXS("Curses::getnstr", XS_Curses_getnstr); + C_NEWXS("Curses::getyx", XS_Curses_getyx); + C_NEWXS("Curses::getparyx", XS_Curses_getparyx); + C_NEWXS("Curses::getbegyx", XS_Curses_getbegyx); + C_NEWXS("Curses::getmaxyx", XS_Curses_getmaxyx); + C_NEWXS("Curses::inch", XS_Curses_inch); + C_NEWXS("Curses::inchstr", XS_Curses_inchstr); + C_NEWXS("Curses::inchnstr", XS_Curses_inchnstr); + C_NEWXS("Curses::initscr", XS_Curses_initscr); + C_NEWXS("Curses::endwin", XS_Curses_endwin); + C_NEWXS("Curses::isendwin", XS_Curses_isendwin); + C_NEWXS("Curses::newterm", XS_Curses_newterm); + C_NEWXS("Curses::set_term", XS_Curses_set_term); + C_NEWXS("Curses::delscreen", XS_Curses_delscreen); +#ifdef C_INTCBREAK + C_NEWXS("Curses::cbreak", XS_Curses_cbreak); +#else + C_NEWXS("Curses::cbreak", XS_Curses_cbreak); +#endif +#ifdef C_INTNOCBREAK + C_NEWXS("Curses::nocbreak", XS_Curses_nocbreak); +#else + C_NEWXS("Curses::nocbreak", XS_Curses_nocbreak); +#endif +#ifdef C_INTECHO + C_NEWXS("Curses::echo", XS_Curses_echo); +#else + C_NEWXS("Curses::echo", XS_Curses_echo); +#endif +#ifdef C_INTNOECHO + C_NEWXS("Curses::noecho", XS_Curses_noecho); +#else + C_NEWXS("Curses::noecho", XS_Curses_noecho); +#endif + C_NEWXS("Curses::halfdelay", XS_Curses_halfdelay); + C_NEWXS("Curses::intrflush", XS_Curses_intrflush); + C_NEWXS("Curses::keypad", XS_Curses_keypad); + C_NEWXS("Curses::meta", XS_Curses_meta); + C_NEWXS("Curses::nodelay", XS_Curses_nodelay); + C_NEWXS("Curses::notimeout", XS_Curses_notimeout); +#ifdef C_INTRAW + C_NEWXS("Curses::raw", XS_Curses_raw); +#else + C_NEWXS("Curses::raw", XS_Curses_raw); +#endif +#ifdef C_INTNORAW + C_NEWXS("Curses::noraw", XS_Curses_noraw); +#else + C_NEWXS("Curses::noraw", XS_Curses_noraw); +#endif + C_NEWXS("Curses::qiflush", XS_Curses_qiflush); + C_NEWXS("Curses::noqiflush", XS_Curses_noqiflush); + C_NEWXS("Curses::timeout", XS_Curses_timeout); + C_NEWXS("Curses::typeahead", XS_Curses_typeahead); + C_NEWXS("Curses::insch", XS_Curses_insch); + C_NEWXS("Curses::insstr", XS_Curses_insstr); + C_NEWXS("Curses::insnstr", XS_Curses_insnstr); + C_NEWXS("Curses::instr", XS_Curses_instr); + C_NEWXS("Curses::innstr", XS_Curses_innstr); + C_NEWXS("Curses::def_prog_mode", XS_Curses_def_prog_mode); + C_NEWXS("Curses::def_shell_mode", XS_Curses_def_shell_mode); + C_NEWXS("Curses::reset_prog_mode", XS_Curses_reset_prog_mode); + C_NEWXS("Curses::reset_shell_mode", XS_Curses_reset_shell_mode); + C_NEWXS("Curses::resetty", XS_Curses_resetty); + C_NEWXS("Curses::savetty", XS_Curses_savetty); +#ifdef C_INTGETSYX + C_NEWXS("Curses::getsyx", XS_Curses_getsyx); +#else + C_NEWXS("Curses::getsyx", XS_Curses_getsyx); +#endif +#ifdef C_INTSETSYX + C_NEWXS("Curses::setsyx", XS_Curses_setsyx); +#else + C_NEWXS("Curses::setsyx", XS_Curses_setsyx); +#endif + C_NEWXS("Curses::curs_set", XS_Curses_curs_set); + C_NEWXS("Curses::napms", XS_Curses_napms); + C_NEWXS("Curses::move", XS_Curses_move); + C_NEWXS("Curses::clearok", XS_Curses_clearok); +#ifdef C_INTIDLOK + C_NEWXS("Curses::idlok", XS_Curses_idlok); +#else + C_NEWXS("Curses::idlok", XS_Curses_idlok); +#endif + C_NEWXS("Curses::idcok", XS_Curses_idcok); + C_NEWXS("Curses::immedok", XS_Curses_immedok); + C_NEWXS("Curses::leaveok", XS_Curses_leaveok); + C_NEWXS("Curses::setscrreg", XS_Curses_setscrreg); + C_NEWXS("Curses::scrollok", XS_Curses_scrollok); +#ifdef C_INTNL + C_NEWXS("Curses::nl", XS_Curses_nl); +#else + C_NEWXS("Curses::nl", XS_Curses_nl); +#endif +#ifdef C_INTNONL + C_NEWXS("Curses::nonl", XS_Curses_nonl); +#else + C_NEWXS("Curses::nonl", XS_Curses_nonl); +#endif + C_NEWXS("Curses::overlay", XS_Curses_overlay); + C_NEWXS("Curses::overwrite", XS_Curses_overwrite); + C_NEWXS("Curses::copywin", XS_Curses_copywin); + C_NEWXS("Curses::newpad", XS_Curses_newpad); + C_NEWXS("Curses::subpad", XS_Curses_subpad); + C_NEWXS("Curses::prefresh", XS_Curses_prefresh); + C_NEWXS("Curses::pnoutrefresh", XS_Curses_pnoutrefresh); + C_NEWXS("Curses::pechochar", XS_Curses_pechochar); + C_NEWXS("Curses::refresh", XS_Curses_refresh); + C_NEWXS("Curses::noutrefresh", XS_Curses_noutrefresh); + C_NEWXS("Curses::doupdate", XS_Curses_doupdate); + C_NEWXS("Curses::redrawwin", XS_Curses_redrawwin); + C_NEWXS("Curses::redrawln", XS_Curses_redrawln); + C_NEWXS("Curses::scr_dump", XS_Curses_scr_dump); + C_NEWXS("Curses::scr_restore", XS_Curses_scr_restore); + C_NEWXS("Curses::scr_init", XS_Curses_scr_init); + C_NEWXS("Curses::scr_set", XS_Curses_scr_set); + C_NEWXS("Curses::scroll", XS_Curses_scroll); + C_NEWXS("Curses::scrl", XS_Curses_scrl); + C_NEWXS("Curses::slk_init", XS_Curses_slk_init); + C_NEWXS("Curses::slk_set", XS_Curses_slk_set); + C_NEWXS("Curses::slk_refresh", XS_Curses_slk_refresh); + C_NEWXS("Curses::slk_noutrefresh", XS_Curses_slk_noutrefresh); + C_NEWXS("Curses::slk_label", XS_Curses_slk_label); + C_NEWXS("Curses::slk_clear", XS_Curses_slk_clear); + C_NEWXS("Curses::slk_restore", XS_Curses_slk_restore); + C_NEWXS("Curses::slk_touch", XS_Curses_slk_touch); + C_NEWXS("Curses::slk_attron", XS_Curses_slk_attron); + C_NEWXS("Curses::slk_attrset", XS_Curses_slk_attrset); + C_NEWXS("Curses::slk_attr", XS_Curses_slk_attr); + C_NEWXS("Curses::slk_attroff", XS_Curses_slk_attroff); + C_NEWXS("Curses::slk_color", XS_Curses_slk_color); + C_NEWXS("Curses::baudrate", XS_Curses_baudrate); + C_NEWXS("Curses::erasechar", XS_Curses_erasechar); + C_NEWXS("Curses::has_ic", XS_Curses_has_ic); + C_NEWXS("Curses::has_il", XS_Curses_has_il); + C_NEWXS("Curses::killchar", XS_Curses_killchar); +#ifdef C_LONG0ARGS + C_NEWXS("Curses::longname", XS_Curses_longname); +#else + C_NEWXS("Curses::longname", XS_Curses_longname); +#endif + C_NEWXS("Curses::termattrs", XS_Curses_termattrs); + C_NEWXS("Curses::termname", XS_Curses_termname); + C_NEWXS("Curses::touchwin", XS_Curses_touchwin); +#ifdef C_TOUCH3ARGS + C_NEWXS("Curses::touchline", XS_Curses_touchline); +#else + C_NEWXS("Curses::touchline", XS_Curses_touchline); +#endif + C_NEWXS("Curses::untouchwin", XS_Curses_untouchwin); + C_NEWXS("Curses::touchln", XS_Curses_touchln); + C_NEWXS("Curses::is_linetouched", XS_Curses_is_linetouched); + C_NEWXS("Curses::is_wintouched", XS_Curses_is_wintouched); + C_NEWXS("Curses::unctrl", XS_Curses_unctrl); + C_NEWXS("Curses::keyname", XS_Curses_keyname); +#ifdef C_INTFILTER + C_NEWXS("Curses::filter", XS_Curses_filter); +#else + C_NEWXS("Curses::filter", XS_Curses_filter); +#endif + C_NEWXS("Curses::use_env", XS_Curses_use_env); + C_NEWXS("Curses::putwin", XS_Curses_putwin); + C_NEWXS("Curses::getwin", XS_Curses_getwin); + C_NEWXS("Curses::delay_output", XS_Curses_delay_output); + C_NEWXS("Curses::flushinp", XS_Curses_flushinp); + C_NEWXS("Curses::newwin", XS_Curses_newwin); + C_NEWXS("Curses::delwin", XS_Curses_delwin); + C_NEWXS("Curses::mvwin", XS_Curses_mvwin); + C_NEWXS("Curses::subwin", XS_Curses_subwin); + C_NEWXS("Curses::derwin", XS_Curses_derwin); + C_NEWXS("Curses::mvderwin", XS_Curses_mvderwin); + C_NEWXS("Curses::dupwin", XS_Curses_dupwin); + C_NEWXS("Curses::syncup", XS_Curses_syncup); + C_NEWXS("Curses::syncok", XS_Curses_syncok); + C_NEWXS("Curses::cursyncup", XS_Curses_cursyncup); + C_NEWXS("Curses::syncdown", XS_Curses_syncdown); + C_NEWXS("Curses::getmouse", XS_Curses_getmouse); + C_NEWXS("Curses::ungetmouse", XS_Curses_ungetmouse); + C_NEWXS("Curses::mousemask", XS_Curses_mousemask); + C_NEWXS("Curses::enclose", XS_Curses_enclose); + C_NEWXS("Curses::mouse_trafo", XS_Curses_mouse_trafo); + C_NEWXS("Curses::mouseinterval", XS_Curses_mouseinterval); + C_NEWXS("Curses::BUTTON_RELEASE", XS_Curses_BUTTON_RELEASE); + C_NEWXS("Curses::BUTTON_PRESS", XS_Curses_BUTTON_PRESS); + C_NEWXS("Curses::BUTTON_CLICK", XS_Curses_BUTTON_CLICK); + C_NEWXS("Curses::BUTTON_DOUBLE_CLICK", XS_Curses_BUTTON_DOUBLE_CLICK); + C_NEWXS("Curses::BUTTON_TRIPLE_CLICK", XS_Curses_BUTTON_TRIPLE_CLICK); + C_NEWXS("Curses::BUTTON_RESERVED_EVENT", XS_Curses_BUTTON_RESERVED_EVENT); + C_NEWXS("Curses::use_default_colors", XS_Curses_use_default_colors); + C_NEWXS("Curses::assume_default_colors", XS_Curses_assume_default_colors); + C_NEWXS("Curses::define_key", XS_Curses_define_key); + C_NEWXS("Curses::keybound", XS_Curses_keybound); + C_NEWXS("Curses::keyok", XS_Curses_keyok); + C_NEWXS("Curses::resizeterm", XS_Curses_resizeterm); + C_NEWXS("Curses::resize", XS_Curses_resize); + C_NEWXS("Curses::getmaxy", XS_Curses_getmaxy); + C_NEWXS("Curses::getmaxx", XS_Curses_getmaxx); + C_NEWXS("Curses::flusok", XS_Curses_flusok); + C_NEWXS("Curses::getcap", XS_Curses_getcap); + C_NEWXS("Curses::touchoverlap", XS_Curses_touchoverlap); + C_NEWXS("Curses::new_panel", XS_Curses_new_panel); + C_NEWXS("Curses::bottom_panel", XS_Curses_bottom_panel); + C_NEWXS("Curses::top_panel", XS_Curses_top_panel); + C_NEWXS("Curses::show_panel", XS_Curses_show_panel); + C_NEWXS("Curses::update_panels", XS_Curses_update_panels); + C_NEWXS("Curses::hide_panel", XS_Curses_hide_panel); + C_NEWXS("Curses::panel_window", XS_Curses_panel_window); + C_NEWXS("Curses::replace_panel", XS_Curses_replace_panel); + C_NEWXS("Curses::move_panel", XS_Curses_move_panel); + C_NEWXS("Curses::panel_hidden", XS_Curses_panel_hidden); + C_NEWXS("Curses::panel_above", XS_Curses_panel_above); + C_NEWXS("Curses::panel_below", XS_Curses_panel_below); + C_NEWXS("Curses::set_panel_userptr", XS_Curses_set_panel_userptr); + C_NEWXS("Curses::panel_userptr", XS_Curses_panel_userptr); + C_NEWXS("Curses::del_panel", XS_Curses_del_panel); + C_NEWXS("Curses::set_menu_fore", XS_Curses_set_menu_fore); + C_NEWXS("Curses::menu_fore", XS_Curses_menu_fore); + C_NEWXS("Curses::set_menu_back", XS_Curses_set_menu_back); + C_NEWXS("Curses::menu_back", XS_Curses_menu_back); + C_NEWXS("Curses::set_menu_grey", XS_Curses_set_menu_grey); + C_NEWXS("Curses::menu_grey", XS_Curses_menu_grey); + C_NEWXS("Curses::set_menu_pad", XS_Curses_set_menu_pad); + C_NEWXS("Curses::menu_pad", XS_Curses_menu_pad); + C_NEWXS("Curses::pos_menu_cursor", XS_Curses_pos_menu_cursor); + C_NEWXS("Curses::menu_driver", XS_Curses_menu_driver); + C_NEWXS("Curses::set_menu_format", XS_Curses_set_menu_format); + C_NEWXS("Curses::menu_format", XS_Curses_menu_format); + C_NEWXS("Curses::set_menu_items", XS_Curses_set_menu_items); + C_NEWXS("Curses::menu_items", XS_Curses_menu_items); + C_NEWXS("Curses::item_count", XS_Curses_item_count); + C_NEWXS("Curses::set_menu_mark", XS_Curses_set_menu_mark); + C_NEWXS("Curses::menu_mark", XS_Curses_menu_mark); + C_NEWXS("Curses::new_menu", XS_Curses_new_menu); + C_NEWXS("Curses::free_menu", XS_Curses_free_menu); + C_NEWXS("Curses::menu_opts", XS_Curses_menu_opts); + C_NEWXS("Curses::set_menu_opts", XS_Curses_set_menu_opts); + C_NEWXS("Curses::menu_opts_on", XS_Curses_menu_opts_on); + C_NEWXS("Curses::menu_opts_off", XS_Curses_menu_opts_off); + C_NEWXS("Curses::set_menu_pattern", XS_Curses_set_menu_pattern); + C_NEWXS("Curses::menu_pattern", XS_Curses_menu_pattern); + C_NEWXS("Curses::post_menu", XS_Curses_post_menu); + C_NEWXS("Curses::unpost_menu", XS_Curses_unpost_menu); + C_NEWXS("Curses::set_menu_userptr", XS_Curses_set_menu_userptr); + C_NEWXS("Curses::menu_userptr", XS_Curses_menu_userptr); + C_NEWXS("Curses::set_menu_win", XS_Curses_set_menu_win); + C_NEWXS("Curses::menu_win", XS_Curses_menu_win); + C_NEWXS("Curses::set_menu_sub", XS_Curses_set_menu_sub); + C_NEWXS("Curses::menu_sub", XS_Curses_menu_sub); + C_NEWXS("Curses::scale_menu", XS_Curses_scale_menu); + C_NEWXS("Curses::set_current_item", XS_Curses_set_current_item); + C_NEWXS("Curses::current_item", XS_Curses_current_item); + C_NEWXS("Curses::set_top_row", XS_Curses_set_top_row); + C_NEWXS("Curses::top_row", XS_Curses_top_row); + C_NEWXS("Curses::item_index", XS_Curses_item_index); + C_NEWXS("Curses::item_name", XS_Curses_item_name); + C_NEWXS("Curses::item_description", XS_Curses_item_description); + C_NEWXS("Curses::new_item", XS_Curses_new_item); + C_NEWXS("Curses::free_item", XS_Curses_free_item); + C_NEWXS("Curses::set_item_opts", XS_Curses_set_item_opts); + C_NEWXS("Curses::item_opts_on", XS_Curses_item_opts_on); + C_NEWXS("Curses::item_opts_off", XS_Curses_item_opts_off); + C_NEWXS("Curses::item_opts", XS_Curses_item_opts); + C_NEWXS("Curses::item_userptr", XS_Curses_item_userptr); + C_NEWXS("Curses::set_item_userptr", XS_Curses_set_item_userptr); + C_NEWXS("Curses::set_item_value", XS_Curses_set_item_value); + C_NEWXS("Curses::item_value", XS_Curses_item_value); + C_NEWXS("Curses::item_visible", XS_Curses_item_visible); + C_NEWXS("Curses::menu_request_name", XS_Curses_menu_request_name); + C_NEWXS("Curses::menu_request_by_name", XS_Curses_menu_request_by_name); + C_NEWXS("Curses::set_menu_spacing", XS_Curses_set_menu_spacing); + C_NEWXS("Curses::menu_spacing", XS_Curses_menu_spacing); + C_NEWXS("Curses::pos_form_cursor", XS_Curses_pos_form_cursor); + C_NEWXS("Curses::data_ahead", XS_Curses_data_ahead); + C_NEWXS("Curses::data_behind", XS_Curses_data_behind); + C_NEWXS("Curses::form_driver", XS_Curses_form_driver); + C_NEWXS("Curses::set_form_fields", XS_Curses_set_form_fields); + C_NEWXS("Curses::form_fields", XS_Curses_form_fields); + C_NEWXS("Curses::field_count", XS_Curses_field_count); + C_NEWXS("Curses::move_field", XS_Curses_move_field); + C_NEWXS("Curses::new_form", XS_Curses_new_form); + C_NEWXS("Curses::free_form", XS_Curses_free_form); + C_NEWXS("Curses::set_new_page", XS_Curses_set_new_page); + C_NEWXS("Curses::new_page", XS_Curses_new_page); + C_NEWXS("Curses::set_form_opts", XS_Curses_set_form_opts); + C_NEWXS("Curses::form_opts_on", XS_Curses_form_opts_on); + C_NEWXS("Curses::form_opts_off", XS_Curses_form_opts_off); + C_NEWXS("Curses::form_opts", XS_Curses_form_opts); + C_NEWXS("Curses::set_current_field", XS_Curses_set_current_field); + C_NEWXS("Curses::current_field", XS_Curses_current_field); + C_NEWXS("Curses::set_form_page", XS_Curses_set_form_page); + C_NEWXS("Curses::form_page", XS_Curses_form_page); + C_NEWXS("Curses::field_index", XS_Curses_field_index); + C_NEWXS("Curses::post_form", XS_Curses_post_form); + C_NEWXS("Curses::unpost_form", XS_Curses_unpost_form); + C_NEWXS("Curses::set_form_userptr", XS_Curses_set_form_userptr); + C_NEWXS("Curses::form_userptr", XS_Curses_form_userptr); + C_NEWXS("Curses::set_form_win", XS_Curses_set_form_win); + C_NEWXS("Curses::form_win", XS_Curses_form_win); + C_NEWXS("Curses::set_form_sub", XS_Curses_set_form_sub); + C_NEWXS("Curses::form_sub", XS_Curses_form_sub); + C_NEWXS("Curses::scale_form", XS_Curses_scale_form); + C_NEWXS("Curses::set_field_fore", XS_Curses_set_field_fore); + C_NEWXS("Curses::field_fore", XS_Curses_field_fore); + C_NEWXS("Curses::set_field_back", XS_Curses_set_field_back); + C_NEWXS("Curses::field_back", XS_Curses_field_back); + C_NEWXS("Curses::set_field_pad", XS_Curses_set_field_pad); + C_NEWXS("Curses::field_pad", XS_Curses_field_pad); + C_NEWXS("Curses::set_field_buffer", XS_Curses_set_field_buffer); + C_NEWXS("Curses::field_buffer", XS_Curses_field_buffer); + C_NEWXS("Curses::set_field_status", XS_Curses_set_field_status); + C_NEWXS("Curses::field_status", XS_Curses_field_status); + C_NEWXS("Curses::set_max_field", XS_Curses_set_max_field); + C_NEWXS("Curses::field_info", XS_Curses_field_info); + C_NEWXS("Curses::dynamic_field_info", XS_Curses_dynamic_field_info); + C_NEWXS("Curses::set_field_just", XS_Curses_set_field_just); + C_NEWXS("Curses::field_just", XS_Curses_field_just); + C_NEWXS("Curses::new_field", XS_Curses_new_field); + C_NEWXS("Curses::dup_field", XS_Curses_dup_field); + C_NEWXS("Curses::link_field", XS_Curses_link_field); + C_NEWXS("Curses::free_field", XS_Curses_free_field); + C_NEWXS("Curses::set_field_opts", XS_Curses_set_field_opts); + C_NEWXS("Curses::field_opts_on", XS_Curses_field_opts_on); + C_NEWXS("Curses::field_opts_off", XS_Curses_field_opts_off); + C_NEWXS("Curses::field_opts", XS_Curses_field_opts); + C_NEWXS("Curses::set_field_userptr", XS_Curses_set_field_userptr); + C_NEWXS("Curses::field_userptr", XS_Curses_field_userptr); + C_NEWXS("Curses::field_arg", XS_Curses_field_arg); + C_NEWXS("Curses::form_request_name", XS_Curses_form_request_name); + C_NEWXS("Curses::form_request_by_name", XS_Curses_form_request_by_name); + + /* Variables masquerading as functions */ + + C_NEWXS("Curses::LINES", XS_Curses_LINES); + C_NEWXS("Curses::COLS", XS_Curses_COLS); + C_NEWXS("Curses::stdscr", XS_Curses_stdscr); + C_NEWXS("Curses::curscr", XS_Curses_curscr); + C_NEWXS("Curses::COLORS", XS_Curses_COLORS); + C_NEWXS("Curses::COLOR_PAIRS", XS_Curses_COLOR_PAIRS); + + /* 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 */ + +#ifdef ERR + C_NEWCS("ERR", ERR); +#endif +#ifdef OK + C_NEWCS("OK", OK); +#endif + C_NEWXS("Curses::ACS_BLOCK", XS_Curses_ACS_BLOCK); + C_NEWXS("Curses::ACS_BOARD", XS_Curses_ACS_BOARD); + C_NEWXS("Curses::ACS_BTEE", XS_Curses_ACS_BTEE); + C_NEWXS("Curses::ACS_BULLET", XS_Curses_ACS_BULLET); + C_NEWXS("Curses::ACS_CKBOARD", XS_Curses_ACS_CKBOARD); + C_NEWXS("Curses::ACS_DARROW", XS_Curses_ACS_DARROW); + C_NEWXS("Curses::ACS_DEGREE", XS_Curses_ACS_DEGREE); + C_NEWXS("Curses::ACS_DIAMOND", XS_Curses_ACS_DIAMOND); + C_NEWXS("Curses::ACS_HLINE", XS_Curses_ACS_HLINE); + C_NEWXS("Curses::ACS_LANTERN", XS_Curses_ACS_LANTERN); + C_NEWXS("Curses::ACS_LARROW", XS_Curses_ACS_LARROW); + C_NEWXS("Curses::ACS_LLCORNER", XS_Curses_ACS_LLCORNER); + C_NEWXS("Curses::ACS_LRCORNER", XS_Curses_ACS_LRCORNER); + C_NEWXS("Curses::ACS_LTEE", XS_Curses_ACS_LTEE); + C_NEWXS("Curses::ACS_PLMINUS", XS_Curses_ACS_PLMINUS); + C_NEWXS("Curses::ACS_PLUS", XS_Curses_ACS_PLUS); + C_NEWXS("Curses::ACS_RARROW", XS_Curses_ACS_RARROW); + C_NEWXS("Curses::ACS_RTEE", XS_Curses_ACS_RTEE); + C_NEWXS("Curses::ACS_S1", XS_Curses_ACS_S1); + C_NEWXS("Curses::ACS_S9", XS_Curses_ACS_S9); + C_NEWXS("Curses::ACS_TTEE", XS_Curses_ACS_TTEE); + C_NEWXS("Curses::ACS_UARROW", XS_Curses_ACS_UARROW); + C_NEWXS("Curses::ACS_ULCORNER", XS_Curses_ACS_ULCORNER); + C_NEWXS("Curses::ACS_URCORNER", XS_Curses_ACS_URCORNER); + C_NEWXS("Curses::ACS_VLINE", XS_Curses_ACS_VLINE); +#ifdef A_ALTCHARSET + C_NEWCS("A_ALTCHARSET", A_ALTCHARSET); +#endif +#ifdef A_ATTRIBUTES + C_NEWCS("A_ATTRIBUTES", A_ATTRIBUTES); +#endif +#ifdef A_BLINK + C_NEWCS("A_BLINK", A_BLINK); +#endif +#ifdef A_BOLD + C_NEWCS("A_BOLD", A_BOLD); +#endif +#ifdef A_CHARTEXT + C_NEWCS("A_CHARTEXT", A_CHARTEXT); +#endif +#ifdef A_COLOR + C_NEWCS("A_COLOR", A_COLOR); +#endif +#ifdef A_DIM + C_NEWCS("A_DIM", A_DIM); +#endif +#ifdef A_INVIS + C_NEWCS("A_INVIS", A_INVIS); +#endif +#ifdef A_NORMAL + C_NEWCS("A_NORMAL", A_NORMAL); +#endif +#ifdef A_PROTECT + C_NEWCS("A_PROTECT", A_PROTECT); +#endif +#ifdef A_REVERSE + C_NEWCS("A_REVERSE", A_REVERSE); +#endif +#ifdef A_STANDOUT + C_NEWCS("A_STANDOUT", A_STANDOUT); +#endif +#ifdef A_UNDERLINE + C_NEWCS("A_UNDERLINE", A_UNDERLINE); +#endif +#ifdef COLOR_BLACK + C_NEWCS("COLOR_BLACK", COLOR_BLACK); +#endif +#ifdef COLOR_BLUE + C_NEWCS("COLOR_BLUE", COLOR_BLUE); +#endif +#ifdef COLOR_CYAN + C_NEWCS("COLOR_CYAN", COLOR_CYAN); +#endif +#ifdef COLOR_GREEN + C_NEWCS("COLOR_GREEN", COLOR_GREEN); +#endif +#ifdef COLOR_MAGENTA + C_NEWCS("COLOR_MAGENTA", COLOR_MAGENTA); +#endif +#ifdef COLOR_RED + C_NEWCS("COLOR_RED", COLOR_RED); +#endif +#ifdef COLOR_WHITE + C_NEWCS("COLOR_WHITE", COLOR_WHITE); +#endif +#ifdef COLOR_YELLOW + C_NEWCS("COLOR_YELLOW", COLOR_YELLOW); +#endif +#ifdef KEY_A1 + C_NEWCS("KEY_A1", KEY_A1); +#endif +#ifdef KEY_A3 + C_NEWCS("KEY_A3", KEY_A3); +#endif +#ifdef KEY_B2 + C_NEWCS("KEY_B2", KEY_B2); +#endif +#ifdef KEY_BACKSPACE + C_NEWCS("KEY_BACKSPACE", KEY_BACKSPACE); +#endif +#ifdef KEY_BEG + C_NEWCS("KEY_BEG", KEY_BEG); +#endif +#ifdef KEY_BREAK + C_NEWCS("KEY_BREAK", KEY_BREAK); +#endif +#ifdef KEY_BTAB + C_NEWCS("KEY_BTAB", KEY_BTAB); +#endif +#ifdef KEY_C1 + C_NEWCS("KEY_C1", KEY_C1); +#endif +#ifdef KEY_C3 + C_NEWCS("KEY_C3", KEY_C3); +#endif +#ifdef KEY_CANCEL + C_NEWCS("KEY_CANCEL", KEY_CANCEL); +#endif +#ifdef KEY_CATAB + C_NEWCS("KEY_CATAB", KEY_CATAB); +#endif +#ifdef KEY_CLEAR + C_NEWCS("KEY_CLEAR", KEY_CLEAR); +#endif +#ifdef KEY_CLOSE + C_NEWCS("KEY_CLOSE", KEY_CLOSE); +#endif +#ifdef KEY_COMMAND + C_NEWCS("KEY_COMMAND", KEY_COMMAND); +#endif +#ifdef KEY_COPY + C_NEWCS("KEY_COPY", KEY_COPY); +#endif +#ifdef KEY_CREATE + C_NEWCS("KEY_CREATE", KEY_CREATE); +#endif +#ifdef KEY_CTAB + C_NEWCS("KEY_CTAB", KEY_CTAB); +#endif +#ifdef KEY_DC + C_NEWCS("KEY_DC", KEY_DC); +#endif +#ifdef KEY_DL + C_NEWCS("KEY_DL", KEY_DL); +#endif +#ifdef KEY_DOWN + C_NEWCS("KEY_DOWN", KEY_DOWN); +#endif +#ifdef KEY_EIC + C_NEWCS("KEY_EIC", KEY_EIC); +#endif +#ifdef KEY_END + C_NEWCS("KEY_END", KEY_END); +#endif +#ifdef KEY_ENTER + C_NEWCS("KEY_ENTER", KEY_ENTER); +#endif +#ifdef KEY_EOL + C_NEWCS("KEY_EOL", KEY_EOL); +#endif +#ifdef KEY_EOS + C_NEWCS("KEY_EOS", KEY_EOS); +#endif +#ifdef KEY_EXIT + C_NEWCS("KEY_EXIT", KEY_EXIT); +#endif +#ifdef KEY_F0 + C_NEWCS("KEY_F0", KEY_F0); +#endif +#ifdef KEY_FIND + C_NEWCS("KEY_FIND", KEY_FIND); +#endif +#ifdef KEY_HELP + C_NEWCS("KEY_HELP", KEY_HELP); +#endif +#ifdef KEY_HOME + C_NEWCS("KEY_HOME", KEY_HOME); +#endif +#ifdef KEY_IC + C_NEWCS("KEY_IC", KEY_IC); +#endif +#ifdef KEY_IL + C_NEWCS("KEY_IL", KEY_IL); +#endif +#ifdef KEY_LEFT + C_NEWCS("KEY_LEFT", KEY_LEFT); +#endif +#ifdef KEY_LL + C_NEWCS("KEY_LL", KEY_LL); +#endif +#ifdef KEY_MARK + C_NEWCS("KEY_MARK", KEY_MARK); +#endif +#ifdef KEY_MAX + C_NEWCS("KEY_MAX", KEY_MAX); +#endif +#ifdef KEY_MESSAGE + C_NEWCS("KEY_MESSAGE", KEY_MESSAGE); +#endif +#ifdef KEY_MIN + C_NEWCS("KEY_MIN", KEY_MIN); +#endif +#ifdef KEY_MOVE + C_NEWCS("KEY_MOVE", KEY_MOVE); +#endif +#ifdef KEY_NEXT + C_NEWCS("KEY_NEXT", KEY_NEXT); +#endif +#ifdef KEY_NPAGE + C_NEWCS("KEY_NPAGE", KEY_NPAGE); +#endif +#ifdef KEY_OPEN + C_NEWCS("KEY_OPEN", KEY_OPEN); +#endif +#ifdef KEY_OPTIONS + C_NEWCS("KEY_OPTIONS", KEY_OPTIONS); +#endif +#ifdef KEY_PPAGE + C_NEWCS("KEY_PPAGE", KEY_PPAGE); +#endif +#ifdef KEY_PREVIOUS + C_NEWCS("KEY_PREVIOUS", KEY_PREVIOUS); +#endif +#ifdef KEY_PRINT + C_NEWCS("KEY_PRINT", KEY_PRINT); +#endif +#ifdef KEY_REDO + C_NEWCS("KEY_REDO", KEY_REDO); +#endif +#ifdef KEY_REFERENCE + C_NEWCS("KEY_REFERENCE", KEY_REFERENCE); +#endif +#ifdef KEY_REFRESH + C_NEWCS("KEY_REFRESH", KEY_REFRESH); +#endif +#ifdef KEY_REPLACE + C_NEWCS("KEY_REPLACE", KEY_REPLACE); +#endif +#ifdef KEY_RESET + C_NEWCS("KEY_RESET", KEY_RESET); +#endif +#ifdef KEY_RESTART + C_NEWCS("KEY_RESTART", KEY_RESTART); +#endif +#ifdef KEY_RESUME + C_NEWCS("KEY_RESUME", KEY_RESUME); +#endif +#ifdef KEY_RIGHT + C_NEWCS("KEY_RIGHT", KEY_RIGHT); +#endif +#ifdef KEY_SAVE + C_NEWCS("KEY_SAVE", KEY_SAVE); +#endif +#ifdef KEY_SBEG + C_NEWCS("KEY_SBEG", KEY_SBEG); +#endif +#ifdef KEY_SCANCEL + C_NEWCS("KEY_SCANCEL", KEY_SCANCEL); +#endif +#ifdef KEY_SCOMMAND + C_NEWCS("KEY_SCOMMAND", KEY_SCOMMAND); +#endif +#ifdef KEY_SCOPY + C_NEWCS("KEY_SCOPY", KEY_SCOPY); +#endif +#ifdef KEY_SCREATE + C_NEWCS("KEY_SCREATE", KEY_SCREATE); +#endif +#ifdef KEY_SDC + C_NEWCS("KEY_SDC", KEY_SDC); +#endif +#ifdef KEY_SDL + C_NEWCS("KEY_SDL", KEY_SDL); +#endif +#ifdef KEY_SELECT + C_NEWCS("KEY_SELECT", KEY_SELECT); +#endif +#ifdef KEY_SEND + C_NEWCS("KEY_SEND", KEY_SEND); +#endif +#ifdef KEY_SEOL + C_NEWCS("KEY_SEOL", KEY_SEOL); +#endif +#ifdef KEY_SEXIT + C_NEWCS("KEY_SEXIT", KEY_SEXIT); +#endif +#ifdef KEY_SF + C_NEWCS("KEY_SF", KEY_SF); +#endif +#ifdef KEY_SFIND + C_NEWCS("KEY_SFIND", KEY_SFIND); +#endif +#ifdef KEY_SHELP + C_NEWCS("KEY_SHELP", KEY_SHELP); +#endif +#ifdef KEY_SHOME + C_NEWCS("KEY_SHOME", KEY_SHOME); +#endif +#ifdef KEY_SIC + C_NEWCS("KEY_SIC", KEY_SIC); +#endif +#ifdef KEY_SLEFT + C_NEWCS("KEY_SLEFT", KEY_SLEFT); +#endif +#ifdef KEY_SMESSAGE + C_NEWCS("KEY_SMESSAGE", KEY_SMESSAGE); +#endif +#ifdef KEY_SMOVE + C_NEWCS("KEY_SMOVE", KEY_SMOVE); +#endif +#ifdef KEY_SNEXT + C_NEWCS("KEY_SNEXT", KEY_SNEXT); +#endif +#ifdef KEY_SOPTIONS + C_NEWCS("KEY_SOPTIONS", KEY_SOPTIONS); +#endif +#ifdef KEY_SPREVIOUS + C_NEWCS("KEY_SPREVIOUS", KEY_SPREVIOUS); +#endif +#ifdef KEY_SPRINT + C_NEWCS("KEY_SPRINT", KEY_SPRINT); +#endif +#ifdef KEY_SR + C_NEWCS("KEY_SR", KEY_SR); +#endif +#ifdef KEY_SREDO + C_NEWCS("KEY_SREDO", KEY_SREDO); +#endif +#ifdef KEY_SREPLACE + C_NEWCS("KEY_SREPLACE", KEY_SREPLACE); +#endif +#ifdef KEY_SRESET + C_NEWCS("KEY_SRESET", KEY_SRESET); +#endif +#ifdef KEY_SRIGHT + C_NEWCS("KEY_SRIGHT", KEY_SRIGHT); +#endif +#ifdef KEY_SRSUME + C_NEWCS("KEY_SRSUME", KEY_SRSUME); +#endif +#ifdef KEY_SSAVE + C_NEWCS("KEY_SSAVE", KEY_SSAVE); +#endif +#ifdef KEY_SSUSPEND + C_NEWCS("KEY_SSUSPEND", KEY_SSUSPEND); +#endif +#ifdef KEY_STAB + C_NEWCS("KEY_STAB", KEY_STAB); +#endif +#ifdef KEY_SUNDO + C_NEWCS("KEY_SUNDO", KEY_SUNDO); +#endif +#ifdef KEY_SUSPEND + C_NEWCS("KEY_SUSPEND", KEY_SUSPEND); +#endif +#ifdef KEY_UNDO + C_NEWCS("KEY_UNDO", KEY_UNDO); +#endif +#ifdef KEY_UP + C_NEWCS("KEY_UP", KEY_UP); +#endif +#ifdef KEY_MOUSE + C_NEWCS("KEY_MOUSE", KEY_MOUSE); +#endif +#ifdef BUTTON1_RELEASED + C_NEWCS("BUTTON1_RELEASED", BUTTON1_RELEASED); +#endif +#ifdef BUTTON1_PRESSED + C_NEWCS("BUTTON1_PRESSED", BUTTON1_PRESSED); +#endif +#ifdef BUTTON1_CLICKED + C_NEWCS("BUTTON1_CLICKED", BUTTON1_CLICKED); +#endif +#ifdef BUTTON1_DOUBLE_CLICKED + C_NEWCS("BUTTON1_DOUBLE_CLICKED", BUTTON1_DOUBLE_CLICKED); +#endif +#ifdef BUTTON1_TRIPLE_CLICKED + C_NEWCS("BUTTON1_TRIPLE_CLICKED", BUTTON1_TRIPLE_CLICKED); +#endif +#ifdef BUTTON1_RESERVED_EVENT + C_NEWCS("BUTTON1_RESERVED_EVENT", BUTTON1_RESERVED_EVENT); +#endif +#ifdef BUTTON2_RELEASED + C_NEWCS("BUTTON2_RELEASED", BUTTON2_RELEASED); +#endif +#ifdef BUTTON2_PRESSED + C_NEWCS("BUTTON2_PRESSED", BUTTON2_PRESSED); +#endif +#ifdef BUTTON2_CLICKED + C_NEWCS("BUTTON2_CLICKED", BUTTON2_CLICKED); +#endif +#ifdef BUTTON2_DOUBLE_CLICKED + C_NEWCS("BUTTON2_DOUBLE_CLICKED", BUTTON2_DOUBLE_CLICKED); +#endif +#ifdef BUTTON2_TRIPLE_CLICKED + C_NEWCS("BUTTON2_TRIPLE_CLICKED", BUTTON2_TRIPLE_CLICKED); +#endif +#ifdef BUTTON2_RESERVED_EVENT + C_NEWCS("BUTTON2_RESERVED_EVENT", BUTTON2_RESERVED_EVENT); +#endif +#ifdef BUTTON3_RELEASED + C_NEWCS("BUTTON3_RELEASED", BUTTON3_RELEASED); +#endif +#ifdef BUTTON3_PRESSED + C_NEWCS("BUTTON3_PRESSED", BUTTON3_PRESSED); +#endif +#ifdef BUTTON3_CLICKED + C_NEWCS("BUTTON3_CLICKED", BUTTON3_CLICKED); +#endif +#ifdef BUTTON3_DOUBLE_CLICKED + C_NEWCS("BUTTON3_DOUBLE_CLICKED", BUTTON3_DOUBLE_CLICKED); +#endif +#ifdef BUTTON3_TRIPLE_CLICKED + C_NEWCS("BUTTON3_TRIPLE_CLICKED", BUTTON3_TRIPLE_CLICKED); +#endif +#ifdef BUTTON3_RESERVED_EVENT + C_NEWCS("BUTTON3_RESERVED_EVENT", BUTTON3_RESERVED_EVENT); +#endif +#ifdef BUTTON4_RELEASED + C_NEWCS("BUTTON4_RELEASED", BUTTON4_RELEASED); +#endif +#ifdef BUTTON4_PRESSED + C_NEWCS("BUTTON4_PRESSED", BUTTON4_PRESSED); +#endif +#ifdef BUTTON4_CLICKED + C_NEWCS("BUTTON4_CLICKED", BUTTON4_CLICKED); +#endif +#ifdef BUTTON4_DOUBLE_CLICKED + C_NEWCS("BUTTON4_DOUBLE_CLICKED", BUTTON4_DOUBLE_CLICKED); +#endif +#ifdef BUTTON4_TRIPLE_CLICKED + C_NEWCS("BUTTON4_TRIPLE_CLICKED", BUTTON4_TRIPLE_CLICKED); +#endif +#ifdef BUTTON4_RESERVED_EVENT + C_NEWCS("BUTTON4_RESERVED_EVENT", BUTTON4_RESERVED_EVENT); +#endif +#ifdef BUTTON_CTRL + C_NEWCS("BUTTON_CTRL", BUTTON_CTRL); +#endif +#ifdef BUTTON_SHIFT + C_NEWCS("BUTTON_SHIFT", BUTTON_SHIFT); +#endif +#ifdef BUTTON_ALT + C_NEWCS("BUTTON_ALT", BUTTON_ALT); +#endif +#ifdef ALL_MOUSE_EVENTS + C_NEWCS("ALL_MOUSE_EVENTS", ALL_MOUSE_EVENTS); +#endif +#ifdef REPORT_MOUSE_POSITION + C_NEWCS("REPORT_MOUSE_POSITION", REPORT_MOUSE_POSITION); +#endif +#ifdef NCURSES_MOUSE_VERSION + C_NEWCS("NCURSES_MOUSE_VERSION", NCURSES_MOUSE_VERSION); +#endif +#ifdef E_OK + C_NEWCS("E_OK", E_OK); +#endif +#ifdef E_SYSTEM_ERROR + C_NEWCS("E_SYSTEM_ERROR", E_SYSTEM_ERROR); +#endif +#ifdef E_BAD_ARGUMENT + C_NEWCS("E_BAD_ARGUMENT", E_BAD_ARGUMENT); +#endif +#ifdef E_POSTED + C_NEWCS("E_POSTED", E_POSTED); +#endif +#ifdef E_CONNECTED + C_NEWCS("E_CONNECTED", E_CONNECTED); +#endif +#ifdef E_BAD_STATE + C_NEWCS("E_BAD_STATE", E_BAD_STATE); +#endif +#ifdef E_NO_ROOM + C_NEWCS("E_NO_ROOM", E_NO_ROOM); +#endif +#ifdef E_NOT_POSTED + C_NEWCS("E_NOT_POSTED", E_NOT_POSTED); +#endif +#ifdef E_UNKNOWN_COMMAND + C_NEWCS("E_UNKNOWN_COMMAND", E_UNKNOWN_COMMAND); +#endif +#ifdef E_NO_MATCH + C_NEWCS("E_NO_MATCH", E_NO_MATCH); +#endif +#ifdef E_NOT_SELECTABLE + C_NEWCS("E_NOT_SELECTABLE", E_NOT_SELECTABLE); +#endif +#ifdef E_NOT_CONNECTED + C_NEWCS("E_NOT_CONNECTED", E_NOT_CONNECTED); +#endif +#ifdef E_REQUEST_DENIED + C_NEWCS("E_REQUEST_DENIED", E_REQUEST_DENIED); +#endif +#ifdef E_INVALID_FIELD + C_NEWCS("E_INVALID_FIELD", E_INVALID_FIELD); +#endif +#ifdef E_CURRENT + C_NEWCS("E_CURRENT", E_CURRENT); +#endif +#ifdef REQ_LEFT_ITEM + C_NEWCS("REQ_LEFT_ITEM", REQ_LEFT_ITEM); +#endif +#ifdef REQ_RIGHT_ITEM + C_NEWCS("REQ_RIGHT_ITEM", REQ_RIGHT_ITEM); +#endif +#ifdef REQ_UP_ITEM + C_NEWCS("REQ_UP_ITEM", REQ_UP_ITEM); +#endif +#ifdef REQ_DOWN_ITEM + C_NEWCS("REQ_DOWN_ITEM", REQ_DOWN_ITEM); +#endif +#ifdef REQ_SCR_ULINE + C_NEWCS("REQ_SCR_ULINE", REQ_SCR_ULINE); +#endif +#ifdef REQ_SCR_DLINE + C_NEWCS("REQ_SCR_DLINE", REQ_SCR_DLINE); +#endif +#ifdef REQ_SCR_DPAGE + C_NEWCS("REQ_SCR_DPAGE", REQ_SCR_DPAGE); +#endif +#ifdef REQ_SCR_UPAGE + C_NEWCS("REQ_SCR_UPAGE", REQ_SCR_UPAGE); +#endif +#ifdef REQ_FIRST_ITEM + C_NEWCS("REQ_FIRST_ITEM", REQ_FIRST_ITEM); +#endif +#ifdef REQ_LAST_ITEM + C_NEWCS("REQ_LAST_ITEM", REQ_LAST_ITEM); +#endif +#ifdef REQ_NEXT_ITEM + C_NEWCS("REQ_NEXT_ITEM", REQ_NEXT_ITEM); +#endif +#ifdef REQ_PREV_ITEM + C_NEWCS("REQ_PREV_ITEM", REQ_PREV_ITEM); +#endif +#ifdef REQ_TOGGLE_ITEM + C_NEWCS("REQ_TOGGLE_ITEM", REQ_TOGGLE_ITEM); +#endif +#ifdef REQ_CLEAR_PATTERN + C_NEWCS("REQ_CLEAR_PATTERN", REQ_CLEAR_PATTERN); +#endif +#ifdef REQ_BACK_PATTERN + C_NEWCS("REQ_BACK_PATTERN", REQ_BACK_PATTERN); +#endif +#ifdef REQ_NEXT_MATCH + C_NEWCS("REQ_NEXT_MATCH", REQ_NEXT_MATCH); +#endif +#ifdef REQ_PREV_MATCH + C_NEWCS("REQ_PREV_MATCH", REQ_PREV_MATCH); +#endif +#ifdef MIN_MENU_COMMAND + C_NEWCS("MIN_MENU_COMMAND", MIN_MENU_COMMAND); +#endif +#ifdef MAX_MENU_COMMAND + C_NEWCS("MAX_MENU_COMMAND", MAX_MENU_COMMAND); +#endif +#ifdef O_ONEVALUE + C_NEWCS("O_ONEVALUE", O_ONEVALUE); +#endif +#ifdef O_SHOWDESC + C_NEWCS("O_SHOWDESC", O_SHOWDESC); +#endif +#ifdef O_ROWMAJOR + C_NEWCS("O_ROWMAJOR", O_ROWMAJOR); +#endif +#ifdef O_IGNORECASE + C_NEWCS("O_IGNORECASE", O_IGNORECASE); +#endif +#ifdef O_SHOWMATCH + C_NEWCS("O_SHOWMATCH", O_SHOWMATCH); +#endif +#ifdef O_NONCYCLIC + C_NEWCS("O_NONCYCLIC", O_NONCYCLIC); +#endif +#ifdef O_SELECTABLE + C_NEWCS("O_SELECTABLE", O_SELECTABLE); +#endif +#ifdef REQ_NEXT_PAGE + C_NEWCS("REQ_NEXT_PAGE", REQ_NEXT_PAGE); +#endif +#ifdef REQ_PREV_PAGE + C_NEWCS("REQ_PREV_PAGE", REQ_PREV_PAGE); +#endif +#ifdef REQ_FIRST_PAGE + C_NEWCS("REQ_FIRST_PAGE", REQ_FIRST_PAGE); +#endif +#ifdef REQ_LAST_PAGE + C_NEWCS("REQ_LAST_PAGE", REQ_LAST_PAGE); +#endif +#ifdef REQ_NEXT_FIELD + C_NEWCS("REQ_NEXT_FIELD", REQ_NEXT_FIELD); +#endif +#ifdef REQ_PREV_FIELD + C_NEWCS("REQ_PREV_FIELD", REQ_PREV_FIELD); +#endif +#ifdef REQ_FIRST_FIELD + C_NEWCS("REQ_FIRST_FIELD", REQ_FIRST_FIELD); +#endif +#ifdef REQ_LAST_FIELD + C_NEWCS("REQ_LAST_FIELD", REQ_LAST_FIELD); +#endif +#ifdef REQ_SNEXT_FIELD + C_NEWCS("REQ_SNEXT_FIELD", REQ_SNEXT_FIELD); +#endif +#ifdef REQ_SPREV_FIELD + C_NEWCS("REQ_SPREV_FIELD", REQ_SPREV_FIELD); +#endif +#ifdef REQ_SFIRST_FIELD + C_NEWCS("REQ_SFIRST_FIELD", REQ_SFIRST_FIELD); +#endif +#ifdef REQ_SLAST_FIELD + C_NEWCS("REQ_SLAST_FIELD", REQ_SLAST_FIELD); +#endif +#ifdef REQ_LEFT_FIELD + C_NEWCS("REQ_LEFT_FIELD", REQ_LEFT_FIELD); +#endif +#ifdef REQ_RIGHT_FIELD + C_NEWCS("REQ_RIGHT_FIELD", REQ_RIGHT_FIELD); +#endif +#ifdef REQ_UP_FIELD + C_NEWCS("REQ_UP_FIELD", REQ_UP_FIELD); +#endif +#ifdef REQ_DOWN_FIELD + C_NEWCS("REQ_DOWN_FIELD", REQ_DOWN_FIELD); +#endif +#ifdef REQ_NEXT_CHAR + C_NEWCS("REQ_NEXT_CHAR", REQ_NEXT_CHAR); +#endif +#ifdef REQ_PREV_CHAR + C_NEWCS("REQ_PREV_CHAR", REQ_PREV_CHAR); +#endif +#ifdef REQ_NEXT_LINE + C_NEWCS("REQ_NEXT_LINE", REQ_NEXT_LINE); +#endif +#ifdef REQ_PREV_LINE + C_NEWCS("REQ_PREV_LINE", REQ_PREV_LINE); +#endif +#ifdef REQ_NEXT_WORD + C_NEWCS("REQ_NEXT_WORD", REQ_NEXT_WORD); +#endif +#ifdef REQ_PREV_WORD + C_NEWCS("REQ_PREV_WORD", REQ_PREV_WORD); +#endif +#ifdef REQ_BEG_FIELD + C_NEWCS("REQ_BEG_FIELD", REQ_BEG_FIELD); +#endif +#ifdef REQ_END_FIELD + C_NEWCS("REQ_END_FIELD", REQ_END_FIELD); +#endif +#ifdef REQ_BEG_LINE + C_NEWCS("REQ_BEG_LINE", REQ_BEG_LINE); +#endif +#ifdef REQ_END_LINE + C_NEWCS("REQ_END_LINE", REQ_END_LINE); +#endif +#ifdef REQ_LEFT_CHAR + C_NEWCS("REQ_LEFT_CHAR", REQ_LEFT_CHAR); +#endif +#ifdef REQ_RIGHT_CHAR + C_NEWCS("REQ_RIGHT_CHAR", REQ_RIGHT_CHAR); +#endif +#ifdef REQ_UP_CHAR + C_NEWCS("REQ_UP_CHAR", REQ_UP_CHAR); +#endif +#ifdef REQ_DOWN_CHAR + C_NEWCS("REQ_DOWN_CHAR", REQ_DOWN_CHAR); +#endif +#ifdef REQ_NEW_LINE + C_NEWCS("REQ_NEW_LINE", REQ_NEW_LINE); +#endif +#ifdef REQ_INS_CHAR + C_NEWCS("REQ_INS_CHAR", REQ_INS_CHAR); +#endif +#ifdef REQ_INS_LINE + C_NEWCS("REQ_INS_LINE", REQ_INS_LINE); +#endif +#ifdef REQ_DEL_CHAR + C_NEWCS("REQ_DEL_CHAR", REQ_DEL_CHAR); +#endif +#ifdef REQ_DEL_PREV + C_NEWCS("REQ_DEL_PREV", REQ_DEL_PREV); +#endif +#ifdef REQ_DEL_LINE + C_NEWCS("REQ_DEL_LINE", REQ_DEL_LINE); +#endif +#ifdef REQ_DEL_WORD + C_NEWCS("REQ_DEL_WORD", REQ_DEL_WORD); +#endif +#ifdef REQ_CLR_EOL + C_NEWCS("REQ_CLR_EOL", REQ_CLR_EOL); +#endif +#ifdef REQ_CLR_EOF + C_NEWCS("REQ_CLR_EOF", REQ_CLR_EOF); +#endif +#ifdef REQ_CLR_FIELD + C_NEWCS("REQ_CLR_FIELD", REQ_CLR_FIELD); +#endif +#ifdef REQ_OVL_MODE + C_NEWCS("REQ_OVL_MODE", REQ_OVL_MODE); +#endif +#ifdef REQ_INS_MODE + C_NEWCS("REQ_INS_MODE", REQ_INS_MODE); +#endif +#ifdef REQ_SCR_FLINE + C_NEWCS("REQ_SCR_FLINE", REQ_SCR_FLINE); +#endif +#ifdef REQ_SCR_BLINE + C_NEWCS("REQ_SCR_BLINE", REQ_SCR_BLINE); +#endif +#ifdef REQ_SCR_FPAGE + C_NEWCS("REQ_SCR_FPAGE", REQ_SCR_FPAGE); +#endif +#ifdef REQ_SCR_BPAGE + C_NEWCS("REQ_SCR_BPAGE", REQ_SCR_BPAGE); +#endif +#ifdef REQ_SCR_FHPAGE + C_NEWCS("REQ_SCR_FHPAGE", REQ_SCR_FHPAGE); +#endif +#ifdef REQ_SCR_BHPAGE + C_NEWCS("REQ_SCR_BHPAGE", REQ_SCR_BHPAGE); +#endif +#ifdef REQ_SCR_FCHAR + C_NEWCS("REQ_SCR_FCHAR", REQ_SCR_FCHAR); +#endif +#ifdef REQ_SCR_BCHAR + C_NEWCS("REQ_SCR_BCHAR", REQ_SCR_BCHAR); +#endif +#ifdef REQ_SCR_HFLINE + C_NEWCS("REQ_SCR_HFLINE", REQ_SCR_HFLINE); +#endif +#ifdef REQ_SCR_HBLINE + C_NEWCS("REQ_SCR_HBLINE", REQ_SCR_HBLINE); +#endif +#ifdef REQ_SCR_HFHALF + C_NEWCS("REQ_SCR_HFHALF", REQ_SCR_HFHALF); +#endif +#ifdef REQ_SCR_HBHALF + C_NEWCS("REQ_SCR_HBHALF", REQ_SCR_HBHALF); +#endif +#ifdef REQ_VALIDATION + C_NEWCS("REQ_VALIDATION", REQ_VALIDATION); +#endif +#ifdef REQ_NEXT_CHOICE + C_NEWCS("REQ_NEXT_CHOICE", REQ_NEXT_CHOICE); +#endif +#ifdef REQ_PREV_CHOICE + C_NEWCS("REQ_PREV_CHOICE", REQ_PREV_CHOICE); +#endif +#ifdef MIN_FORM_COMMAND + C_NEWCS("MIN_FORM_COMMAND", MIN_FORM_COMMAND); +#endif +#ifdef MAX_FORM_COMMAND + C_NEWCS("MAX_FORM_COMMAND", MAX_FORM_COMMAND); +#endif +#ifdef NO_JUSTIFICATION + C_NEWCS("NO_JUSTIFICATION", NO_JUSTIFICATION); +#endif +#ifdef JUSTIFY_LEFT + C_NEWCS("JUSTIFY_LEFT", JUSTIFY_LEFT); +#endif +#ifdef JUSTIFY_CENTER + C_NEWCS("JUSTIFY_CENTER", JUSTIFY_CENTER); +#endif +#ifdef JUSTIFY_RIGHT + C_NEWCS("JUSTIFY_RIGHT", JUSTIFY_RIGHT); +#endif +#ifdef O_VISIBLE + C_NEWCS("O_VISIBLE", O_VISIBLE); +#endif +#ifdef O_ACTIVE + C_NEWCS("O_ACTIVE", O_ACTIVE); +#endif +#ifdef O_PUBLIC + C_NEWCS("O_PUBLIC", O_PUBLIC); +#endif +#ifdef O_EDIT + C_NEWCS("O_EDIT", O_EDIT); +#endif +#ifdef O_WRAP + C_NEWCS("O_WRAP", O_WRAP); +#endif +#ifdef O_BLANK + C_NEWCS("O_BLANK", O_BLANK); +#endif +#ifdef O_AUTOSKIP + C_NEWCS("O_AUTOSKIP", O_AUTOSKIP); +#endif +#ifdef O_NULLOK + C_NEWCS("O_NULLOK", O_NULLOK); +#endif +#ifdef O_PASSOK + C_NEWCS("O_PASSOK", O_PASSOK); +#endif +#ifdef O_STATIC + C_NEWCS("O_STATIC", O_STATIC); +#endif +#ifdef O_NL_OVERLOAD + C_NEWCS("O_NL_OVERLOAD", O_NL_OVERLOAD); +#endif +#ifdef O_BS_OVERLOAD + C_NEWCS("O_BS_OVERLOAD", O_BS_OVERLOAD); +#endif + + /* traceon(); */ + ST(0) = &PL_sv_yes; + XSRETURN(1); +} diff --git a/Curses-1.23/CursesCon.c b/Curses-1.23/CursesCon.c new file mode 100644 index 0000000..a5cafa1 --- /dev/null +++ b/Curses-1.23/CursesCon.c @@ -0,0 +1,436 @@ +/* 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 +} + diff --git a/Curses-1.23/CursesFun.c b/Curses-1.23/CursesFun.c new file mode 100644 index 0000000..8f73899 --- /dev/null +++ b/Curses-1.23/CursesFun.c @@ -0,0 +1,6949 @@ +/* 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. +*/ + +/* curs_addch */ + +XS(XS_Curses_addch) +{ + dXSARGS; +#ifdef C_ADDCH + c_countargs("addch", items, 1); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + chtype ch = c_sv2chtype(ST(c_arg)); + int ret = c_mret == ERR ? ERR : waddch(win, ch); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("addch"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_echochar) +{ + dXSARGS; +#ifdef C_ECHOCHAR + c_countargs("echochar", items, 1); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + chtype ch = c_sv2chtype(ST(c_arg)); + int ret = c_mret == ERR ? ERR : wechochar(win, ch); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("echochar"); + XSRETURN(0); +#endif +} + + +/* curs_addchstr */ + +XS(XS_Curses_addchstr) +{ + dXSARGS; +#ifdef C_ADDCHSTR + c_countargs("addchstr", items, 1); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + chtype *str = (chtype *)SvPV_nolen(ST(c_arg)); + int ret = c_mret == ERR ? ERR : waddchstr(win, str); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("addchstr"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_addchnstr) +{ + dXSARGS; +#ifdef C_ADDCHNSTR + c_countargs("addchnstr", items, 2); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + chtype *str = (chtype *)SvPV_nolen(ST(c_arg)); + int n = (int)SvIV(ST(c_arg+1)); + int ret = c_mret == ERR ? ERR : waddchnstr(win, str, n); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("addchnstr"); + XSRETURN(0); +#endif +} + + +/* curs_addstr */ + +XS(XS_Curses_addstr) +{ + dXSARGS; +#ifdef C_ADDSTR + c_countargs("addstr", items, 1); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + char * str = (char *)SvPV_nolen(ST(c_arg)); + int ret = c_mret == ERR ? ERR : waddstr(win, str); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("addstr"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_addnstr) +{ + dXSARGS; +#ifdef C_ADDNSTR + c_countargs("addnstr", items, 2); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + char * str = (char *)SvPV_nolen(ST(c_arg)); + int n = (int)SvIV(ST(c_arg+1)); + int ret = c_mret == ERR ? ERR : waddnstr(win, str, n); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("addnstr"); + XSRETURN(0); +#endif +} + + +/* curs_attr */ + +XS(XS_Curses_attroff) +{ + dXSARGS; +#ifdef C_ATTROFF + c_countargs("attroff", items, 1); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int attrs = (int)SvIV(ST(c_arg)); + int ret = c_mret == ERR ? ERR : wattroff(win, attrs); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("attroff"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_attron) +{ + dXSARGS; +#ifdef C_ATTRON + c_countargs("attron", items, 1); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int attrs = (int)SvIV(ST(c_arg)); + int ret = c_mret == ERR ? ERR : wattron(win, attrs); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("attron"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_attrset) +{ + dXSARGS; +#ifdef C_ATTRSET + c_countargs("attrset", items, 1); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int attrs = (int)SvIV(ST(c_arg)); + int ret = c_mret == ERR ? ERR : wattrset(win, attrs); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("attrset"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_standend) +{ + dXSARGS; +#ifdef C_STANDEND + c_countargs("standend", items, 0); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int ret = c_mret == ERR ? ERR : (int)wstandend(win); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("standend"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_standout) +{ + dXSARGS; +#ifdef C_STANDOUT + c_countargs("standout", items, 0); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int ret = c_mret == ERR ? ERR : (int)wstandout(win); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("standout"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_attr_get) +{ + dXSARGS; +#ifdef C_ATTR_GET + c_countargs("attr_get", items, 3); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + attr_t attrs = 0; + short color = 0; + void * opts = 0; + int ret = c_mret == ERR ? ERR : wattr_get(win, &attrs, &color, opts); + + sv_setiv(ST(c_arg), (IV)attrs);; + sv_setiv(ST(c_arg+1), (IV)color);; + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("attr_get"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_attr_off) +{ + dXSARGS; +#ifdef C_ATTR_OFF + c_countargs("attr_off", items, 2); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + attr_t attrs = (attr_t)SvIV(ST(c_arg)); + void * opts = 0; + int ret = c_mret == ERR ? ERR : wattr_off(win, attrs, opts); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("attr_off"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_attr_on) +{ + dXSARGS; +#ifdef C_ATTR_ON + c_countargs("attr_on", items, 2); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + attr_t attrs = (attr_t)SvIV(ST(c_arg)); + void * opts = 0; + int ret = c_mret == ERR ? ERR : wattr_on(win, attrs, opts); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("attr_on"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_attr_set) +{ + dXSARGS; +#ifdef C_ATTR_SET + c_countargs("attr_set", items, 3); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + attr_t attrs = (attr_t)SvIV(ST(c_arg)); + short color = (short)SvIV(ST(c_arg+1)); + void * opts = 0; + int ret = c_mret == ERR ? ERR : wattr_set(win, attrs, color, opts); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("attr_set"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_chgat) +{ + dXSARGS; +#ifdef C_CHGAT + /* Our 4th argument is meaningless. It mirrors the meaningless "opts" + argument in the Curses C library. + + In Perl Curses 1.16, we tried reducing this to 3 as a user thought + a 3-argument call ought to work, and we thought this number might + just be the _minimum_ argument count. Well, it's not. So for + backward compatibility if nothing else, it has to be 4. Fixed + back to 4 in 1.18. + */ + c_countargs("chgat", items, 4); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int n = (int)SvIV(ST(c_arg)); + attr_t attrs = (attr_t)SvIV(ST(c_arg+1)); + short color = (short)SvIV(ST(c_arg+2)); + void * opts = 0; + int ret = c_mret == ERR ? ERR : wchgat(win, n, attrs, color, opts); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("chgat"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_COLOR_PAIR) +{ + dXSARGS; +#ifdef C_COLOR_PAIR + c_exactargs("COLOR_PAIR", items, 1); + { + int n = (int)SvIV(ST(0)); + int ret = COLOR_PAIR(n); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("COLOR_PAIR"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_PAIR_NUMBER) +{ + dXSARGS; +#ifdef C_PAIR_NUMBER + c_exactargs("PAIR_NUMBER", items, 1); + { + int attrs = (int)SvIV(ST(0)); + int ret = PAIR_NUMBER(attrs); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("PAIR_NUMBER"); + XSRETURN(0); +#endif +} + + +/* curs_beep */ + +XS(XS_Curses_beep) +{ + dXSARGS; +#ifdef C_BEEP + c_exactargs("beep", items, 0); + { + int ret = beep(); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("beep"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_flash) +{ + dXSARGS; +#ifdef C_FLASH + c_exactargs("flash", items, 0); + { + int ret = flash(); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("flash"); + XSRETURN(0); +#endif +} + + +/* curs_bkgd */ + +XS(XS_Curses_bkgd) +{ + dXSARGS; +#ifdef C_BKGD + c_countargs("bkgd", items, 1); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + chtype ch = c_sv2chtype(ST(c_arg)); + int ret = c_mret == ERR ? ERR : wbkgd(win, ch); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("bkgd"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_bkgdset) +{ + dXSARGS; +#ifdef C_BKGDSET + c_countargs("bkgdset", items, 1); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + chtype ch = c_sv2chtype(ST(c_arg)); + + if (c_mret == OK) { wbkgdset(win, ch); } + } + XSRETURN(0); +#else + c_fun_not_there("bkgdset"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_getbkgd) +{ + dXSARGS; +#ifdef C_GETBKGD + c_countargs("getbkgd", items, 0); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + chtype ret = c_mret == ERR ? ERR : getbkgd(win); + + ST(0) = sv_newmortal(); + c_chtype2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("getbkgd"); + XSRETURN(0); +#endif +} + + +/* curs_border */ + +XS(XS_Curses_border) +{ + dXSARGS; +#ifdef C_BORDER + c_countargs("border", items, 8); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + chtype ls = c_sv2chtype(ST(c_arg)); + chtype rs_ = c_sv2chtype(ST(c_arg+1)); + chtype ts = c_sv2chtype(ST(c_arg+2)); + chtype bs = c_sv2chtype(ST(c_arg+3)); + chtype tl = c_sv2chtype(ST(c_arg+4)); + chtype tr = c_sv2chtype(ST(c_arg+5)); + chtype bl = c_sv2chtype(ST(c_arg+6)); + chtype br = c_sv2chtype(ST(c_arg+7)); + int ret = c_mret == ERR ? ERR : wborder(win, ls, rs_, ts, bs, tl, tr, bl, br); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("border"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_box) +{ + dXSARGS; +#ifdef C_BOX + c_countargs("box", items, 2); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + chtype verch = c_sv2chtype(ST(c_arg)); + chtype horch = c_sv2chtype(ST(c_arg+1)); + int ret = c_mret == ERR ? ERR : box(win, verch, horch); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("box"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_hline) +{ + dXSARGS; +#ifdef C_HLINE + c_countargs("hline", items, 2); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + chtype ch = c_sv2chtype(ST(c_arg)); + int n = (int)SvIV(ST(c_arg+1)); + int ret = c_mret == ERR ? ERR : whline(win, ch, n); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("hline"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_vline) +{ + dXSARGS; +#ifdef C_VLINE + c_countargs("vline", items, 2); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + chtype ch = c_sv2chtype(ST(c_arg)); + int n = (int)SvIV(ST(c_arg+1)); + int ret = c_mret == ERR ? ERR : wvline(win, ch, n); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("vline"); + XSRETURN(0); +#endif +} + + +/* curs_clear */ + +XS(XS_Curses_erase) +{ + dXSARGS; +#ifdef C_ERASE + c_countargs("erase", items, 0); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int ret = c_mret == ERR ? ERR : werase(win); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("erase"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_clear) +{ + dXSARGS; +#ifdef C_CLEAR + c_countargs("clear", items, 0); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int ret = c_mret == ERR ? ERR : wclear(win); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("clear"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_clrtobot) +{ + dXSARGS; +#ifdef C_CLRTOBOT + c_countargs("clrtobot", items, 0); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int ret = c_mret == ERR ? ERR : wclrtobot(win); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("clrtobot"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_clrtoeol) +{ + dXSARGS; +#ifdef C_CLRTOEOL + c_countargs("clrtoeol", items, 0); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int ret = c_mret == ERR ? ERR : wclrtoeol(win); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("clrtoeol"); + XSRETURN(0); +#endif +} + + +/* curs_color */ + +XS(XS_Curses_start_color) +{ + dXSARGS; +#ifdef C_START_COLOR + c_exactargs("start_color", items, 0); + { + int ret = start_color(); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("start_color"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_init_pair) +{ + dXSARGS; +#ifdef C_INIT_PAIR + c_exactargs("init_pair", items, 3); + { + short pair = (short)SvIV(ST(0)); + short f = (short)SvIV(ST(1)); + short b = (short)SvIV(ST(2)); + int ret = init_pair(pair, f, b); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("init_pair"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_init_color) +{ + dXSARGS; +#ifdef C_INIT_COLOR + c_exactargs("init_color", items, 4); + { + short color = (short)SvIV(ST(0)); + short r = (short)SvIV(ST(1)); + short g = (short)SvIV(ST(2)); + short b = (short)SvIV(ST(3)); + int ret = init_color(color, r, g, b); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("init_color"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_has_colors) +{ + dXSARGS; +#ifdef C_HAS_COLORS + c_exactargs("has_colors", items, 0); + { + bool ret = has_colors(); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("has_colors"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_can_change_color) +{ + dXSARGS; +#ifdef C_CAN_CHANGE_COLOR + c_exactargs("can_change_color", items, 0); + { + bool ret = can_change_color(); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("can_change_color"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_color_content) +{ + dXSARGS; +#ifdef C_COLOR_CONTENT + c_exactargs("color_content", items, 4); + { + short color = (short)SvIV(ST(0)); + short r = 0; + short g = 0; + short b = 0; + int ret = color_content(color, &r, &g, &b); + + sv_setiv(ST(1), (IV)r);; + sv_setiv(ST(2), (IV)g);; + sv_setiv(ST(3), (IV)b);; + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("color_content"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_pair_content) +{ + dXSARGS; +#ifdef C_PAIR_CONTENT + c_exactargs("pair_content", items, 3); + { + short pair = (short)SvIV(ST(0)); + short f = 0; + short b = 0; + int ret = pair_content(pair, &f, &b); + + sv_setiv(ST(1), (IV)f);; + sv_setiv(ST(2), (IV)b);; + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("pair_content"); + XSRETURN(0); +#endif +} + + +/* curs_delch */ + +XS(XS_Curses_delch) +{ + dXSARGS; +#ifdef C_DELCH + c_countargs("delch", items, 0); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int ret = c_mret == ERR ? ERR : wdelch(win); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("delch"); + XSRETURN(0); +#endif +} + + +/* curs_deleteln */ + +XS(XS_Curses_deleteln) +{ + dXSARGS; +#ifdef C_DELETELN + c_countargs("deleteln", items, 0); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int ret = c_mret == ERR ? ERR : wdeleteln(win); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("deleteln"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_insdelln) +{ + dXSARGS; +#ifdef C_INSDELLN + c_countargs("insdelln", items, 1); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int n = (int)SvIV(ST(c_arg)); + int ret = c_mret == ERR ? ERR : winsdelln(win, n); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("insdelln"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_insertln) +{ + dXSARGS; +#ifdef C_INSERTLN + c_countargs("insertln", items, 0); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int ret = c_mret == ERR ? ERR : winsertln(win); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("insertln"); + XSRETURN(0); +#endif +} + + +/* curs_getch */ + +XS(XS_Curses_getch) +{ + dXSARGS; +#ifdef C_GETCH + c_countargs("getch", items, 0); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + chtype ret = c_mret == ERR ? ERR : wgetch(win); + + ST(0) = sv_newmortal(); + c_chtype2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("getch"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_ungetch) +{ + dXSARGS; +#ifdef C_UNGETCH + c_exactargs("ungetch", items, 1); + { + chtype ch = c_sv2chtype(ST(0)); + int ret = ungetch(ch); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("ungetch"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_has_key) +{ + dXSARGS; +#ifdef C_HAS_KEY + c_exactargs("has_key", items, 1); + { + int ch = (int)SvIV(ST(0)); + int ret = has_key(ch); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("has_key"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_KEY_F) +{ + dXSARGS; +#ifdef C_KEY_F + c_exactargs("KEY_F", items, 1); + { + int n = (int)SvIV(ST(0)); + chtype ret = KEY_F(n); + + ST(0) = sv_newmortal(); + c_chtype2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("KEY_F"); + XSRETURN(0); +#endif +} + + +/* curs_getstr */ + +XS(XS_Curses_getstr) +{ + dXSARGS; +#ifdef C_GETSTR + c_countargs("getstr", items, 1); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + char * str = (char *)sv_grow(ST(c_arg), 250); + int ret = c_mret == ERR ? ERR : wgetstr(win, str); + + c_setchar(ST(c_arg), str); + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("getstr"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_getnstr) +{ + dXSARGS; +#ifdef C_GETNSTR + c_countargs("getnstr", items, 2); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int n = (int)SvIV(ST(c_arg+1)); + char * str = (char *)sv_grow(ST(c_arg), n+1); + int ret = c_mret == ERR ? ERR : wgetnstr(win, str, n); + + c_setchar(ST(c_arg), str); + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("getnstr"); + XSRETURN(0); +#endif +} + + +/* curs_getyx */ + +XS(XS_Curses_getyx) +{ + dXSARGS; +#ifdef C_GETYX + c_countargs("getyx", items, 2); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int y = 0; + int x = 0; + + if (c_mret == OK) { getyx(win, y, x); } + sv_setiv(ST(c_arg), (IV)y);; + sv_setiv(ST(c_arg+1), (IV)x);; + } + XSRETURN(0); +#else + c_fun_not_there("getyx"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_getparyx) +{ + dXSARGS; +#ifdef C_GETPARYX + c_countargs("getparyx", items, 2); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int y = 0; + int x = 0; + + if (c_mret == OK) { getparyx(win, y, x); } + sv_setiv(ST(c_arg), (IV)y);; + sv_setiv(ST(c_arg+1), (IV)x);; + } + XSRETURN(0); +#else + c_fun_not_there("getparyx"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_getbegyx) +{ + dXSARGS; +#ifdef C_GETBEGYX + c_countargs("getbegyx", items, 2); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int y = 0; + int x = 0; + + if (c_mret == OK) { getbegyx(win, y, x); } + sv_setiv(ST(c_arg), (IV)y);; + sv_setiv(ST(c_arg+1), (IV)x);; + } + XSRETURN(0); +#else + c_fun_not_there("getbegyx"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_getmaxyx) +{ + dXSARGS; +#ifdef C_GETMAXYX + c_countargs("getmaxyx", items, 2); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int y = 0; + int x = 0; + + if (c_mret == OK) { getmaxyx(win, y, x); } + sv_setiv(ST(c_arg), (IV)y);; + sv_setiv(ST(c_arg+1), (IV)x);; + } + XSRETURN(0); +#else + c_fun_not_there("getmaxyx"); + XSRETURN(0); +#endif +} + + +/* curs_inch */ + +XS(XS_Curses_inch) +{ + dXSARGS; +#ifdef C_INCH + c_countargs("inch", items, 0); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + chtype ret = c_mret == ERR ? ERR : winch(win); + + ST(0) = sv_newmortal(); + c_chtype2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("inch"); + XSRETURN(0); +#endif +} + + +/* curs_inchstr */ + +XS(XS_Curses_inchstr) +{ + dXSARGS; +#ifdef C_INCHSTR + c_countargs("inchstr", items, 1); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + chtype *str = (chtype *)sv_grow(ST(c_arg), (250)*sizeof(chtype)); + int ret = c_mret == ERR ? ERR : winchstr(win, str); + + c_setchtype(ST(c_arg), str); + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("inchstr"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_inchnstr) +{ + dXSARGS; +#ifdef C_INCHNSTR + c_countargs("inchnstr", items, 2); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int n = (int)SvIV(ST(c_arg+1)); + chtype *str = (chtype *)sv_grow(ST(c_arg), (n+1)*sizeof(chtype)); + int ret = c_mret == ERR ? ERR : winchnstr(win, str, n); + + c_setchtype(ST(c_arg), str); + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("inchnstr"); + XSRETURN(0); +#endif +} + + +/* curs_initscr */ + +XS(XS_Curses_initscr) +{ + dXSARGS; +#ifdef C_INITSCR + c_exactargs("initscr", items, 0); + { + WINDOW * ret = initscr(); + + ST(0) = sv_newmortal(); + c_window2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("initscr"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_endwin) +{ + dXSARGS; +#ifdef C_ENDWIN + c_exactargs("endwin", items, 0); + { + int ret = endwin(); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("endwin"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_isendwin) +{ + dXSARGS; +#ifdef C_ISENDWIN + c_exactargs("isendwin", items, 0); + { + int ret = isendwin(); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("isendwin"); + XSRETURN(0); +#endif +} + +/* newterm() has some complexities because of PerlIo. + + IoIFP() returns a FILE * with some Perl cores, and PerlIo with + others. We need FILE *. One would think that on the PerlIo system, + there would be some way to call something that uses FILE *, + such as newterm(), but I haven't found one. + + With some Perl cores, "FILE" is a macro that expands to "PerlIo". + That seems ridiculous, because something such as newterm() needs a + real FILE *, not just something called that. +*/ + + +XS(XS_Curses_newterm) +{ + dXSARGS; +#ifdef C_NEWTERM +#ifdef PERLIO_IS_STDIO + c_exactargs("newterm", items, 3); + { + char * type = ST(0) != &PL_sv_undef ? (char *)SvPV_nolen(ST(0)) : NULL; + + FILE * outfd = IoIFP(sv_2io(ST(1))); + FILE * infd = IoIFP(sv_2io(ST(2))); + SCREEN * ret = newterm(type, outfd, infd); + + ST(0) = sv_newmortal(); + c_screen2sv(ST(0), ret); + } + XSRETURN(1); +#else /* PERLIO_IS_STDIO */ + croak("You cannot use newterm() with this Perl interpreter core because " + "it uses PerlIo for file I/O, and the Curses library doesn't " + "know what to do with that"); + /* See explanation in comments above */ +#endif +#else + c_fun_not_there("newterm"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_set_term) +{ + dXSARGS; +#ifdef C_SET_TERM + c_exactargs("set_term", items, 1); + { + SCREEN *new = c_sv2screen(ST(0), 0); + SCREEN * ret = set_term(new); + + ST(0) = sv_newmortal(); + c_screen2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_term"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_delscreen) +{ + dXSARGS; +#ifdef C_DELSCREEN + c_exactargs("delscreen", items, 1); + { + SCREEN *sp = c_sv2screen(ST(0), 0); + + delscreen(sp); + } + XSRETURN(0); +#else + c_fun_not_there("delscreen"); + XSRETURN(0); +#endif +} + + +/* curs_inopts */ + +#ifdef C_INTCBREAK +XS(XS_Curses_cbreak) +{ + dXSARGS; +#ifdef C_CBREAK + c_exactargs("cbreak", items, 0); + { + int ret = cbreak(); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("cbreak"); + XSRETURN(0); +#endif +} + +#else +XS(XS_Curses_cbreak) +{ + dXSARGS; +#ifdef C_CBREAK + c_exactargs("cbreak", items, 0); + { + cbreak(); + } + XSRETURN(0); +#else + c_fun_not_there("cbreak"); + XSRETURN(0); +#endif +} + +#endif +#ifdef C_INTNOCBREAK +XS(XS_Curses_nocbreak) +{ + dXSARGS; +#ifdef C_NOCBREAK + c_exactargs("nocbreak", items, 0); + { + int ret = nocbreak(); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("nocbreak"); + XSRETURN(0); +#endif +} + +#else +XS(XS_Curses_nocbreak) +{ + dXSARGS; +#ifdef C_NOCBREAK + c_exactargs("nocbreak", items, 0); + { + nocbreak(); + } + XSRETURN(0); +#else + c_fun_not_there("nocbreak"); + XSRETURN(0); +#endif +} + +#endif +#ifdef C_INTECHO +XS(XS_Curses_echo) +{ + dXSARGS; +#ifdef C_ECHO + c_exactargs("echo", items, 0); + { + int ret = echo(); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("echo"); + XSRETURN(0); +#endif +} + +#else +XS(XS_Curses_echo) +{ + dXSARGS; +#ifdef C_ECHO + c_exactargs("echo", items, 0); + { + echo(); + } + XSRETURN(0); +#else + c_fun_not_there("echo"); + XSRETURN(0); +#endif +} + +#endif +#ifdef C_INTNOECHO +XS(XS_Curses_noecho) +{ + dXSARGS; +#ifdef C_NOECHO + c_exactargs("noecho", items, 0); + { + int ret = noecho(); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("noecho"); + XSRETURN(0); +#endif +} + +#else +XS(XS_Curses_noecho) +{ + dXSARGS; +#ifdef C_NOECHO + c_exactargs("noecho", items, 0); + { + noecho(); + } + XSRETURN(0); +#else + c_fun_not_there("noecho"); + XSRETURN(0); +#endif +} + +#endif +XS(XS_Curses_halfdelay) +{ + dXSARGS; +#ifdef C_HALFDELAY + c_exactargs("halfdelay", items, 1); + { + int tenths = (int)SvIV(ST(0)); + int ret = halfdelay(tenths); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("halfdelay"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_intrflush) +{ + dXSARGS; +#ifdef C_INTRFLUSH + c_countargs("intrflush", items, 1); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + bool bf = (int)SvIV(ST(c_arg)); + int ret = c_mret == ERR ? ERR : intrflush(win, bf); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("intrflush"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_keypad) +{ + dXSARGS; +#ifdef C_KEYPAD + c_countargs("keypad", items, 1); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + bool bf = (int)SvIV(ST(c_arg)); + int ret = c_mret == ERR ? ERR : keypad(win, bf); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("keypad"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_meta) +{ + dXSARGS; +#ifdef C_META + c_countargs("meta", items, 1); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + bool bf = (int)SvIV(ST(c_arg)); + int ret = c_mret == ERR ? ERR : meta(win, bf); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("meta"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_nodelay) +{ + dXSARGS; +#ifdef C_NODELAY + c_countargs("nodelay", items, 1); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + bool bf = (int)SvIV(ST(c_arg)); + int ret = c_mret == ERR ? ERR : nodelay(win, bf); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("nodelay"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_notimeout) +{ + dXSARGS; +#ifdef C_NOTIMEOUT + c_countargs("notimeout", items, 1); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + bool bf = (int)SvIV(ST(c_arg)); + int ret = c_mret == ERR ? ERR : notimeout(win, bf); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("notimeout"); + XSRETURN(0); +#endif +} + +#ifdef C_INTRAW +XS(XS_Curses_raw) +{ + dXSARGS; +#ifdef C_RAW + c_exactargs("raw", items, 0); + { + int ret = raw(); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("raw"); + XSRETURN(0); +#endif +} + +#else +XS(XS_Curses_raw) +{ + dXSARGS; +#ifdef C_RAW + c_exactargs("raw", items, 0); + { + raw(); + } + XSRETURN(0); +#else + c_fun_not_there("raw"); + XSRETURN(0); +#endif +} + +#endif +#ifdef C_INTNORAW +XS(XS_Curses_noraw) +{ + dXSARGS; +#ifdef C_NORAW + c_exactargs("noraw", items, 0); + { + int ret = noraw(); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("noraw"); + XSRETURN(0); +#endif +} + +#else +XS(XS_Curses_noraw) +{ + dXSARGS; +#ifdef C_NORAW + c_exactargs("noraw", items, 0); + { + noraw(); + } + XSRETURN(0); +#else + c_fun_not_there("noraw"); + XSRETURN(0); +#endif +} + +#endif +XS(XS_Curses_qiflush) +{ + dXSARGS; +#ifdef C_QIFLUSH + c_exactargs("qiflush", items, 0); + { + qiflush(); + } + XSRETURN(0); +#else + c_fun_not_there("qiflush"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_noqiflush) +{ + dXSARGS; +#ifdef C_NOQIFLUSH + c_exactargs("noqiflush", items, 0); + { + noqiflush(); + } + XSRETURN(0); +#else + c_fun_not_there("noqiflush"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_timeout) +{ + dXSARGS; +#ifdef C_TIMEOUT + c_countargs("timeout", items, 1); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int delay = (int)SvIV(ST(c_arg)); + + if (c_mret == OK) { wtimeout(win, delay); } + } + XSRETURN(0); +#else + c_fun_not_there("timeout"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_typeahead) +{ + dXSARGS; +#ifdef C_TYPEAHEAD + c_exactargs("typeahead", items, 1); + { + int fd = (int)SvIV(ST(0)); + int ret = typeahead(fd); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("typeahead"); + XSRETURN(0); +#endif +} + + +/* curs_insch */ + +XS(XS_Curses_insch) +{ + dXSARGS; +#ifdef C_INSCH + c_countargs("insch", items, 1); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + chtype ch = c_sv2chtype(ST(c_arg)); + int ret = c_mret == ERR ? ERR : winsch(win, ch); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("insch"); + XSRETURN(0); +#endif +} + + +/* curs_insstr */ + +XS(XS_Curses_insstr) +{ + dXSARGS; +#ifdef C_INSSTR + c_countargs("insstr", items, 1); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + char * str = (char *)SvPV_nolen(ST(c_arg)); + int ret = c_mret == ERR ? ERR : winsstr(win, str); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("insstr"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_insnstr) +{ + dXSARGS; +#ifdef C_INSNSTR + c_countargs("insnstr", items, 2); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + char * str = (char *)SvPV_nolen(ST(c_arg)); + int n = (int)SvIV(ST(c_arg+1)); + int ret = c_mret == ERR ? ERR : winsnstr(win, str, n); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("insnstr"); + XSRETURN(0); +#endif +} + + +/* curs_instr */ + +XS(XS_Curses_instr) +{ + dXSARGS; +#ifdef C_INSTR + c_countargs("instr", items, 1); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + char * str = (char *)sv_grow(ST(c_arg), 250); + int ret = c_mret == ERR ? ERR : winstr(win, str); + + c_setchar(ST(c_arg), str); + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("instr"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_innstr) +{ + dXSARGS; +#ifdef C_INNSTR + c_countargs("innstr", items, 2); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int n = (int)SvIV(ST(c_arg+1)); + char * str = (char *)sv_grow(ST(c_arg), n+1); + int ret = c_mret == ERR ? ERR : winnstr(win, str, n); + + c_setchar(ST(c_arg), str); + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("innstr"); + XSRETURN(0); +#endif +} + + +/* curs_kernel */ + +XS(XS_Curses_def_prog_mode) +{ + dXSARGS; +#ifdef C_DEF_PROG_MODE + c_exactargs("def_prog_mode", items, 0); + { + int ret = def_prog_mode(); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("def_prog_mode"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_def_shell_mode) +{ + dXSARGS; +#ifdef C_DEF_SHELL_MODE + c_exactargs("def_shell_mode", items, 0); + { + int ret = def_shell_mode(); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("def_shell_mode"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_reset_prog_mode) +{ + dXSARGS; +#ifdef C_RESET_PROG_MODE + c_exactargs("reset_prog_mode", items, 0); + { + int ret = reset_prog_mode(); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("reset_prog_mode"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_reset_shell_mode) +{ + dXSARGS; +#ifdef C_RESET_SHELL_MODE + c_exactargs("reset_shell_mode", items, 0); + { + int ret = reset_shell_mode(); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("reset_shell_mode"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_resetty) +{ + dXSARGS; +#ifdef C_RESETTY + c_exactargs("resetty", items, 0); + { + int ret = resetty(); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("resetty"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_savetty) +{ + dXSARGS; +#ifdef C_SAVETTY + c_exactargs("savetty", items, 0); + { + int ret = savetty(); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("savetty"); + XSRETURN(0); +#endif +} + +#ifdef C_INTGETSYX +XS(XS_Curses_getsyx) +{ + dXSARGS; +#ifdef C_GETSYX + c_exactargs("getsyx", items, 2); + { + int y = 0; + int x = 0; + int ret = getsyx(y, x); + + sv_setiv(ST(0), (IV)y);; + sv_setiv(ST(1), (IV)x);; + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("getsyx"); + XSRETURN(0); +#endif +} + +#else +XS(XS_Curses_getsyx) +{ + dXSARGS; +#ifdef C_GETSYX + c_exactargs("getsyx", items, 2); + { + int y = 0; + int x = 0; + + getsyx(y, x); + sv_setiv(ST(0), (IV)y);; + sv_setiv(ST(1), (IV)x);; + } + XSRETURN(0); +#else + c_fun_not_there("getsyx"); + XSRETURN(0); +#endif +} + +#endif +#ifdef C_INTSETSYX +XS(XS_Curses_setsyx) +{ + dXSARGS; +#ifdef C_SETSYX + c_exactargs("setsyx", items, 2); + { + int y = (int)SvIV(ST(0)); + int x = (int)SvIV(ST(1)); + int ret = setsyx(y, x); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("setsyx"); + XSRETURN(0); +#endif +} + +#else +XS(XS_Curses_setsyx) +{ + dXSARGS; +#ifdef C_SETSYX + c_exactargs("setsyx", items, 2); + { + int y = (int)SvIV(ST(0)); + int x = (int)SvIV(ST(1)); + + setsyx(y, x); + } + XSRETURN(0); +#else + c_fun_not_there("setsyx"); + XSRETURN(0); +#endif +} + +#endif +XS(XS_Curses_curs_set) +{ + dXSARGS; +#ifdef C_CURS_SET + c_exactargs("curs_set", items, 1); + { + int visibility = (int)SvIV(ST(0)); + int ret = curs_set(visibility); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("curs_set"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_napms) +{ + dXSARGS; +#ifdef C_NAPMS + c_exactargs("napms", items, 1); + { + int ms = (int)SvIV(ST(0)); + int ret = napms(ms); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("napms"); + XSRETURN(0); +#endif +} + + +/* curs_move */ + +XS(XS_Curses_move) +{ + dXSARGS; +#ifdef C_MOVE + c_countargs("move", items, 2); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int y = (int)SvIV(ST(c_arg)); + int x = (int)SvIV(ST(c_arg+1)); + int ret = c_mret == ERR ? ERR : wmove(win, y, x); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("move"); + XSRETURN(0); +#endif +} + + +/* curs_outopts */ + +XS(XS_Curses_clearok) +{ + dXSARGS; +#ifdef C_CLEAROK + c_countargs("clearok", items, 1); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + bool bf = (int)SvIV(ST(c_arg)); + int ret = c_mret == ERR ? ERR : clearok(win, bf); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("clearok"); + XSRETURN(0); +#endif +} + +#ifdef C_INTIDLOK +XS(XS_Curses_idlok) +{ + dXSARGS; +#ifdef C_IDLOK + c_countargs("idlok", items, 1); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + bool bf = (int)SvIV(ST(c_arg)); + int ret = c_mret == ERR ? ERR : idlok(win, bf); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("idlok"); + XSRETURN(0); +#endif +} + +#else +XS(XS_Curses_idlok) +{ + dXSARGS; +#ifdef C_IDLOK + c_countargs("idlok", items, 1); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + bool bf = (int)SvIV(ST(c_arg)); + + if (c_mret == OK) { idlok(win, bf); } + } + XSRETURN(0); +#else + c_fun_not_there("idlok"); + XSRETURN(0); +#endif +} + +#endif +XS(XS_Curses_idcok) +{ + dXSARGS; +#ifdef C_IDCOK + c_countargs("idcok", items, 1); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + bool bf = (int)SvIV(ST(c_arg)); + + if (c_mret == OK) { idcok(win, bf); } + } + XSRETURN(0); +#else + c_fun_not_there("idcok"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_immedok) +{ + dXSARGS; +#ifdef C_IMMEDOK + c_countargs("immedok", items, 1); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + bool bf = (int)SvIV(ST(c_arg)); + + if (c_mret == OK) { immedok(win, bf); } + } + XSRETURN(0); +#else + c_fun_not_there("immedok"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_leaveok) +{ + dXSARGS; +#ifdef C_LEAVEOK + c_countargs("leaveok", items, 1); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + bool bf = (int)SvIV(ST(c_arg)); + int ret = c_mret == ERR ? ERR : leaveok(win, bf); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("leaveok"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_setscrreg) +{ + dXSARGS; +#ifdef C_SETSCRREG + c_countargs("setscrreg", items, 2); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int top = (int)SvIV(ST(c_arg)); + int bot = (int)SvIV(ST(c_arg+1)); + int ret = c_mret == ERR ? ERR : wsetscrreg(win, top, bot); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("setscrreg"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_scrollok) +{ + dXSARGS; +#ifdef C_SCROLLOK + c_countargs("scrollok", items, 1); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + bool bf = (int)SvIV(ST(c_arg)); + int ret = c_mret == ERR ? ERR : scrollok(win, bf); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("scrollok"); + XSRETURN(0); +#endif +} + +#ifdef C_INTNL +XS(XS_Curses_nl) +{ + dXSARGS; +#ifdef C_NL + c_exactargs("nl", items, 0); + { + int ret = nl(); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("nl"); + XSRETURN(0); +#endif +} + +#else +XS(XS_Curses_nl) +{ + dXSARGS; +#ifdef C_NL + c_exactargs("nl", items, 0); + { + nl(); + } + XSRETURN(0); +#else + c_fun_not_there("nl"); + XSRETURN(0); +#endif +} + +#endif +#ifdef C_INTNONL +XS(XS_Curses_nonl) +{ + dXSARGS; +#ifdef C_NONL + c_exactargs("nonl", items, 0); + { + int ret = nonl(); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("nonl"); + XSRETURN(0); +#endif +} + +#else +XS(XS_Curses_nonl) +{ + dXSARGS; +#ifdef C_NONL + c_exactargs("nonl", items, 0); + { + nonl(); + } + XSRETURN(0); +#else + c_fun_not_there("nonl"); + XSRETURN(0); +#endif +} + +#endif + +/* curs_overlay */ + +XS(XS_Curses_overlay) +{ + dXSARGS; +#ifdef C_OVERLAY + c_exactargs("overlay", items, 2); + { + WINDOW *srcwin = c_sv2window(ST(0), 0); + WINDOW *dstwin = c_sv2window(ST(1), 1); + int ret = overlay(srcwin, dstwin); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("overlay"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_overwrite) +{ + dXSARGS; +#ifdef C_OVERWRITE + c_exactargs("overwrite", items, 2); + { + WINDOW *srcwin = c_sv2window(ST(0), 0); + WINDOW *dstwin = c_sv2window(ST(1), 1); + int ret = overwrite(srcwin, dstwin); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("overwrite"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_copywin) +{ + dXSARGS; +#ifdef C_COPYWIN + c_exactargs("copywin", items, 9); + { + WINDOW *srcwin = c_sv2window(ST(0), 0); + WINDOW *dstwin = c_sv2window(ST(1), 1); + int sminrow = (int)SvIV(ST(2)); + int smincol = (int)SvIV(ST(3)); + int dminrow = (int)SvIV(ST(4)); + int dmincol = (int)SvIV(ST(5)); + int dmaxrow = (int)SvIV(ST(6)); + int dmaxcol = (int)SvIV(ST(7)); + int overlay = (int)SvIV(ST(8)); + int ret = copywin(srcwin, dstwin, sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol, overlay); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("copywin"); + XSRETURN(0); +#endif +} + + +/* curs_pad */ + +XS(XS_Curses_newpad) +{ + dXSARGS; +#ifdef C_NEWPAD + c_exactargs("newpad", items, 2); + { + int lines_ = (int)SvIV(ST(0)); + int cols = (int)SvIV(ST(1)); + WINDOW * ret = newpad(lines_, cols); + + ST(0) = sv_newmortal(); + c_window2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("newpad"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_subpad) +{ + dXSARGS; +#ifdef C_SUBPAD + c_exactargs("subpad", items, 5); + { + WINDOW *orig = c_sv2window(ST(0), 0); + int lines_ = (int)SvIV(ST(1)); + int cols = (int)SvIV(ST(2)); + int beginy = (int)SvIV(ST(3)); + int beginx = (int)SvIV(ST(4)); + WINDOW * ret = subpad(orig, lines_, cols, beginy, beginx); + + ST(0) = sv_newmortal(); + c_window2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("subpad"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_prefresh) +{ + dXSARGS; +#ifdef C_PREFRESH + c_exactargs("prefresh", items, 7); + { + WINDOW *pad = c_sv2window(ST(0), 0); + int pminrow = (int)SvIV(ST(1)); + int pmincol = (int)SvIV(ST(2)); + int sminrow = (int)SvIV(ST(3)); + int smincol = (int)SvIV(ST(4)); + int smaxrow = (int)SvIV(ST(5)); + int smaxcol = (int)SvIV(ST(6)); + int ret = prefresh(pad, pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("prefresh"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_pnoutrefresh) +{ + dXSARGS; +#ifdef C_PNOUTREFRESH + c_exactargs("pnoutrefresh", items, 7); + { + WINDOW *pad = c_sv2window(ST(0), 0); + int pminrow = (int)SvIV(ST(1)); + int pmincol = (int)SvIV(ST(2)); + int sminrow = (int)SvIV(ST(3)); + int smincol = (int)SvIV(ST(4)); + int smaxrow = (int)SvIV(ST(5)); + int smaxcol = (int)SvIV(ST(6)); + int ret = pnoutrefresh(pad, pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("pnoutrefresh"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_pechochar) +{ + dXSARGS; +#ifdef C_PECHOCHAR + c_exactargs("pechochar", items, 2); + { + WINDOW *pad = c_sv2window(ST(0), 0); + chtype ch = c_sv2chtype(ST(1)); + int ret = pechochar(pad, ch); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("pechochar"); + XSRETURN(0); +#endif +} + + +/* curs_printw */ + +/* done in perl */ + +/* curs_refresh */ + +XS(XS_Curses_refresh) +{ + dXSARGS; +#ifdef C_REFRESH + c_countargs("refresh", items, 0); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int ret = c_mret == ERR ? ERR : wrefresh(win); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("refresh"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_noutrefresh) +{ + dXSARGS; +#ifdef C_NOUTREFRESH + c_countargs("noutrefresh", items, 0); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int ret = c_mret == ERR ? ERR : wnoutrefresh(win); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("noutrefresh"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_doupdate) +{ + dXSARGS; +#ifdef C_DOUPDATE + c_exactargs("doupdate", items, 0); + { + int ret = doupdate(); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("doupdate"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_redrawwin) +{ + dXSARGS; +#ifdef C_REDRAWWIN + c_countargs("redrawwin", items, 0); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int ret = c_mret == ERR ? ERR : redrawwin(win); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("redrawwin"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_redrawln) +{ + dXSARGS; +#ifdef C_REDRAWLN + c_countargs("redrawln", items, 2); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int beg_line = (int)SvIV(ST(c_arg)); + int num_lines = (int)SvIV(ST(c_arg+1)); + int ret = c_mret == ERR ? ERR : wredrawln(win, beg_line, num_lines); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("redrawln"); + XSRETURN(0); +#endif +} + + +/* curs_scanw */ + +/* done in perl */ + +/* curs_scr_dump */ + +XS(XS_Curses_scr_dump) +{ + dXSARGS; +#ifdef C_SCR_DUMP + c_exactargs("scr_dump", items, 1); + { + char * filename = (char *)SvPV_nolen(ST(0)); + int ret = scr_dump(filename); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("scr_dump"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_scr_restore) +{ + dXSARGS; +#ifdef C_SCR_RESTORE + c_exactargs("scr_restore", items, 1); + { + char * filename = (char *)SvPV_nolen(ST(0)); + int ret = scr_restore(filename); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("scr_restore"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_scr_init) +{ + dXSARGS; +#ifdef C_SCR_INIT + c_exactargs("scr_init", items, 1); + { + char * filename = (char *)SvPV_nolen(ST(0)); + int ret = scr_init(filename); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("scr_init"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_scr_set) +{ + dXSARGS; +#ifdef C_SCR_SET + c_exactargs("scr_set", items, 1); + { + char * filename = (char *)SvPV_nolen(ST(0)); + int ret = scr_set(filename); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("scr_set"); + XSRETURN(0); +#endif +} + + +/* curs_scroll */ + +XS(XS_Curses_scroll) +{ + dXSARGS; +#ifdef C_SCROLL + c_countargs("scroll", items, 0); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int ret = c_mret == ERR ? ERR : scroll(win); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("scroll"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_scrl) +{ + dXSARGS; +#ifdef C_SCRL + c_countargs("scrl", items, 1); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int n = (int)SvIV(ST(c_arg)); + int ret = c_mret == ERR ? ERR : wscrl(win, n); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("scrl"); + XSRETURN(0); +#endif +} + + +/* curs_slk */ + +XS(XS_Curses_slk_init) +{ + dXSARGS; +#ifdef C_SLK_INIT + c_exactargs("slk_init", items, 1); + { + int fmt = (int)SvIV(ST(0)); + int ret = slk_init(fmt); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("slk_init"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_slk_set) +{ + dXSARGS; +#ifdef C_SLK_SET + c_exactargs("slk_set", items, 3); + { + int labnum = (int)SvIV(ST(0)); + char * label = (char *)SvPV_nolen(ST(1)); + int fmt = (int)SvIV(ST(2)); + int ret = slk_set(labnum, label, fmt); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("slk_set"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_slk_refresh) +{ + dXSARGS; +#ifdef C_SLK_REFRESH + c_exactargs("slk_refresh", items, 0); + { + int ret = slk_refresh(); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("slk_refresh"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_slk_noutrefresh) +{ + dXSARGS; +#ifdef C_SLK_NOUTREFRESH + c_exactargs("slk_noutrefresh", items, 0); + { + int ret = slk_noutrefresh(); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("slk_noutrefresh"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_slk_label) +{ + dXSARGS; +#ifdef C_SLK_LABEL + c_exactargs("slk_label", items, 1); + { + int labnum = (int)SvIV(ST(0)); + char * ret = slk_label(labnum); + + ST(0) = sv_newmortal(); + sv_setpv((SV*)ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("slk_label"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_slk_clear) +{ + dXSARGS; +#ifdef C_SLK_CLEAR + c_exactargs("slk_clear", items, 0); + { + int ret = slk_clear(); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("slk_clear"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_slk_restore) +{ + dXSARGS; +#ifdef C_SLK_RESTORE + c_exactargs("slk_restore", items, 0); + { + int ret = slk_restore(); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("slk_restore"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_slk_touch) +{ + dXSARGS; +#ifdef C_SLK_TOUCH + c_exactargs("slk_touch", items, 0); + { + int ret = slk_touch(); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("slk_touch"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_slk_attron) +{ + dXSARGS; +#ifdef C_SLK_ATTRON + c_exactargs("slk_attron", items, 1); + { + chtype attrs = c_sv2chtype(ST(0)); + int ret = slk_attron(attrs); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("slk_attron"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_slk_attrset) +{ + dXSARGS; +#ifdef C_SLK_ATTRSET + c_exactargs("slk_attrset", items, 1); + { + chtype attrs = c_sv2chtype(ST(0)); + int ret = slk_attrset(attrs); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("slk_attrset"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_slk_attr) +{ + dXSARGS; +#ifdef C_SLK_ATTR + c_exactargs("slk_attr", items, 0); + { + attr_t ret = slk_attr(); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("slk_attr"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_slk_attroff) +{ + dXSARGS; +#ifdef C_SLK_ATTROFF + c_exactargs("slk_attroff", items, 1); + { + chtype attrs = c_sv2chtype(ST(0)); + int ret = slk_attroff(attrs); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("slk_attroff"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_slk_color) +{ + dXSARGS; +#ifdef C_SLK_COLOR + c_exactargs("slk_color", items, 1); + { + short color_pair_number = (short)SvIV(ST(0)); + int ret = slk_color(color_pair_number); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("slk_color"); + XSRETURN(0); +#endif +} + + +/* curs_termattrs */ + +XS(XS_Curses_baudrate) +{ + dXSARGS; +#ifdef C_BAUDRATE + c_exactargs("baudrate", items, 0); + { + int ret = baudrate(); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("baudrate"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_erasechar) +{ + dXSARGS; +#ifdef C_ERASECHAR + c_exactargs("erasechar", items, 0); + { + char ret = erasechar(); + + ST(0) = sv_newmortal(); + sv_setpvn(ST(0), (char *)&ret, 1); + } + XSRETURN(1); +#else + c_fun_not_there("erasechar"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_has_ic) +{ + dXSARGS; +#ifdef C_HAS_IC + c_exactargs("has_ic", items, 0); + { + int ret = has_ic(); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("has_ic"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_has_il) +{ + dXSARGS; +#ifdef C_HAS_IL + c_exactargs("has_il", items, 0); + { + int ret = has_il(); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("has_il"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_killchar) +{ + dXSARGS; +#ifdef C_KILLCHAR + c_exactargs("killchar", items, 0); + { + char ret = killchar(); + + ST(0) = sv_newmortal(); + sv_setpvn(ST(0), (char *)&ret, 1); + } + XSRETURN(1); +#else + c_fun_not_there("killchar"); + XSRETURN(0); +#endif +} + +#ifdef C_LONG0ARGS +XS(XS_Curses_longname) +{ + dXSARGS; +#ifdef C_LONGNAME + c_exactargs("longname", items, 0); + { + char * ret = longname(); + + ST(0) = sv_newmortal(); + sv_setpv((SV*)ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("longname"); + XSRETURN(0); +#endif +} + +#else +XS(XS_Curses_longname) +{ + dXSARGS; +#ifdef C_LONGNAME + c_exactargs("longname", items, 2); + { + char * a = (char *)SvPV_nolen(ST(0)); + char * b = (char *)SvPV_nolen(ST(1)); + char * ret = longname(a, b); + + ST(0) = sv_newmortal(); + sv_setpv((SV*)ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("longname"); + XSRETURN(0); +#endif +} + +#endif + +XS(XS_Curses_termattrs) +{ + dXSARGS; +#ifdef C_TERMATTRS + c_exactargs("termattrs", items, 0); + { + chtype ret = termattrs(); + + ST(0) = sv_newmortal(); + c_chtype2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("termattrs"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_termname) +{ + dXSARGS; +#ifdef C_TERMNAME + c_exactargs("termname", items, 0); + { + char * ret = termname(); + + ST(0) = sv_newmortal(); + sv_setpv((SV*)ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("termname"); + XSRETURN(0); +#endif +} + + +/* curs_touch */ + +XS(XS_Curses_touchwin) +{ + dXSARGS; +#ifdef C_TOUCHWIN + c_countargs("touchwin", items, 0); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int ret = c_mret == ERR ? ERR : touchwin(win); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("touchwin"); + XSRETURN(0); +#endif +} + +#ifdef C_TOUCH3ARGS +XS(XS_Curses_touchline) +{ + dXSARGS; +#ifdef C_TOUCHLINE + c_countargs("touchline", items, 2); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int start = (int)SvIV(ST(c_arg)); + int count = (int)SvIV(ST(c_arg+1)); + int ret = c_mret == ERR ? ERR : touchline(win, start, count); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("touchline"); + XSRETURN(0); +#endif +} + +#else +XS(XS_Curses_touchline) +{ + dXSARGS; +#ifdef C_TOUCHLINE + c_countargs("touchline", items, 3); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int y = (int)SvIV(ST(c_arg)); + int sx = (int)SvIV(ST(c_arg+1)); + int ex = (int)SvIV(ST(c_arg+2)); + int ret = c_mret == ERR ? ERR : touchline(win, y, sx, ex); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("touchline"); + XSRETURN(0); +#endif +} + +#endif + +XS(XS_Curses_untouchwin) +{ + dXSARGS; +#ifdef C_UNTOUCHWIN + c_countargs("untouchwin", items, 0); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int ret = c_mret == ERR ? ERR : untouchwin(win); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("untouchwin"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_touchln) +{ + dXSARGS; +#ifdef C_TOUCHLN + c_countargs("touchln", items, 3); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int y = (int)SvIV(ST(c_arg)); + int n = (int)SvIV(ST(c_arg+1)); + int changed = (int)SvIV(ST(c_arg+2)); + int ret = c_mret == ERR ? ERR : wtouchln(win, y, n, changed); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("touchln"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_is_linetouched) +{ + dXSARGS; +#ifdef C_IS_LINETOUCHED + c_countargs("is_linetouched", items, 1); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int line = (int)SvIV(ST(c_arg)); + int ret = c_mret == ERR ? ERR : is_linetouched(win, line); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("is_linetouched"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_is_wintouched) +{ + dXSARGS; +#ifdef C_IS_WINTOUCHED + c_countargs("is_wintouched", items, 0); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int ret = c_mret == ERR ? ERR : is_wintouched(win); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("is_wintouched"); + XSRETURN(0); +#endif +} + + +/* curs_util */ + +XS(XS_Curses_unctrl) +{ + dXSARGS; +#ifdef C_UNCTRL + c_exactargs("unctrl", items, 1); + { + chtype ch = c_sv2chtype(ST(0)); + char * ret = unctrl(ch); + + ST(0) = sv_newmortal(); + sv_setpv((SV*)ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("unctrl"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_keyname) +{ + dXSARGS; +#ifdef C_KEYNAME + c_exactargs("keyname", items, 1); + { + int k = (int)SvIV(ST(0)); + char * ret = (char *)keyname(k); + + ST(0) = sv_newmortal(); + sv_setpv((SV*)ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("keyname"); + XSRETURN(0); +#endif +} + +#ifdef C_INTFILTER +XS(XS_Curses_filter) +{ + dXSARGS; +#ifdef C_FILTER + c_exactargs("filter", items, 0); + { + int ret = filter(); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("filter"); + XSRETURN(0); +#endif +} + +#else +XS(XS_Curses_filter) +{ + dXSARGS; +#ifdef C_FILTER + c_exactargs("filter", items, 0); + { + filter(); + } + XSRETURN(0); +#else + c_fun_not_there("filter"); + XSRETURN(0); +#endif +} + +#endif +XS(XS_Curses_use_env) +{ + dXSARGS; +#ifdef C_USE_ENV + c_exactargs("use_env", items, 1); + { + bool bf = (int)SvIV(ST(0)); + + use_env(bf); + } + XSRETURN(0); +#else + c_fun_not_there("use_env"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_putwin) +{ + dXSARGS; +#ifdef C_PUTWIN + c_exactargs("putwin", items, 2); + { + WINDOW *win = c_sv2window(ST(0), 0); + FILE * filep = IoIFP(sv_2io(ST(1))); + int ret = putwin(win, filep); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("putwin"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_getwin) +{ + dXSARGS; +#ifdef C_GETWIN + c_exactargs("getwin", items, 1); + { + FILE * filep = IoIFP(sv_2io(ST(0))); + WINDOW * ret = getwin(filep); + + ST(0) = sv_newmortal(); + c_window2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("getwin"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_delay_output) +{ + dXSARGS; +#ifdef C_DELAY_OUTPUT + c_exactargs("delay_output", items, 1); + { + int ms = (int)SvIV(ST(0)); + int ret = delay_output(ms); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("delay_output"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_flushinp) +{ + dXSARGS; +#ifdef C_FLUSHINP + c_exactargs("flushinp", items, 0); + { + int ret = flushinp(); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("flushinp"); + XSRETURN(0); +#endif +} + + +/* curs_window */ + +XS(XS_Curses_newwin) +{ + dXSARGS; +#ifdef C_NEWWIN + c_exactargs("newwin", items, 4); + { + int nlines = (int)SvIV(ST(0)); + int ncols = (int)SvIV(ST(1)); + int beginy = (int)SvIV(ST(2)); + int beginx = (int)SvIV(ST(3)); + WINDOW * ret = newwin(nlines, ncols, beginy, beginx); + + ST(0) = sv_newmortal(); + c_window2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("newwin"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_delwin) +{ + dXSARGS; +#ifdef C_DELWIN + c_countargs("delwin", items, 0); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int ret = c_mret == ERR ? ERR : delwin(win); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("delwin"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_mvwin) +{ + dXSARGS; +#ifdef C_MVWIN + c_countargs("mvwin", items, 2); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int y = (int)SvIV(ST(c_arg)); + int x = (int)SvIV(ST(c_arg+1)); + int ret = c_mret == ERR ? ERR : mvwin(win, y, x); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("mvwin"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_subwin) +{ + dXSARGS; +#ifdef C_SUBWIN + c_countargs("subwin", items, 4); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int nlines = (int)SvIV(ST(c_arg)); + int ncols = (int)SvIV(ST(c_arg+1)); + int beginy = (int)SvIV(ST(c_arg+2)); + int beginx = (int)SvIV(ST(c_arg+3)); + WINDOW * ret = c_mret == ERR ? NULL : subwin(win, nlines, ncols, beginy, beginx); + + ST(0) = sv_newmortal(); + c_window2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("subwin"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_derwin) +{ + dXSARGS; +#ifdef C_DERWIN + c_countargs("derwin", items, 4); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int nlines = (int)SvIV(ST(c_arg)); + int ncols = (int)SvIV(ST(c_arg+1)); + int beginy = (int)SvIV(ST(c_arg+2)); + int beginx = (int)SvIV(ST(c_arg+3)); + WINDOW * ret = c_mret == ERR ? NULL : derwin(win, nlines, ncols, beginy, beginx); + + ST(0) = sv_newmortal(); + c_window2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("derwin"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_mvderwin) +{ + dXSARGS; +#ifdef C_MVDERWIN + c_countargs("mvderwin", items, 2); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int par_y = (int)SvIV(ST(c_arg)); + int par_x = (int)SvIV(ST(c_arg+1)); + int ret = c_mret == ERR ? ERR : mvderwin(win, par_y, par_x); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("mvderwin"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_dupwin) +{ + dXSARGS; +#ifdef C_DUPWIN + c_countargs("dupwin", items, 0); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + WINDOW * ret = c_mret == ERR ? NULL : dupwin(win); + + ST(0) = sv_newmortal(); + c_window2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("dupwin"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_syncup) +{ + dXSARGS; +#ifdef C_SYNCUP + c_countargs("syncup", items, 0); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + + if (c_mret == OK) { wsyncup(win); } + } + XSRETURN(0); +#else + c_fun_not_there("syncup"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_syncok) +{ + dXSARGS; +#ifdef C_SYNCOK + c_countargs("syncok", items, 1); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + bool bf = (int)SvIV(ST(c_arg)); + int ret = c_mret == ERR ? ERR : syncok(win, bf); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("syncok"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_cursyncup) +{ + dXSARGS; +#ifdef C_CURSYNCUP + c_countargs("cursyncup", items, 0); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + + if (c_mret == OK) { wcursyncup(win); } + } + XSRETURN(0); +#else + c_fun_not_there("cursyncup"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_syncdown) +{ + dXSARGS; +#ifdef C_SYNCDOWN + c_countargs("syncdown", items, 0); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + + if (c_mret == OK) { wsyncdown(win); } + } + XSRETURN(0); +#else + c_fun_not_there("syncdown"); + XSRETURN(0); +#endif +} + + +/* ncurses extension functions */ + +XS(XS_Curses_getmouse) +{ + dXSARGS; +#ifdef C_GETMOUSE + c_exactargs("getmouse", items, 1); + { + MEVENT *event = (MEVENT *)sv_grow(ST(0), 2 * sizeof(MEVENT)); + int ret = getmouse(event); + + c_setmevent(ST(0), event); + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("getmouse"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_ungetmouse) +{ + dXSARGS; +#ifdef C_UNGETMOUSE + c_exactargs("ungetmouse", items, 1); + { + MEVENT *event = (MEVENT *)SvPV_nolen(ST(0)); + int ret = ungetmouse(event); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("ungetmouse"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_mousemask) +{ + dXSARGS; +#ifdef C_MOUSEMASK + c_exactargs("mousemask", items, 2); + { + mmask_t newmask = (mmask_t)SvIV(ST(0)); + mmask_t oldmask = 0; + mmask_t ret = mousemask(newmask, &oldmask); + + sv_setiv(ST(1), (IV)oldmask);; + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("mousemask"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_enclose) +{ + dXSARGS; +#ifdef C_ENCLOSE + c_countargs("enclose", items, 2); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int y = (int)SvIV(ST(c_arg)); + int x = (int)SvIV(ST(c_arg+1)); + bool ret = c_mret == ERR ? ERR : wenclose(win, y, x); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("enclose"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_mouse_trafo) +{ + dXSARGS; +#ifdef C_MOUSE_TRAFO + c_countargs("mouse_trafo", items, 3); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int pY = 0; + int pX = 0; + bool to_screen = (int)SvIV(ST(c_arg+2)); + bool ret = c_mret == ERR ? ERR : wmouse_trafo(win, &pY, &pX, to_screen); + + sv_setiv(ST(c_arg), (IV)pY);; + sv_setiv(ST(c_arg+1), (IV)pX);; + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("mouse_trafo"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_mouseinterval) +{ + dXSARGS; +#ifdef C_MOUSEINTERVAL + c_exactargs("mouseinterval", items, 1); + { + int erval = (int)SvIV(ST(0)); + int ret = mouseinterval(erval); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("mouseinterval"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_BUTTON_RELEASE) +{ + dXSARGS; +#ifdef C_BUTTON_RELEASE + c_exactargs("BUTTON_RELEASE", items, 2); + { + mmask_t e = (mmask_t)SvIV(ST(0)); + int x = (int)SvIV(ST(1)); + int ret = BUTTON_RELEASE(e, x); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("BUTTON_RELEASE"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_BUTTON_PRESS) +{ + dXSARGS; +#ifdef C_BUTTON_PRESS + c_exactargs("BUTTON_PRESS", items, 2); + { + mmask_t e = (mmask_t)SvIV(ST(0)); + int x = (int)SvIV(ST(1)); + int ret = BUTTON_PRESS(e, x); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("BUTTON_PRESS"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_BUTTON_CLICK) +{ + dXSARGS; +#ifdef C_BUTTON_CLICK + c_exactargs("BUTTON_CLICK", items, 2); + { + mmask_t e = (mmask_t)SvIV(ST(0)); + int x = (int)SvIV(ST(1)); + int ret = BUTTON_CLICK(e, x); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("BUTTON_CLICK"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_BUTTON_DOUBLE_CLICK) +{ + dXSARGS; +#ifdef C_BUTTON_DOUBLE_CLICK + c_exactargs("BUTTON_DOUBLE_CLICK", items, 2); + { + mmask_t e = (mmask_t)SvIV(ST(0)); + int x = (int)SvIV(ST(1)); + int ret = BUTTON_DOUBLE_CLICK(e, x); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("BUTTON_DOUBLE_CLICK"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_BUTTON_TRIPLE_CLICK) +{ + dXSARGS; +#ifdef C_BUTTON_TRIPLE_CLICK + c_exactargs("BUTTON_TRIPLE_CLICK", items, 2); + { + mmask_t e = (mmask_t)SvIV(ST(0)); + int x = (int)SvIV(ST(1)); + int ret = BUTTON_TRIPLE_CLICK(e, x); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("BUTTON_TRIPLE_CLICK"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_BUTTON_RESERVED_EVENT) +{ + dXSARGS; +#ifdef C_BUTTON_RESERVED_EVENT + c_exactargs("BUTTON_RESERVED_EVENT", items, 2); + { + mmask_t e = (mmask_t)SvIV(ST(0)); + int x = (int)SvIV(ST(1)); + int ret = BUTTON_RESERVED_EVENT(e, x); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("BUTTON_RESERVED_EVENT"); + XSRETURN(0); +#endif +} + + +XS(XS_Curses_use_default_colors) +{ + dXSARGS; +#ifdef C_USE_DEFAULT_COLORS + c_exactargs("use_default_colors", items, 0); + { + int ret = use_default_colors(); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("use_default_colors"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_assume_default_colors) +{ + dXSARGS; +#ifdef C_ASSUME_DEFAULT_COLORS + c_exactargs("assume_default_colors", items, 2); + { + int fg = (int)SvIV(ST(0)); + int bg = (int)SvIV(ST(1)); + int ret = assume_default_colors(fg, bg); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("assume_default_colors"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_define_key) +{ + dXSARGS; +#ifdef C_DEFINE_KEY + c_exactargs("define_key", items, 2); + { + char * definition = (char *)SvPV_nolen(ST(0)); + int keycode = (int)SvIV(ST(1)); + int ret = define_key(definition, keycode); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("define_key"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_keybound) +{ + dXSARGS; +#ifdef C_KEYBOUND + c_exactargs("keybound", items, 2); + { + int keycode = (int)SvIV(ST(0)); + int count = (int)SvIV(ST(1)); + char * ret = keybound(keycode, count); + + ST(0) = sv_newmortal(); + sv_setpv((SV*)ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("keybound"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_keyok) +{ + dXSARGS; +#ifdef C_KEYOK + c_exactargs("keyok", items, 2); + { + int keycode = (int)SvIV(ST(0)); + bool enable = (int)SvIV(ST(1)); + int ret = keyok(keycode, enable); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("keyok"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_resizeterm) +{ + dXSARGS; +#ifdef C_RESIZETERM + c_exactargs("resizeterm", items, 2); + { + int lines = (int)SvIV(ST(0)); + int cols = (int)SvIV(ST(1)); + int ret = resizeterm(lines, cols); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("resizeterm"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_resize) +{ + dXSARGS; +#ifdef C_RESIZE + c_countargs("resize", items, 2); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int lines_ = (int)SvIV(ST(c_arg)); + int columns = (int)SvIV(ST(c_arg+1)); + int ret = c_mret == ERR ? ERR : wresize(win, lines_, columns); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("resize"); + XSRETURN(0); +#endif +} + + +/* DEC curses, I think */ + +XS(XS_Curses_getmaxy) +{ + dXSARGS; +#ifdef C_GETMAXY + c_countargs("getmaxy", items, 0); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int ret = c_mret == ERR ? ERR : getmaxy(win); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("getmaxy"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_getmaxx) +{ + dXSARGS; +#ifdef C_GETMAXX + c_countargs("getmaxx", items, 0); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + int ret = c_mret == ERR ? ERR : getmaxx(win); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("getmaxx"); + XSRETURN(0); +#endif +} + + +/* old BSD curses calls */ + +XS(XS_Curses_flusok) +{ + dXSARGS; +#ifdef C_FLUSOK + c_countargs("flusok", items, 1); + { + WINDOW *win = c_win ? c_sv2window(ST(0), 0) : stdscr; + int c_mret = c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK; + bool bf = (int)SvIV(ST(c_arg)); + + if (c_mret == OK) { flusok(win, bf); } + } + XSRETURN(0); +#else + c_fun_not_there("flusok"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_getcap) +{ + dXSARGS; +#ifdef C_GETCAP + c_exactargs("getcap", items, 1); + { + char * term = (char *)SvPV_nolen(ST(0)); + char * ret = (char *)getcap(term); + + ST(0) = sv_newmortal(); + sv_setpv((SV*)ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("getcap"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_touchoverlap) +{ + dXSARGS; +#ifdef C_TOUCHOVERLAP + c_exactargs("touchoverlap", items, 2); + { + WINDOW *src = c_sv2window(ST(0), 0); + WINDOW *dst = c_sv2window(ST(1), 1); + int ret = touchoverlap(src, dst); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("touchoverlap"); + XSRETURN(0); +#endif +} + + +/* Panel support */ + +XS(XS_Curses_new_panel) +{ + dXSARGS; +#ifdef C_NEW_PANEL + c_exactargs("new_panel", items, 1); + { + WINDOW *win = c_sv2window(ST(0), 0); + PANEL * ret = new_panel(win); + + ST(0) = sv_newmortal(); + c_panel2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("new_panel"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_bottom_panel) +{ + dXSARGS; +#ifdef C_BOTTOM_PANEL + c_exactargs("bottom_panel", items, 1); + { + PANEL * pan = c_sv2panel(ST(0), 0); + int ret = bottom_panel(pan); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("bottom_panel"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_top_panel) +{ + dXSARGS; +#ifdef C_TOP_PANEL + c_exactargs("top_panel", items, 1); + { + PANEL * pan = c_sv2panel(ST(0), 0); + int ret = top_panel(pan); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("top_panel"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_show_panel) +{ + dXSARGS; +#ifdef C_SHOW_PANEL + c_exactargs("show_panel", items, 1); + { + PANEL * pan = c_sv2panel(ST(0), 0); + int ret = show_panel(pan); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("show_panel"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_update_panels) +{ + dXSARGS; +#ifdef C_UPDATE_PANELS + c_exactargs("update_panels", items, 0); + { + update_panels(); + } + XSRETURN(0); +#else + c_fun_not_there("update_panels"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_hide_panel) +{ + dXSARGS; +#ifdef C_HIDE_PANEL + c_exactargs("hide_panel", items, 1); + { + PANEL * pan = c_sv2panel(ST(0), 0); + int ret = hide_panel(pan); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("hide_panel"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_panel_window) +{ + dXSARGS; +#ifdef C_PANEL_WINDOW + c_exactargs("panel_window", items, 1); + { + PANEL * pan = c_sv2panel(ST(0), 0); + WINDOW * ret = panel_window(pan); + + ST(0) = sv_newmortal(); + c_window2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("panel_window"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_replace_panel) +{ + dXSARGS; +#ifdef C_REPLACE_PANEL + c_exactargs("replace_panel", items, 2); + { + PANEL * pan = c_sv2panel(ST(0), 0); + WINDOW *window = c_sv2window(ST(1), 1); + int ret = replace_panel(pan, window); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("replace_panel"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_move_panel) +{ + dXSARGS; +#ifdef C_MOVE_PANEL + c_exactargs("move_panel", items, 3); + { + PANEL * pan = c_sv2panel(ST(0), 0); + int starty = (int)SvIV(ST(1)); + int startx = (int)SvIV(ST(2)); + int ret = move_panel(pan, starty, startx); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("move_panel"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_panel_hidden) +{ + dXSARGS; +#ifdef C_PANEL_HIDDEN + c_exactargs("panel_hidden", items, 1); + { + PANEL * pan = c_sv2panel(ST(0), 0); + int ret = panel_hidden(pan); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("panel_hidden"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_panel_above) +{ + dXSARGS; +#ifdef C_PANEL_ABOVE + c_exactargs("panel_above", items, 1); + { + PANEL * pan = ST(0) != &PL_sv_undef ? c_sv2panel(ST(0), 0) : NULL; + PANEL * ret = panel_above(pan); + + ST(0) = sv_newmortal(); + c_panel2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("panel_above"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_panel_below) +{ + dXSARGS; +#ifdef C_PANEL_BELOW + c_exactargs("panel_below", items, 1); + { + PANEL * pan = ST(0) != &PL_sv_undef ? c_sv2panel(ST(0), 0) : NULL; + PANEL * ret = panel_below(pan); + + ST(0) = sv_newmortal(); + c_panel2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("panel_below"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_set_panel_userptr) +{ + dXSARGS; +#ifdef C_SET_PANEL_USERPTR + c_exactargs("set_panel_userptr", items, 2); + { + PANEL * pan = c_sv2panel(ST(0), 0); + char * ptr = (char *)SvPV_nolen(ST(1)); + int ret = set_panel_userptr(pan, ptr); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_panel_userptr"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_panel_userptr) +{ + dXSARGS; +#ifdef C_PANEL_USERPTR + c_exactargs("panel_userptr", items, 1); + { + PANEL * pan = c_sv2panel(ST(0), 0); + char * ret = (char *)panel_userptr(pan); + + ST(0) = sv_newmortal(); + sv_setpv((SV*)ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("panel_userptr"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_del_panel) +{ + dXSARGS; +#ifdef C_DEL_PANEL + c_exactargs("del_panel", items, 1); + { + PANEL * pan = c_sv2panel(ST(0), 0); + int ret = del_panel(pan); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("del_panel"); + XSRETURN(0); +#endif +} + + +/* Menu support */ + +/* menu_attributes */ + +XS(XS_Curses_set_menu_fore) +{ + dXSARGS; +#ifdef C_SET_MENU_FORE + c_exactargs("set_menu_fore", items, 2); + { + MENU * menu = c_sv2menu(ST(0), 0); + chtype attr = c_sv2chtype(ST(1)); + int ret = set_menu_fore(menu, attr); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_menu_fore"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_menu_fore) +{ + dXSARGS; +#ifdef C_MENU_FORE + c_exactargs("menu_fore", items, 1); + { + MENU * menu = c_sv2menu(ST(0), 0); + chtype ret = menu_fore(menu); + + ST(0) = sv_newmortal(); + c_chtype2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("menu_fore"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_set_menu_back) +{ + dXSARGS; +#ifdef C_SET_MENU_BACK + c_exactargs("set_menu_back", items, 2); + { + MENU * menu = c_sv2menu(ST(0), 0); + chtype attr = c_sv2chtype(ST(1)); + int ret = set_menu_back(menu, attr); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_menu_back"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_menu_back) +{ + dXSARGS; +#ifdef C_MENU_BACK + c_exactargs("menu_back", items, 1); + { + MENU * menu = c_sv2menu(ST(0), 0); + chtype ret = menu_back(menu); + + ST(0) = sv_newmortal(); + c_chtype2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("menu_back"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_set_menu_grey) +{ + dXSARGS; +#ifdef C_SET_MENU_GREY + c_exactargs("set_menu_grey", items, 2); + { + MENU * menu = c_sv2menu(ST(0), 0); + chtype attr = c_sv2chtype(ST(1)); + int ret = set_menu_grey(menu, attr); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_menu_grey"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_menu_grey) +{ + dXSARGS; +#ifdef C_MENU_GREY + c_exactargs("menu_grey", items, 1); + { + MENU * menu = c_sv2menu(ST(0), 0); + chtype ret = menu_grey(menu); + + ST(0) = sv_newmortal(); + c_chtype2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("menu_grey"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_set_menu_pad) +{ + dXSARGS; +#ifdef C_SET_MENU_PAD + c_exactargs("set_menu_pad", items, 2); + { + MENU * menu = c_sv2menu(ST(0), 0); + int pad = (int)SvIV(ST(1)); + int ret = set_menu_pad(menu, pad); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_menu_pad"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_menu_pad) +{ + dXSARGS; +#ifdef C_MENU_PAD + c_exactargs("menu_pad", items, 1); + { + MENU * menu = c_sv2menu(ST(0), 0); + int ret = menu_pad(menu); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("menu_pad"); + XSRETURN(0); +#endif +} + + +/* menu_cursor */ + +XS(XS_Curses_pos_menu_cursor) +{ + dXSARGS; +#ifdef C_POS_MENU_CURSOR + c_exactargs("pos_menu_cursor", items, 1); + { + MENU * menu = c_sv2menu(ST(0), 0); + int ret = pos_menu_cursor(menu); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("pos_menu_cursor"); + XSRETURN(0); +#endif +} + + +/* menu_driver */ + +XS(XS_Curses_menu_driver) +{ + dXSARGS; +#ifdef C_MENU_DRIVER + c_exactargs("menu_driver", items, 2); + { + MENU * menu = c_sv2menu(ST(0), 0); + int c = (int)SvIV(ST(1)); + int ret = menu_driver(menu, c); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("menu_driver"); + XSRETURN(0); +#endif +} + + +/* menu_format */ + +XS(XS_Curses_set_menu_format) +{ + dXSARGS; +#ifdef C_SET_MENU_FORMAT + c_exactargs("set_menu_format", items, 3); + { + MENU * menu = c_sv2menu(ST(0), 0); + int rows = (int)SvIV(ST(1)); + int cols = (int)SvIV(ST(2)); + int ret = set_menu_format(menu, rows, cols); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_menu_format"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_menu_format) +{ + dXSARGS; +#ifdef C_MENU_FORMAT + c_exactargs("menu_format", items, 3); + { + MENU * menu = c_sv2menu(ST(0), 0); + int rows = 0; + int cols = 0; + + menu_format(menu, &rows, &cols); + sv_setiv(ST(1), (IV)rows);; + sv_setiv(ST(2), (IV)cols);; + } + XSRETURN(0); +#else + c_fun_not_there("menu_format"); + XSRETURN(0); +#endif +} + + +/* menu_items */ + +XS(XS_Curses_set_menu_items) +{ + dXSARGS; +#ifdef C_SET_MENU_ITEMS + c_exactargs("set_menu_items", items, 2); + { + MENU * menu = c_sv2menu(ST(0), 0); + ITEM ** items = (ITEM **)SvPV_nolen(ST(1)); + int ret = set_menu_items(menu, items); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_menu_items"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_menu_items) +{ + dXSARGS; +#ifdef C_MENU_ITEMS + c_exactargs("menu_items", items, 1); + { + MENU * menu = c_sv2menu(ST(0), 0); + ITEM ** ret = menu_items(menu); + + ST(0) = sv_newmortal(); + sv_setpv((SV*)ST(0), (char *)ret); + } + XSRETURN(1); +#else + c_fun_not_there("menu_items"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_item_count) +{ + dXSARGS; +#ifdef C_ITEM_COUNT + c_exactargs("item_count", items, 1); + { + MENU * menu = c_sv2menu(ST(0), 0); + int ret = item_count(menu); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("item_count"); + XSRETURN(0); +#endif +} + + +/* menu_mark */ + +XS(XS_Curses_set_menu_mark) +{ + dXSARGS; +#ifdef C_SET_MENU_MARK + c_exactargs("set_menu_mark", items, 2); + { + MENU * menu = c_sv2menu(ST(0), 0); + char * mark = (char *)SvPV_nolen(ST(1)); + int ret = set_menu_mark(menu, mark); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_menu_mark"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_menu_mark) +{ + dXSARGS; +#ifdef C_MENU_MARK + c_exactargs("menu_mark", items, 1); + { + MENU * menu = c_sv2menu(ST(0), 0); + char * ret = (char *)menu_mark(menu); + + ST(0) = sv_newmortal(); + sv_setpv((SV*)ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("menu_mark"); + XSRETURN(0); +#endif +} + + +/* menu_new */ + +XS(XS_Curses_new_menu) +{ + dXSARGS; +#ifdef C_NEW_MENU + c_exactargs("new_menu", items, 1); + { + ITEM ** items = (ITEM **)SvPV_nolen(ST(0)); + MENU * ret = new_menu(items); + + ST(0) = sv_newmortal(); + c_menu2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("new_menu"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_free_menu) +{ + dXSARGS; +#ifdef C_FREE_MENU + c_exactargs("free_menu", items, 1); + { + MENU * menu = c_sv2menu(ST(0), 0); + int ret = free_menu(menu); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("free_menu"); + XSRETURN(0); +#endif +} + + +/* menu_opts */ + +XS(XS_Curses_menu_opts) +{ + dXSARGS; +#ifdef C_MENU_OPTS + c_exactargs("menu_opts", items, 1); + { + MENU * menu = c_sv2menu(ST(0), 0); + int ret = menu_opts(menu); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("menu_opts"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_set_menu_opts) +{ + dXSARGS; +#ifdef C_SET_MENU_OPTS + c_exactargs("set_menu_opts", items, 2); + { + MENU * menu = c_sv2menu(ST(0), 0); + int opts = (int)SvIV(ST(1)); + int ret = set_menu_opts(menu, opts); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_menu_opts"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_menu_opts_on) +{ + dXSARGS; +#ifdef C_MENU_OPTS_ON + c_exactargs("menu_opts_on", items, 2); + { + MENU * menu = c_sv2menu(ST(0), 0); + int opts = (int)SvIV(ST(1)); + int ret = menu_opts_on(menu, opts); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("menu_opts_on"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_menu_opts_off) +{ + dXSARGS; +#ifdef C_MENU_OPTS_OFF + c_exactargs("menu_opts_off", items, 2); + { + MENU * menu = c_sv2menu(ST(0), 0); + int opts = (int)SvIV(ST(1)); + int ret = menu_opts_off(menu, opts); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("menu_opts_off"); + XSRETURN(0); +#endif +} + + +/* menu_pattern */ + +XS(XS_Curses_set_menu_pattern) +{ + dXSARGS; +#ifdef C_SET_MENU_PATTERN + c_exactargs("set_menu_pattern", items, 2); + { + MENU * menu = c_sv2menu(ST(0), 0); + char * pattern = (char *)SvPV_nolen(ST(1)); + int ret = set_menu_pattern(menu, pattern); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_menu_pattern"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_menu_pattern) +{ + dXSARGS; +#ifdef C_MENU_PATTERN + c_exactargs("menu_pattern", items, 1); + { + MENU * menu = c_sv2menu(ST(0), 0); + char * ret = menu_pattern(menu); + + ST(0) = sv_newmortal(); + sv_setpv((SV*)ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("menu_pattern"); + XSRETURN(0); +#endif +} + + +/* menu_post */ + +XS(XS_Curses_post_menu) +{ + dXSARGS; +#ifdef C_POST_MENU + c_exactargs("post_menu", items, 1); + { + MENU * menu = c_sv2menu(ST(0), 0); + int ret = post_menu(menu); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("post_menu"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_unpost_menu) +{ + dXSARGS; +#ifdef C_UNPOST_MENU + c_exactargs("unpost_menu", items, 1); + { + MENU * menu = c_sv2menu(ST(0), 0); + int ret = unpost_menu(menu); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("unpost_menu"); + XSRETURN(0); +#endif +} + + +/* menu_userptr */ + +XS(XS_Curses_set_menu_userptr) +{ + dXSARGS; +#ifdef C_SET_MENU_USERPTR + c_exactargs("set_menu_userptr", items, 2); + { + MENU * item = c_sv2menu(ST(0), 0); + char * userptr = (char *)SvPV_nolen(ST(1)); + int ret = set_menu_userptr(item, userptr); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_menu_userptr"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_menu_userptr) +{ + dXSARGS; +#ifdef C_MENU_USERPTR + c_exactargs("menu_userptr", items, 1); + { + MENU * item = c_sv2menu(ST(0), 0); + char * ret = menu_userptr(item); + + ST(0) = sv_newmortal(); + sv_setpv((SV*)ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("menu_userptr"); + XSRETURN(0); +#endif +} + + +/* menu_win */ + +XS(XS_Curses_set_menu_win) +{ + dXSARGS; +#ifdef C_SET_MENU_WIN + c_exactargs("set_menu_win", items, 2); + { + MENU * menu = c_sv2menu(ST(0), 0); + WINDOW *win = c_sv2window(ST(1), 1); + int ret = set_menu_win(menu, win); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_menu_win"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_menu_win) +{ + dXSARGS; +#ifdef C_MENU_WIN + c_exactargs("menu_win", items, 1); + { + MENU * menu = c_sv2menu(ST(0), 0); + WINDOW * ret = menu_win(menu); + + ST(0) = sv_newmortal(); + c_window2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("menu_win"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_set_menu_sub) +{ + dXSARGS; +#ifdef C_SET_MENU_SUB + c_exactargs("set_menu_sub", items, 2); + { + MENU * menu = c_sv2menu(ST(0), 0); + WINDOW *win = c_sv2window(ST(1), 1); + int ret = set_menu_sub(menu, win); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_menu_sub"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_menu_sub) +{ + dXSARGS; +#ifdef C_MENU_SUB + c_exactargs("menu_sub", items, 1); + { + MENU * menu = c_sv2menu(ST(0), 0); + WINDOW * ret = menu_sub(menu); + + ST(0) = sv_newmortal(); + c_window2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("menu_sub"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_scale_menu) +{ + dXSARGS; +#ifdef C_SCALE_MENU + c_exactargs("scale_menu", items, 3); + { + MENU * menu = c_sv2menu(ST(0), 0); + int rows = 0; + int cols = 0; + int ret = scale_menu(menu, &rows, &cols); + + sv_setiv(ST(1), (IV)rows);; + sv_setiv(ST(2), (IV)cols);; + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("scale_menu"); + XSRETURN(0); +#endif +} + + +/* menu_item_current */ + +XS(XS_Curses_set_current_item) +{ + dXSARGS; +#ifdef C_SET_CURRENT_ITEM + c_exactargs("set_current_item", items, 2); + { + MENU * menu = c_sv2menu(ST(0), 0); + ITEM * item = c_sv2item(ST(1), 1); + int ret = set_current_item(menu, item); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_current_item"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_current_item) +{ + dXSARGS; +#ifdef C_CURRENT_ITEM + c_exactargs("current_item", items, 1); + { + MENU * menu = c_sv2menu(ST(0), 0); + ITEM * ret = current_item(menu); + + ST(0) = sv_newmortal(); + c_item2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("current_item"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_set_top_row) +{ + dXSARGS; +#ifdef C_SET_TOP_ROW + c_exactargs("set_top_row", items, 2); + { + MENU * menu = c_sv2menu(ST(0), 0); + int row = (int)SvIV(ST(1)); + int ret = set_top_row(menu, row); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_top_row"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_top_row) +{ + dXSARGS; +#ifdef C_TOP_ROW + c_exactargs("top_row", items, 1); + { + MENU * menu = c_sv2menu(ST(0), 0); + int ret = top_row(menu); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("top_row"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_item_index) +{ + dXSARGS; +#ifdef C_ITEM_INDEX + c_exactargs("item_index", items, 1); + { + ITEM * item = c_sv2item(ST(0), 0); + int ret = item_index(item); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("item_index"); + XSRETURN(0); +#endif +} + + +/* menu_item_name */ + +XS(XS_Curses_item_name) +{ + dXSARGS; +#ifdef C_ITEM_NAME + c_exactargs("item_name", items, 1); + { + ITEM * item = c_sv2item(ST(0), 0); + char * ret = (char *)item_name(item); + + ST(0) = sv_newmortal(); + sv_setpv((SV*)ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("item_name"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_item_description) +{ + dXSARGS; +#ifdef C_ITEM_DESCRIPTION + c_exactargs("item_description", items, 1); + { + ITEM * item = c_sv2item(ST(0), 0); + char * ret = (char *)item_description(item); + + ST(0) = sv_newmortal(); + sv_setpv((SV*)ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("item_description"); + XSRETURN(0); +#endif +} + + +/* menu_item_new */ + +XS(XS_Curses_new_item) +{ + dXSARGS; +#ifdef C_NEW_ITEM + c_exactargs("new_item", items, 2); + { + char * name = (char *)SvPV_nolen(ST(0)); + char * descr = (char *)SvPV_nolen(ST(1)); + ITEM * ret = new_item(name, descr); + + ST(0) = sv_newmortal(); + c_item2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("new_item"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_free_item) +{ + dXSARGS; +#ifdef C_FREE_ITEM + c_exactargs("free_item", items, 1); + { + ITEM * item = c_sv2item(ST(0), 0); + int ret = free_item(item); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("free_item"); + XSRETURN(0); +#endif +} + + +/* menu_item_opts */ + +XS(XS_Curses_set_item_opts) +{ + dXSARGS; +#ifdef C_SET_ITEM_OPTS + c_exactargs("set_item_opts", items, 2); + { + ITEM * item = c_sv2item(ST(0), 0); + int opts = (int)SvIV(ST(1)); + int ret = set_item_opts(item, opts); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_item_opts"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_item_opts_on) +{ + dXSARGS; +#ifdef C_ITEM_OPTS_ON + c_exactargs("item_opts_on", items, 2); + { + ITEM * item = c_sv2item(ST(0), 0); + int opts = (int)SvIV(ST(1)); + int ret = item_opts_on(item, opts); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("item_opts_on"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_item_opts_off) +{ + dXSARGS; +#ifdef C_ITEM_OPTS_OFF + c_exactargs("item_opts_off", items, 2); + { + ITEM * item = c_sv2item(ST(0), 0); + int opts = (int)SvIV(ST(1)); + int ret = item_opts_off(item, opts); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("item_opts_off"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_item_opts) +{ + dXSARGS; +#ifdef C_ITEM_OPTS + c_exactargs("item_opts", items, 1); + { + ITEM * item = c_sv2item(ST(0), 0); + int ret = item_opts(item); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("item_opts"); + XSRETURN(0); +#endif +} + + +/* menu_item_userptr */ + +XS(XS_Curses_item_userptr) +{ + dXSARGS; +#ifdef C_ITEM_USERPTR + c_exactargs("item_userptr", items, 1); + { + ITEM * item = c_sv2item(ST(0), 0); + char * ret = (char *)item_userptr(item); + + ST(0) = sv_newmortal(); + sv_setpv((SV*)ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("item_userptr"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_set_item_userptr) +{ + dXSARGS; +#ifdef C_SET_ITEM_USERPTR + c_exactargs("set_item_userptr", items, 2); + { + ITEM * item = c_sv2item(ST(0), 0); + char * ptr = (char *)SvPV_nolen(ST(1)); + int ret = set_item_userptr(item, ptr); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_item_userptr"); + XSRETURN(0); +#endif +} + + +/* menu_item_value */ + +XS(XS_Curses_set_item_value) +{ + dXSARGS; +#ifdef C_SET_ITEM_VALUE + c_exactargs("set_item_value", items, 2); + { + ITEM * item = c_sv2item(ST(0), 0); + bool val = (int)SvIV(ST(1)); + int ret = set_item_value(item, val); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_item_value"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_item_value) +{ + dXSARGS; +#ifdef C_ITEM_VALUE + c_exactargs("item_value", items, 1); + { + ITEM * item = c_sv2item(ST(0), 0); + bool ret = item_value(item); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("item_value"); + XSRETURN(0); +#endif +} + + +/* menu_item_visible */ + +XS(XS_Curses_item_visible) +{ + dXSARGS; +#ifdef C_ITEM_VISIBLE + c_exactargs("item_visible", items, 1); + { + ITEM * item = c_sv2item(ST(0), 0); + bool ret = item_visible(item); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("item_visible"); + XSRETURN(0); +#endif +} + + +/* ncurses menu extension functions */ + +XS(XS_Curses_menu_request_name) +{ + dXSARGS; +#ifdef C_MENU_REQUEST_NAME + c_exactargs("menu_request_name", items, 1); + { + int request = (int)SvIV(ST(0)); + char * ret = (char *)menu_request_name(request); + + ST(0) = sv_newmortal(); + sv_setpv((SV*)ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("menu_request_name"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_menu_request_by_name) +{ + dXSARGS; +#ifdef C_MENU_REQUEST_BY_NAME + c_exactargs("menu_request_by_name", items, 1); + { + char * name = (char *)SvPV_nolen(ST(0)); + int ret = menu_request_by_name(name); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("menu_request_by_name"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_set_menu_spacing) +{ + dXSARGS; +#ifdef C_SET_MENU_SPACING + c_exactargs("set_menu_spacing", items, 4); + { + MENU * menu = c_sv2menu(ST(0), 0); + int descr = (int)SvIV(ST(1)); + int rows = (int)SvIV(ST(2)); + int cols = (int)SvIV(ST(3)); + int ret = set_menu_spacing(menu, descr, rows, cols); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_menu_spacing"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_menu_spacing) +{ + dXSARGS; +#ifdef C_MENU_SPACING + c_exactargs("menu_spacing", items, 4); + { + MENU * menu = c_sv2menu(ST(0), 0); + int descr = 0; + int rows = 0; + int cols = 0; + int ret = menu_spacing(menu, &descr, &rows, &cols); + + sv_setiv(ST(1), (IV)descr);; + sv_setiv(ST(2), (IV)rows);; + sv_setiv(ST(3), (IV)cols);; + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("menu_spacing"); + XSRETURN(0); +#endif +} + + +/* Form support */ + +/* form_cursor */ + +XS(XS_Curses_pos_form_cursor) +{ + dXSARGS; +#ifdef C_POS_FORM_CURSOR + c_exactargs("pos_form_cursor", items, 1); + { + FORM * form = c_sv2form(ST(0), 0); + int ret = pos_form_cursor(form); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("pos_form_cursor"); + XSRETURN(0); +#endif +} + + +/* form_data */ + +XS(XS_Curses_data_ahead) +{ + dXSARGS; +#ifdef C_DATA_AHEAD + c_exactargs("data_ahead", items, 1); + { + FORM * form = c_sv2form(ST(0), 0); + bool ret = data_ahead(form); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("data_ahead"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_data_behind) +{ + dXSARGS; +#ifdef C_DATA_BEHIND + c_exactargs("data_behind", items, 1); + { + FORM * form = c_sv2form(ST(0), 0); + bool ret = data_behind(form); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("data_behind"); + XSRETURN(0); +#endif +} + + +/* form_driver */ + +XS(XS_Curses_form_driver) +{ + dXSARGS; +#ifdef C_FORM_DRIVER + c_exactargs("form_driver", items, 2); + { + FORM * form = c_sv2form(ST(0), 0); + int c = (int)SvIV(ST(1)); + int ret = form_driver(form, c); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("form_driver"); + XSRETURN(0); +#endif +} + + +/* form_field */ + +XS(XS_Curses_set_form_fields) +{ + dXSARGS; +#ifdef C_SET_FORM_FIELDS + c_exactargs("set_form_fields", items, 2); + { + FORM * form = c_sv2form(ST(0), 0); + FIELD **fields = (FIELD **)SvPV_nolen(ST(1)); + int ret = set_form_fields(form, fields); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_form_fields"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_form_fields) +{ + dXSARGS; +#ifdef C_FORM_FIELDS + c_exactargs("form_fields", items, 1); + { + FORM * form = c_sv2form(ST(0), 0); + FIELD ** ret = form_fields(form); + + ST(0) = sv_newmortal(); + sv_setpv((SV*)ST(0), (char *)ret); + } + XSRETURN(1); +#else + c_fun_not_there("form_fields"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_field_count) +{ + dXSARGS; +#ifdef C_FIELD_COUNT + c_exactargs("field_count", items, 1); + { + FORM * form = c_sv2form(ST(0), 0); + int ret = field_count(form); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("field_count"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_move_field) +{ + dXSARGS; +#ifdef C_MOVE_FIELD + c_exactargs("move_field", items, 3); + { + FIELD * field = c_sv2field(ST(0), 0); + int frow = (int)SvIV(ST(1)); + int fcol = (int)SvIV(ST(2)); + int ret = move_field(field, frow, fcol); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("move_field"); + XSRETURN(0); +#endif +} + + +/* form_new */ + +XS(XS_Curses_new_form) { + dXSARGS; +#ifdef C_NEW_FORM + c_exactargs("new_form", items, 1); + { + FIELD ** fields = (FIELD **)SvPV_nolen(ST(0)); + FORM * ret = new_form(fields); + + ST(0) = sv_newmortal(); + c_form2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("new_form"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_free_form) +{ + dXSARGS; +#ifdef C_FREE_FORM + c_exactargs("free_form", items, 1); + { + FORM * form = c_sv2form(ST(0), 0); + int ret = free_form(form); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("free_form"); + XSRETURN(0); +#endif +} + + +/* form_new_page */ + +XS(XS_Curses_set_new_page) +{ + dXSARGS; +#ifdef C_SET_NEW_PAGE + c_exactargs("set_new_page", items, 2); + { + FIELD * field = c_sv2field(ST(0), 0); + bool new_page_flag = (int)SvIV(ST(1)); + int ret = set_new_page(field, new_page_flag); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_new_page"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_new_page) +{ + dXSARGS; +#ifdef C_NEW_PAGE + c_exactargs("new_page", items, 1); + { + FIELD * field = c_sv2field(ST(0), 0); + bool ret = new_page(field); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("new_page"); + XSRETURN(0); +#endif +} + + +/* form_opts */ + +XS(XS_Curses_set_form_opts) +{ + dXSARGS; +#ifdef C_SET_FORM_OPTS + c_exactargs("set_form_opts", items, 2); + { + FORM * form = c_sv2form(ST(0), 0); + int opts = (int)SvIV(ST(1)); + int ret = set_form_opts(form, opts); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_form_opts"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_form_opts_on) +{ + dXSARGS; +#ifdef C_FORM_OPTS_ON + c_exactargs("form_opts_on", items, 2); + { + FORM * form = c_sv2form(ST(0), 0); + int opts = (int)SvIV(ST(1)); + int ret = form_opts_on(form, opts); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("form_opts_on"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_form_opts_off) +{ + dXSARGS; +#ifdef C_FORM_OPTS_OFF + c_exactargs("form_opts_off", items, 2); + { + FORM * form = c_sv2form(ST(0), 0); + int opts = (int)SvIV(ST(1)); + int ret = form_opts_off(form, opts); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("form_opts_off"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_form_opts) +{ + dXSARGS; +#ifdef C_FORM_OPTS + c_exactargs("form_opts", items, 1); + { + FORM * form = c_sv2form(ST(0), 0); + int ret = form_opts(form); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("form_opts"); + XSRETURN(0); +#endif +} + + +/* form_page */ + +XS(XS_Curses_set_current_field) +{ + dXSARGS; +#ifdef C_SET_CURRENT_FIELD + c_exactargs("set_current_field", items, 2); + { + FORM * form = c_sv2form(ST(0), 0); + FIELD * field = c_sv2field(ST(1), 1); + int ret = set_current_field(form, field); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_current_field"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_current_field) +{ + dXSARGS; +#ifdef C_CURRENT_FIELD + c_exactargs("current_field", items, 1); + { + FORM * form = c_sv2form(ST(0), 0); + FIELD * ret = current_field(form); + + ST(0) = sv_newmortal(); + c_field2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("current_field"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_set_form_page) +{ + dXSARGS; +#ifdef C_SET_FORM_PAGE + c_exactargs("set_form_page", items, 2); + { + FORM * form = c_sv2form(ST(0), 0); + int n = (int)SvIV(ST(1)); + int ret = set_form_page(form, n); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_form_page"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_form_page) +{ + dXSARGS; +#ifdef C_FORM_PAGE + c_exactargs("form_page", items, 1); + { + FORM * form = c_sv2form(ST(0), 0); + int ret = form_page(form); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("form_page"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_field_index) +{ + dXSARGS; +#ifdef C_FIELD_INDEX + c_exactargs("field_index", items, 1); + { + FIELD * field = c_sv2field(ST(0), 0); + int ret = field_index(field); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("field_index"); + XSRETURN(0); +#endif +} + + +/* form_post */ + +XS(XS_Curses_post_form) +{ + dXSARGS; +#ifdef C_POST_FORM + c_exactargs("post_form", items, 1); + { + FORM * form = c_sv2form(ST(0), 0); + int ret = post_form(form); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("post_form"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_unpost_form) +{ + dXSARGS; +#ifdef C_UNPOST_FORM + c_exactargs("unpost_form", items, 1); + { + FORM * form = c_sv2form(ST(0), 0); + int ret = unpost_form(form); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("unpost_form"); + XSRETURN(0); +#endif +} + + +/* form_userptr */ + +XS(XS_Curses_set_form_userptr) +{ + dXSARGS; +#ifdef C_SET_FORM_USERPTR + c_exactargs("set_form_userptr", items, 2); + { + FORM * form = c_sv2form(ST(0), 0); + char * userptr = (char *)SvPV_nolen(ST(1)); + int ret = set_form_userptr(form, userptr); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_form_userptr"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_form_userptr) +{ + dXSARGS; +#ifdef C_FORM_USERPTR + c_exactargs("form_userptr", items, 1); + { + FORM * form = c_sv2form(ST(0), 0); + char * ret = form_userptr(form); + + ST(0) = sv_newmortal(); + sv_setpv((SV*)ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("form_userptr"); + XSRETURN(0); +#endif +} + + +/* form_win */ + +XS(XS_Curses_set_form_win) +{ + dXSARGS; +#ifdef C_SET_FORM_WIN + c_exactargs("set_form_win", items, 2); + { + FORM * form = c_sv2form(ST(0), 0); + WINDOW *win = c_sv2window(ST(1), 1); + int ret = set_form_win(form, win); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_form_win"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_form_win) +{ + dXSARGS; +#ifdef C_FORM_WIN + c_exactargs("form_win", items, 1); + { + FORM * form = c_sv2form(ST(0), 0); + WINDOW * ret = form_win(form); + + ST(0) = sv_newmortal(); + c_window2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("form_win"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_set_form_sub) +{ + dXSARGS; +#ifdef C_SET_FORM_SUB + c_exactargs("set_form_sub", items, 2); + { + FORM * form = c_sv2form(ST(0), 0); + WINDOW *sub = c_sv2window(ST(1), 1); + int ret = set_form_sub(form, sub); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_form_sub"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_form_sub) +{ + dXSARGS; +#ifdef C_FORM_SUB + c_exactargs("form_sub", items, 1); + { + FORM * form = c_sv2form(ST(0), 0); + WINDOW * ret = form_sub(form); + + ST(0) = sv_newmortal(); + c_window2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("form_sub"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_scale_form) +{ + dXSARGS; +#ifdef C_SCALE_FORM + c_exactargs("scale_form", items, 3); + { + FORM * form = c_sv2form(ST(0), 0); + int rows = 0; + int cols = 0; + int ret = scale_form(form, &rows, &cols); + + sv_setiv(ST(1), (IV)rows);; + sv_setiv(ST(2), (IV)cols);; + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("scale_form"); + XSRETURN(0); +#endif +} + + +/* form_field_attributes */ + +XS(XS_Curses_set_field_fore) +{ + dXSARGS; +#ifdef C_SET_FIELD_FORE + c_exactargs("set_field_fore", items, 2); + { + FIELD * field = c_sv2field(ST(0), 0); + chtype attr = c_sv2chtype(ST(1)); + int ret = set_field_fore(field, attr); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_field_fore"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_field_fore) +{ + dXSARGS; +#ifdef C_FIELD_FORE + c_exactargs("field_fore", items, 1); + { + FIELD * field = c_sv2field(ST(0), 0); + chtype ret = field_fore(field); + + ST(0) = sv_newmortal(); + c_chtype2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("field_fore"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_set_field_back) +{ + dXSARGS; +#ifdef C_SET_FIELD_BACK + c_exactargs("set_field_back", items, 2); + { + FIELD * field = c_sv2field(ST(0), 0); + chtype attr = c_sv2chtype(ST(1)); + int ret = set_field_back(field, attr); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_field_back"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_field_back) +{ + dXSARGS; +#ifdef C_FIELD_BACK + c_exactargs("field_back", items, 1); + { + FIELD * field = c_sv2field(ST(0), 0); + chtype ret = field_back(field); + + ST(0) = sv_newmortal(); + c_chtype2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("field_back"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_set_field_pad) +{ + dXSARGS; +#ifdef C_SET_FIELD_PAD + c_exactargs("set_field_pad", items, 2); + { + FIELD * field = c_sv2field(ST(0), 0); + int pad = (int)SvIV(ST(1)); + int ret = set_field_pad(field, pad); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_field_pad"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_field_pad) +{ + dXSARGS; +#ifdef C_FIELD_PAD + c_exactargs("field_pad", items, 1); + { + FIELD * field = c_sv2field(ST(0), 0); + chtype ret = field_pad(field); + + ST(0) = sv_newmortal(); + c_chtype2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("field_pad"); + XSRETURN(0); +#endif +} + + +/* form_field_buffer */ + +XS(XS_Curses_set_field_buffer) +{ + dXSARGS; +#ifdef C_SET_FIELD_BUFFER + c_exactargs("set_field_buffer", items, 3); + { + FIELD * field = c_sv2field(ST(0), 0); + int buf = (int)SvIV(ST(1)); + char * value = (char *)SvPV_nolen(ST(2)); + int ret = set_field_buffer(field, buf, value); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_field_buffer"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_field_buffer) +{ + dXSARGS; +#ifdef C_FIELD_BUFFER + c_exactargs("field_buffer", items, 2); + { + FIELD * field = c_sv2field(ST(0), 0); + int buffer = (int)SvIV(ST(1)); + char * ret = field_buffer(field, buffer); + + ST(0) = sv_newmortal(); + sv_setpv((SV*)ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("field_buffer"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_set_field_status) +{ + dXSARGS; +#ifdef C_SET_FIELD_STATUS + c_exactargs("set_field_status", items, 2); + { + FIELD * field = c_sv2field(ST(0), 0); + bool status = (int)SvIV(ST(1)); + int ret = set_field_status(field, status); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_field_status"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_field_status) +{ + dXSARGS; +#ifdef C_FIELD_STATUS + c_exactargs("field_status", items, 1); + { + FIELD * field = c_sv2field(ST(0), 0); + bool ret = field_status(field); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("field_status"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_set_max_field) +{ + dXSARGS; +#ifdef C_SET_MAX_FIELD + c_exactargs("set_max_field", items, 2); + { + FIELD * field = c_sv2field(ST(0), 0); + int max = (int)SvIV(ST(1)); + int ret = set_max_field(field, max); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_max_field"); + XSRETURN(0); +#endif +} + + +/* form_field_info */ + +XS(XS_Curses_field_info) +{ + dXSARGS; +#ifdef C_FIELD_INFO + c_exactargs("field_info", items, 7); + { + FIELD * field = c_sv2field(ST(0), 0); + int rows = 0; + int cols = 0; + int frow = 0; + int fcol = 0; + int nrow = 0; + int nbuf = 0; + int ret = field_info(field, &rows, &cols, &frow, &fcol, &nrow, &nbuf); + + sv_setiv(ST(1), (IV)rows);; + sv_setiv(ST(2), (IV)cols);; + sv_setiv(ST(3), (IV)frow);; + sv_setiv(ST(4), (IV)fcol);; + sv_setiv(ST(5), (IV)nrow);; + sv_setiv(ST(6), (IV)nbuf);; + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("field_info"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_dynamic_field_info) +{ + dXSARGS; +#ifdef C_DYNAMIC_FIELD_INFO + c_exactargs("dynamic_field_info", items, 4); + { + FIELD * field = c_sv2field(ST(0), 0); + int rows = 0; + int cols = 0; + int max = 0; + int ret = dynamic_field_info(field, &rows, &cols, &max); + + sv_setiv(ST(1), (IV)rows);; + sv_setiv(ST(2), (IV)cols);; + sv_setiv(ST(3), (IV)max);; + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("dynamic_field_info"); + XSRETURN(0); +#endif +} + + +/* form_field_just */ + +XS(XS_Curses_set_field_just) +{ + dXSARGS; +#ifdef C_SET_FIELD_JUST + c_exactargs("set_field_just", items, 2); + { + FIELD * field = c_sv2field(ST(0), 0); + int justif = (int)SvIV(ST(1)); + int ret = set_field_just(field, justif); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_field_just"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_field_just) +{ + dXSARGS; +#ifdef C_FIELD_JUST + c_exactargs("field_just", items, 1); + { + FIELD * field = c_sv2field(ST(0), 0); + int ret = field_just(field); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("field_just"); + XSRETURN(0); +#endif +} + + +/* form_field_new */ + +XS(XS_Curses_new_field) +{ + dXSARGS; +#ifdef C_NEW_FIELD + c_exactargs("new_field", items, 6); + { + int const height = (int)SvIV(ST(0)); + int const width = (int)SvIV(ST(1)); + int const toprow = (int)SvIV(ST(2)); + int const leftcol = (int)SvIV(ST(3)); + int const offscreen = (int)SvIV(ST(4)); + int const nbuffers = (int)SvIV(ST(5)); + FIELD * ret = new_field(height, width, toprow, leftcol, offscreen, nbuffers); + ST(0) = sv_newmortal(); + c_field2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("new_field"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_dup_field) +{ + dXSARGS; +#ifdef C_DUP_FIELD + c_exactargs("dup_field", items, 3); + { + FIELD * field = c_sv2field(ST(0), 0); + int toprow = (int)SvIV(ST(1)); + int leftcol = (int)SvIV(ST(2)); + FIELD * ret = dup_field(field, toprow, leftcol); + + ST(0) = sv_newmortal(); + c_field2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("dup_field"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_link_field) +{ + dXSARGS; +#ifdef C_LINK_FIELD + c_exactargs("link_field", items, 3); + { + FIELD * field = c_sv2field(ST(0), 0); + int toprow = (int)SvIV(ST(1)); + int leftcol = (int)SvIV(ST(2)); + FIELD * ret = link_field(field, toprow, leftcol); + + ST(0) = sv_newmortal(); + c_field2sv(ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("link_field"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_free_field) +{ + dXSARGS; +#ifdef C_FREE_FIELD + c_exactargs("free_field", items, 1); + { + FIELD * field = c_sv2field(ST(0), 0); + int ret = free_field(field); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("free_field"); + XSRETURN(0); +#endif +} + + +/* form_field_opts */ + +XS(XS_Curses_set_field_opts) +{ + dXSARGS; +#ifdef C_SET_FIELD_OPTS + c_exactargs("set_field_opts", items, 2); + { + FIELD * field = c_sv2field(ST(0), 0); + int opts = (int)SvIV(ST(1)); + int ret = set_field_opts(field, opts); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_field_opts"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_field_opts_on) +{ + dXSARGS; +#ifdef C_FIELD_OPTS_ON + c_exactargs("field_opts_on", items, 2); + { + FIELD * field = c_sv2field(ST(0), 0); + int opts = (int)SvIV(ST(1)); + int ret = field_opts_on(field, opts); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("field_opts_on"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_field_opts_off) +{ + dXSARGS; +#ifdef C_FIELD_OPTS_OFF + c_exactargs("field_opts_off", items, 2); + { + FIELD * field = c_sv2field(ST(0), 0); + int opts = (int)SvIV(ST(1)); + int ret = field_opts_off(field, opts); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("field_opts_off"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_field_opts) +{ + dXSARGS; +#ifdef C_FIELD_OPTS + c_exactargs("field_opts", items, 1); + { + FIELD * field = c_sv2field(ST(0), 0); + int ret = field_opts(field); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("field_opts"); + XSRETURN(0); +#endif +} + + +/* form_field_userptr */ + +XS(XS_Curses_set_field_userptr) +{ + dXSARGS; +#ifdef C_SET_FIELD_USERPTR + c_exactargs("set_field_userptr", items, 2); + { + FIELD * field = c_sv2field(ST(0), 0); + char * userptr = (char *)SvPV_nolen(ST(1)); + int ret = set_field_userptr(field, userptr); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("set_field_userptr"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_field_userptr) +{ + dXSARGS; +#ifdef C_FIELD_USERPTR + c_exactargs("field_userptr", items, 1); + { + FIELD * field = c_sv2field(ST(0), 0); + char * ret = field_userptr(field); + + ST(0) = sv_newmortal(); + sv_setpv((SV*)ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("field_userptr"); + XSRETURN(0); +#endif +} + + +/* form_field_validation */ + +XS(XS_Curses_field_arg) +{ + dXSARGS; +#ifdef C_FIELD_ARG + c_exactargs("field_arg", items, 1); + { + FIELD * field = c_sv2field(ST(0), 0); + char * ret = field_arg(field); + + ST(0) = sv_newmortal(); + sv_setpv((SV*)ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("field_arg"); + XSRETURN(0); +#endif +} + + +/* ncurses form extension functions */ + +XS(XS_Curses_form_request_name) +{ + dXSARGS; +#ifdef C_FORM_REQUEST_NAME + c_exactargs("form_request_name", items, 1); + { + int request = (int)SvIV(ST(0)); + char * ret = (char *)form_request_name(request); + + ST(0) = sv_newmortal(); + sv_setpv((SV*)ST(0), ret); + } + XSRETURN(1); +#else + c_fun_not_there("form_request_name"); + XSRETURN(0); +#endif +} + +XS(XS_Curses_form_request_by_name) +{ + dXSARGS; +#ifdef C_FORM_REQUEST_BY_NAME + c_exactargs("form_request_by_name", items, 1); + { + char * name = (char *)SvPV_nolen(ST(0)); + int ret = form_request_by_name(name); + + ST(0) = sv_newmortal(); + sv_setiv(ST(0), (IV)ret); + } + XSRETURN(1); +#else + c_fun_not_there("form_request_by_name"); + XSRETURN(0); +#endif +} + diff --git a/Curses-1.23/CursesTyp.h b/Curses-1.23/CursesTyp.h new file mode 100644 index 0000000..d190836 --- /dev/null +++ b/Curses-1.23/CursesTyp.h @@ -0,0 +1,52 @@ +/*============================================================================= + 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. +*/ + diff --git a/Curses-1.23/CursesVar.c b/Curses-1.23/CursesVar.c new file mode 100644 index 0000000..aa3c4d5 --- /dev/null +++ b/Curses-1.23/CursesVar.c @@ -0,0 +1,248 @@ +/* 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); +} diff --git a/Curses-1.23/HISTORY b/Curses-1.23/HISTORY new file mode 100644 index 0000000..3e4f44c --- /dev/null +++ b/Curses-1.23/HISTORY @@ -0,0 +1,219 @@ +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 rezic 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 . + + 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 + 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? + diff --git a/Curses-1.23/INSTALL b/Curses-1.23/INSTALL new file mode 100644 index 0000000..7119330 --- /dev/null +++ b/Curses-1.23/INSTALL @@ -0,0 +1,280 @@ +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 + + 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=" 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. diff --git a/Curses-1.23/MAINTENANCE b/Curses-1.23/MAINTENANCE new file mode 100644 index 0000000..9fdec5d --- /dev/null +++ b/Curses-1.23/MAINTENANCE @@ -0,0 +1,73 @@ +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. diff --git a/Curses-1.23/MANIFEST b/Curses-1.23/MANIFEST new file mode 100644 index 0000000..415f893 --- /dev/null +++ b/Curses-1.23/MANIFEST @@ -0,0 +1,70 @@ +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 diff --git a/Curses-1.23/Makefile.PL b/Curses-1.23/Makefile.PL new file mode 100755 index 0000000..dfadf92 --- /dev/null +++ b/Curses-1.23/Makefile.PL @@ -0,0 +1,629 @@ +#! /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" ] +# 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 ] +# +# $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 = < /* not in perl.h ??? */ +#endif +#ifdef WIN32 +#include +#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 = "); + 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(); +} diff --git a/Curses-1.23/demo b/Curses-1.23/demo new file mode 100755 index 0000000..f480a48 --- /dev/null +++ b/Curses-1.23/demo @@ -0,0 +1,79 @@ +#! /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(); diff --git a/Curses-1.23/demo.form b/Curses-1.23/demo.form new file mode 100755 index 0000000..df3874e --- /dev/null +++ b/Curses-1.23/demo.form @@ -0,0 +1,199 @@ +#! /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); diff --git a/Curses-1.23/demo.menu b/Curses-1.23/demo.menu new file mode 100755 index 0000000..ff7f49e --- /dev/null +++ b/Curses-1.23/demo.menu @@ -0,0 +1,121 @@ +#! /usr/bin/perl +## +## This code contributed by Yury Pshenichny +## based on demo.panel by Chris Leach +## 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; +} diff --git a/Curses-1.23/demo.panel b/Curses-1.23/demo.panel new file mode 100755 index 0000000..9ca749c --- /dev/null +++ b/Curses-1.23/demo.panel @@ -0,0 +1,80 @@ +#! /usr/bin/perl +## +## This code contributed by Chris Leach + +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; +} diff --git a/Curses-1.23/demo2 b/Curses-1.23/demo2 new file mode 100755 index 0000000..ac09d0e --- /dev/null +++ b/Curses-1.23/demo2 @@ -0,0 +1,78 @@ +#! /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(); diff --git a/Curses-1.23/gdc b/Curses-1.23/gdc new file mode 100755 index 0000000..58a132c --- /dev/null +++ b/Curses-1.23/gdc @@ -0,0 +1,150 @@ +#! /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; +} diff --git a/Curses-1.23/gen/Gen.pm b/Curses-1.23/gen/Gen.pm new file mode 100644 index 0000000..3683226 --- /dev/null +++ b/Curses-1.23/gen/Gen.pm @@ -0,0 +1,468 @@ +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 () { + 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 () { + next if /^!/; + + while (s/\\\n//) { + $_ .= ; + 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 () { + next if /^!/; + + while (s/\\\n//) { + $_ .= ; + 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 () { + next if /^!/; + + while (s/\\\n//) { + $_ .= ; + 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 () { + next if /^!/; + + while (s/\\\n//) { + $_ .= ; + 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; diff --git a/Curses-1.23/gen/README b/Curses-1.23/gen/README new file mode 100644 index 0000000..ad3d7b9 --- /dev/null +++ b/Curses-1.23/gen/README @@ -0,0 +1,5 @@ +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 diff --git a/Curses-1.23/gen/increase-version b/Curses-1.23/gen/increase-version new file mode 100755 index 0000000..f9f1dac --- /dev/null +++ b/Curses-1.23/gen/increase-version @@ -0,0 +1,22 @@ +#!/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 " + 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 diff --git a/Curses-1.23/gen/list.con b/Curses-1.23/gen/list.con new file mode 100644 index 0000000..19ac543 --- /dev/null +++ b/Curses-1.23/gen/list.con @@ -0,0 +1,304 @@ +> 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; diff --git a/Curses-1.23/gen/list.fun b/Curses-1.23/gen/list.fun new file mode 100644 index 0000000..d6819a0 --- /dev/null +++ b/Curses-1.23/gen/list.fun @@ -0,0 +1,645 @@ +!! 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} " 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 getbkgd(void); + +/* curs_border */ + +> int {w}border(chtype ls, chtype rs_, chtype ts, chtype bs, \ + chtype tl, chtype tr, chtype bl, chtype br); +> int 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 getyx({out} int y, {out} int x); +> void getparyx({out} int y, {out} int x); +> void getbegyx({out} int y, {out} int x); +> void 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 intrflush(bool bf); +> int keypad(bool bf); +> int meta(bool bf); +> int nodelay(bool bf); +> int 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 clearok(bool bf); +#ifdef C_INTIDLOK +> {itest} int idlok(bool bf); +#else +> {dup} void idlok(bool bf); +#endif +> void idcok(bool bf); +> void immedok(bool bf); +> int leaveok(bool bf); +> int {w}setscrreg(int top, int bot); +> int 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 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 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 touchwin(void); +#ifdef C_TOUCH3ARGS +> {notest} int touchline(int start, int count); +#else +> {dup} int touchline(int y, int sx, int ex); +#endif + +> int untouchwin(void); +> int |w|touchln(int y, int n, int changed); +> int is_linetouched(int line); +> int 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 delwin(void); +> int mvwin(int y, int x); +> WINDOW *subwin(int nlines, int ncols, int beginy, int beginx); +> WINDOW *derwin(int nlines, int ncols, int beginy, int beginx); +> int mvderwin(int par_y, int par_x); +> WINDOW *dupwin(void); +> void |w|syncup(void); +> int 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 getmaxy(void); +> int getmaxx(void); + +/* old BSD curses calls */ + +> void 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); diff --git a/Curses-1.23/gen/list.typ b/Curses-1.23/gen/list.typ new file mode 100644 index 0000000..6d96150 --- /dev/null +++ b/Curses-1.23/gen/list.typ @@ -0,0 +1,6 @@ +> attr_t sym; +> bool sym; +> chtype sym; +> MEVENT sym; +> mmask_t sym; +> SCREEN sym; diff --git a/Curses-1.23/gen/list.var b/Curses-1.23/gen/list.var new file mode 100644 index 0000000..b48d5e6 --- /dev/null +++ b/Curses-1.23/gen/list.var @@ -0,0 +1,9 @@ +> int LINES; +> int COLS; +> WINDOW *stdscr; +> WINDOW *curscr; +> int COLORS; +> int COLOR_PAIRS; +/* char *ttytype; */ +/* char *Def_term; */ +/* bool My_term; */ diff --git a/Curses-1.23/gen/make.Curses.pm b/Curses-1.23/gen/make.Curses.pm new file mode 100755 index 0000000..1d97086 --- /dev/null +++ b/Curses-1.23/gen/make.Curses.pm @@ -0,0 +1,559 @@ +#!/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 < 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, I, and/or I. 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 has +three other variants: C, C, and C. +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 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, along with a column listing if it is I. If +so, it takes a varying number of arguments as follows: + +=over 4 + +C + +I is an optional window argument, defaulting to C if not +specified. + +I is an optional coordinate pair used to move the cursor, +defaulting to no move if not specified. + +I 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 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 package. See L<"Perl 4.X C 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 (see +L<"Supported Functions"> below and L<"Unified Functions"> above) +can be called as a method for a Curses object. + +Do not use C if using objects, as the first call to get +a C 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 Compatibility + +C 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 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, even with +the C 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 and C. This is because of a Perl bug. +See the L section for details. + +=head2 Incompatibilities with previous versions of C + +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 and C +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 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 function. See the DESCRIPTION section on L for more information. + +=item * Curses function '%s' is not defined by your vendor at ... + +You have a C 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 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 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 interface to the C +variables. Don't do that. :-) + +=item * Anything else + +Check out the F 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 and C), you might run into +a bug in Perl where the "magic" isn't called early enough. This is +manifested by the C 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 + +=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 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 + + 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 + + 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 + + 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 diff --git a/Curses-1.23/gen/make.CursesBoot.c b/Curses-1.23/gen/make.CursesBoot.c new file mode 100755 index 0000000..5d17c3b --- /dev/null +++ b/Curses-1.23/gen/make.CursesBoot.c @@ -0,0 +1,128 @@ +#!/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); +} diff --git a/Curses-1.23/gen/make.CursesCon.c b/Curses-1.23/gen/make.CursesCon.c new file mode 100755 index 0000000..6df617b --- /dev/null +++ b/Curses-1.23/gen/make.CursesCon.c @@ -0,0 +1,69 @@ +#!/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<{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 diff --git a/Curses-1.23/gen/make.CursesFun.c b/Curses-1.23/gen/make.CursesFun.c new file mode 100755 index 0000000..574e85d --- /dev/null +++ b/Curses-1.23/gen/make.CursesFun.c @@ -0,0 +1,150 @@ +#!/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<{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<{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 diff --git a/Curses-1.23/gen/make.CursesTyp.h b/Curses-1.23/gen/make.CursesTyp.h new file mode 100755 index 0000000..3274768 --- /dev/null +++ b/Curses-1.23/gen/make.CursesTyp.h @@ -0,0 +1,54 @@ +#!/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<{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 diff --git a/Curses-1.23/gen/make.CursesVar.c b/Curses-1.23/gen/make.CursesVar.c new file mode 100755 index 0000000..8576ff8 --- /dev/null +++ b/Curses-1.23/gen/make.CursesVar.c @@ -0,0 +1,182 @@ +#!/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<{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<{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<{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); +} diff --git a/Curses-1.23/gen/make.list.syms b/Curses-1.23/gen/make.list.syms new file mode 100755 index 0000000..f4812d7 --- /dev/null +++ b/Curses-1.23/gen/make.list.syms @@ -0,0 +1,67 @@ +#!/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 + diff --git a/Curses-1.23/hints/c-MSWin32.borland.h b/Curses-1.23/hints/c-MSWin32.borland.h new file mode 100644 index 0000000..784875c --- /dev/null +++ b/Curses-1.23/hints/c-MSWin32.borland.h @@ -0,0 +1,38 @@ +/* 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 */ + +/* We used to include , but users found it is actually + installed as . 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 + +#ifdef C_PANELSUPPORT +#include +#endif + +#ifdef C_MENUSUPPORT +#include +#endif + +#ifdef C_FORMSUPPORT +#include +#endif + +#define C_LONGNAME +#define C_LONG0ARGS +#undef C_LONG2ARGS + +#define C_TOUCHLINE +#define C_TOUCH3ARGS +#undef C_TOUCH4ARGS diff --git a/Curses-1.23/hints/c-MSWin32.visualc.h b/Curses-1.23/hints/c-MSWin32.visualc.h new file mode 100644 index 0000000..3c7fa33 --- /dev/null +++ b/Curses-1.23/hints/c-MSWin32.visualc.h @@ -0,0 +1,38 @@ +/* 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 */ + +/* We used to include , but users found it is actually + installed as . 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 + +#ifdef C_PANELSUPPORT +#include +#endif + +#ifdef C_MENUSUPPORT +#include +#endif + +#ifdef C_FORMSUPPORT +#include +#endif + +#define C_LONGNAME +#define C_LONG0ARGS +#undef C_LONG2ARGS + +#define C_TOUCHLINE +#define C_TOUCH3ARGS +#undef C_TOUCH4ARGS diff --git a/Curses-1.23/hints/c-aix.h b/Curses-1.23/hints/c-aix.h new file mode 100644 index 0000000..e2e6129 --- /dev/null +++ b/Curses-1.23/hints/c-aix.h @@ -0,0 +1,27 @@ +/* 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 + +#ifdef C_PANELSUPPORT +#include +#endif + +#ifdef C_MENUSUPPORT +#include +#endif + +#ifdef C_FORMSUPPORT +#include +#endif + +#define C_LONGNAME +#define C_LONG0ARGS +#undef C_LONG2ARGS + +#define C_TOUCHLINE +#define C_TOUCH3ARGS +#undef C_TOUCH4ARGS diff --git a/Curses-1.23/hints/c-bsd386.h b/Curses-1.23/hints/c-bsd386.h new file mode 100644 index 0000000..ad96dc5 --- /dev/null +++ b/Curses-1.23/hints/c-bsd386.h @@ -0,0 +1,30 @@ +/* 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" */ + +#include + +#ifdef C_PANELSUPPORT +#include +#endif + +#ifdef C_MENUSUPPORT +#include +#endif + +#ifdef C_FORMSUPPORT +#include +#endif + +#define C_LONGNAME +#undef C_LONG0ARGS +#define C_LONG2ARGS + +#define C_TOUCHLINE +#undef C_TOUCH3ARGS +#define C_TOUCH4ARGS diff --git a/Curses-1.23/hints/c-bsdos.h b/Curses-1.23/hints/c-bsdos.h new file mode 100644 index 0000000..9667e37 --- /dev/null +++ b/Curses-1.23/hints/c-bsdos.h @@ -0,0 +1,29 @@ +/* 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 */ + +#include + +#ifdef C_PANELSUPPORT +#include +#endif + +#ifdef C_MENUSUPPORT +#include +#endif + +#ifdef C_FORMSUPPORT +#include +#endif + +#define C_LONGNAME +#undef C_LONG0ARGS +#define C_LONG2ARGS + +#define C_TOUCHLINE +#undef C_TOUCH3ARGS +#define C_TOUCH4ARGS diff --git a/Curses-1.23/hints/c-cygwin.h b/Curses-1.23/hints/c-cygwin.h new file mode 100644 index 0000000..9f9527e --- /dev/null +++ b/Curses-1.23/hints/c-cygwin.h @@ -0,0 +1,31 @@ +/* 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 + (2001) and yselkowitz@users.sourceforge.net (October 2005) +*/ + +#include + +#ifdef C_PANELSUPPORT +#include +#endif + +#ifdef C_MENUSUPPORT +#include +#endif + +#ifdef C_FORMSUPPORT +#include +#endif + +#undef C_LONGNAME +#undef C_LONG0ARGS +#undef C_LONG2ARGS + +#undef C_TOUCHLINE +#undef C_TOUCH3ARGS +#undef C_TOUCH4ARGS diff --git a/Curses-1.23/hints/c-darwin.h b/Curses-1.23/hints/c-darwin.h new file mode 100644 index 0000000..0194872 --- /dev/null +++ b/Curses-1.23/hints/c-darwin.h @@ -0,0 +1,29 @@ +/* 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 + +#ifdef C_PANELSUPPORT +#include +#endif + + +#ifdef C_MENUSUPPORT +#include +#endif + + +#ifdef C_FORMSUPPORT +#include +#endif + +#define C_LONGNAME +#define C_LONG0ARGS +#undef C_LONG2ARGS + +#define C_TOUCHLINE +#define C_TOUCH3ARGS +#undef C_TOUCH4ARGS diff --git a/Curses-1.23/hints/c-darwin.old.h b/Curses-1.23/hints/c-darwin.old.h new file mode 100644 index 0000000..1aaefb6 --- /dev/null +++ b/Curses-1.23/hints/c-darwin.old.h @@ -0,0 +1,29 @@ +/* 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 */ + +#include + +#ifdef C_PANELSUPPORT +#include +#endif + +#ifdef C_MENUSUPPORT +#include +#endif + +#ifdef C_FORMSUPPORT +#include +#endif + +#define C_LONGNAME +#undef C_LONG0ARGS +#define C_LONG2ARGS + +#define C_TOUCHLINE +#undef C_TOUCH3ARGS +#define C_TOUCH4ARGS diff --git a/Curses-1.23/hints/c-dec_osf.h b/Curses-1.23/hints/c-dec_osf.h new file mode 100644 index 0000000..80f8701 --- /dev/null +++ b/Curses-1.23/hints/c-dec_osf.h @@ -0,0 +1,30 @@ +/* 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 */ + +#include +/* #include */ + +#ifdef C_PANELSUPPORT +#include +#endif + +#ifdef C_MENUSUPPORT +#include +#endif + +#ifdef C_FORMSUPPORT +#include +#endif + +#define C_LONGNAME +#define C_LONG0ARGS +#undef C_LONG2ARGS + +#undef C_TOUCHLINE +#undef C_TOUCH3ARGS +#undef C_TOUCH4ARGS diff --git a/Curses-1.23/hints/c-dgux.h b/Curses-1.23/hints/c-dgux.h new file mode 100644 index 0000000..e2fc2cf --- /dev/null +++ b/Curses-1.23/hints/c-dgux.h @@ -0,0 +1,29 @@ +/* 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 */ + +#include + +#ifdef C_PANELSUPPORT +#include +#endif + +#ifdef C_MENUSUPPORT +#include +#endif + +#ifdef C_FORMSUPPORT +#include +#endif + +#define C_LONGNAME +#define C_LONG0ARGS +#undef C_LONG2ARGS + +#define C_TOUCHLINE +#define C_TOUCH3ARGS +#undef C_TOUCH4ARGS diff --git a/Curses-1.23/hints/c-dynixptx.h b/Curses-1.23/hints/c-dynixptx.h new file mode 100644 index 0000000..871acc3 --- /dev/null +++ b/Curses-1.23/hints/c-dynixptx.h @@ -0,0 +1,29 @@ +/* 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 */ + +#include + +#ifdef C_PANELSUPPORT +#include +#endif + +#ifdef C_MENUSUPPORT +#include +#endif + +#ifdef C_FORMSUPPORT +#include +#endif + +#define C_LONGNAME +#define C_LONG0ARGS +#undef C_LONG2ARGS + +#define C_TOUCHLINE +#define C_TOUCH3ARGS +#undef C_TOUCH4ARGS diff --git a/Curses-1.23/hints/c-freebsd.bsd.h b/Curses-1.23/hints/c-freebsd.bsd.h new file mode 100644 index 0000000..5a1672c --- /dev/null +++ b/Curses-1.23/hints/c-freebsd.bsd.h @@ -0,0 +1,17 @@ +/* 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" */ + +#include + +#define C_LONGNAME +#undef C_LONG0ARGS +#define C_LONG2ARGS + +#define C_TOUCHLINE +#undef C_TOUCH3ARGS +#define C_TOUCH4ARGS diff --git a/Curses-1.23/hints/c-freebsd.ncurses.h b/Curses-1.23/hints/c-freebsd.ncurses.h new file mode 100644 index 0000000..828b049 --- /dev/null +++ b/Curses-1.23/hints/c-freebsd.ncurses.h @@ -0,0 +1,29 @@ +/* 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" */ + +#include + +#ifdef C_PANELSUPPORT +#include +#endif + +#ifdef C_MENUSUPPORT +#include +#endif + +#ifdef C_FORMSUPPORT +#include +#endif + +#define C_LONGNAME +#define C_LONG0ARGS +#undef C_LONG2ARGS + +#define C_TOUCHLINE +#define C_TOUCH3ARGS +#undef C_TOUCH4ARGS diff --git a/Curses-1.23/hints/c-gnukfreebsd.h b/Curses-1.23/hints/c-gnukfreebsd.h new file mode 100644 index 0000000..6c7432b --- /dev/null +++ b/Curses-1.23/hints/c-gnukfreebsd.h @@ -0,0 +1,27 @@ +/* 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 + +#ifdef C_PANELSUPPORT +#include +#endif + +#ifdef C_MENUSUPPORT +#include +#endif + +#ifdef C_FORMSUPPORT +#include +#endif + +#define C_LONGNAME +#define C_LONG0ARGS +#undef C_LONG2ARGS + +#define C_TOUCHLINE +#define C_TOUCH3ARGS +#undef C_TOUCH4ARGS diff --git a/Curses-1.23/hints/c-hpux.h b/Curses-1.23/hints/c-hpux.h new file mode 100644 index 0000000..adb2f54 --- /dev/null +++ b/Curses-1.23/hints/c-hpux.h @@ -0,0 +1,27 @@ +/* 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 + +#ifdef C_PANELSUPPORT +#include +#endif + +#ifdef C_MENUSUPPORT +#include +#endif + +#ifdef C_FORMSUPPORT +#include +#endif + +#define C_LONGNAME +#define C_LONG0ARGS +#undef C_LONG2ARGS + +#define C_TOUCHLINE +#define C_TOUCH3ARGS +#undef C_TOUCH4ARGS diff --git a/Curses-1.23/hints/c-irix.bsd.h b/Curses-1.23/hints/c-irix.bsd.h new file mode 100644 index 0000000..b214a18 --- /dev/null +++ b/Curses-1.23/hints/c-irix.bsd.h @@ -0,0 +1,17 @@ +/* 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 */ + +#include + +#define C_LONGNAME +#define C_LONG0ARGS +#undef C_LONG2ARGS + +#define C_TOUCHLINE +#define C_TOUCH3ARGS +#undef C_TOUCH4ARGS diff --git a/Curses-1.23/hints/c-irix.ncurses.h b/Curses-1.23/hints/c-irix.ncurses.h new file mode 100644 index 0000000..10b6836 --- /dev/null +++ b/Curses-1.23/hints/c-irix.ncurses.h @@ -0,0 +1,30 @@ +/* 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 Feb 1999*/ + +#include + +#ifdef C_PANELSUPPORT +#include +#endif + +#ifdef C_MENUSUPPORT +#include +#endif + +#ifdef C_FORMSUPPORT +#include +#endif + +#define C_LONGNAME +#define C_LONG0ARGS +#undef C_LONG2ARGS + +#define C_TOUCHLINE +#define C_TOUCH3ARGS +#undef C_TOUCH4ARGS diff --git a/Curses-1.23/hints/c-isc.h b/Curses-1.23/hints/c-isc.h new file mode 100644 index 0000000..8952f37 --- /dev/null +++ b/Curses-1.23/hints/c-isc.h @@ -0,0 +1,29 @@ +/* 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 + +#ifdef C_PANELSUPPORT +#include +#endif + +#ifdef C_MENUSUPPORT +#include +#endif + +#ifdef C_FORMSUPPORT +#include +#endif + +#define C_LONGNAME +#define C_LONG0ARGS +#undef C_LONG2ARGS + +#define C_TOUCHLINE +#define C_TOUCH3ARGS +#undef C_TOUCH4ARGS + + diff --git a/Curses-1.23/hints/c-linux.bsd.h b/Curses-1.23/hints/c-linux.bsd.h new file mode 100644 index 0000000..1533240 --- /dev/null +++ b/Curses-1.23/hints/c-linux.bsd.h @@ -0,0 +1,15 @@ +/* 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 + +#undef C_LONGNAME +#define C_LONG0ARGS +#undef C_LONG2ARGS + +#define C_TOUCHLINE +#undef C_TOUCH3ARGS +#define C_TOUCH4ARGS diff --git a/Curses-1.23/hints/c-linux.ncurses.h b/Curses-1.23/hints/c-linux.ncurses.h new file mode 100644 index 0000000..bdc7632 --- /dev/null +++ b/Curses-1.23/hints/c-linux.ncurses.h @@ -0,0 +1,27 @@ +/* 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 + +#ifdef C_PANELSUPPORT +#include +#endif + +#ifdef C_MENUSUPPORT +#include +#endif + +#ifdef C_FORMSUPPORT +#include +#endif + +#define C_LONGNAME +#define C_LONG0ARGS +#undef C_LONG2ARGS + +#define C_TOUCHLINE +#define C_TOUCH3ARGS +#undef C_TOUCH4ARGS diff --git a/Curses-1.23/hints/c-netbsd.h b/Curses-1.23/hints/c-netbsd.h new file mode 100644 index 0000000..efe36b5 --- /dev/null +++ b/Curses-1.23/hints/c-netbsd.h @@ -0,0 +1,35 @@ +/* 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 */ + +/* 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 + +#ifdef C_PANELSUPPORT +#include +#endif + +#ifdef C_MENUSUPPORT +#include +#endif + +#ifdef C_FORMSUPPORT +#include +#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? */ diff --git a/Curses-1.23/hints/c-next.h b/Curses-1.23/hints/c-next.h new file mode 100644 index 0000000..12f3f01 --- /dev/null +++ b/Curses-1.23/hints/c-next.h @@ -0,0 +1,29 @@ +/* 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 */ + +#include + +#ifdef C_PANELSUPPORT +#include +#endif + +#ifdef C_MENUSUPPORT +#include +#endif + +#ifdef C_FORMSUPPORT +#include +#endif + +#define C_LONGNAME +#undef C_LONG0ARGS +#define C_LONG2ARGS + +#define C_TOUCHLINE +#undef C_TOUCH3ARGS +#define C_TOUCH4ARGS diff --git a/Curses-1.23/hints/c-none.h b/Curses-1.23/hints/c-none.h new file mode 100644 index 0000000..d69f065 --- /dev/null +++ b/Curses-1.23/hints/c-none.h @@ -0,0 +1,40 @@ +/* Change below to the proper "include" file for curses. */ +#include + +/* Change below to the proper "include" file for panels. */ +#ifdef C_PANELSUPPORT +#include +#endif + +/* Change below to the proper "include" file for menus. */ +#ifdef C_MENUSUPPORT +#include +#endif + +/* Change below to the proper "include" file for forms. */ +#ifdef C_FORMSUPPORT +#include +#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. + */ + diff --git a/Curses-1.23/hints/c-openbsd.h b/Curses-1.23/hints/c-openbsd.h new file mode 100644 index 0000000..9dca027 --- /dev/null +++ b/Curses-1.23/hints/c-openbsd.h @@ -0,0 +1,29 @@ +/* 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 */ + +#include + +#ifdef C_PANELSUPPORT +#include +#endif + +#ifdef C_MENUSUPPORT +#include +#endif + +#ifdef C_FORMSUPPORT +#include +#endif + +#define C_LONGNAME +#define C_LONG0ARGS +#undef C_LONG2ARGS + +#define C_TOUCHLINE +#define C_TOUCH3ARGS +#undef C_TOUCH4ARGS diff --git a/Curses-1.23/hints/c-os2.ncurses.h b/Curses-1.23/hints/c-os2.ncurses.h new file mode 100644 index 0000000..456d152 --- /dev/null +++ b/Curses-1.23/hints/c-os2.ncurses.h @@ -0,0 +1,29 @@ +/* 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" */ + +#include + +#ifdef C_PANELSUPPORT +#include +#endif + +#ifdef C_MENUSUPPORT +#include +#endif + +#ifdef C_FORMSUPPORT +#include +#endif + +#define C_LONGNAME +#define C_LONG0ARGS +#undef C_LONG2ARGS + +#define C_TOUCHLINE +#define C_TOUCH3ARGS +#undef C_TOUCH4ARGS diff --git a/Curses-1.23/hints/c-sco.h b/Curses-1.23/hints/c-sco.h new file mode 100644 index 0000000..fed920c --- /dev/null +++ b/Curses-1.23/hints/c-sco.h @@ -0,0 +1,29 @@ +/* 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 + +#ifdef C_PANELSUPPORT +#include +#endif + +#ifdef C_MENUSUPPORT +#include +#endif + +#ifdef C_FORMSUPPORT +#include +#endif + +#define C_LONGNAME +#define C_LONG0ARGS +#undef C_LONG2ARGS + +#define C_TOUCHLINE +#define C_TOUCH3ARGS +#undef C_TOUCH4ARGS diff --git a/Curses-1.23/hints/c-solaris.h b/Curses-1.23/hints/c-solaris.h new file mode 100644 index 0000000..ff04281 --- /dev/null +++ b/Curses-1.23/hints/c-solaris.h @@ -0,0 +1,29 @@ +/* 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 */ + +#include + +#ifdef C_PANELSUPPORT +#include +#endif + +#ifdef C_MENUSUPPORT +#include +#endif + +#ifdef C_FORMSUPPORT +#include +#endif + +#define C_LONGNAME +#define C_LONG0ARGS +#undef C_LONG2ARGS + +#define C_TOUCHLINE +#define C_TOUCH3ARGS +#undef C_TOUCH4ARGS diff --git a/Curses-1.23/hints/c-sunos.bsd.h b/Curses-1.23/hints/c-sunos.bsd.h new file mode 100644 index 0000000..b84db1e --- /dev/null +++ b/Curses-1.23/hints/c-sunos.bsd.h @@ -0,0 +1,15 @@ +/* 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 + +#define C_LONGNAME +#define C_LONG0ARGS +#undef C_LONG2ARGS + +#define C_TOUCHLINE +#define C_TOUCH3ARGS +#undef C_TOUCH4ARGS diff --git a/Curses-1.23/hints/c-sunos.ncurses.h b/Curses-1.23/hints/c-sunos.ncurses.h new file mode 100644 index 0000000..2479fb2 --- /dev/null +++ b/Curses-1.23/hints/c-sunos.ncurses.h @@ -0,0 +1,29 @@ +/* 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 */ + +#include /* or curses.h */ + +#ifdef C_PANELSUPPORT +#include +#endif + +#ifdef C_MENUSUPPORT +#include +#endif + +#ifdef C_FORMSUPPORT +#include +#endif + +#define C_LONGNAME +#define C_LONG0ARGS +#undef C_LONG2ARGS + +#define C_TOUCHLINE +#define C_TOUCH3ARGS +#undef C_TOUCH4ARGS diff --git a/Curses-1.23/hints/c-sunos.sysv.h b/Curses-1.23/hints/c-sunos.sysv.h new file mode 100644 index 0000000..adf0302 --- /dev/null +++ b/Curses-1.23/hints/c-sunos.sysv.h @@ -0,0 +1,52 @@ +/* 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 + * and "perl.h" + * 3) Lots of redefined warnings, because was included by + * both 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 + +#ifdef C_PANELSUPPORT +#include +#endif + +#ifdef C_MENUSUPPORT +#include +#endif + +#ifdef C_FORMSUPPORT +#include +#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 diff --git a/Curses-1.23/hints/c-svr4.h b/Curses-1.23/hints/c-svr4.h new file mode 100644 index 0000000..28c5e62 --- /dev/null +++ b/Curses-1.23/hints/c-svr4.h @@ -0,0 +1,30 @@ +/* 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 */ + + +#include + +#ifdef C_PANELSUPPORT +#include +#endif + +#ifdef C_MENUSUPPORT +#include +#endif + +#ifdef C_FORMSUPPORT +#include +#endif + +#define C_LONGNAME +#define C_LONG0ARGS +#undef C_LONG2ARGS + +#define C_TOUCHLINE +#define C_TOUCH3ARGS +#undef C_TOUCH4ARGS diff --git a/Curses-1.23/hints/c-vms.h b/Curses-1.23/hints/c-vms.h new file mode 100644 index 0000000..feadc11 --- /dev/null +++ b/Curses-1.23/hints/c-vms.h @@ -0,0 +1,32 @@ +/* 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 */ + +#include + +#ifdef C_PANELSUPPORT +#include +#endif + +#ifdef C_MENUSUPPORT +#include +#endif + +#ifdef C_FORMSUPPORT +#include +#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() diff --git a/Curses-1.23/list.syms b/Curses-1.23/list.syms new file mode 100644 index 0000000..53860c1 --- /dev/null +++ b/Curses-1.23/list.syms @@ -0,0 +1,349 @@ +## 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 diff --git a/Curses-1.23/perl-Curses.spec b/Curses-1.23/perl-Curses.spec new file mode 100644 index 0000000..eccd9e2 --- /dev/null +++ b/Curses-1.23/perl-Curses.spec @@ -0,0 +1,69 @@ +%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 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 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 ++ perl-Curses-1.23-1 +- First cut for xCAT 2.0. + +* Tue Jan 09 2007 Daryl W. Grunau ++ xcat-perl-Curses-1.23-1 +- First cut. + diff --git a/Curses-1.23/ppport.h b/Curses-1.23/ppport.h new file mode 100644 index 0000000..905cddd --- /dev/null +++ b/Curses-1.23/ppport.h @@ -0,0 +1,6377 @@ +#if 0 +<<'SKIP'; +#endif +/* +---------------------------------------------------------------------- + + ppport.h -- Perl/Pollution/Portability Version 3.13 + + Automatically created by Devel::PPPort running under perl 5.006002. + + Do NOT edit this file directly! -- Edit PPPort_pm.PL and the + includes in parts/inc/ instead. + + Use 'perldoc ppport.h' to view the documentation below. + +---------------------------------------------------------------------- + +SKIP + +=pod + +=head1 NAME + +ppport.h - Perl/Pollution/Portability version 3.13 + +=head1 SYNOPSIS + + perl ppport.h [options] [source files] + + Searches current directory for files if no [source files] are given + + --help show short help + + --version show version + + --patch=file write one patch file with changes + --copy=suffix write changed copies with suffix + --diff=program use diff program and options + + --compat-version=version provide compatibility with Perl version + --cplusplus accept C++ comments + + --quiet don't output anything except fatal errors + --nodiag don't show diagnostics + --nohints don't show hints + --nochanges don't suggest changes + --nofilter don't filter input files + + --strip strip all script and doc functionality from + ppport.h + + --list-provided list provided API + --list-unsupported list unsupported API + --api-info=name show Perl API portability information + +=head1 COMPATIBILITY + +This version of F is designed to support operation with Perl +installations back to 5.003, and has been tested up to 5.10.0. + +=head1 OPTIONS + +=head2 --help + +Display a brief usage summary. + +=head2 --version + +Display the version of F. + +=head2 --patch=I + +If this option is given, a single patch file will be created if +any changes are suggested. This requires a working diff program +to be installed on your system. + +=head2 --copy=I + +If this option is given, a copy of each file will be saved with +the given suffix that contains the suggested changes. This does +not require any external programs. Note that this does not +automagially add a dot between the original filename and the +suffix. If you want the dot, you have to include it in the option +argument. + +If neither C<--patch> or C<--copy> are given, the default is to +simply print the diffs for each file. This requires either +C or a C program to be installed. + +=head2 --diff=I + +Manually set the diff program and options to use. The default +is to use C, when installed, and output unified +context diffs. + +=head2 --compat-version=I + +Tell F to check for compatibility with the given +Perl version. The default is to check for compatibility with Perl +version 5.003. You can use this option to reduce the output +of F if you intend to be backward compatible only +down to a certain Perl version. + +=head2 --cplusplus + +Usually, F will detect C++ style comments and +replace them with C style comments for portability reasons. +Using this option instructs F to leave C++ +comments untouched. + +=head2 --quiet + +Be quiet. Don't print anything except fatal errors. + +=head2 --nodiag + +Don't output any diagnostic messages. Only portability +alerts will be printed. + +=head2 --nohints + +Don't output any hints. Hints often contain useful portability +notes. Warnings will still be displayed. + +=head2 --nochanges + +Don't suggest any changes. Only give diagnostic output and hints +unless these are also deactivated. + +=head2 --nofilter + +Don't filter the list of input files. By default, files not looking +like source code (i.e. not *.xs, *.c, *.cc, *.cpp or *.h) are skipped. + +=head2 --strip + +Strip all script and documentation functionality from F. +This reduces the size of F dramatically and may be useful +if you want to include F in smaller modules without +increasing their distribution size too much. + +The stripped F will have a C<--unstrip> option that allows +you to undo the stripping, but only if an appropriate C +module is installed. + +=head2 --list-provided + +Lists the API elements for which compatibility is provided by +F. Also lists if it must be explicitly requested, +if it has dependencies, and if there are hints or warnings for it. + +=head2 --list-unsupported + +Lists the API elements that are known not to be supported by +F and below which version of Perl they probably +won't be available or work. + +=head2 --api-info=I + +Show portability information for API elements matching I. +If I is surrounded by slashes, it is interpreted as a regular +expression. + +=head1 DESCRIPTION + +In order for a Perl extension (XS) module to be as portable as possible +across differing versions of Perl itself, certain steps need to be taken. + +=over 4 + +=item * + +Including this header is the first major one. This alone will give you +access to a large part of the Perl API that hasn't been available in +earlier Perl releases. Use + + perl ppport.h --list-provided + +to see which API elements are provided by ppport.h. + +=item * + +You should avoid using deprecated parts of the API. For example, using +global Perl variables without the C prefix is deprecated. Also, +some API functions used to have a C prefix. Using this form is +also deprecated. You can safely use the supported API, as F +will provide wrappers for older Perl versions. + +=item * + +If you use one of a few functions or variables that were not present in +earlier versions of Perl, and that can't be provided using a macro, you +have to explicitly request support for these functions by adding one or +more C<#define>s in your source code before the inclusion of F. + +These functions or variables will be marked C in the list shown +by C<--list-provided>. + +Depending on whether you module has a single or multiple files that +use such functions or variables, you want either C or global +variants. + +For a C function or variable (used only in a single source +file), use: + + #define NEED_function + #define NEED_variable + +For a global function or variable (used in multiple source files), +use: + + #define NEED_function_GLOBAL + #define NEED_variable_GLOBAL + +Note that you mustn't have more than one global request for the +same function or variable in your project. + + Function / Variable Static Request Global Request + ----------------------------------------------------------------------------------------- + PL_signals NEED_PL_signals NEED_PL_signals_GLOBAL + eval_pv() NEED_eval_pv NEED_eval_pv_GLOBAL + grok_bin() NEED_grok_bin NEED_grok_bin_GLOBAL + grok_hex() NEED_grok_hex NEED_grok_hex_GLOBAL + grok_number() NEED_grok_number NEED_grok_number_GLOBAL + grok_numeric_radix() NEED_grok_numeric_radix NEED_grok_numeric_radix_GLOBAL + grok_oct() NEED_grok_oct NEED_grok_oct_GLOBAL + load_module() NEED_load_module NEED_load_module_GLOBAL + my_snprintf() NEED_my_snprintf NEED_my_snprintf_GLOBAL + my_strlcat() NEED_my_strlcat NEED_my_strlcat_GLOBAL + my_strlcpy() NEED_my_strlcpy NEED_my_strlcpy_GLOBAL + newCONSTSUB() NEED_newCONSTSUB NEED_newCONSTSUB_GLOBAL + newRV_noinc() NEED_newRV_noinc NEED_newRV_noinc_GLOBAL + newSVpvn_share() NEED_newSVpvn_share NEED_newSVpvn_share_GLOBAL + sv_2pv_flags() NEED_sv_2pv_flags NEED_sv_2pv_flags_GLOBAL + sv_2pvbyte() NEED_sv_2pvbyte NEED_sv_2pvbyte_GLOBAL + sv_catpvf_mg() NEED_sv_catpvf_mg NEED_sv_catpvf_mg_GLOBAL + sv_catpvf_mg_nocontext() NEED_sv_catpvf_mg_nocontext NEED_sv_catpvf_mg_nocontext_GLOBAL + sv_pvn_force_flags() NEED_sv_pvn_force_flags NEED_sv_pvn_force_flags_GLOBAL + sv_setpvf_mg() NEED_sv_setpvf_mg NEED_sv_setpvf_mg_GLOBAL + sv_setpvf_mg_nocontext() NEED_sv_setpvf_mg_nocontext NEED_sv_setpvf_mg_nocontext_GLOBAL + vload_module() NEED_vload_module NEED_vload_module_GLOBAL + vnewSVpvf() NEED_vnewSVpvf NEED_vnewSVpvf_GLOBAL + warner() NEED_warner NEED_warner_GLOBAL + +To avoid namespace conflicts, you can change the namespace of the +explicitly exported functions / variables using the C +macro. Just C<#define> the macro before including C: + + #define DPPP_NAMESPACE MyOwnNamespace_ + #include "ppport.h" + +The default namespace is C. + +=back + +The good thing is that most of the above can be checked by running +F on your source code. See the next section for +details. + +=head1 EXAMPLES + +To verify whether F is needed for your module, whether you +should make any changes to your code, and whether any special defines +should be used, F can be run as a Perl script to check your +source code. Simply say: + + perl ppport.h + +The result will usually be a list of patches suggesting changes +that should at least be acceptable, if not necessarily the most +efficient solution, or a fix for all possible problems. + +If you know that your XS module uses features only available in +newer Perl releases, if you're aware that it uses C++ comments, +and if you want all suggestions as a single patch file, you could +use something like this: + + perl ppport.h --compat-version=5.6.0 --cplusplus --patch=test.diff + +If you only want your code to be scanned without any suggestions +for changes, use: + + perl ppport.h --nochanges + +You can specify a different C program or options, using +the C<--diff> option: + + perl ppport.h --diff='diff -C 10' + +This would output context diffs with 10 lines of context. + +If you want to create patched copies of your files instead, use: + + perl ppport.h --copy=.new + +To display portability information for the C function, +use: + + perl ppport.h --api-info=newSVpvn + +Since the argument to C<--api-info> can be a regular expression, +you can use + + perl ppport.h --api-info=/_nomg$/ + +to display portability information for all C<_nomg> functions or + + perl ppport.h --api-info=/./ + +to display information for all known API elements. + +=head1 BUGS + +If this version of F is causing failure during +the compilation of this module, please check if newer versions +of either this module or C are available on CPAN +before sending a bug report. + +If F was generated using the latest version of +C and is causing failure of this module, please +file a bug report using the CPAN Request Tracker at L. + +Please include the following information: + +=over 4 + +=item 1. + +The complete output from running "perl -V" + +=item 2. + +This file. + +=item 3. + +The name and version of the module you were trying to build. + +=item 4. + +A full log of the build that failed. + +=item 5. + +Any other information that you think could be relevant. + +=back + +For the latest version of this code, please get the C +module from CPAN. + +=head1 COPYRIGHT + +Version 3.x, Copyright (c) 2004-2007, Marcus Holland-Moritz. + +Version 2.x, Copyright (C) 2001, Paul Marquess. + +Version 1.x, Copyright (C) 1999, Kenneth Albanowski. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +=head1 SEE ALSO + +See L. + +=cut + +use strict; + +# Disable broken TRIE-optimization +BEGIN { eval '${^RE_TRIE_MAXBUF} = -1' if $] >= 5.009004 && $] <= 5.009005 } + +my $VERSION = 3.13; + +my %opt = ( + quiet => 0, + diag => 1, + hints => 1, + changes => 1, + cplusplus => 0, + filter => 1, + strip => 0, + version => 0, +); + +my($ppport) = $0 =~ /([\w.]+)$/; +my $LF = '(?:\r\n|[\r\n])'; # line feed +my $HS = "[ \t]"; # horizontal whitespace + +# Never use C comments in this file! +my $ccs = '/'.'*'; +my $cce = '*'.'/'; +my $rccs = quotemeta $ccs; +my $rcce = quotemeta $cce; + +eval { + require Getopt::Long; + Getopt::Long::GetOptions(\%opt, qw( + help quiet diag! filter! hints! changes! cplusplus strip version + patch=s copy=s diff=s compat-version=s + list-provided list-unsupported api-info=s + )) or usage(); +}; + +if ($@ and grep /^-/, @ARGV) { + usage() if "@ARGV" =~ /^--?h(?:elp)?$/; + die "Getopt::Long not found. Please don't use any options.\n"; +} + +if ($opt{version}) { + print "This is $0 $VERSION.\n"; + exit 0; +} + +usage() if $opt{help}; +strip() if $opt{strip}; + +if (exists $opt{'compat-version'}) { + my($r,$v,$s) = eval { parse_version($opt{'compat-version'}) }; + if ($@) { + die "Invalid version number format: '$opt{'compat-version'}'\n"; + } + die "Only Perl 5 is supported\n" if $r != 5; + die "Invalid version number: $opt{'compat-version'}\n" if $v >= 1000 || $s >= 1000; + $opt{'compat-version'} = sprintf "%d.%03d%03d", $r, $v, $s; +} +else { + $opt{'compat-version'} = 5; +} + +my %API = map { /^(\w+)\|([^|]*)\|([^|]*)\|(\w*)$/ + ? ( $1 => { + ($2 ? ( base => $2 ) : ()), + ($3 ? ( todo => $3 ) : ()), + (index($4, 'v') >= 0 ? ( varargs => 1 ) : ()), + (index($4, 'p') >= 0 ? ( provided => 1 ) : ()), + (index($4, 'n') >= 0 ? ( nothxarg => 1 ) : ()), + } ) + : die "invalid spec: $_" } qw( +AvFILLp|5.004050||p +AvFILL||| +CLASS|||n +CX_CURPAD_SAVE||| +CX_CURPAD_SV||| +CopFILEAV|5.006000||p +CopFILEGV_set|5.006000||p +CopFILEGV|5.006000||p +CopFILESV|5.006000||p +CopFILE_set|5.006000||p +CopFILE|5.006000||p +CopSTASHPV_set|5.006000||p +CopSTASHPV|5.006000||p +CopSTASH_eq|5.006000||p +CopSTASH_set|5.006000||p +CopSTASH|5.006000||p +CopyD|5.009002||p +Copy||| +CvPADLIST||| +CvSTASH||| +CvWEAKOUTSIDE||| +DEFSV|5.004050||p +END_EXTERN_C|5.005000||p +ENTER||| +ERRSV|5.004050||p +EXTEND||| +EXTERN_C|5.005000||p +F0convert|||n +FREETMPS||| +GIMME_V||5.004000|n +GIMME|||n +GROK_NUMERIC_RADIX|5.007002||p +G_ARRAY||| +G_DISCARD||| +G_EVAL||| +G_NOARGS||| +G_SCALAR||| +G_VOID||5.004000| +GetVars||| +GvSV||| +Gv_AMupdate||| +HEf_SVKEY||5.004000| +HeHASH||5.004000| +HeKEY||5.004000| +HeKLEN||5.004000| +HePV||5.004000| +HeSVKEY_force||5.004000| +HeSVKEY_set||5.004000| +HeSVKEY||5.004000| +HeVAL||5.004000| +HvNAME||| +INT2PTR|5.006000||p +IN_LOCALE_COMPILETIME|5.007002||p +IN_LOCALE_RUNTIME|5.007002||p +IN_LOCALE|5.007002||p +IN_PERL_COMPILETIME|5.008001||p +IS_NUMBER_GREATER_THAN_UV_MAX|5.007002||p +IS_NUMBER_INFINITY|5.007002||p +IS_NUMBER_IN_UV|5.007002||p +IS_NUMBER_NAN|5.007003||p +IS_NUMBER_NEG|5.007002||p +IS_NUMBER_NOT_INT|5.007002||p +IVSIZE|5.006000||p +IVTYPE|5.006000||p +IVdf|5.006000||p +LEAVE||| +LVRET||| +MARK||| +MULTICALL||5.009005| +MY_CXT_CLONE|5.009002||p +MY_CXT_INIT|5.007003||p +MY_CXT|5.007003||p +MoveD|5.009002||p +Move||| +NOOP|5.005000||p +NUM2PTR|5.006000||p +NVTYPE|5.006000||p +NVef|5.006001||p +NVff|5.006001||p +NVgf|5.006001||p +Newxc|5.009003||p +Newxz|5.009003||p +Newx|5.009003||p +Nullav||| +Nullch||| +Nullcv||| +Nullhv||| +Nullsv||| +ORIGMARK||| +PAD_BASE_SV||| +PAD_CLONE_VARS||| +PAD_COMPNAME_FLAGS||| +PAD_COMPNAME_GEN_set||| +PAD_COMPNAME_GEN||| +PAD_COMPNAME_OURSTASH||| +PAD_COMPNAME_PV||| +PAD_COMPNAME_TYPE||| +PAD_RESTORE_LOCAL||| +PAD_SAVE_LOCAL||| +PAD_SAVE_SETNULLPAD||| +PAD_SETSV||| +PAD_SET_CUR_NOSAVE||| +PAD_SET_CUR||| +PAD_SVl||| +PAD_SV||| +PERL_ABS|5.008001||p +PERL_BCDVERSION|5.009005||p +PERL_GCC_BRACE_GROUPS_FORBIDDEN|5.008001||p +PERL_HASH|5.004000||p +PERL_INT_MAX|5.004000||p +PERL_INT_MIN|5.004000||p +PERL_LONG_MAX|5.004000||p +PERL_LONG_MIN|5.004000||p +PERL_MAGIC_arylen|5.007002||p +PERL_MAGIC_backref|5.007002||p +PERL_MAGIC_bm|5.007002||p +PERL_MAGIC_collxfrm|5.007002||p +PERL_MAGIC_dbfile|5.007002||p +PERL_MAGIC_dbline|5.007002||p +PERL_MAGIC_defelem|5.007002||p +PERL_MAGIC_envelem|5.007002||p +PERL_MAGIC_env|5.007002||p +PERL_MAGIC_ext|5.007002||p +PERL_MAGIC_fm|5.007002||p +PERL_MAGIC_glob|5.009005||p +PERL_MAGIC_isaelem|5.007002||p +PERL_MAGIC_isa|5.007002||p +PERL_MAGIC_mutex|5.009005||p +PERL_MAGIC_nkeys|5.007002||p +PERL_MAGIC_overload_elem|5.007002||p +PERL_MAGIC_overload_table|5.007002||p +PERL_MAGIC_overload|5.007002||p +PERL_MAGIC_pos|5.007002||p +PERL_MAGIC_qr|5.007002||p +PERL_MAGIC_regdata|5.007002||p +PERL_MAGIC_regdatum|5.007002||p +PERL_MAGIC_regex_global|5.007002||p +PERL_MAGIC_shared_scalar|5.007003||p +PERL_MAGIC_shared|5.007003||p +PERL_MAGIC_sigelem|5.007002||p +PERL_MAGIC_sig|5.007002||p +PERL_MAGIC_substr|5.007002||p +PERL_MAGIC_sv|5.007002||p +PERL_MAGIC_taint|5.007002||p +PERL_MAGIC_tiedelem|5.007002||p +PERL_MAGIC_tiedscalar|5.007002||p +PERL_MAGIC_tied|5.007002||p +PERL_MAGIC_utf8|5.008001||p +PERL_MAGIC_uvar_elem|5.007003||p +PERL_MAGIC_uvar|5.007002||p +PERL_MAGIC_vec|5.007002||p +PERL_MAGIC_vstring|5.008001||p +PERL_QUAD_MAX|5.004000||p +PERL_QUAD_MIN|5.004000||p +PERL_REVISION|5.006000||p +PERL_SCAN_ALLOW_UNDERSCORES|5.007003||p +PERL_SCAN_DISALLOW_PREFIX|5.007003||p +PERL_SCAN_GREATER_THAN_UV_MAX|5.007003||p +PERL_SCAN_SILENT_ILLDIGIT|5.008001||p +PERL_SHORT_MAX|5.004000||p +PERL_SHORT_MIN|5.004000||p +PERL_SIGNALS_UNSAFE_FLAG|5.008001||p +PERL_SUBVERSION|5.006000||p +PERL_UCHAR_MAX|5.004000||p +PERL_UCHAR_MIN|5.004000||p +PERL_UINT_MAX|5.004000||p +PERL_UINT_MIN|5.004000||p +PERL_ULONG_MAX|5.004000||p +PERL_ULONG_MIN|5.004000||p +PERL_UNUSED_ARG|5.009003||p +PERL_UNUSED_CONTEXT|5.009004||p +PERL_UNUSED_DECL|5.007002||p +PERL_UNUSED_VAR|5.007002||p +PERL_UQUAD_MAX|5.004000||p +PERL_UQUAD_MIN|5.004000||p +PERL_USE_GCC_BRACE_GROUPS|5.009004||p +PERL_USHORT_MAX|5.004000||p +PERL_USHORT_MIN|5.004000||p +PERL_VERSION|5.006000||p +PL_DBsignal|5.005000||p +PL_DBsingle|||pn +PL_DBsub|||pn +PL_DBtrace|||pn +PL_Sv|5.005000||p +PL_compiling|5.004050||p +PL_copline|5.009005||p +PL_curcop|5.004050||p +PL_curstash|5.004050||p +PL_debstash|5.004050||p +PL_defgv|5.004050||p +PL_diehook|5.004050||p +PL_dirty|5.004050||p +PL_dowarn|||pn +PL_errgv|5.004050||p +PL_expect|5.009005||p +PL_hexdigit|5.005000||p +PL_hints|5.005000||p +PL_last_in_gv|||n +PL_laststatval|5.005000||p +PL_modglobal||5.005000|n +PL_na|5.004050||pn +PL_no_modify|5.006000||p +PL_ofs_sv|||n +PL_perl_destruct_level|5.004050||p +PL_perldb|5.004050||p +PL_ppaddr|5.006000||p +PL_rsfp_filters|5.004050||p +PL_rsfp|5.004050||p +PL_rs|||n +PL_signals|5.008001||p +PL_stack_base|5.004050||p +PL_stack_sp|5.004050||p +PL_statcache|5.005000||p +PL_stdingv|5.004050||p +PL_sv_arenaroot|5.004050||p +PL_sv_no|5.004050||pn +PL_sv_undef|5.004050||pn +PL_sv_yes|5.004050||pn +PL_tainted|5.004050||p +PL_tainting|5.004050||p +POP_MULTICALL||5.009005| +POPi|||n +POPl|||n +POPn|||n +POPpbytex||5.007001|n +POPpx||5.005030|n +POPp|||n +POPs|||n +PTR2IV|5.006000||p +PTR2NV|5.006000||p +PTR2UV|5.006000||p +PTR2ul|5.007001||p +PTRV|5.006000||p +PUSHMARK||| +PUSH_MULTICALL||5.009005| +PUSHi||| +PUSHmortal|5.009002||p +PUSHn||| +PUSHp||| +PUSHs||| +PUSHu|5.004000||p +PUTBACK||| +PerlIO_clearerr||5.007003| +PerlIO_close||5.007003| +PerlIO_context_layers||5.009004| +PerlIO_eof||5.007003| +PerlIO_error||5.007003| +PerlIO_fileno||5.007003| +PerlIO_fill||5.007003| +PerlIO_flush||5.007003| +PerlIO_get_base||5.007003| +PerlIO_get_bufsiz||5.007003| +PerlIO_get_cnt||5.007003| +PerlIO_get_ptr||5.007003| +PerlIO_read||5.007003| +PerlIO_seek||5.007003| +PerlIO_set_cnt||5.007003| +PerlIO_set_ptrcnt||5.007003| +PerlIO_setlinebuf||5.007003| +PerlIO_stderr||5.007003| +PerlIO_stdin||5.007003| +PerlIO_stdout||5.007003| +PerlIO_tell||5.007003| +PerlIO_unread||5.007003| +PerlIO_write||5.007003| +Perl_signbit||5.009005|n +PoisonFree|5.009004||p +PoisonNew|5.009004||p +PoisonWith|5.009004||p +Poison|5.008000||p +RETVAL|||n +Renewc||| +Renew||| +SAVECLEARSV||| +SAVECOMPPAD||| +SAVEPADSV||| +SAVETMPS||| +SAVE_DEFSV|5.004050||p +SPAGAIN||| +SP||| +START_EXTERN_C|5.005000||p +START_MY_CXT|5.007003||p +STMT_END|||p +STMT_START|||p +STR_WITH_LEN|5.009003||p +ST||| +SV_CONST_RETURN|5.009003||p +SV_COW_DROP_PV|5.008001||p +SV_COW_SHARED_HASH_KEYS|5.009005||p +SV_GMAGIC|5.007002||p +SV_HAS_TRAILING_NUL|5.009004||p +SV_IMMEDIATE_UNREF|5.007001||p +SV_MUTABLE_RETURN|5.009003||p +SV_NOSTEAL|5.009002||p +SV_SMAGIC|5.009003||p +SV_UTF8_NO_ENCODING|5.008001||p +SVf|5.006000||p +SVt_IV||| +SVt_NV||| +SVt_PVAV||| +SVt_PVCV||| +SVt_PVHV||| +SVt_PVMG||| +SVt_PV||| +Safefree||| +Slab_Alloc||| +Slab_Free||| +Slab_to_rw||| +StructCopy||| +SvCUR_set||| +SvCUR||| +SvEND||| +SvGAMAGIC||5.006001| +SvGETMAGIC|5.004050||p +SvGROW||| +SvIOK_UV||5.006000| +SvIOK_notUV||5.006000| +SvIOK_off||| +SvIOK_only_UV||5.006000| +SvIOK_only||| +SvIOK_on||| +SvIOKp||| +SvIOK||| +SvIVX||| +SvIV_nomg|5.009001||p +SvIV_set||| +SvIVx||| +SvIV||| +SvIsCOW_shared_hash||5.008003| +SvIsCOW||5.008003| +SvLEN_set||| +SvLEN||| +SvLOCK||5.007003| +SvMAGIC_set|5.009003||p +SvNIOK_off||| +SvNIOKp||| +SvNIOK||| +SvNOK_off||| +SvNOK_only||| +SvNOK_on||| +SvNOKp||| +SvNOK||| +SvNVX||| +SvNV_set||| +SvNVx||| +SvNV||| +SvOK||| +SvOOK||| +SvPOK_off||| +SvPOK_only_UTF8||5.006000| +SvPOK_only||| +SvPOK_on||| +SvPOKp||| +SvPOK||| +SvPVX_const|5.009003||p +SvPVX_mutable|5.009003||p +SvPVX||| +SvPV_const|5.009003||p +SvPV_flags_const_nolen|5.009003||p +SvPV_flags_const|5.009003||p +SvPV_flags_mutable|5.009003||p +SvPV_flags|5.007002||p +SvPV_force_flags_mutable|5.009003||p +SvPV_force_flags_nolen|5.009003||p +SvPV_force_flags|5.007002||p +SvPV_force_mutable|5.009003||p +SvPV_force_nolen|5.009003||p +SvPV_force_nomg_nolen|5.009003||p +SvPV_force_nomg|5.007002||p +SvPV_force|||p +SvPV_mutable|5.009003||p +SvPV_nolen_const|5.009003||p +SvPV_nolen|5.006000||p +SvPV_nomg_const_nolen|5.009003||p +SvPV_nomg_const|5.009003||p +SvPV_nomg|5.007002||p +SvPV_set||| +SvPVbyte_force||5.009002| +SvPVbyte_nolen||5.006000| +SvPVbytex_force||5.006000| +SvPVbytex||5.006000| +SvPVbyte|5.006000||p +SvPVutf8_force||5.006000| +SvPVutf8_nolen||5.006000| +SvPVutf8x_force||5.006000| +SvPVutf8x||5.006000| +SvPVutf8||5.006000| +SvPVx||| +SvPV||| +SvREFCNT_dec||| +SvREFCNT_inc_NN|5.009004||p +SvREFCNT_inc_simple_NN|5.009004||p +SvREFCNT_inc_simple_void_NN|5.009004||p +SvREFCNT_inc_simple_void|5.009004||p +SvREFCNT_inc_simple|5.009004||p +SvREFCNT_inc_void_NN|5.009004||p +SvREFCNT_inc_void|5.009004||p +SvREFCNT_inc|||p +SvREFCNT||| +SvROK_off||| +SvROK_on||| +SvROK||| +SvRV_set|5.009003||p +SvRV||| +SvRXOK||5.009005| +SvRX||5.009005| +SvSETMAGIC||| +SvSHARED_HASH|5.009003||p +SvSHARE||5.007003| +SvSTASH_set|5.009003||p +SvSTASH||| +SvSetMagicSV_nosteal||5.004000| +SvSetMagicSV||5.004000| +SvSetSV_nosteal||5.004000| +SvSetSV||| +SvTAINTED_off||5.004000| +SvTAINTED_on||5.004000| +SvTAINTED||5.004000| +SvTAINT||| +SvTRUE||| +SvTYPE||| +SvUNLOCK||5.007003| +SvUOK|5.007001|5.006000|p +SvUPGRADE||| +SvUTF8_off||5.006000| +SvUTF8_on||5.006000| +SvUTF8||5.006000| +SvUVXx|5.004000||p +SvUVX|5.004000||p +SvUV_nomg|5.009001||p +SvUV_set|5.009003||p +SvUVx|5.004000||p +SvUV|5.004000||p +SvVOK||5.008001| +SvVSTRING_mg|5.009004||p +THIS|||n +UNDERBAR|5.009002||p +UTF8_MAXBYTES|5.009002||p +UVSIZE|5.006000||p +UVTYPE|5.006000||p +UVXf|5.007001||p +UVof|5.006000||p +UVuf|5.006000||p +UVxf|5.006000||p +WARN_ALL|5.006000||p +WARN_AMBIGUOUS|5.006000||p +WARN_ASSERTIONS|5.009005||p +WARN_BAREWORD|5.006000||p +WARN_CLOSED|5.006000||p +WARN_CLOSURE|5.006000||p +WARN_DEBUGGING|5.006000||p +WARN_DEPRECATED|5.006000||p +WARN_DIGIT|5.006000||p +WARN_EXEC|5.006000||p +WARN_EXITING|5.006000||p +WARN_GLOB|5.006000||p +WARN_INPLACE|5.006000||p +WARN_INTERNAL|5.006000||p +WARN_IO|5.006000||p +WARN_LAYER|5.008000||p +WARN_MALLOC|5.006000||p +WARN_MISC|5.006000||p +WARN_NEWLINE|5.006000||p +WARN_NUMERIC|5.006000||p +WARN_ONCE|5.006000||p +WARN_OVERFLOW|5.006000||p +WARN_PACK|5.006000||p +WARN_PARENTHESIS|5.006000||p +WARN_PIPE|5.006000||p +WARN_PORTABLE|5.006000||p +WARN_PRECEDENCE|5.006000||p +WARN_PRINTF|5.006000||p +WARN_PROTOTYPE|5.006000||p +WARN_QW|5.006000||p +WARN_RECURSION|5.006000||p +WARN_REDEFINE|5.006000||p +WARN_REGEXP|5.006000||p +WARN_RESERVED|5.006000||p +WARN_SEMICOLON|5.006000||p +WARN_SEVERE|5.006000||p +WARN_SIGNAL|5.006000||p +WARN_SUBSTR|5.006000||p +WARN_SYNTAX|5.006000||p +WARN_TAINT|5.006000||p +WARN_THREADS|5.008000||p +WARN_UNINITIALIZED|5.006000||p +WARN_UNOPENED|5.006000||p +WARN_UNPACK|5.006000||p +WARN_UNTIE|5.006000||p +WARN_UTF8|5.006000||p +WARN_VOID|5.006000||p +XCPT_CATCH|5.009002||p +XCPT_RETHROW|5.009002||p +XCPT_TRY_END|5.009002||p +XCPT_TRY_START|5.009002||p +XPUSHi||| +XPUSHmortal|5.009002||p +XPUSHn||| +XPUSHp||| +XPUSHs||| +XPUSHu|5.004000||p +XSRETURN_EMPTY||| +XSRETURN_IV||| +XSRETURN_NO||| +XSRETURN_NV||| +XSRETURN_PV||| +XSRETURN_UNDEF||| +XSRETURN_UV|5.008001||p +XSRETURN_YES||| +XSRETURN|||p +XST_mIV||| +XST_mNO||| +XST_mNV||| +XST_mPV||| +XST_mUNDEF||| +XST_mUV|5.008001||p +XST_mYES||| +XS_VERSION_BOOTCHECK||| +XS_VERSION||| +XSprePUSH|5.006000||p +XS||| +ZeroD|5.009002||p +Zero||| +_aMY_CXT|5.007003||p +_pMY_CXT|5.007003||p +aMY_CXT_|5.007003||p +aMY_CXT|5.007003||p +aTHXR_|5.009005||p +aTHXR|5.009005||p +aTHX_|5.006000||p +aTHX|5.006000||p +add_data|||n +addmad||| +allocmy||| +amagic_call||| +amagic_cmp_locale||| +amagic_cmp||| +amagic_i_ncmp||| +amagic_ncmp||| +any_dup||| +ao||| +append_elem||| +append_list||| +append_madprops||| +apply_attrs_my||| +apply_attrs_string||5.006001| +apply_attrs||| +apply||| +atfork_lock||5.007003|n +atfork_unlock||5.007003|n +av_arylen_p||5.009003| +av_clear||| +av_create_and_push||5.009005| +av_create_and_unshift_one||5.009005| +av_delete||5.006000| +av_exists||5.006000| +av_extend||| +av_fake||| +av_fetch||| +av_fill||| +av_len||| +av_make||| +av_pop||| +av_push||| +av_reify||| +av_shift||| +av_store||| +av_undef||| +av_unshift||| +ax|||n +bad_type||| +bind_match||| +block_end||| +block_gimme||5.004000| +block_start||| +boolSV|5.004000||p +boot_core_PerlIO||| +boot_core_UNIVERSAL||| +boot_core_mro||| +boot_core_xsutils||| +bytes_from_utf8||5.007001| +bytes_to_uni|||n +bytes_to_utf8||5.006001| +call_argv|5.006000||p +call_atexit||5.006000| +call_list||5.004000| +call_method|5.006000||p +call_pv|5.006000||p +call_sv|5.006000||p +calloc||5.007002|n +cando||| +cast_i32||5.006000| +cast_iv||5.006000| +cast_ulong||5.006000| +cast_uv||5.006000| +check_type_and_open||| +check_uni||| +checkcomma||| +checkposixcc||| +ckWARN|5.006000||p +ck_anoncode||| +ck_bitop||| +ck_concat||| +ck_defined||| +ck_delete||| +ck_die||| +ck_eof||| +ck_eval||| +ck_exec||| +ck_exists||| +ck_exit||| +ck_ftst||| +ck_fun||| +ck_glob||| +ck_grep||| +ck_index||| +ck_join||| +ck_lengthconst||| +ck_lfun||| +ck_listiob||| +ck_match||| +ck_method||| +ck_null||| +ck_open||| +ck_readline||| +ck_repeat||| +ck_require||| +ck_retarget||| +ck_return||| +ck_rfun||| +ck_rvconst||| +ck_sassign||| +ck_select||| +ck_shift||| +ck_sort||| +ck_spair||| +ck_split||| +ck_subr||| +ck_substr||| +ck_svconst||| +ck_trunc||| +ck_unpack||| +ckwarn_d||5.009003| +ckwarn||5.009003| +cl_and|||n +cl_anything|||n +cl_init_zero|||n +cl_init|||n +cl_is_anything|||n +cl_or|||n +clear_placeholders||| +closest_cop||| +convert||| +cop_free||| +cr_textfilter||| +create_eval_scope||| +croak_nocontext|||vn +croak|||v +csighandler||5.009003|n +curmad||| +custom_op_desc||5.007003| +custom_op_name||5.007003| +cv_ckproto_len||| +cv_ckproto||| +cv_clone||| +cv_const_sv||5.004000| +cv_dump||| +cv_undef||| +cx_dump||5.005000| +cx_dup||| +cxinc||| +dAXMARK|5.009003||p +dAX|5.007002||p +dITEMS|5.007002||p +dMARK||| +dMULTICALL||5.009003| +dMY_CXT_SV|5.007003||p +dMY_CXT|5.007003||p +dNOOP|5.006000||p +dORIGMARK||| +dSP||| +dTHR|5.004050||p +dTHXR|5.009005||p +dTHXa|5.006000||p +dTHXoa|5.006000||p +dTHX|5.006000||p +dUNDERBAR|5.009002||p +dVAR|5.009003||p +dXCPT|5.009002||p +dXSARGS||| +dXSI32||| +dXSTARG|5.006000||p +deb_curcv||| +deb_nocontext|||vn +deb_stack_all||| +deb_stack_n||| +debop||5.005000| +debprofdump||5.005000| +debprof||| +debstackptrs||5.007003| +debstack||5.007003| +debug_start_match||| +deb||5.007003|v +del_sv||| +delete_eval_scope||| +delimcpy||5.004000| +deprecate_old||| +deprecate||| +despatch_signals||5.007001| +destroy_matcher||| +die_nocontext|||vn +die_where||| +die|||v +dirp_dup||| +div128||| +djSP||| +do_aexec5||| +do_aexec||| +do_aspawn||| +do_binmode||5.004050| +do_chomp||| +do_chop||| +do_close||| +do_dump_pad||| +do_eof||| +do_exec3||| +do_execfree||| +do_exec||| +do_gv_dump||5.006000| +do_gvgv_dump||5.006000| +do_hv_dump||5.006000| +do_ipcctl||| +do_ipcget||| +do_join||| +do_kv||| +do_magic_dump||5.006000| +do_msgrcv||| +do_msgsnd||| +do_oddball||| +do_op_dump||5.006000| +do_op_xmldump||| +do_open9||5.006000| +do_openn||5.007001| +do_open||5.004000| +do_pipe||| +do_pmop_dump||5.006000| +do_pmop_xmldump||| +do_print||| +do_readline||| +do_seek||| +do_semop||| +do_shmio||| +do_smartmatch||| +do_spawn_nowait||| +do_spawn||| +do_sprintf||| +do_sv_dump||5.006000| +do_sysseek||| +do_tell||| +do_trans_complex_utf8||| +do_trans_complex||| +do_trans_count_utf8||| +do_trans_count||| +do_trans_simple_utf8||| +do_trans_simple||| +do_trans||| +do_vecget||| +do_vecset||| +do_vop||| +docatch_body||| +docatch||| +doeval||| +dofile||| +dofindlabel||| +doform||| +doing_taint||5.008001|n +dooneliner||| +doopen_pm||| +doparseform||| +dopoptoeval||| +dopoptogiven||| +dopoptolabel||| +dopoptoloop||| +dopoptosub_at||| +dopoptosub||| +dopoptowhen||| +doref||5.009003| +dounwind||| +dowantarray||| +dump_all||5.006000| +dump_eval||5.006000| +dump_exec_pos||| +dump_fds||| +dump_form||5.006000| +dump_indent||5.006000|v +dump_mstats||| +dump_packsubs||5.006000| +dump_sub||5.006000| +dump_sv_child||| +dump_trie_interim_list||| +dump_trie_interim_table||| +dump_trie||| +dump_vindent||5.006000| +dumpuntil||| +dup_attrlist||| +emulate_cop_io||| +emulate_eaccess||| +eval_pv|5.006000||p +eval_sv|5.006000||p +exec_failed||| +expect_number||| +fbm_compile||5.005000| +fbm_instr||5.005000| +fd_on_nosuid_fs||| +feature_is_enabled||| +filter_add||| +filter_del||| +filter_gets||| +filter_read||| +find_and_forget_pmops||| +find_array_subscript||| +find_beginning||| +find_byclass||| +find_hash_subscript||| +find_in_my_stash||| +find_runcv||5.008001| +find_rundefsvoffset||5.009002| +find_script||| +find_uninit_var||| +first_symbol|||n +fold_constants||| +forbid_setid||| +force_ident||| +force_list||| +force_next||| +force_version||| +force_word||| +forget_pmop||| +form_nocontext|||vn +form||5.004000|v +fp_dup||| +fprintf_nocontext|||vn +free_global_struct||| +free_tied_hv_pool||| +free_tmps||| +gen_constant_list||| +get_arena||| +get_av|5.006000||p +get_context||5.006000|n +get_cvn_flags||5.009005| +get_cv|5.006000||p +get_db_sub||| +get_debug_opts||| +get_hash_seed||| +get_hv|5.006000||p +get_mstats||| +get_no_modify||| +get_num||| +get_op_descs||5.005000| +get_op_names||5.005000| +get_opargs||| +get_ppaddr||5.006000| +get_re_arg||| +get_sv|5.006000||p +get_vtbl||5.005030| +getcwd_sv||5.007002| +getenv_len||| +glob_2number||| +glob_2pv||| +glob_assign_glob||| +glob_assign_ref||| +gp_dup||| +gp_free||| +gp_ref||| +grok_bin|5.007003||p +grok_hex|5.007003||p +grok_number|5.007002||p +grok_numeric_radix|5.007002||p +grok_oct|5.007003||p +group_end||| +gv_AVadd||| +gv_HVadd||| +gv_IOadd||| +gv_SVadd||| +gv_autoload4||5.004000| +gv_check||| +gv_const_sv||5.009003| +gv_dump||5.006000| +gv_efullname3||5.004000| +gv_efullname4||5.006001| +gv_efullname||| +gv_ename||| +gv_fetchfile_flags||5.009005| +gv_fetchfile||| +gv_fetchmeth_autoload||5.007003| +gv_fetchmethod_autoload||5.004000| +gv_fetchmethod||| +gv_fetchmeth||| +gv_fetchpvn_flags||5.009002| +gv_fetchpv||| +gv_fetchsv||5.009002| +gv_fullname3||5.004000| +gv_fullname4||5.006001| +gv_fullname||| +gv_handler||5.007001| +gv_init_sv||| +gv_init||| +gv_name_set||5.009004| +gv_stashpvn|5.004000||p +gv_stashpvs||5.009003| +gv_stashpv||| +gv_stashsv||| +he_dup||| +hek_dup||| +hfreeentries||| +hsplit||| +hv_assert||5.009005| +hv_auxinit|||n +hv_backreferences_p||| +hv_clear_placeholders||5.009001| +hv_clear||| +hv_copy_hints_hv||| +hv_delayfree_ent||5.004000| +hv_delete_common||| +hv_delete_ent||5.004000| +hv_delete||| +hv_eiter_p||5.009003| +hv_eiter_set||5.009003| +hv_exists_ent||5.004000| +hv_exists||| +hv_fetch_common||| +hv_fetch_ent||5.004000| +hv_fetchs|5.009003||p +hv_fetch||| +hv_free_ent||5.004000| +hv_iterinit||| +hv_iterkeysv||5.004000| +hv_iterkey||| +hv_iternext_flags||5.008000| +hv_iternextsv||| +hv_iternext||| +hv_iterval||| +hv_kill_backrefs||| +hv_ksplit||5.004000| +hv_magic_check|||n +hv_magic_uvar_xkey||| +hv_magic||| +hv_name_set||5.009003| +hv_notallowed||| +hv_placeholders_get||5.009003| +hv_placeholders_p||5.009003| +hv_placeholders_set||5.009003| +hv_riter_p||5.009003| +hv_riter_set||5.009003| +hv_scalar||5.009001| +hv_store_ent||5.004000| +hv_store_flags||5.008000| +hv_stores|5.009004||p +hv_store||| +hv_undef||| +ibcmp_locale||5.004000| +ibcmp_utf8||5.007003| +ibcmp||| +incl_perldb||| +incline||| +incpush_if_exists||| +incpush||| +ingroup||| +init_argv_symbols||| +init_debugger||| +init_global_struct||| +init_i18nl10n||5.006000| +init_i18nl14n||5.006000| +init_ids||| +init_interp||| +init_main_stash||| +init_perllib||| +init_postdump_symbols||| +init_predump_symbols||| +init_stacks||5.005000| +init_tm||5.007002| +instr||| +intro_my||| +intuit_method||| +intuit_more||| +invert||| +io_close||| +isALNUM||| +isALPHA||| +isDIGIT||| +isLOWER||| +isSPACE||| +isUPPER||| +is_an_int||| +is_gv_magical_sv||| +is_gv_magical||| +is_handle_constructor|||n +is_list_assignment||| +is_lvalue_sub||5.007001| +is_uni_alnum_lc||5.006000| +is_uni_alnumc_lc||5.006000| +is_uni_alnumc||5.006000| +is_uni_alnum||5.006000| +is_uni_alpha_lc||5.006000| +is_uni_alpha||5.006000| +is_uni_ascii_lc||5.006000| +is_uni_ascii||5.006000| +is_uni_cntrl_lc||5.006000| +is_uni_cntrl||5.006000| +is_uni_digit_lc||5.006000| +is_uni_digit||5.006000| +is_uni_graph_lc||5.006000| +is_uni_graph||5.006000| +is_uni_idfirst_lc||5.006000| +is_uni_idfirst||5.006000| +is_uni_lower_lc||5.006000| +is_uni_lower||5.006000| +is_uni_print_lc||5.006000| +is_uni_print||5.006000| +is_uni_punct_lc||5.006000| +is_uni_punct||5.006000| +is_uni_space_lc||5.006000| +is_uni_space||5.006000| +is_uni_upper_lc||5.006000| +is_uni_upper||5.006000| +is_uni_xdigit_lc||5.006000| +is_uni_xdigit||5.006000| +is_utf8_alnumc||5.006000| +is_utf8_alnum||5.006000| +is_utf8_alpha||5.006000| +is_utf8_ascii||5.006000| +is_utf8_char_slow|||n +is_utf8_char||5.006000| +is_utf8_cntrl||5.006000| +is_utf8_common||| +is_utf8_digit||5.006000| +is_utf8_graph||5.006000| +is_utf8_idcont||5.008000| +is_utf8_idfirst||5.006000| +is_utf8_lower||5.006000| +is_utf8_mark||5.006000| +is_utf8_print||5.006000| +is_utf8_punct||5.006000| +is_utf8_space||5.006000| +is_utf8_string_loclen||5.009003| +is_utf8_string_loc||5.008001| +is_utf8_string||5.006001| +is_utf8_upper||5.006000| +is_utf8_xdigit||5.006000| +isa_lookup||| +items|||n +ix|||n +jmaybe||| +join_exact||| +keyword||| +leave_scope||| +lex_end||| +lex_start||| +linklist||| +listkids||| +list||| +load_module_nocontext|||vn +load_module|5.006000||pv +localize||| +looks_like_bool||| +looks_like_number||| +lop||| +mPUSHi|5.009002||p +mPUSHn|5.009002||p +mPUSHp|5.009002||p +mPUSHu|5.009002||p +mXPUSHi|5.009002||p +mXPUSHn|5.009002||p +mXPUSHp|5.009002||p +mXPUSHu|5.009002||p +mad_free||| +madlex||| +madparse||| +magic_clear_all_env||| +magic_clearenv||| +magic_clearhint||| +magic_clearpack||| +magic_clearsig||| +magic_dump||5.006000| +magic_existspack||| +magic_freearylen_p||| +magic_freeovrld||| +magic_freeregexp||| +magic_getarylen||| +magic_getdefelem||| +magic_getnkeys||| +magic_getpack||| +magic_getpos||| +magic_getsig||| +magic_getsubstr||| +magic_gettaint||| +magic_getuvar||| +magic_getvec||| +magic_get||| +magic_killbackrefs||| +magic_len||| +magic_methcall||| +magic_methpack||| +magic_nextpack||| +magic_regdata_cnt||| +magic_regdatum_get||| +magic_regdatum_set||| +magic_scalarpack||| +magic_set_all_env||| +magic_setamagic||| +magic_setarylen||| +magic_setbm||| +magic_setcollxfrm||| +magic_setdbline||| +magic_setdefelem||| +magic_setenv||| +magic_setfm||| +magic_setglob||| +magic_sethint||| +magic_setisa||| +magic_setmglob||| +magic_setnkeys||| +magic_setpack||| +magic_setpos||| +magic_setregexp||| +magic_setsig||| +magic_setsubstr||| +magic_settaint||| +magic_setutf8||| +magic_setuvar||| +magic_setvec||| +magic_set||| +magic_sizepack||| +magic_wipepack||| +magicname||| +make_matcher||| +make_trie_failtable||| +make_trie||| +malloced_size|||n +malloc||5.007002|n +markstack_grow||| +matcher_matches_sv||| +measure_struct||| +memEQ|5.004000||p +memNE|5.004000||p +mem_collxfrm||| +mess_alloc||| +mess_nocontext|||vn +mess||5.006000|v +method_common||| +mfree||5.007002|n +mg_clear||| +mg_copy||| +mg_dup||| +mg_find||| +mg_free||| +mg_get||| +mg_length||5.005000| +mg_localize||| +mg_magical||| +mg_set||| +mg_size||5.005000| +mini_mktime||5.007002| +missingterm||| +mode_from_discipline||| +modkids||| +mod||| +more_bodies||| +more_sv||| +moreswitches||| +mro_get_linear_isa_c3||5.009005| +mro_get_linear_isa_dfs||5.009005| +mro_get_linear_isa||5.009005| +mro_isa_changed_in||| +mro_meta_dup||| +mro_meta_init||| +mro_method_changed_in||5.009005| +mul128||| +mulexp10|||n +my_atof2||5.007002| +my_atof||5.006000| +my_attrs||| +my_bcopy|||n +my_betoh16|||n +my_betoh32|||n +my_betoh64|||n +my_betohi|||n +my_betohl|||n +my_betohs|||n +my_bzero|||n +my_chsize||| +my_clearenv||| +my_cxt_index||| +my_cxt_init||| +my_dirfd||5.009005| +my_exit_jump||| +my_exit||| +my_failure_exit||5.004000| +my_fflush_all||5.006000| +my_fork||5.007003|n +my_htobe16|||n +my_htobe32|||n +my_htobe64|||n +my_htobei|||n +my_htobel|||n +my_htobes|||n +my_htole16|||n +my_htole32|||n +my_htole64|||n +my_htolei|||n +my_htolel|||n +my_htoles|||n +my_htonl||| +my_kid||| +my_letoh16|||n +my_letoh32|||n +my_letoh64|||n +my_letohi|||n +my_letohl|||n +my_letohs|||n +my_lstat||| +my_memcmp||5.004000|n +my_memset|||n +my_ntohl||| +my_pclose||5.004000| +my_popen_list||5.007001| +my_popen||5.004000| +my_setenv||| +my_snprintf|5.009004||pvn +my_socketpair||5.007003|n +my_sprintf||5.009003|vn +my_stat||| +my_strftime||5.007002| +my_strlcat|5.009004||pn +my_strlcpy|5.009004||pn +my_swabn|||n +my_swap||| +my_unexec||| +my_vsnprintf||5.009004|n +my||| +need_utf8|||n +newANONATTRSUB||5.006000| +newANONHASH||| +newANONLIST||| +newANONSUB||| +newASSIGNOP||| +newATTRSUB||5.006000| +newAVREF||| +newAV||| +newBINOP||| +newCONDOP||| +newCONSTSUB|5.004050||p +newCVREF||| +newDEFSVOP||| +newFORM||| +newFOROP||| +newGIVENOP||5.009003| +newGIVWHENOP||| +newGP||| +newGVOP||| +newGVREF||| +newGVgen||| +newHVREF||| +newHVhv||5.005000| +newHV||| +newIO||| +newLISTOP||| +newLOGOP||| +newLOOPEX||| +newLOOPOP||| +newMADPROP||| +newMADsv||| +newMYSUB||| +newNULLLIST||| +newOP||| +newPADOP||| +newPMOP||| +newPROG||| +newPVOP||| +newRANGE||| +newRV_inc|5.004000||p +newRV_noinc|5.004000||p +newRV||| +newSLICEOP||| +newSTATEOP||| +newSUB||| +newSVOP||| +newSVREF||| +newSV_type||5.009005| +newSVhek||5.009003| +newSViv||| +newSVnv||| +newSVpvf_nocontext|||vn +newSVpvf||5.004000|v +newSVpvn_share|5.007001||p +newSVpvn|5.004050||p +newSVpvs_share||5.009003| +newSVpvs|5.009003||p +newSVpv||| +newSVrv||| +newSVsv||| +newSVuv|5.006000||p +newSV||| +newTOKEN||| +newUNOP||| +newWHENOP||5.009003| +newWHILEOP||5.009003| +newXS_flags||5.009004| +newXSproto||5.006000| +newXS||5.006000| +new_collate||5.006000| +new_constant||| +new_ctype||5.006000| +new_he||| +new_logop||| +new_numeric||5.006000| +new_stackinfo||5.005000| +new_version||5.009000| +new_warnings_bitfield||| +next_symbol||| +nextargv||| +nextchar||| +ninstr||| +no_bareword_allowed||| +no_fh_allowed||| +no_op||| +not_a_number||| +nothreadhook||5.008000| +nuke_stacks||| +num_overflow|||n +offer_nice_chunk||| +oopsAV||| +oopsCV||| +oopsHV||| +op_clear||| +op_const_sv||| +op_dump||5.006000| +op_free||| +op_getmad_weak||| +op_getmad||| +op_null||5.007002| +op_refcnt_dec||| +op_refcnt_inc||| +op_refcnt_lock||5.009002| +op_refcnt_unlock||5.009002| +op_xmldump||| +open_script||| +pMY_CXT_|5.007003||p +pMY_CXT|5.007003||p +pTHX_|5.006000||p +pTHX|5.006000||p +packWARN|5.007003||p +pack_cat||5.007003| +pack_rec||| +package||| +packlist||5.008001| +pad_add_anon||| +pad_add_name||| +pad_alloc||| +pad_block_start||| +pad_check_dup||| +pad_compname_type||| +pad_findlex||| +pad_findmy||| +pad_fixup_inner_anons||| +pad_free||| +pad_leavemy||| +pad_new||| +pad_peg|||n +pad_push||| +pad_reset||| +pad_setsv||| +pad_sv||5.009005| +pad_swipe||| +pad_tidy||| +pad_undef||| +parse_body||| +parse_unicode_opts||| +parser_dup||| +parser_free||| +path_is_absolute|||n +peep||| +pending_Slabs_to_ro||| +perl_alloc_using|||n +perl_alloc|||n +perl_clone_using|||n +perl_clone|||n +perl_construct|||n +perl_destruct||5.007003|n +perl_free|||n +perl_parse||5.006000|n +perl_run|||n +pidgone||| +pm_description||| +pmflag||| +pmop_dump||5.006000| +pmop_xmldump||| +pmruntime||| +pmtrans||| +pop_scope||| +pregcomp||5.009005| +pregexec||| +pregfree||| +prepend_elem||| +prepend_madprops||| +printbuf||| +printf_nocontext|||vn +process_special_blocks||| +ptr_table_clear||5.009005| +ptr_table_fetch||5.009005| +ptr_table_find|||n +ptr_table_free||5.009005| +ptr_table_new||5.009005| +ptr_table_split||5.009005| +ptr_table_store||5.009005| +push_scope||| +put_byte||| +pv_display||5.006000| +pv_escape||5.009004| +pv_pretty||5.009004| +pv_uni_display||5.007003| +qerror||| +qsortsvu||| +re_compile||5.009005| +re_croak2||| +re_dup||| +re_intuit_start||5.009005| +re_intuit_string||5.006000| +readpipe_override||| +realloc||5.007002|n +reentrant_free||| +reentrant_init||| +reentrant_retry|||vn +reentrant_size||| +ref_array_or_hash||| +refcounted_he_chain_2hv||| +refcounted_he_fetch||| +refcounted_he_free||| +refcounted_he_new||| +refcounted_he_value||| +refkids||| +refto||| +ref||5.009003| +reg_check_named_buff_matched||| +reg_named_buff_all||5.009005| +reg_named_buff_exists||5.009005| +reg_named_buff_fetch||5.009005| +reg_named_buff_firstkey||5.009005| +reg_named_buff_iter||| +reg_named_buff_nextkey||5.009005| +reg_named_buff_scalar||5.009005| +reg_named_buff||| +reg_namedseq||| +reg_node||| +reg_numbered_buff_fetch||| +reg_numbered_buff_length||| +reg_numbered_buff_store||| +reg_qr_package||| +reg_recode||| +reg_scan_name||| +reg_skipcomment||| +reg_stringify||5.009005| +reg_temp_copy||| +reganode||| +regatom||| +regbranch||| +regclass_swash||5.009004| +regclass||| +regcppop||| +regcppush||| +regcurly|||n +regdump_extflags||| +regdump||5.005000| +regdupe_internal||| +regexec_flags||5.005000| +regfree_internal||5.009005| +reghop3|||n +reghop4|||n +reghopmaybe3|||n +reginclass||| +reginitcolors||5.006000| +reginsert||| +regmatch||| +regnext||5.005000| +regpiece||| +regpposixcc||| +regprop||| +regrepeat||| +regtail_study||| +regtail||| +regtry||| +reguni||| +regwhite|||n +reg||| +repeatcpy||| +report_evil_fh||| +report_uninit||| +require_pv||5.006000| +require_tie_mod||| +restore_magic||| +rninstr||| +rsignal_restore||| +rsignal_save||| +rsignal_state||5.004000| +rsignal||5.004000| +run_body||| +run_user_filter||| +runops_debug||5.005000| +runops_standard||5.005000| +rvpv_dup||| +rxres_free||| +rxres_restore||| +rxres_save||| +safesyscalloc||5.006000|n +safesysfree||5.006000|n +safesysmalloc||5.006000|n +safesysrealloc||5.006000|n +same_dirent||| +save_I16||5.004000| +save_I32||| +save_I8||5.006000| +save_aelem||5.004050| +save_alloc||5.006000| +save_aptr||| +save_ary||| +save_bool||5.008001| +save_clearsv||| +save_delete||| +save_destructor_x||5.006000| +save_destructor||5.006000| +save_freeop||| +save_freepv||| +save_freesv||| +save_generic_pvref||5.006001| +save_generic_svref||5.005030| +save_gp||5.004000| +save_hash||| +save_hek_flags|||n +save_helem||5.004050| +save_hints||5.005000| +save_hptr||| +save_int||| +save_item||| +save_iv||5.005000| +save_lines||| +save_list||| +save_long||| +save_magic||| +save_mortalizesv||5.007001| +save_nogv||| +save_op||| +save_padsv||5.007001| +save_pptr||| +save_re_context||5.006000| +save_scalar_at||| +save_scalar||| +save_set_svflags||5.009000| +save_shared_pvref||5.007003| +save_sptr||| +save_svref||| +save_vptr||5.006000| +savepvn||| +savepvs||5.009003| +savepv||| +savesharedpvn||5.009005| +savesharedpv||5.007003| +savestack_grow_cnt||5.008001| +savestack_grow||| +savesvpv||5.009002| +sawparens||| +scalar_mod_type|||n +scalarboolean||| +scalarkids||| +scalarseq||| +scalarvoid||| +scalar||| +scan_bin||5.006000| +scan_commit||| +scan_const||| +scan_formline||| +scan_heredoc||| +scan_hex||| +scan_ident||| +scan_inputsymbol||| +scan_num||5.007001| +scan_oct||| +scan_pat||| +scan_str||| +scan_subst||| +scan_trans||| +scan_version||5.009001| +scan_vstring||5.009005| +scan_word||| +scope||| +screaminstr||5.005000| +seed||5.008001| +sequence_num||| +sequence_tail||| +sequence||| +set_context||5.006000|n +set_csh||| +set_numeric_local||5.006000| +set_numeric_radix||5.006000| +set_numeric_standard||5.006000| +setdefout||| +setenv_getix||| +share_hek_flags||| +share_hek||5.004000| +si_dup||| +sighandler|||n +simplify_sort||| +skipspace0||| +skipspace1||| +skipspace2||| +skipspace||| +softref2xv||| +sortcv_stacked||| +sortcv_xsub||| +sortcv||| +sortsv_flags||5.009003| +sortsv||5.007003| +space_join_names_mortal||| +ss_dup||| +stack_grow||| +start_force||| +start_glob||| +start_subparse||5.004000| +stashpv_hvname_match||5.009005| +stdize_locale||| +strEQ||| +strGE||| +strGT||| +strLE||| +strLT||| +strNE||| +str_to_version||5.006000| +strip_return||| +strnEQ||| +strnNE||| +study_chunk||| +sub_crush_depth||| +sublex_done||| +sublex_push||| +sublex_start||| +sv_2bool||| +sv_2cv||| +sv_2io||| +sv_2iuv_common||| +sv_2iuv_non_preserve||| +sv_2iv_flags||5.009001| +sv_2iv||| +sv_2mortal||| +sv_2nv||| +sv_2pv_flags|5.007002||p +sv_2pv_nolen|5.006000||p +sv_2pvbyte_nolen|5.006000||p +sv_2pvbyte|5.006000||p +sv_2pvutf8_nolen||5.006000| +sv_2pvutf8||5.006000| +sv_2pv||| +sv_2uv_flags||5.009001| +sv_2uv|5.004000||p +sv_add_arena||| +sv_add_backref||| +sv_backoff||| +sv_bless||| +sv_cat_decode||5.008001| +sv_catpv_mg|5.004050||p +sv_catpvf_mg_nocontext|||pvn +sv_catpvf_mg|5.006000|5.004000|pv +sv_catpvf_nocontext|||vn +sv_catpvf||5.004000|v +sv_catpvn_flags||5.007002| +sv_catpvn_mg|5.004050||p +sv_catpvn_nomg|5.007002||p +sv_catpvn||| +sv_catpvs|5.009003||p +sv_catpv||| +sv_catsv_flags||5.007002| +sv_catsv_mg|5.004050||p +sv_catsv_nomg|5.007002||p +sv_catsv||| +sv_catxmlpvn||| +sv_catxmlsv||| +sv_chop||| +sv_clean_all||| +sv_clean_objs||| +sv_clear||| +sv_cmp_locale||5.004000| +sv_cmp||| +sv_collxfrm||| +sv_compile_2op||5.008001| +sv_copypv||5.007003| +sv_dec||| +sv_del_backref||| +sv_derived_from||5.004000| +sv_does||5.009004| +sv_dump||| +sv_dup||| +sv_eq||| +sv_exp_grow||| +sv_force_normal_flags||5.007001| +sv_force_normal||5.006000| +sv_free2||| +sv_free_arenas||| +sv_free||| +sv_gets||5.004000| +sv_grow||| +sv_i_ncmp||| +sv_inc||| +sv_insert||| +sv_isa||| +sv_isobject||| +sv_iv||5.005000| +sv_kill_backrefs||| +sv_len_utf8||5.006000| +sv_len||| +sv_magic_portable|5.009005|5.004000|p +sv_magicext||5.007003| +sv_magic||| +sv_mortalcopy||| +sv_ncmp||| +sv_newmortal||| +sv_newref||| +sv_nolocking||5.007003| +sv_nosharing||5.007003| +sv_nounlocking||| +sv_nv||5.005000| +sv_peek||5.005000| +sv_pos_b2u_midway||| +sv_pos_b2u||5.006000| +sv_pos_u2b_cached||| +sv_pos_u2b_forwards|||n +sv_pos_u2b_midway|||n +sv_pos_u2b||5.006000| +sv_pvbyten_force||5.006000| +sv_pvbyten||5.006000| +sv_pvbyte||5.006000| +sv_pvn_force_flags|5.007002||p +sv_pvn_force||| +sv_pvn_nomg|5.007003||p +sv_pvn||| +sv_pvutf8n_force||5.006000| +sv_pvutf8n||5.006000| +sv_pvutf8||5.006000| +sv_pv||5.006000| +sv_recode_to_utf8||5.007003| +sv_reftype||| +sv_release_COW||| +sv_replace||| +sv_report_used||| +sv_reset||| +sv_rvweaken||5.006000| +sv_setiv_mg|5.004050||p +sv_setiv||| +sv_setnv_mg|5.006000||p +sv_setnv||| +sv_setpv_mg|5.004050||p +sv_setpvf_mg_nocontext|||pvn +sv_setpvf_mg|5.006000|5.004000|pv +sv_setpvf_nocontext|||vn +sv_setpvf||5.004000|v +sv_setpviv_mg||5.008001| +sv_setpviv||5.008001| +sv_setpvn_mg|5.004050||p +sv_setpvn||| +sv_setpvs|5.009004||p +sv_setpv||| +sv_setref_iv||| +sv_setref_nv||| +sv_setref_pvn||| +sv_setref_pv||| +sv_setref_uv||5.007001| +sv_setsv_cow||| +sv_setsv_flags||5.007002| +sv_setsv_mg|5.004050||p +sv_setsv_nomg|5.007002||p +sv_setsv||| +sv_setuv_mg|5.004050||p +sv_setuv|5.004000||p +sv_tainted||5.004000| +sv_taint||5.004000| +sv_true||5.005000| +sv_unglob||| +sv_uni_display||5.007003| +sv_unmagic||| +sv_unref_flags||5.007001| +sv_unref||| +sv_untaint||5.004000| +sv_upgrade||| +sv_usepvn_flags||5.009004| +sv_usepvn_mg|5.004050||p +sv_usepvn||| +sv_utf8_decode||5.006000| +sv_utf8_downgrade||5.006000| +sv_utf8_encode||5.006000| +sv_utf8_upgrade_flags||5.007002| +sv_utf8_upgrade||5.007001| +sv_uv|5.005000||p +sv_vcatpvf_mg|5.006000|5.004000|p +sv_vcatpvfn||5.004000| +sv_vcatpvf|5.006000|5.004000|p +sv_vsetpvf_mg|5.006000|5.004000|p +sv_vsetpvfn||5.004000| +sv_vsetpvf|5.006000|5.004000|p +sv_xmlpeek||| +svtype||| +swallow_bom||| +swap_match_buff||| +swash_fetch||5.007002| +swash_get||| +swash_init||5.006000| +sys_intern_clear||| +sys_intern_dup||| +sys_intern_init||| +taint_env||| +taint_proper||| +tmps_grow||5.006000| +toLOWER||| +toUPPER||| +to_byte_substr||| +to_uni_fold||5.007003| +to_uni_lower_lc||5.006000| +to_uni_lower||5.007003| +to_uni_title_lc||5.006000| +to_uni_title||5.007003| +to_uni_upper_lc||5.006000| +to_uni_upper||5.007003| +to_utf8_case||5.007003| +to_utf8_fold||5.007003| +to_utf8_lower||5.007003| +to_utf8_substr||| +to_utf8_title||5.007003| +to_utf8_upper||5.007003| +token_free||| +token_getmad||| +tokenize_use||| +tokeq||| +tokereport||| +too_few_arguments||| +too_many_arguments||| +uiv_2buf|||n +unlnk||| +unpack_rec||| +unpack_str||5.007003| +unpackstring||5.008001| +unshare_hek_or_pvn||| +unshare_hek||| +unsharepvn||5.004000| +unwind_handler_stack||| +update_debugger_info||| +upg_version||5.009005| +usage||| +utf16_to_utf8_reversed||5.006001| +utf16_to_utf8||5.006001| +utf8_distance||5.006000| +utf8_hop||5.006000| +utf8_length||5.007001| +utf8_mg_pos_cache_update||| +utf8_to_bytes||5.006001| +utf8_to_uvchr||5.007001| +utf8_to_uvuni||5.007001| +utf8n_to_uvchr||| +utf8n_to_uvuni||5.007001| +utilize||| +uvchr_to_utf8_flags||5.007003| +uvchr_to_utf8||| +uvuni_to_utf8_flags||5.007003| +uvuni_to_utf8||5.007001| +validate_suid||| +varname||| +vcmp||5.009000| +vcroak||5.006000| +vdeb||5.007003| +vdie_common||| +vdie_croak_common||| +vdie||| +vform||5.006000| +visit||| +vivify_defelem||| +vivify_ref||| +vload_module|5.006000||p +vmess||5.006000| +vnewSVpvf|5.006000|5.004000|p +vnormal||5.009002| +vnumify||5.009000| +vstringify||5.009000| +vverify||5.009003| +vwarner||5.006000| +vwarn||5.006000| +wait4pid||| +warn_nocontext|||vn +warner_nocontext|||vn +warner|5.006000|5.004000|pv +warn|||v +watch||| +whichsig||| +write_no_mem||| +write_to_stderr||| +xmldump_all||| +xmldump_attr||| +xmldump_eval||| +xmldump_form||| +xmldump_indent|||v +xmldump_packsubs||| +xmldump_sub||| +xmldump_vindent||| +yyerror||| +yylex||| +yyparse||| +yywarn||| +); + +if (exists $opt{'list-unsupported'}) { + my $f; + for $f (sort { lc $a cmp lc $b } keys %API) { + next unless $API{$f}{todo}; + print "$f ", '.'x(40-length($f)), " ", format_version($API{$f}{todo}), "\n"; + } + exit 0; +} + +# Scan for possible replacement candidates + +my(%replace, %need, %hints, %warnings, %depends); +my $replace = 0; +my($hint, $define, $function); + +sub find_api +{ + my $code = shift; + $code =~ s{ + / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]*) + | "[^"\\]*(?:\\.[^"\\]*)*" + | '[^'\\]*(?:\\.[^'\\]*)*' }{}egsx; + grep { exists $API{$_} } $code =~ /(\w+)/mg; +} + +while () { + if ($hint) { + my $h = $hint->[0] eq 'Hint' ? \%hints : \%warnings; + if (m{^\s*\*\s(.*?)\s*$}) { + for (@{$hint->[1]}) { + $h->{$_} ||= ''; # suppress warning with older perls + $h->{$_} .= "$1\n"; + } + } + else { undef $hint } + } + + $hint = [$1, [split /,?\s+/, $2]] + if m{^\s*$rccs\s+(Hint|Warning):\s+(\w+(?:,?\s+\w+)*)\s*$}; + + if ($define) { + if ($define->[1] =~ /\\$/) { + $define->[1] .= $_; + } + else { + if (exists $API{$define->[0]} && $define->[1] !~ /^DPPP_\(/) { + my @n = find_api($define->[1]); + push @{$depends{$define->[0]}}, @n if @n + } + undef $define; + } + } + + $define = [$1, $2] if m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(.*)}; + + if ($function) { + if (/^}/) { + if (exists $API{$function->[0]}) { + my @n = find_api($function->[1]); + push @{$depends{$function->[0]}}, @n if @n + } + undef $define; + } + else { + $function->[1] .= $_; + } + } + + $function = [$1, ''] if m{^DPPP_\(my_(\w+)\)}; + + $replace = $1 if m{^\s*$rccs\s+Replace:\s+(\d+)\s+$rcce\s*$}; + $replace{$2} = $1 if $replace and m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(\w+)}; + $replace{$2} = $1 if m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(\w+).*$rccs\s+Replace\s+$rcce}; + $replace{$1} = $2 if m{^\s*$rccs\s+Replace (\w+) with (\w+)\s+$rcce\s*$}; + + if (m{^\s*$rccs\s+(\w+)\s+depends\s+on\s+(\w+(\s*,\s*\w+)*)\s+$rcce\s*$}) { + push @{$depends{$1}}, map { s/\s+//g; $_ } split /,/, $2; + } + + $need{$1} = 1 if m{^#if\s+defined\(NEED_(\w+)(?:_GLOBAL)?\)}; +} + +for (values %depends) { + my %s; + $_ = [sort grep !$s{$_}++, @$_]; +} + +if (exists $opt{'api-info'}) { + my $f; + my $count = 0; + my $match = $opt{'api-info'} =~ m!^/(.*)/$! ? $1 : "^\Q$opt{'api-info'}\E\$"; + for $f (sort { lc $a cmp lc $b } keys %API) { + next unless $f =~ /$match/; + print "\n=== $f ===\n\n"; + my $info = 0; + if ($API{$f}{base} || $API{$f}{todo}) { + my $base = format_version($API{$f}{base} || $API{$f}{todo}); + print "Supported at least starting from perl-$base.\n"; + $info++; + } + if ($API{$f}{provided}) { + my $todo = $API{$f}{todo} ? format_version($API{$f}{todo}) : "5.003"; + print "Support by $ppport provided back to perl-$todo.\n"; + print "Support needs to be explicitly requested by NEED_$f.\n" if exists $need{$f}; + print "Depends on: ", join(', ', @{$depends{$f}}), ".\n" if exists $depends{$f}; + print "\n$hints{$f}" if exists $hints{$f}; + print "\nWARNING:\n$warnings{$f}" if exists $warnings{$f}; + $info++; + } + print "No portability information available.\n" unless $info; + $count++; + } + $count or print "Found no API matching '$opt{'api-info'}'."; + print "\n"; + exit 0; +} + +if (exists $opt{'list-provided'}) { + my $f; + for $f (sort { lc $a cmp lc $b } keys %API) { + next unless $API{$f}{provided}; + my @flags; + push @flags, 'explicit' if exists $need{$f}; + push @flags, 'depend' if exists $depends{$f}; + push @flags, 'hint' if exists $hints{$f}; + push @flags, 'warning' if exists $warnings{$f}; + my $flags = @flags ? ' ['.join(', ', @flags).']' : ''; + print "$f$flags\n"; + } + exit 0; +} + +my @files; +my @srcext = qw( .xs .c .h .cc .cpp -c.inc -xs.inc ); +my $srcext = join '|', map { quotemeta $_ } @srcext; + +if (@ARGV) { + my %seen; + for (@ARGV) { + if (-e) { + if (-f) { + push @files, $_ unless $seen{$_}++; + } + else { warn "'$_' is not a file.\n" } + } + else { + my @new = grep { -f } glob $_ + or warn "'$_' does not exist.\n"; + push @files, grep { !$seen{$_}++ } @new; + } + } +} +else { + eval { + require File::Find; + File::Find::find(sub { + $File::Find::name =~ /($srcext)$/i + and push @files, $File::Find::name; + }, '.'); + }; + if ($@) { + @files = map { glob "*$_" } @srcext; + } +} + +if (!@ARGV || $opt{filter}) { + my(@in, @out); + my %xsc = map { /(.*)\.xs$/ ? ("$1.c" => 1, "$1.cc" => 1) : () } @files; + for (@files) { + my $out = exists $xsc{$_} || /\b\Q$ppport\E$/i || !/($srcext)$/i; + push @{ $out ? \@out : \@in }, $_; + } + if (@ARGV && @out) { + warning("Skipping the following files (use --nofilter to avoid this):\n| ", join "\n| ", @out); + } + @files = @in; +} + +die "No input files given!\n" unless @files; + +my(%files, %global, %revreplace); +%revreplace = reverse %replace; +my $filename; +my $patch_opened = 0; + +for $filename (@files) { + unless (open IN, "<$filename") { + warn "Unable to read from $filename: $!\n"; + next; + } + + info("Scanning $filename ..."); + + my $c = do { local $/; }; + close IN; + + my %file = (orig => $c, changes => 0); + + # Temporarily remove C/XS comments and strings from the code + my @ccom; + + $c =~ s{ + ( ^$HS*\#$HS*include\b[^\r\n]+\b(?:\Q$ppport\E|XSUB\.h)\b[^\r\n]* + | ^$HS*\#$HS*(?:define|elif|if(?:def)?)\b[^\r\n]* ) + | ( ^$HS*\#[^\r\n]* + | "[^"\\]*(?:\\.[^"\\]*)*" + | '[^'\\]*(?:\\.[^'\\]*)*' + | / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]* ) ) + }{ defined $2 and push @ccom, $2; + defined $1 ? $1 : "$ccs$#ccom$cce" }mgsex; + + $file{ccom} = \@ccom; + $file{code} = $c; + $file{has_inc_ppport} = $c =~ /^$HS*#$HS*include[^\r\n]+\b\Q$ppport\E\b/m; + + my $func; + + for $func (keys %API) { + my $match = $func; + $match .= "|$revreplace{$func}" if exists $revreplace{$func}; + if ($c =~ /\b(?:Perl_)?($match)\b/) { + $file{uses_replace}{$1}++ if exists $revreplace{$func} && $1 eq $revreplace{$func}; + $file{uses_Perl}{$func}++ if $c =~ /\bPerl_$func\b/; + if (exists $API{$func}{provided}) { + $file{uses_provided}{$func}++; + if (!exists $API{$func}{base} || $API{$func}{base} > $opt{'compat-version'}) { + $file{uses}{$func}++; + my @deps = rec_depend($func); + if (@deps) { + $file{uses_deps}{$func} = \@deps; + for (@deps) { + $file{uses}{$_} = 0 unless exists $file{uses}{$_}; + } + } + for ($func, @deps) { + $file{needs}{$_} = 'static' if exists $need{$_}; + } + } + } + if (exists $API{$func}{todo} && $API{$func}{todo} > $opt{'compat-version'}) { + if ($c =~ /\b$func\b/) { + $file{uses_todo}{$func}++; + } + } + } + } + + while ($c =~ /^$HS*#$HS*define$HS+(NEED_(\w+?)(_GLOBAL)?)\b/mg) { + if (exists $need{$2}) { + $file{defined $3 ? 'needed_global' : 'needed_static'}{$2}++; + } + else { warning("Possibly wrong #define $1 in $filename") } + } + + for (qw(uses needs uses_todo needed_global needed_static)) { + for $func (keys %{$file{$_}}) { + push @{$global{$_}{$func}}, $filename; + } + } + + $files{$filename} = \%file; +} + +# Globally resolve NEED_'s +my $need; +for $need (keys %{$global{needs}}) { + if (@{$global{needs}{$need}} > 1) { + my @targets = @{$global{needs}{$need}}; + my @t = grep $files{$_}{needed_global}{$need}, @targets; + @targets = @t if @t; + @t = grep /\.xs$/i, @targets; + @targets = @t if @t; + my $target = shift @targets; + $files{$target}{needs}{$need} = 'global'; + for (@{$global{needs}{$need}}) { + $files{$_}{needs}{$need} = 'extern' if $_ ne $target; + } + } +} + +for $filename (@files) { + exists $files{$filename} or next; + + info("=== Analyzing $filename ==="); + + my %file = %{$files{$filename}}; + my $func; + my $c = $file{code}; + my $warnings = 0; + + for $func (sort keys %{$file{uses_Perl}}) { + if ($API{$func}{varargs}) { + unless ($API{$func}{nothxarg}) { + my $changes = ($c =~ s{\b(Perl_$func\s*\(\s*)(?!aTHX_?)(\)|[^\s)]*\))} + { $1 . ($2 eq ')' ? 'aTHX' : 'aTHX_ ') . $2 }ge); + if ($changes) { + warning("Doesn't pass interpreter argument aTHX to Perl_$func"); + $file{changes} += $changes; + } + } + } + else { + warning("Uses Perl_$func instead of $func"); + $file{changes} += ($c =~ s{\bPerl_$func(\s*)\((\s*aTHX_?)?\s*} + {$func$1(}g); + } + } + + for $func (sort keys %{$file{uses_replace}}) { + warning("Uses $func instead of $replace{$func}"); + $file{changes} += ($c =~ s/\b$func\b/$replace{$func}/g); + } + + for $func (sort keys %{$file{uses_provided}}) { + if ($file{uses}{$func}) { + if (exists $file{uses_deps}{$func}) { + diag("Uses $func, which depends on ", join(', ', @{$file{uses_deps}{$func}})); + } + else { + diag("Uses $func"); + } + } + $warnings += hint($func); + } + + unless ($opt{quiet}) { + for $func (sort keys %{$file{uses_todo}}) { + print "*** WARNING: Uses $func, which may not be portable below perl ", + format_version($API{$func}{todo}), ", even with '$ppport'\n"; + $warnings++; + } + } + + for $func (sort keys %{$file{needed_static}}) { + my $message = ''; + if (not exists $file{uses}{$func}) { + $message = "No need to define NEED_$func if $func is never used"; + } + elsif (exists $file{needs}{$func} && $file{needs}{$func} ne 'static') { + $message = "No need to define NEED_$func when already needed globally"; + } + if ($message) { + diag($message); + $file{changes} += ($c =~ s/^$HS*#$HS*define$HS+NEED_$func\b.*$LF//mg); + } + } + + for $func (sort keys %{$file{needed_global}}) { + my $message = ''; + if (not exists $global{uses}{$func}) { + $message = "No need to define NEED_${func}_GLOBAL if $func is never used"; + } + elsif (exists $file{needs}{$func}) { + if ($file{needs}{$func} eq 'extern') { + $message = "No need to define NEED_${func}_GLOBAL when already needed globally"; + } + elsif ($file{needs}{$func} eq 'static') { + $message = "No need to define NEED_${func}_GLOBAL when only used in this file"; + } + } + if ($message) { + diag($message); + $file{changes} += ($c =~ s/^$HS*#$HS*define$HS+NEED_${func}_GLOBAL\b.*$LF//mg); + } + } + + $file{needs_inc_ppport} = keys %{$file{uses}}; + + if ($file{needs_inc_ppport}) { + my $pp = ''; + + for $func (sort keys %{$file{needs}}) { + my $type = $file{needs}{$func}; + next if $type eq 'extern'; + my $suffix = $type eq 'global' ? '_GLOBAL' : ''; + unless (exists $file{"needed_$type"}{$func}) { + if ($type eq 'global') { + diag("Files [@{$global{needs}{$func}}] need $func, adding global request"); + } + else { + diag("File needs $func, adding static request"); + } + $pp .= "#define NEED_$func$suffix\n"; + } + } + + if ($pp && ($c =~ s/^(?=$HS*#$HS*define$HS+NEED_\w+)/$pp/m)) { + $pp = ''; + $file{changes}++; + } + + unless ($file{has_inc_ppport}) { + diag("Needs to include '$ppport'"); + $pp .= qq(#include "$ppport"\n) + } + + if ($pp) { + $file{changes} += ($c =~ s/^($HS*#$HS*define$HS+NEED_\w+.*?)^/$1$pp/ms) + || ($c =~ s/^(?=$HS*#$HS*include.*\Q$ppport\E)/$pp/m) + || ($c =~ s/^($HS*#$HS*include.*XSUB.*\s*?)^/$1$pp/m) + || ($c =~ s/^/$pp/); + } + } + else { + if ($file{has_inc_ppport}) { + diag("No need to include '$ppport'"); + $file{changes} += ($c =~ s/^$HS*?#$HS*include.*\Q$ppport\E.*?$LF//m); + } + } + + # put back in our C comments + my $ix; + my $cppc = 0; + my @ccom = @{$file{ccom}}; + for $ix (0 .. $#ccom) { + if (!$opt{cplusplus} && $ccom[$ix] =~ s!^//!!) { + $cppc++; + $file{changes} += $c =~ s/$rccs$ix$rcce/$ccs$ccom[$ix] $cce/; + } + else { + $c =~ s/$rccs$ix$rcce/$ccom[$ix]/; + } + } + + if ($cppc) { + my $s = $cppc != 1 ? 's' : ''; + warning("Uses $cppc C++ style comment$s, which is not portable"); + } + + my $s = $warnings != 1 ? 's' : ''; + my $warn = $warnings ? " ($warnings warning$s)" : ''; + info("Analysis completed$warn"); + + if ($file{changes}) { + if (exists $opt{copy}) { + my $newfile = "$filename$opt{copy}"; + if (-e $newfile) { + error("'$newfile' already exists, refusing to write copy of '$filename'"); + } + else { + local *F; + if (open F, ">$newfile") { + info("Writing copy of '$filename' with changes to '$newfile'"); + print F $c; + close F; + } + else { + error("Cannot open '$newfile' for writing: $!"); + } + } + } + elsif (exists $opt{patch} || $opt{changes}) { + if (exists $opt{patch}) { + unless ($patch_opened) { + if (open PATCH, ">$opt{patch}") { + $patch_opened = 1; + } + else { + error("Cannot open '$opt{patch}' for writing: $!"); + delete $opt{patch}; + $opt{changes} = 1; + goto fallback; + } + } + mydiff(\*PATCH, $filename, $c); + } + else { +fallback: + info("Suggested changes:"); + mydiff(\*STDOUT, $filename, $c); + } + } + else { + my $s = $file{changes} == 1 ? '' : 's'; + info("$file{changes} potentially required change$s detected"); + } + } + else { + info("Looks good"); + } +} + +close PATCH if $patch_opened; + +exit 0; + + +sub try_use { eval "use @_;"; return $@ eq '' } + +sub mydiff +{ + local *F = shift; + my($file, $str) = @_; + my $diff; + + if (exists $opt{diff}) { + $diff = run_diff($opt{diff}, $file, $str); + } + + if (!defined $diff and try_use('Text::Diff')) { + $diff = Text::Diff::diff($file, \$str, { STYLE => 'Unified' }); + $diff = <
$tmp") { + print F $str; + close F; + + if (open F, "$prog $file $tmp |") { + while () { + s/\Q$tmp\E/$file.patched/; + $diff .= $_; + } + close F; + unlink $tmp; + return $diff; + } + + unlink $tmp; + } + else { + error("Cannot open '$tmp' for writing: $!"); + } + + return undef; +} + +sub rec_depend +{ + my($func, $seen) = @_; + return () unless exists $depends{$func}; + $seen = {%{$seen||{}}}; + return () if $seen->{$func}++; + my %s; + grep !$s{$_}++, map { ($_, rec_depend($_, $seen)) } @{$depends{$func}}; +} + +sub parse_version +{ + my $ver = shift; + + if ($ver =~ /^(\d+)\.(\d+)\.(\d+)$/) { + return ($1, $2, $3); + } + elsif ($ver !~ /^\d+\.[\d_]+$/) { + die "cannot parse version '$ver'\n"; + } + + $ver =~ s/_//g; + $ver =~ s/$/000000/; + + my($r,$v,$s) = $ver =~ /(\d+)\.(\d{3})(\d{3})/; + + $v = int $v; + $s = int $s; + + if ($r < 5 || ($r == 5 && $v < 6)) { + if ($s % 10) { + die "cannot parse version '$ver'\n"; + } + } + + return ($r, $v, $s); +} + +sub format_version +{ + my $ver = shift; + + $ver =~ s/$/000000/; + my($r,$v,$s) = $ver =~ /(\d+)\.(\d{3})(\d{3})/; + + $v = int $v; + $s = int $s; + + if ($r < 5 || ($r == 5 && $v < 6)) { + if ($s % 10) { + die "invalid version '$ver'\n"; + } + $s /= 10; + + $ver = sprintf "%d.%03d", $r, $v; + $s > 0 and $ver .= sprintf "_%02d", $s; + + return $ver; + } + + return sprintf "%d.%d.%d", $r, $v, $s; +} + +sub info +{ + $opt{quiet} and return; + print @_, "\n"; +} + +sub diag +{ + $opt{quiet} and return; + $opt{diag} and print @_, "\n"; +} + +sub warning +{ + $opt{quiet} and return; + print "*** ", @_, "\n"; +} + +sub error +{ + print "*** ERROR: ", @_, "\n"; +} + +my %given_hints; +my %given_warnings; +sub hint +{ + $opt{quiet} and return; + my $func = shift; + my $rv = 0; + if (exists $warnings{$func} && !$given_warnings{$func}++) { + my $warn = $warnings{$func}; + $warn =~ s!^!*** !mg; + print "*** WARNING: $func\n", $warn; + $rv++; + } + if ($opt{hints} && exists $hints{$func} && !$given_hints{$func}++) { + my $hint = $hints{$func}; + $hint =~ s/^/ /mg; + print " --- hint for $func ---\n", $hint; + } + $rv; +} + +sub usage +{ + my($usage) = do { local(@ARGV,$/)=($0); <> } =~ /^=head\d$HS+SYNOPSIS\s*^(.*?)\s*^=/ms; + my %M = ( 'I' => '*' ); + $usage =~ s/^\s*perl\s+\S+/$^X $0/; + $usage =~ s/([A-Z])<([^>]+)>/$M{$1}$2$M{$1}/g; + + print < }; + my($copy) = $self =~ /^=head\d\s+COPYRIGHT\s*^(.*?)^=\w+/ms; + $copy =~ s/^(?=\S+)/ /gms; + $self =~ s/^$HS+Do NOT edit.*?(?=^-)/$copy/ms; + $self =~ s/^SKIP.*(?=^__DATA__)/SKIP +if (\@ARGV && \$ARGV[0] eq '--unstrip') { + eval { require Devel::PPPort }; + \$@ and die "Cannot require Devel::PPPort, please install.\\n"; + if (\$Devel::PPPort::VERSION < $VERSION) { + die "$0 was originally generated with Devel::PPPort $VERSION.\\n" + . "Your Devel::PPPort is only version \$Devel::PPPort::VERSION.\\n" + . "Please install a newer version, or --unstrip will not work.\\n"; + } + Devel::PPPort::WriteFile(\$0); + exit 0; +} +print <$0" or die "cannot strip $0: $!\n"; + print OUT "$pl$c\n"; + + exit 0; +} + +__DATA__ +*/ + +#ifndef _P_P_PORTABILITY_H_ +#define _P_P_PORTABILITY_H_ + +#ifndef DPPP_NAMESPACE +# define DPPP_NAMESPACE DPPP_ +#endif + +#define DPPP_CAT2(x,y) CAT2(x,y) +#define DPPP_(name) DPPP_CAT2(DPPP_NAMESPACE, name) + +#ifndef PERL_REVISION +# if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION)) +# define PERL_PATCHLEVEL_H_IMPLICIT +# include +# endif +# if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL))) +# include +# endif +# ifndef PERL_REVISION +# define PERL_REVISION (5) + /* Replace: 1 */ +# define PERL_VERSION PATCHLEVEL +# define PERL_SUBVERSION SUBVERSION + /* Replace PERL_PATCHLEVEL with PERL_VERSION */ + /* Replace: 0 */ +# endif +#endif + +#define _dpppDEC2BCD(dec) ((((dec)/100)<<8)|((((dec)%100)/10)<<4)|((dec)%10)) +#define PERL_BCDVERSION ((_dpppDEC2BCD(PERL_REVISION)<<24)|(_dpppDEC2BCD(PERL_VERSION)<<12)|_dpppDEC2BCD(PERL_SUBVERSION)) + +/* It is very unlikely that anyone will try to use this with Perl 6 + (or greater), but who knows. + */ +#if PERL_REVISION != 5 +# error ppport.h only works with Perl version 5 +#endif /* PERL_REVISION != 5 */ + +#ifdef I_LIMITS +# include +#endif + +#ifndef PERL_UCHAR_MIN +# define PERL_UCHAR_MIN ((unsigned char)0) +#endif + +#ifndef PERL_UCHAR_MAX +# ifdef UCHAR_MAX +# define PERL_UCHAR_MAX ((unsigned char)UCHAR_MAX) +# else +# ifdef MAXUCHAR +# define PERL_UCHAR_MAX ((unsigned char)MAXUCHAR) +# else +# define PERL_UCHAR_MAX ((unsigned char)~(unsigned)0) +# endif +# endif +#endif + +#ifndef PERL_USHORT_MIN +# define PERL_USHORT_MIN ((unsigned short)0) +#endif + +#ifndef PERL_USHORT_MAX +# ifdef USHORT_MAX +# define PERL_USHORT_MAX ((unsigned short)USHORT_MAX) +# else +# ifdef MAXUSHORT +# define PERL_USHORT_MAX ((unsigned short)MAXUSHORT) +# else +# ifdef USHRT_MAX +# define PERL_USHORT_MAX ((unsigned short)USHRT_MAX) +# else +# define PERL_USHORT_MAX ((unsigned short)~(unsigned)0) +# endif +# endif +# endif +#endif + +#ifndef PERL_SHORT_MAX +# ifdef SHORT_MAX +# define PERL_SHORT_MAX ((short)SHORT_MAX) +# else +# ifdef MAXSHORT /* Often used in */ +# define PERL_SHORT_MAX ((short)MAXSHORT) +# else +# ifdef SHRT_MAX +# define PERL_SHORT_MAX ((short)SHRT_MAX) +# else +# define PERL_SHORT_MAX ((short) (PERL_USHORT_MAX >> 1)) +# endif +# endif +# endif +#endif + +#ifndef PERL_SHORT_MIN +# ifdef SHORT_MIN +# define PERL_SHORT_MIN ((short)SHORT_MIN) +# else +# ifdef MINSHORT +# define PERL_SHORT_MIN ((short)MINSHORT) +# else +# ifdef SHRT_MIN +# define PERL_SHORT_MIN ((short)SHRT_MIN) +# else +# define PERL_SHORT_MIN (-PERL_SHORT_MAX - ((3 & -1) == 3)) +# endif +# endif +# endif +#endif + +#ifndef PERL_UINT_MAX +# ifdef UINT_MAX +# define PERL_UINT_MAX ((unsigned int)UINT_MAX) +# else +# ifdef MAXUINT +# define PERL_UINT_MAX ((unsigned int)MAXUINT) +# else +# define PERL_UINT_MAX (~(unsigned int)0) +# endif +# endif +#endif + +#ifndef PERL_UINT_MIN +# define PERL_UINT_MIN ((unsigned int)0) +#endif + +#ifndef PERL_INT_MAX +# ifdef INT_MAX +# define PERL_INT_MAX ((int)INT_MAX) +# else +# ifdef MAXINT /* Often used in */ +# define PERL_INT_MAX ((int)MAXINT) +# else +# define PERL_INT_MAX ((int)(PERL_UINT_MAX >> 1)) +# endif +# endif +#endif + +#ifndef PERL_INT_MIN +# ifdef INT_MIN +# define PERL_INT_MIN ((int)INT_MIN) +# else +# ifdef MININT +# define PERL_INT_MIN ((int)MININT) +# else +# define PERL_INT_MIN (-PERL_INT_MAX - ((3 & -1) == 3)) +# endif +# endif +#endif + +#ifndef PERL_ULONG_MAX +# ifdef ULONG_MAX +# define PERL_ULONG_MAX ((unsigned long)ULONG_MAX) +# else +# ifdef MAXULONG +# define PERL_ULONG_MAX ((unsigned long)MAXULONG) +# else +# define PERL_ULONG_MAX (~(unsigned long)0) +# endif +# endif +#endif + +#ifndef PERL_ULONG_MIN +# define PERL_ULONG_MIN ((unsigned long)0L) +#endif + +#ifndef PERL_LONG_MAX +# ifdef LONG_MAX +# define PERL_LONG_MAX ((long)LONG_MAX) +# else +# ifdef MAXLONG +# define PERL_LONG_MAX ((long)MAXLONG) +# else +# define PERL_LONG_MAX ((long) (PERL_ULONG_MAX >> 1)) +# endif +# endif +#endif + +#ifndef PERL_LONG_MIN +# ifdef LONG_MIN +# define PERL_LONG_MIN ((long)LONG_MIN) +# else +# ifdef MINLONG +# define PERL_LONG_MIN ((long)MINLONG) +# else +# define PERL_LONG_MIN (-PERL_LONG_MAX - ((3 & -1) == 3)) +# endif +# endif +#endif + +#if defined(HAS_QUAD) && (defined(convex) || defined(uts)) +# ifndef PERL_UQUAD_MAX +# ifdef ULONGLONG_MAX +# define PERL_UQUAD_MAX ((unsigned long long)ULONGLONG_MAX) +# else +# ifdef MAXULONGLONG +# define PERL_UQUAD_MAX ((unsigned long long)MAXULONGLONG) +# else +# define PERL_UQUAD_MAX (~(unsigned long long)0) +# endif +# endif +# endif + +# ifndef PERL_UQUAD_MIN +# define PERL_UQUAD_MIN ((unsigned long long)0L) +# endif + +# ifndef PERL_QUAD_MAX +# ifdef LONGLONG_MAX +# define PERL_QUAD_MAX ((long long)LONGLONG_MAX) +# else +# ifdef MAXLONGLONG +# define PERL_QUAD_MAX ((long long)MAXLONGLONG) +# else +# define PERL_QUAD_MAX ((long long) (PERL_UQUAD_MAX >> 1)) +# endif +# endif +# endif + +# ifndef PERL_QUAD_MIN +# ifdef LONGLONG_MIN +# define PERL_QUAD_MIN ((long long)LONGLONG_MIN) +# else +# ifdef MINLONGLONG +# define PERL_QUAD_MIN ((long long)MINLONGLONG) +# else +# define PERL_QUAD_MIN (-PERL_QUAD_MAX - ((3 & -1) == 3)) +# endif +# endif +# endif +#endif + +/* This is based on code from 5.003 perl.h */ +#ifdef HAS_QUAD +# ifdef cray +#ifndef IVTYPE +# define IVTYPE int +#endif + +#ifndef IV_MIN +# define IV_MIN PERL_INT_MIN +#endif + +#ifndef IV_MAX +# define IV_MAX PERL_INT_MAX +#endif + +#ifndef UV_MIN +# define UV_MIN PERL_UINT_MIN +#endif + +#ifndef UV_MAX +# define UV_MAX PERL_UINT_MAX +#endif + +# ifdef INTSIZE +#ifndef IVSIZE +# define IVSIZE INTSIZE +#endif + +# endif +# else +# if defined(convex) || defined(uts) +#ifndef IVTYPE +# define IVTYPE long long +#endif + +#ifndef IV_MIN +# define IV_MIN PERL_QUAD_MIN +#endif + +#ifndef IV_MAX +# define IV_MAX PERL_QUAD_MAX +#endif + +#ifndef UV_MIN +# define UV_MIN PERL_UQUAD_MIN +#endif + +#ifndef UV_MAX +# define UV_MAX PERL_UQUAD_MAX +#endif + +# ifdef LONGLONGSIZE +#ifndef IVSIZE +# define IVSIZE LONGLONGSIZE +#endif + +# endif +# else +#ifndef IVTYPE +# define IVTYPE long +#endif + +#ifndef IV_MIN +# define IV_MIN PERL_LONG_MIN +#endif + +#ifndef IV_MAX +# define IV_MAX PERL_LONG_MAX +#endif + +#ifndef UV_MIN +# define UV_MIN PERL_ULONG_MIN +#endif + +#ifndef UV_MAX +# define UV_MAX PERL_ULONG_MAX +#endif + +# ifdef LONGSIZE +#ifndef IVSIZE +# define IVSIZE LONGSIZE +#endif + +# endif +# endif +# endif +#ifndef IVSIZE +# define IVSIZE 8 +#endif + +#ifndef PERL_QUAD_MIN +# define PERL_QUAD_MIN IV_MIN +#endif + +#ifndef PERL_QUAD_MAX +# define PERL_QUAD_MAX IV_MAX +#endif + +#ifndef PERL_UQUAD_MIN +# define PERL_UQUAD_MIN UV_MIN +#endif + +#ifndef PERL_UQUAD_MAX +# define PERL_UQUAD_MAX UV_MAX +#endif + +#else +#ifndef IVTYPE +# define IVTYPE long +#endif + +#ifndef IV_MIN +# define IV_MIN PERL_LONG_MIN +#endif + +#ifndef IV_MAX +# define IV_MAX PERL_LONG_MAX +#endif + +#ifndef UV_MIN +# define UV_MIN PERL_ULONG_MIN +#endif + +#ifndef UV_MAX +# define UV_MAX PERL_ULONG_MAX +#endif + +#endif + +#ifndef IVSIZE +# ifdef LONGSIZE +# define IVSIZE LONGSIZE +# else +# define IVSIZE 4 /* A bold guess, but the best we can make. */ +# endif +#endif +#ifndef UVTYPE +# define UVTYPE unsigned IVTYPE +#endif + +#ifndef UVSIZE +# define UVSIZE IVSIZE +#endif +#ifndef sv_setuv +# define sv_setuv(sv, uv) \ + STMT_START { \ + UV TeMpUv = uv; \ + if (TeMpUv <= IV_MAX) \ + sv_setiv(sv, TeMpUv); \ + else \ + sv_setnv(sv, (double)TeMpUv); \ + } STMT_END +#endif +#ifndef newSVuv +# define newSVuv(uv) ((uv) <= IV_MAX ? newSViv((IV)uv) : newSVnv((NV)uv)) +#endif +#ifndef sv_2uv +# define sv_2uv(sv) ((PL_Sv = (sv)), (UV) (SvNOK(PL_Sv) ? SvNV(PL_Sv) : sv_2nv(PL_Sv))) +#endif + +#ifndef SvUVX +# define SvUVX(sv) ((UV)SvIVX(sv)) +#endif + +#ifndef SvUVXx +# define SvUVXx(sv) SvUVX(sv) +#endif + +#ifndef SvUV +# define SvUV(sv) (SvIOK(sv) ? SvUVX(sv) : sv_2uv(sv)) +#endif + +#ifndef SvUVx +# define SvUVx(sv) ((PL_Sv = (sv)), SvUV(PL_Sv)) +#endif + +/* Hint: sv_uv + * Always use the SvUVx() macro instead of sv_uv(). + */ +#ifndef sv_uv +# define sv_uv(sv) SvUVx(sv) +#endif + +#if !defined(SvUOK) && defined(SvIOK_UV) +# define SvUOK(sv) SvIOK_UV(sv) +#endif +#ifndef XST_mUV +# define XST_mUV(i,v) (ST(i) = sv_2mortal(newSVuv(v)) ) +#endif + +#ifndef XSRETURN_UV +# define XSRETURN_UV(v) STMT_START { XST_mUV(0,v); XSRETURN(1); } STMT_END +#endif +#ifndef PUSHu +# define PUSHu(u) STMT_START { sv_setuv(TARG, (UV)(u)); PUSHTARG; } STMT_END +#endif + +#ifndef XPUSHu +# define XPUSHu(u) STMT_START { sv_setuv(TARG, (UV)(u)); XPUSHTARG; } STMT_END +#endif + +#ifdef HAS_MEMCMP +#ifndef memNE +# define memNE(s1,s2,l) (memcmp(s1,s2,l)) +#endif + +#ifndef memEQ +# define memEQ(s1,s2,l) (!memcmp(s1,s2,l)) +#endif + +#else +#ifndef memNE +# define memNE(s1,s2,l) (bcmp(s1,s2,l)) +#endif + +#ifndef memEQ +# define memEQ(s1,s2,l) (!bcmp(s1,s2,l)) +#endif + +#endif +#ifndef MoveD +# define MoveD(s,d,n,t) memmove((char*)(d),(char*)(s), (n) * sizeof(t)) +#endif + +#ifndef CopyD +# define CopyD(s,d,n,t) memcpy((char*)(d),(char*)(s), (n) * sizeof(t)) +#endif + +#ifdef HAS_MEMSET +#ifndef ZeroD +# define ZeroD(d,n,t) memzero((char*)(d), (n) * sizeof(t)) +#endif + +#else +#ifndef ZeroD +# define ZeroD(d,n,t) ((void)memzero((char*)(d), (n) * sizeof(t)), d) +#endif + +#endif +#ifndef PoisonWith +# define PoisonWith(d,n,t,b) (void)memset((char*)(d), (U8)(b), (n) * sizeof(t)) +#endif + +#ifndef PoisonNew +# define PoisonNew(d,n,t) PoisonWith(d,n,t,0xAB) +#endif + +#ifndef PoisonFree +# define PoisonFree(d,n,t) PoisonWith(d,n,t,0xEF) +#endif + +#ifndef Poison +# define Poison(d,n,t) PoisonFree(d,n,t) +#endif +#ifndef Newx +# define Newx(v,n,t) New(0,v,n,t) +#endif + +#ifndef Newxc +# define Newxc(v,n,t,c) Newc(0,v,n,t,c) +#endif + +#ifndef Newxz +# define Newxz(v,n,t) Newz(0,v,n,t) +#endif + +#ifndef PERL_UNUSED_DECL +# ifdef HASATTRIBUTE +# if (defined(__GNUC__) && defined(__cplusplus)) || defined(__INTEL_COMPILER) +# define PERL_UNUSED_DECL +# else +# define PERL_UNUSED_DECL __attribute__((unused)) +# endif +# else +# define PERL_UNUSED_DECL +# endif +#endif + +#ifndef PERL_UNUSED_ARG +# if defined(lint) && defined(S_SPLINT_S) /* www.splint.org */ +# include +# define PERL_UNUSED_ARG(x) NOTE(ARGUNUSED(x)) +# else +# define PERL_UNUSED_ARG(x) ((void)x) +# endif +#endif + +#ifndef PERL_UNUSED_VAR +# define PERL_UNUSED_VAR(x) ((void)x) +#endif + +#ifndef PERL_UNUSED_CONTEXT +# ifdef USE_ITHREADS +# define PERL_UNUSED_CONTEXT PERL_UNUSED_ARG(my_perl) +# else +# define PERL_UNUSED_CONTEXT +# endif +#endif +#ifndef NOOP +# define NOOP /*EMPTY*/(void)0 +#endif + +#ifndef dNOOP +# define dNOOP extern int /*@unused@*/ Perl___notused PERL_UNUSED_DECL +#endif + +#ifndef NVTYPE +# if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) +# define NVTYPE long double +# else +# define NVTYPE double +# endif +typedef NVTYPE NV; +#endif + +#ifndef INT2PTR + +# if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE) +# define PTRV UV +# define INT2PTR(any,d) (any)(d) +# else +# if PTRSIZE == LONGSIZE +# define PTRV unsigned long +# else +# define PTRV unsigned +# endif +# define INT2PTR(any,d) (any)(PTRV)(d) +# endif + +# define NUM2PTR(any,d) (any)(PTRV)(d) +# define PTR2IV(p) INT2PTR(IV,p) +# define PTR2UV(p) INT2PTR(UV,p) +# define PTR2NV(p) NUM2PTR(NV,p) + +# if PTRSIZE == LONGSIZE +# define PTR2ul(p) (unsigned long)(p) +# else +# define PTR2ul(p) INT2PTR(unsigned long,p) +# endif + +#endif /* !INT2PTR */ + +#undef START_EXTERN_C +#undef END_EXTERN_C +#undef EXTERN_C +#ifdef __cplusplus +# define START_EXTERN_C extern "C" { +# define END_EXTERN_C } +# define EXTERN_C extern "C" +#else +# define START_EXTERN_C +# define END_EXTERN_C +# define EXTERN_C extern +#endif + +#if defined(PERL_GCC_PEDANTIC) +# ifndef PERL_GCC_BRACE_GROUPS_FORBIDDEN +# define PERL_GCC_BRACE_GROUPS_FORBIDDEN +# endif +#endif + +#if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) && !defined(__cplusplus) +# ifndef PERL_USE_GCC_BRACE_GROUPS +# define PERL_USE_GCC_BRACE_GROUPS +# endif +#endif + +#undef STMT_START +#undef STMT_END +#ifdef PERL_USE_GCC_BRACE_GROUPS +# define STMT_START (void)( /* gcc supports ``({ STATEMENTS; })'' */ +# define STMT_END ) +#else +# if defined(VOIDFLAGS) && (VOIDFLAGS) && (defined(sun) || defined(__sun__)) && !defined(__GNUC__) +# define STMT_START if (1) +# define STMT_END else (void)0 +# else +# define STMT_START do +# define STMT_END while (0) +# endif +#endif +#ifndef boolSV +# define boolSV(b) ((b) ? &PL_sv_yes : &PL_sv_no) +#endif + +/* DEFSV appears first in 5.004_56 */ +#ifndef DEFSV +# define DEFSV GvSV(PL_defgv) +#endif + +#ifndef SAVE_DEFSV +# define SAVE_DEFSV SAVESPTR(GvSV(PL_defgv)) +#endif + +/* Older perls (<=5.003) lack AvFILLp */ +#ifndef AvFILLp +# define AvFILLp AvFILL +#endif +#ifndef ERRSV +# define ERRSV get_sv("@",FALSE) +#endif +#ifndef newSVpvn +# define newSVpvn(data,len) ((data) \ + ? ((len) ? newSVpv((data), (len)) : newSVpv("", 0)) \ + : newSV(0)) +#endif + +/* Hint: gv_stashpvn + * This function's backport doesn't support the length parameter, but + * rather ignores it. Portability can only be ensured if the length + * parameter is used for speed reasons, but the length can always be + * correctly computed from the string argument. + */ +#ifndef gv_stashpvn +# define gv_stashpvn(str,len,create) gv_stashpv(str,create) +#endif + +/* Replace: 1 */ +#ifndef get_cv +# define get_cv perl_get_cv +#endif + +#ifndef get_sv +# define get_sv perl_get_sv +#endif + +#ifndef get_av +# define get_av perl_get_av +#endif + +#ifndef get_hv +# define get_hv perl_get_hv +#endif + +/* Replace: 0 */ +#ifndef dUNDERBAR +# define dUNDERBAR dNOOP +#endif + +#ifndef UNDERBAR +# define UNDERBAR DEFSV +#endif +#ifndef dAX +# define dAX I32 ax = MARK - PL_stack_base + 1 +#endif + +#ifndef dITEMS +# define dITEMS I32 items = SP - MARK +#endif +#ifndef dXSTARG +# define dXSTARG SV * targ = sv_newmortal() +#endif +#ifndef dAXMARK +# define dAXMARK I32 ax = POPMARK; \ + register SV ** const mark = PL_stack_base + ax++ +#endif +#ifndef XSprePUSH +# define XSprePUSH (sp = PL_stack_base + ax - 1) +#endif + +#if (PERL_BCDVERSION < 0x5005000) +# undef XSRETURN +# define XSRETURN(off) \ + STMT_START { \ + PL_stack_sp = PL_stack_base + ax + ((off) - 1); \ + return; \ + } STMT_END +#endif +#ifndef PERL_ABS +# define PERL_ABS(x) ((x) < 0 ? -(x) : (x)) +#endif +#ifndef dVAR +# define dVAR dNOOP +#endif +#ifndef SVf +# define SVf "_" +#endif +#ifndef UTF8_MAXBYTES +# define UTF8_MAXBYTES UTF8_MAXLEN +#endif +#ifndef PERL_HASH +# define PERL_HASH(hash,str,len) \ + STMT_START { \ + const char *s_PeRlHaSh = str; \ + I32 i_PeRlHaSh = len; \ + U32 hash_PeRlHaSh = 0; \ + while (i_PeRlHaSh--) \ + hash_PeRlHaSh = hash_PeRlHaSh * 33 + *s_PeRlHaSh++; \ + (hash) = hash_PeRlHaSh; \ + } STMT_END +#endif + +#ifndef PERL_SIGNALS_UNSAFE_FLAG + +#define PERL_SIGNALS_UNSAFE_FLAG 0x0001 + +#if (PERL_BCDVERSION < 0x5008000) +# define D_PPP_PERL_SIGNALS_INIT PERL_SIGNALS_UNSAFE_FLAG +#else +# define D_PPP_PERL_SIGNALS_INIT 0 +#endif + +#if defined(NEED_PL_signals) +static U32 DPPP_(my_PL_signals) = D_PPP_PERL_SIGNALS_INIT; +#elif defined(NEED_PL_signals_GLOBAL) +U32 DPPP_(my_PL_signals) = D_PPP_PERL_SIGNALS_INIT; +#else +extern U32 DPPP_(my_PL_signals); +#endif +#define PL_signals DPPP_(my_PL_signals) + +#endif + +/* Hint: PL_ppaddr + * Calling an op via PL_ppaddr requires passing a context argument + * for threaded builds. Since the context argument is different for + * 5.005 perls, you can use aTHXR (supplied by ppport.h), which will + * automatically be defined as the correct argument. + */ + +#if (PERL_BCDVERSION <= 0x5005005) +/* Replace: 1 */ +# define PL_ppaddr ppaddr +# define PL_no_modify no_modify +/* Replace: 0 */ +#endif + +#if (PERL_BCDVERSION <= 0x5004005) +/* Replace: 1 */ +# define PL_DBsignal DBsignal +# define PL_DBsingle DBsingle +# define PL_DBsub DBsub +# define PL_DBtrace DBtrace +# define PL_Sv Sv +# define PL_compiling compiling +# define PL_copline copline +# define PL_curcop curcop +# define PL_curstash curstash +# define PL_debstash debstash +# define PL_defgv defgv +# define PL_diehook diehook +# define PL_dirty dirty +# define PL_dowarn dowarn +# define PL_errgv errgv +# define PL_expect expect +# define PL_hexdigit hexdigit +# define PL_hints hints +# define PL_laststatval laststatval +# define PL_na na +# define PL_perl_destruct_level perl_destruct_level +# define PL_perldb perldb +# define PL_rsfp_filters rsfp_filters +# define PL_rsfp rsfp +# define PL_stack_base stack_base +# define PL_stack_sp stack_sp +# define PL_statcache statcache +# define PL_stdingv stdingv +# define PL_sv_arenaroot sv_arenaroot +# define PL_sv_no sv_no +# define PL_sv_undef sv_undef +# define PL_sv_yes sv_yes +# define PL_tainted tainted +# define PL_tainting tainting +/* Replace: 0 */ +#endif + +/* Warning: PL_expect, PL_copline, PL_rsfp, PL_rsfp_filters + * Do not use this variable. It is internal to the perl parser + * and may change or even be removed in the future. Note that + * as of perl 5.9.5 you cannot assign to this variable anymore. + */ + +/* TODO: cannot assign to these vars; is it worth fixing? */ +#if (PERL_BCDVERSION >= 0x5009005) +# define PL_expect (PL_parser ? PL_parser->expect : 0) +# define PL_copline (PL_parser ? PL_parser->copline : 0) +# define PL_rsfp (PL_parser ? PL_parser->rsfp : (PerlIO *) 0) +# define PL_rsfp_filters (PL_parser ? PL_parser->rsfp_filters : (AV *) 0) +#endif +#ifndef dTHR +# define dTHR dNOOP +#endif +#ifndef dTHX +# define dTHX dNOOP +#endif + +#ifndef dTHXa +# define dTHXa(x) dNOOP +#endif +#ifndef pTHX +# define pTHX void +#endif + +#ifndef pTHX_ +# define pTHX_ +#endif + +#ifndef aTHX +# define aTHX +#endif + +#ifndef aTHX_ +# define aTHX_ +#endif + +#if (PERL_BCDVERSION < 0x5006000) +# ifdef USE_THREADS +# define aTHXR thr +# define aTHXR_ thr, +# else +# define aTHXR +# define aTHXR_ +# endif +# define dTHXR dTHR +#else +# define aTHXR aTHX +# define aTHXR_ aTHX_ +# define dTHXR dTHX +#endif +#ifndef dTHXoa +# define dTHXoa(x) dTHXa(x) +#endif +#ifndef PUSHmortal +# define PUSHmortal PUSHs(sv_newmortal()) +#endif + +#ifndef mPUSHp +# define mPUSHp(p,l) sv_setpvn_mg(PUSHmortal, (p), (l)) +#endif + +#ifndef mPUSHn +# define mPUSHn(n) sv_setnv_mg(PUSHmortal, (NV)(n)) +#endif + +#ifndef mPUSHi +# define mPUSHi(i) sv_setiv_mg(PUSHmortal, (IV)(i)) +#endif + +#ifndef mPUSHu +# define mPUSHu(u) sv_setuv_mg(PUSHmortal, (UV)(u)) +#endif +#ifndef XPUSHmortal +# define XPUSHmortal XPUSHs(sv_newmortal()) +#endif + +#ifndef mXPUSHp +# define mXPUSHp(p,l) STMT_START { EXTEND(sp,1); sv_setpvn_mg(PUSHmortal, (p), (l)); } STMT_END +#endif + +#ifndef mXPUSHn +# define mXPUSHn(n) STMT_START { EXTEND(sp,1); sv_setnv_mg(PUSHmortal, (NV)(n)); } STMT_END +#endif + +#ifndef mXPUSHi +# define mXPUSHi(i) STMT_START { EXTEND(sp,1); sv_setiv_mg(PUSHmortal, (IV)(i)); } STMT_END +#endif + +#ifndef mXPUSHu +# define mXPUSHu(u) STMT_START { EXTEND(sp,1); sv_setuv_mg(PUSHmortal, (UV)(u)); } STMT_END +#endif + +/* Replace: 1 */ +#ifndef call_sv +# define call_sv perl_call_sv +#endif + +#ifndef call_pv +# define call_pv perl_call_pv +#endif + +#ifndef call_argv +# define call_argv perl_call_argv +#endif + +#ifndef call_method +# define call_method perl_call_method +#endif +#ifndef eval_sv +# define eval_sv perl_eval_sv +#endif +#ifndef PERL_LOADMOD_DENY +# define PERL_LOADMOD_DENY 0x1 +#endif + +#ifndef PERL_LOADMOD_NOIMPORT +# define PERL_LOADMOD_NOIMPORT 0x2 +#endif + +#ifndef PERL_LOADMOD_IMPORT_OPS +# define PERL_LOADMOD_IMPORT_OPS 0x4 +#endif + +/* Replace: 0 */ + +/* Replace perl_eval_pv with eval_pv */ + +#ifndef eval_pv +#if defined(NEED_eval_pv) +static SV* DPPP_(my_eval_pv)(char *p, I32 croak_on_error); +static +#else +extern SV* DPPP_(my_eval_pv)(char *p, I32 croak_on_error); +#endif + +#ifdef eval_pv +# undef eval_pv +#endif +#define eval_pv(a,b) DPPP_(my_eval_pv)(aTHX_ a,b) +#define Perl_eval_pv DPPP_(my_eval_pv) + +#if defined(NEED_eval_pv) || defined(NEED_eval_pv_GLOBAL) + +SV* +DPPP_(my_eval_pv)(char *p, I32 croak_on_error) +{ + dSP; + SV* sv = newSVpv(p, 0); + + PUSHMARK(sp); + eval_sv(sv, G_SCALAR); + SvREFCNT_dec(sv); + + SPAGAIN; + sv = POPs; + PUTBACK; + + if (croak_on_error && SvTRUE(GvSV(errgv))) + croak(SvPVx(GvSV(errgv), na)); + + return sv; +} + +#endif +#endif + +#ifndef vload_module +#if defined(NEED_vload_module) +static void DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args); +static +#else +extern void DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args); +#endif + +#ifdef vload_module +# undef vload_module +#endif +#define vload_module(a,b,c,d) DPPP_(my_vload_module)(aTHX_ a,b,c,d) +#define Perl_vload_module DPPP_(my_vload_module) + +#if defined(NEED_vload_module) || defined(NEED_vload_module_GLOBAL) + +void +DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args) +{ + dTHR; + dVAR; + OP *veop, *imop; + + OP * const modname = newSVOP(OP_CONST, 0, name); + /* 5.005 has a somewhat hacky force_normal that doesn't croak on + SvREADONLY() if PL_compling is true. Current perls take care in + ck_require() to correctly turn off SvREADONLY before calling + force_normal_flags(). This seems a better fix than fudging PL_compling + */ + SvREADONLY_off(((SVOP*)modname)->op_sv); + modname->op_private |= OPpCONST_BARE; + if (ver) { + veop = newSVOP(OP_CONST, 0, ver); + } + else + veop = NULL; + if (flags & PERL_LOADMOD_NOIMPORT) { + imop = sawparens(newNULLLIST()); + } + else if (flags & PERL_LOADMOD_IMPORT_OPS) { + imop = va_arg(*args, OP*); + } + else { + SV *sv; + imop = NULL; + sv = va_arg(*args, SV*); + while (sv) { + imop = append_elem(OP_LIST, imop, newSVOP(OP_CONST, 0, sv)); + sv = va_arg(*args, SV*); + } + } + { + const line_t ocopline = PL_copline; + COP * const ocurcop = PL_curcop; + const int oexpect = PL_expect; + +#if (PERL_BCDVERSION >= 0x5004000) + utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(FALSE, 0), + veop, modname, imop); +#else + utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(), + modname, imop); +#endif + PL_expect = oexpect; + PL_copline = ocopline; + PL_curcop = ocurcop; + } +} + +#endif +#endif + +#ifndef load_module +#if defined(NEED_load_module) +static void DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...); +static +#else +extern void DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...); +#endif + +#ifdef load_module +# undef load_module +#endif +#define load_module DPPP_(my_load_module) +#define Perl_load_module DPPP_(my_load_module) + +#if defined(NEED_load_module) || defined(NEED_load_module_GLOBAL) + +void +DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...) +{ + va_list args; + va_start(args, ver); + vload_module(flags, name, ver, &args); + va_end(args); +} + +#endif +#endif +#ifndef newRV_inc +# define newRV_inc(sv) newRV(sv) /* Replace */ +#endif + +#ifndef newRV_noinc +#if defined(NEED_newRV_noinc) +static SV * DPPP_(my_newRV_noinc)(SV *sv); +static +#else +extern SV * DPPP_(my_newRV_noinc)(SV *sv); +#endif + +#ifdef newRV_noinc +# undef newRV_noinc +#endif +#define newRV_noinc(a) DPPP_(my_newRV_noinc)(aTHX_ a) +#define Perl_newRV_noinc DPPP_(my_newRV_noinc) + +#if defined(NEED_newRV_noinc) || defined(NEED_newRV_noinc_GLOBAL) +SV * +DPPP_(my_newRV_noinc)(SV *sv) +{ + SV *rv = (SV *)newRV(sv); + SvREFCNT_dec(sv); + return rv; +} +#endif +#endif + +/* Hint: newCONSTSUB + * Returns a CV* as of perl-5.7.1. This return value is not supported + * by Devel::PPPort. + */ + +/* newCONSTSUB from IO.xs is in the core starting with 5.004_63 */ +#if (PERL_BCDVERSION < 0x5004063) && (PERL_BCDVERSION != 0x5004005) +#if defined(NEED_newCONSTSUB) +static void DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv); +static +#else +extern void DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv); +#endif + +#ifdef newCONSTSUB +# undef newCONSTSUB +#endif +#define newCONSTSUB(a,b,c) DPPP_(my_newCONSTSUB)(aTHX_ a,b,c) +#define Perl_newCONSTSUB DPPP_(my_newCONSTSUB) + +#if defined(NEED_newCONSTSUB) || defined(NEED_newCONSTSUB_GLOBAL) + +void +DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv) +{ + U32 oldhints = PL_hints; + HV *old_cop_stash = PL_curcop->cop_stash; + HV *old_curstash = PL_curstash; + line_t oldline = PL_curcop->cop_line; + PL_curcop->cop_line = PL_copline; + + PL_hints &= ~HINT_BLOCK_SCOPE; + if (stash) + PL_curstash = PL_curcop->cop_stash = stash; + + newSUB( + +#if (PERL_BCDVERSION < 0x5003022) + start_subparse(), +#elif (PERL_BCDVERSION == 0x5003022) + start_subparse(0), +#else /* 5.003_23 onwards */ + start_subparse(FALSE, 0), +#endif + + newSVOP(OP_CONST, 0, newSVpv((char *) name, 0)), + newSVOP(OP_CONST, 0, &PL_sv_no), /* SvPV(&PL_sv_no) == "" -- GMB */ + newSTATEOP(0, Nullch, newSVOP(OP_CONST, 0, sv)) + ); + + PL_hints = oldhints; + PL_curcop->cop_stash = old_cop_stash; + PL_curstash = old_curstash; + PL_curcop->cop_line = oldline; +} +#endif +#endif + +/* + * Boilerplate macros for initializing and accessing interpreter-local + * data from C. All statics in extensions should be reworked to use + * this, if you want to make the extension thread-safe. See ext/re/re.xs + * for an example of the use of these macros. + * + * Code that uses these macros is responsible for the following: + * 1. #define MY_CXT_KEY to a unique string, e.g. "DynaLoader_guts" + * 2. Declare a typedef named my_cxt_t that is a structure that contains + * all the data that needs to be interpreter-local. + * 3. Use the START_MY_CXT macro after the declaration of my_cxt_t. + * 4. Use the MY_CXT_INIT macro such that it is called exactly once + * (typically put in the BOOT: section). + * 5. Use the members of the my_cxt_t structure everywhere as + * MY_CXT.member. + * 6. Use the dMY_CXT macro (a declaration) in all the functions that + * access MY_CXT. + */ + +#if defined(MULTIPLICITY) || defined(PERL_OBJECT) || \ + defined(PERL_CAPI) || defined(PERL_IMPLICIT_CONTEXT) + +#ifndef START_MY_CXT + +/* This must appear in all extensions that define a my_cxt_t structure, + * right after the definition (i.e. at file scope). The non-threads + * case below uses it to declare the data as static. */ +#define START_MY_CXT + +#if (PERL_BCDVERSION < 0x5004068) +/* Fetches the SV that keeps the per-interpreter data. */ +#define dMY_CXT_SV \ + SV *my_cxt_sv = get_sv(MY_CXT_KEY, FALSE) +#else /* >= perl5.004_68 */ +#define dMY_CXT_SV \ + SV *my_cxt_sv = *hv_fetch(PL_modglobal, MY_CXT_KEY, \ + sizeof(MY_CXT_KEY)-1, TRUE) +#endif /* < perl5.004_68 */ + +/* This declaration should be used within all functions that use the + * interpreter-local data. */ +#define dMY_CXT \ + dMY_CXT_SV; \ + my_cxt_t *my_cxtp = INT2PTR(my_cxt_t*,SvUV(my_cxt_sv)) + +/* Creates and zeroes the per-interpreter data. + * (We allocate my_cxtp in a Perl SV so that it will be released when + * the interpreter goes away.) */ +#define MY_CXT_INIT \ + dMY_CXT_SV; \ + /* newSV() allocates one more than needed */ \ + my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\ + Zero(my_cxtp, 1, my_cxt_t); \ + sv_setuv(my_cxt_sv, PTR2UV(my_cxtp)) + +/* This macro must be used to access members of the my_cxt_t structure. + * e.g. MYCXT.some_data */ +#define MY_CXT (*my_cxtp) + +/* Judicious use of these macros can reduce the number of times dMY_CXT + * is used. Use is similar to pTHX, aTHX etc. */ +#define pMY_CXT my_cxt_t *my_cxtp +#define pMY_CXT_ pMY_CXT, +#define _pMY_CXT ,pMY_CXT +#define aMY_CXT my_cxtp +#define aMY_CXT_ aMY_CXT, +#define _aMY_CXT ,aMY_CXT + +#endif /* START_MY_CXT */ + +#ifndef MY_CXT_CLONE +/* Clones the per-interpreter data. */ +#define MY_CXT_CLONE \ + dMY_CXT_SV; \ + my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\ + Copy(INT2PTR(my_cxt_t*, SvUV(my_cxt_sv)), my_cxtp, 1, my_cxt_t);\ + sv_setuv(my_cxt_sv, PTR2UV(my_cxtp)) +#endif + +#else /* single interpreter */ + +#ifndef START_MY_CXT + +#define START_MY_CXT static my_cxt_t my_cxt; +#define dMY_CXT_SV dNOOP +#define dMY_CXT dNOOP +#define MY_CXT_INIT NOOP +#define MY_CXT my_cxt + +#define pMY_CXT void +#define pMY_CXT_ +#define _pMY_CXT +#define aMY_CXT +#define aMY_CXT_ +#define _aMY_CXT + +#endif /* START_MY_CXT */ + +#ifndef MY_CXT_CLONE +#define MY_CXT_CLONE NOOP +#endif + +#endif + +#ifndef IVdf +# if IVSIZE == LONGSIZE +# define IVdf "ld" +# define UVuf "lu" +# define UVof "lo" +# define UVxf "lx" +# define UVXf "lX" +# else +# if IVSIZE == INTSIZE +# define IVdf "d" +# define UVuf "u" +# define UVof "o" +# define UVxf "x" +# define UVXf "X" +# endif +# endif +#endif + +#ifndef NVef +# if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && \ + defined(PERL_PRIfldbl) /* Not very likely, but let's try anyway. */ +# define NVef PERL_PRIeldbl +# define NVff PERL_PRIfldbl +# define NVgf PERL_PRIgldbl +# else +# define NVef "e" +# define NVff "f" +# define NVgf "g" +# endif +#endif + +#ifndef SvREFCNT_inc +# ifdef PERL_USE_GCC_BRACE_GROUPS +# define SvREFCNT_inc(sv) \ + ({ \ + SV * const _sv = (SV*)(sv); \ + if (_sv) \ + (SvREFCNT(_sv))++; \ + _sv; \ + }) +# else +# define SvREFCNT_inc(sv) \ + ((PL_Sv=(SV*)(sv)) ? (++(SvREFCNT(PL_Sv)),PL_Sv) : NULL) +# endif +#endif + +#ifndef SvREFCNT_inc_simple +# ifdef PERL_USE_GCC_BRACE_GROUPS +# define SvREFCNT_inc_simple(sv) \ + ({ \ + if (sv) \ + (SvREFCNT(sv))++; \ + (SV *)(sv); \ + }) +# else +# define SvREFCNT_inc_simple(sv) \ + ((sv) ? (SvREFCNT(sv)++,(SV*)(sv)) : NULL) +# endif +#endif + +#ifndef SvREFCNT_inc_NN +# ifdef PERL_USE_GCC_BRACE_GROUPS +# define SvREFCNT_inc_NN(sv) \ + ({ \ + SV * const _sv = (SV*)(sv); \ + SvREFCNT(_sv)++; \ + _sv; \ + }) +# else +# define SvREFCNT_inc_NN(sv) \ + (PL_Sv=(SV*)(sv),++(SvREFCNT(PL_Sv)),PL_Sv) +# endif +#endif + +#ifndef SvREFCNT_inc_void +# ifdef PERL_USE_GCC_BRACE_GROUPS +# define SvREFCNT_inc_void(sv) \ + ({ \ + SV * const _sv = (SV*)(sv); \ + if (_sv) \ + (void)(SvREFCNT(_sv)++); \ + }) +# else +# define SvREFCNT_inc_void(sv) \ + (void)((PL_Sv=(SV*)(sv)) ? ++(SvREFCNT(PL_Sv)) : 0) +# endif +#endif +#ifndef SvREFCNT_inc_simple_void +# define SvREFCNT_inc_simple_void(sv) STMT_START { if (sv) SvREFCNT(sv)++; } STMT_END +#endif + +#ifndef SvREFCNT_inc_simple_NN +# define SvREFCNT_inc_simple_NN(sv) (++SvREFCNT(sv), (SV*)(sv)) +#endif + +#ifndef SvREFCNT_inc_void_NN +# define SvREFCNT_inc_void_NN(sv) (void)(++SvREFCNT((SV*)(sv))) +#endif + +#ifndef SvREFCNT_inc_simple_void_NN +# define SvREFCNT_inc_simple_void_NN(sv) (void)(++SvREFCNT((SV*)(sv))) +#endif + +/* Backwards compatibility stuff... :-( */ +#if !defined(NEED_sv_2pv_flags) && defined(NEED_sv_2pv_nolen) +# define NEED_sv_2pv_flags +#endif +#if !defined(NEED_sv_2pv_flags_GLOBAL) && defined(NEED_sv_2pv_nolen_GLOBAL) +# define NEED_sv_2pv_flags_GLOBAL +#endif + +/* Hint: sv_2pv_nolen + * Use the SvPV_nolen() or SvPV_nolen_const() macros instead of sv_2pv_nolen(). + */ +#ifndef sv_2pv_nolen +# define sv_2pv_nolen(sv) SvPV_nolen(sv) +#endif + +#ifdef SvPVbyte + +/* Hint: SvPVbyte + * Does not work in perl-5.6.1, ppport.h implements a version + * borrowed from perl-5.7.3. + */ + +#if (PERL_BCDVERSION < 0x5007000) + +#if defined(NEED_sv_2pvbyte) +static char * DPPP_(my_sv_2pvbyte)(pTHX_ SV * sv, STRLEN * lp); +static +#else +extern char * DPPP_(my_sv_2pvbyte)(pTHX_ SV * sv, STRLEN * lp); +#endif + +#ifdef sv_2pvbyte +# undef sv_2pvbyte +#endif +#define sv_2pvbyte(a,b) DPPP_(my_sv_2pvbyte)(aTHX_ a,b) +#define Perl_sv_2pvbyte DPPP_(my_sv_2pvbyte) + +#if defined(NEED_sv_2pvbyte) || defined(NEED_sv_2pvbyte_GLOBAL) + +char * +DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp) +{ + sv_utf8_downgrade(sv,0); + return SvPV(sv,*lp); +} + +#endif + +/* Hint: sv_2pvbyte + * Use the SvPVbyte() macro instead of sv_2pvbyte(). + */ + +#undef SvPVbyte + +#define SvPVbyte(sv, lp) \ + ((SvFLAGS(sv) & (SVf_POK|SVf_UTF8)) == (SVf_POK) \ + ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pvbyte(sv, &lp)) + +#endif + +#else + +# define SvPVbyte SvPV +# define sv_2pvbyte sv_2pv + +#endif +#ifndef sv_2pvbyte_nolen +# define sv_2pvbyte_nolen(sv) sv_2pv_nolen(sv) +#endif + +/* Hint: sv_pvn + * Always use the SvPV() macro instead of sv_pvn(). + */ + +/* Hint: sv_pvn_force + * Always use the SvPV_force() macro instead of sv_pvn_force(). + */ + +/* If these are undefined, they're not handled by the core anyway */ +#ifndef SV_IMMEDIATE_UNREF +# define SV_IMMEDIATE_UNREF 0 +#endif + +#ifndef SV_GMAGIC +# define SV_GMAGIC 0 +#endif + +#ifndef SV_COW_DROP_PV +# define SV_COW_DROP_PV 0 +#endif + +#ifndef SV_UTF8_NO_ENCODING +# define SV_UTF8_NO_ENCODING 0 +#endif + +#ifndef SV_NOSTEAL +# define SV_NOSTEAL 0 +#endif + +#ifndef SV_CONST_RETURN +# define SV_CONST_RETURN 0 +#endif + +#ifndef SV_MUTABLE_RETURN +# define SV_MUTABLE_RETURN 0 +#endif + +#ifndef SV_SMAGIC +# define SV_SMAGIC 0 +#endif + +#ifndef SV_HAS_TRAILING_NUL +# define SV_HAS_TRAILING_NUL 0 +#endif + +#ifndef SV_COW_SHARED_HASH_KEYS +# define SV_COW_SHARED_HASH_KEYS 0 +#endif + +#if (PERL_BCDVERSION < 0x5007002) + +#if defined(NEED_sv_2pv_flags) +static char * DPPP_(my_sv_2pv_flags)(pTHX_ SV * sv, STRLEN * lp, I32 flags); +static +#else +extern char * DPPP_(my_sv_2pv_flags)(pTHX_ SV * sv, STRLEN * lp, I32 flags); +#endif + +#ifdef sv_2pv_flags +# undef sv_2pv_flags +#endif +#define sv_2pv_flags(a,b,c) DPPP_(my_sv_2pv_flags)(aTHX_ a,b,c) +#define Perl_sv_2pv_flags DPPP_(my_sv_2pv_flags) + +#if defined(NEED_sv_2pv_flags) || defined(NEED_sv_2pv_flags_GLOBAL) + +char * +DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags) +{ + STRLEN n_a = (STRLEN) flags; + return sv_2pv(sv, lp ? lp : &n_a); +} + +#endif + +#if defined(NEED_sv_pvn_force_flags) +static char * DPPP_(my_sv_pvn_force_flags)(pTHX_ SV * sv, STRLEN * lp, I32 flags); +static +#else +extern char * DPPP_(my_sv_pvn_force_flags)(pTHX_ SV * sv, STRLEN * lp, I32 flags); +#endif + +#ifdef sv_pvn_force_flags +# undef sv_pvn_force_flags +#endif +#define sv_pvn_force_flags(a,b,c) DPPP_(my_sv_pvn_force_flags)(aTHX_ a,b,c) +#define Perl_sv_pvn_force_flags DPPP_(my_sv_pvn_force_flags) + +#if defined(NEED_sv_pvn_force_flags) || defined(NEED_sv_pvn_force_flags_GLOBAL) + +char * +DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags) +{ + STRLEN n_a = (STRLEN) flags; + return sv_pvn_force(sv, lp ? lp : &n_a); +} + +#endif + +#endif +#ifndef SvPV_const +# define SvPV_const(sv, lp) SvPV_flags_const(sv, lp, SV_GMAGIC) +#endif + +#ifndef SvPV_mutable +# define SvPV_mutable(sv, lp) SvPV_flags_mutable(sv, lp, SV_GMAGIC) +#endif +#ifndef SvPV_flags +# define SvPV_flags(sv, lp, flags) \ + ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \ + ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pv_flags(sv, &lp, flags)) +#endif +#ifndef SvPV_flags_const +# define SvPV_flags_const(sv, lp, flags) \ + ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \ + ? ((lp = SvCUR(sv)), SvPVX_const(sv)) : \ + (const char*) sv_2pv_flags(sv, &lp, flags|SV_CONST_RETURN)) +#endif +#ifndef SvPV_flags_const_nolen +# define SvPV_flags_const_nolen(sv, flags) \ + ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \ + ? SvPVX_const(sv) : \ + (const char*) sv_2pv_flags(sv, 0, flags|SV_CONST_RETURN)) +#endif +#ifndef SvPV_flags_mutable +# define SvPV_flags_mutable(sv, lp, flags) \ + ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \ + ? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) : \ + sv_2pv_flags(sv, &lp, flags|SV_MUTABLE_RETURN)) +#endif +#ifndef SvPV_force +# define SvPV_force(sv, lp) SvPV_force_flags(sv, lp, SV_GMAGIC) +#endif + +#ifndef SvPV_force_nolen +# define SvPV_force_nolen(sv) SvPV_force_flags_nolen(sv, SV_GMAGIC) +#endif + +#ifndef SvPV_force_mutable +# define SvPV_force_mutable(sv, lp) SvPV_force_flags_mutable(sv, lp, SV_GMAGIC) +#endif + +#ifndef SvPV_force_nomg +# define SvPV_force_nomg(sv, lp) SvPV_force_flags(sv, lp, 0) +#endif + +#ifndef SvPV_force_nomg_nolen +# define SvPV_force_nomg_nolen(sv) SvPV_force_flags_nolen(sv, 0) +#endif +#ifndef SvPV_force_flags +# define SvPV_force_flags(sv, lp, flags) \ + ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \ + ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_pvn_force_flags(sv, &lp, flags)) +#endif +#ifndef SvPV_force_flags_nolen +# define SvPV_force_flags_nolen(sv, flags) \ + ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \ + ? SvPVX(sv) : sv_pvn_force_flags(sv, 0, flags)) +#endif +#ifndef SvPV_force_flags_mutable +# define SvPV_force_flags_mutable(sv, lp, flags) \ + ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \ + ? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) \ + : sv_pvn_force_flags(sv, &lp, flags|SV_MUTABLE_RETURN)) +#endif +#ifndef SvPV_nolen +# define SvPV_nolen(sv) \ + ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \ + ? SvPVX(sv) : sv_2pv_flags(sv, 0, SV_GMAGIC)) +#endif +#ifndef SvPV_nolen_const +# define SvPV_nolen_const(sv) \ + ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \ + ? SvPVX_const(sv) : sv_2pv_flags(sv, 0, SV_GMAGIC|SV_CONST_RETURN)) +#endif +#ifndef SvPV_nomg +# define SvPV_nomg(sv, lp) SvPV_flags(sv, lp, 0) +#endif + +#ifndef SvPV_nomg_const +# define SvPV_nomg_const(sv, lp) SvPV_flags_const(sv, lp, 0) +#endif + +#ifndef SvPV_nomg_const_nolen +# define SvPV_nomg_const_nolen(sv) SvPV_flags_const_nolen(sv, 0) +#endif +#ifndef SvMAGIC_set +# define SvMAGIC_set(sv, val) \ + STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \ + (((XPVMG*) SvANY(sv))->xmg_magic = (val)); } STMT_END +#endif + +#if (PERL_BCDVERSION < 0x5009003) +#ifndef SvPVX_const +# define SvPVX_const(sv) ((const char*) (0 + SvPVX(sv))) +#endif + +#ifndef SvPVX_mutable +# define SvPVX_mutable(sv) (0 + SvPVX(sv)) +#endif +#ifndef SvRV_set +# define SvRV_set(sv, val) \ + STMT_START { assert(SvTYPE(sv) >= SVt_RV); \ + (((XRV*) SvANY(sv))->xrv_rv = (val)); } STMT_END +#endif + +#else +#ifndef SvPVX_const +# define SvPVX_const(sv) ((const char*)((sv)->sv_u.svu_pv)) +#endif + +#ifndef SvPVX_mutable +# define SvPVX_mutable(sv) ((sv)->sv_u.svu_pv) +#endif +#ifndef SvRV_set +# define SvRV_set(sv, val) \ + STMT_START { assert(SvTYPE(sv) >= SVt_RV); \ + ((sv)->sv_u.svu_rv = (val)); } STMT_END +#endif + +#endif +#ifndef SvSTASH_set +# define SvSTASH_set(sv, val) \ + STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \ + (((XPVMG*) SvANY(sv))->xmg_stash = (val)); } STMT_END +#endif + +#if (PERL_BCDVERSION < 0x5004000) +#ifndef SvUV_set +# define SvUV_set(sv, val) \ + STMT_START { assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \ + (((XPVIV*) SvANY(sv))->xiv_iv = (IV) (val)); } STMT_END +#endif + +#else +#ifndef SvUV_set +# define SvUV_set(sv, val) \ + STMT_START { assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \ + (((XPVUV*) SvANY(sv))->xuv_uv = (val)); } STMT_END +#endif + +#endif + +#if (PERL_BCDVERSION >= 0x5004000) && !defined(vnewSVpvf) +#if defined(NEED_vnewSVpvf) +static SV * DPPP_(my_vnewSVpvf)(pTHX_ const char * pat, va_list * args); +static +#else +extern SV * DPPP_(my_vnewSVpvf)(pTHX_ const char * pat, va_list * args); +#endif + +#ifdef vnewSVpvf +# undef vnewSVpvf +#endif +#define vnewSVpvf(a,b) DPPP_(my_vnewSVpvf)(aTHX_ a,b) +#define Perl_vnewSVpvf DPPP_(my_vnewSVpvf) + +#if defined(NEED_vnewSVpvf) || defined(NEED_vnewSVpvf_GLOBAL) + +SV * +DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args) +{ + register SV *sv = newSV(0); + sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); + return sv; +} + +#endif +#endif + +#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vcatpvf) +# define sv_vcatpvf(sv, pat, args) sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)) +#endif + +#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vsetpvf) +# define sv_vsetpvf(sv, pat, args) sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)) +#endif + +#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_catpvf_mg) +#if defined(NEED_sv_catpvf_mg) +static void DPPP_(my_sv_catpvf_mg)(pTHX_ SV * sv, const char * pat, ...); +static +#else +extern void DPPP_(my_sv_catpvf_mg)(pTHX_ SV * sv, const char * pat, ...); +#endif + +#define Perl_sv_catpvf_mg DPPP_(my_sv_catpvf_mg) + +#if defined(NEED_sv_catpvf_mg) || defined(NEED_sv_catpvf_mg_GLOBAL) + +void +DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...) +{ + va_list args; + va_start(args, pat); + sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*)); + SvSETMAGIC(sv); + va_end(args); +} + +#endif +#endif + +#ifdef PERL_IMPLICIT_CONTEXT +#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_catpvf_mg_nocontext) +#if defined(NEED_sv_catpvf_mg_nocontext) +static void DPPP_(my_sv_catpvf_mg_nocontext)(SV * sv, const char * pat, ...); +static +#else +extern void DPPP_(my_sv_catpvf_mg_nocontext)(SV * sv, const char * pat, ...); +#endif + +#define sv_catpvf_mg_nocontext DPPP_(my_sv_catpvf_mg_nocontext) +#define Perl_sv_catpvf_mg_nocontext DPPP_(my_sv_catpvf_mg_nocontext) + +#if defined(NEED_sv_catpvf_mg_nocontext) || defined(NEED_sv_catpvf_mg_nocontext_GLOBAL) + +void +DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...) +{ + dTHX; + va_list args; + va_start(args, pat); + sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*)); + SvSETMAGIC(sv); + va_end(args); +} + +#endif +#endif +#endif + +/* sv_catpvf_mg depends on sv_catpvf_mg_nocontext */ +#ifndef sv_catpvf_mg +# ifdef PERL_IMPLICIT_CONTEXT +# define sv_catpvf_mg Perl_sv_catpvf_mg_nocontext +# else +# define sv_catpvf_mg Perl_sv_catpvf_mg +# endif +#endif + +#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vcatpvf_mg) +# define sv_vcatpvf_mg(sv, pat, args) \ + STMT_START { \ + sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); \ + SvSETMAGIC(sv); \ + } STMT_END +#endif + +#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_setpvf_mg) +#if defined(NEED_sv_setpvf_mg) +static void DPPP_(my_sv_setpvf_mg)(pTHX_ SV * sv, const char * pat, ...); +static +#else +extern void DPPP_(my_sv_setpvf_mg)(pTHX_ SV * sv, const char * pat, ...); +#endif + +#define Perl_sv_setpvf_mg DPPP_(my_sv_setpvf_mg) + +#if defined(NEED_sv_setpvf_mg) || defined(NEED_sv_setpvf_mg_GLOBAL) + +void +DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...) +{ + va_list args; + va_start(args, pat); + sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*)); + SvSETMAGIC(sv); + va_end(args); +} + +#endif +#endif + +#ifdef PERL_IMPLICIT_CONTEXT +#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_setpvf_mg_nocontext) +#if defined(NEED_sv_setpvf_mg_nocontext) +static void DPPP_(my_sv_setpvf_mg_nocontext)(SV * sv, const char * pat, ...); +static +#else +extern void DPPP_(my_sv_setpvf_mg_nocontext)(SV * sv, const char * pat, ...); +#endif + +#define sv_setpvf_mg_nocontext DPPP_(my_sv_setpvf_mg_nocontext) +#define Perl_sv_setpvf_mg_nocontext DPPP_(my_sv_setpvf_mg_nocontext) + +#if defined(NEED_sv_setpvf_mg_nocontext) || defined(NEED_sv_setpvf_mg_nocontext_GLOBAL) + +void +DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...) +{ + dTHX; + va_list args; + va_start(args, pat); + sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*)); + SvSETMAGIC(sv); + va_end(args); +} + +#endif +#endif +#endif + +/* sv_setpvf_mg depends on sv_setpvf_mg_nocontext */ +#ifndef sv_setpvf_mg +# ifdef PERL_IMPLICIT_CONTEXT +# define sv_setpvf_mg Perl_sv_setpvf_mg_nocontext +# else +# define sv_setpvf_mg Perl_sv_setpvf_mg +# endif +#endif + +#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vsetpvf_mg) +# define sv_vsetpvf_mg(sv, pat, args) \ + STMT_START { \ + sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); \ + SvSETMAGIC(sv); \ + } STMT_END +#endif + +#ifndef newSVpvn_share + +#if defined(NEED_newSVpvn_share) +static SV * DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash); +static +#else +extern SV * DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash); +#endif + +#ifdef newSVpvn_share +# undef newSVpvn_share +#endif +#define newSVpvn_share(a,b,c) DPPP_(my_newSVpvn_share)(aTHX_ a,b,c) +#define Perl_newSVpvn_share DPPP_(my_newSVpvn_share) + +#if defined(NEED_newSVpvn_share) || defined(NEED_newSVpvn_share_GLOBAL) + +SV * +DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash) +{ + SV *sv; + if (len < 0) + len = -len; + if (!hash) + PERL_HASH(hash, (char*) src, len); + sv = newSVpvn((char *) src, len); + sv_upgrade(sv, SVt_PVIV); + SvIVX(sv) = hash; + SvREADONLY_on(sv); + SvPOK_on(sv); + return sv; +} + +#endif + +#endif +#ifndef SvSHARED_HASH +# define SvSHARED_HASH(sv) (0 + SvUVX(sv)) +#endif +#ifndef WARN_ALL +# define WARN_ALL 0 +#endif + +#ifndef WARN_CLOSURE +# define WARN_CLOSURE 1 +#endif + +#ifndef WARN_DEPRECATED +# define WARN_DEPRECATED 2 +#endif + +#ifndef WARN_EXITING +# define WARN_EXITING 3 +#endif + +#ifndef WARN_GLOB +# define WARN_GLOB 4 +#endif + +#ifndef WARN_IO +# define WARN_IO 5 +#endif + +#ifndef WARN_CLOSED +# define WARN_CLOSED 6 +#endif + +#ifndef WARN_EXEC +# define WARN_EXEC 7 +#endif + +#ifndef WARN_LAYER +# define WARN_LAYER 8 +#endif + +#ifndef WARN_NEWLINE +# define WARN_NEWLINE 9 +#endif + +#ifndef WARN_PIPE +# define WARN_PIPE 10 +#endif + +#ifndef WARN_UNOPENED +# define WARN_UNOPENED 11 +#endif + +#ifndef WARN_MISC +# define WARN_MISC 12 +#endif + +#ifndef WARN_NUMERIC +# define WARN_NUMERIC 13 +#endif + +#ifndef WARN_ONCE +# define WARN_ONCE 14 +#endif + +#ifndef WARN_OVERFLOW +# define WARN_OVERFLOW 15 +#endif + +#ifndef WARN_PACK +# define WARN_PACK 16 +#endif + +#ifndef WARN_PORTABLE +# define WARN_PORTABLE 17 +#endif + +#ifndef WARN_RECURSION +# define WARN_RECURSION 18 +#endif + +#ifndef WARN_REDEFINE +# define WARN_REDEFINE 19 +#endif + +#ifndef WARN_REGEXP +# define WARN_REGEXP 20 +#endif + +#ifndef WARN_SEVERE +# define WARN_SEVERE 21 +#endif + +#ifndef WARN_DEBUGGING +# define WARN_DEBUGGING 22 +#endif + +#ifndef WARN_INPLACE +# define WARN_INPLACE 23 +#endif + +#ifndef WARN_INTERNAL +# define WARN_INTERNAL 24 +#endif + +#ifndef WARN_MALLOC +# define WARN_MALLOC 25 +#endif + +#ifndef WARN_SIGNAL +# define WARN_SIGNAL 26 +#endif + +#ifndef WARN_SUBSTR +# define WARN_SUBSTR 27 +#endif + +#ifndef WARN_SYNTAX +# define WARN_SYNTAX 28 +#endif + +#ifndef WARN_AMBIGUOUS +# define WARN_AMBIGUOUS 29 +#endif + +#ifndef WARN_BAREWORD +# define WARN_BAREWORD 30 +#endif + +#ifndef WARN_DIGIT +# define WARN_DIGIT 31 +#endif + +#ifndef WARN_PARENTHESIS +# define WARN_PARENTHESIS 32 +#endif + +#ifndef WARN_PRECEDENCE +# define WARN_PRECEDENCE 33 +#endif + +#ifndef WARN_PRINTF +# define WARN_PRINTF 34 +#endif + +#ifndef WARN_PROTOTYPE +# define WARN_PROTOTYPE 35 +#endif + +#ifndef WARN_QW +# define WARN_QW 36 +#endif + +#ifndef WARN_RESERVED +# define WARN_RESERVED 37 +#endif + +#ifndef WARN_SEMICOLON +# define WARN_SEMICOLON 38 +#endif + +#ifndef WARN_TAINT +# define WARN_TAINT 39 +#endif + +#ifndef WARN_THREADS +# define WARN_THREADS 40 +#endif + +#ifndef WARN_UNINITIALIZED +# define WARN_UNINITIALIZED 41 +#endif + +#ifndef WARN_UNPACK +# define WARN_UNPACK 42 +#endif + +#ifndef WARN_UNTIE +# define WARN_UNTIE 43 +#endif + +#ifndef WARN_UTF8 +# define WARN_UTF8 44 +#endif + +#ifndef WARN_VOID +# define WARN_VOID 45 +#endif + +#ifndef WARN_ASSERTIONS +# define WARN_ASSERTIONS 46 +#endif +#ifndef packWARN +# define packWARN(a) (a) +#endif + +#ifndef ckWARN +# ifdef G_WARN_ON +# define ckWARN(a) (PL_dowarn & G_WARN_ON) +# else +# define ckWARN(a) PL_dowarn +# endif +#endif + +#if (PERL_BCDVERSION >= 0x5004000) && !defined(warner) +#if defined(NEED_warner) +static void DPPP_(my_warner)(U32 err, const char *pat, ...); +static +#else +extern void DPPP_(my_warner)(U32 err, const char *pat, ...); +#endif + +#define Perl_warner DPPP_(my_warner) + +#if defined(NEED_warner) || defined(NEED_warner_GLOBAL) + +void +DPPP_(my_warner)(U32 err, const char *pat, ...) +{ + SV *sv; + va_list args; + + PERL_UNUSED_ARG(err); + + va_start(args, pat); + sv = vnewSVpvf(pat, &args); + va_end(args); + sv_2mortal(sv); + warn("%s", SvPV_nolen(sv)); +} + +#define warner Perl_warner + +#define Perl_warner_nocontext Perl_warner + +#endif +#endif + +/* concatenating with "" ensures that only literal strings are accepted as argument + * note that STR_WITH_LEN() can't be used as argument to macros or functions that + * under some configurations might be macros + */ +#ifndef STR_WITH_LEN +# define STR_WITH_LEN(s) (s ""), (sizeof(s)-1) +#endif +#ifndef newSVpvs +# define newSVpvs(str) newSVpvn(str "", sizeof(str) - 1) +#endif + +#ifndef sv_catpvs +# define sv_catpvs(sv, str) sv_catpvn(sv, str "", sizeof(str) - 1) +#endif + +#ifndef sv_setpvs +# define sv_setpvs(sv, str) sv_setpvn(sv, str "", sizeof(str) - 1) +#endif + +#ifndef hv_fetchs +# define hv_fetchs(hv, key, lval) hv_fetch(hv, key "", sizeof(key) - 1, lval) +#endif + +#ifndef hv_stores +# define hv_stores(hv, key, val) hv_store(hv, key "", sizeof(key) - 1, val, 0) +#endif +#ifndef SvGETMAGIC +# define SvGETMAGIC(x) STMT_START { if (SvGMAGICAL(x)) mg_get(x); } STMT_END +#endif +#ifndef PERL_MAGIC_sv +# define PERL_MAGIC_sv '\0' +#endif + +#ifndef PERL_MAGIC_overload +# define PERL_MAGIC_overload 'A' +#endif + +#ifndef PERL_MAGIC_overload_elem +# define PERL_MAGIC_overload_elem 'a' +#endif + +#ifndef PERL_MAGIC_overload_table +# define PERL_MAGIC_overload_table 'c' +#endif + +#ifndef PERL_MAGIC_bm +# define PERL_MAGIC_bm 'B' +#endif + +#ifndef PERL_MAGIC_regdata +# define PERL_MAGIC_regdata 'D' +#endif + +#ifndef PERL_MAGIC_regdatum +# define PERL_MAGIC_regdatum 'd' +#endif + +#ifndef PERL_MAGIC_env +# define PERL_MAGIC_env 'E' +#endif + +#ifndef PERL_MAGIC_envelem +# define PERL_MAGIC_envelem 'e' +#endif + +#ifndef PERL_MAGIC_fm +# define PERL_MAGIC_fm 'f' +#endif + +#ifndef PERL_MAGIC_regex_global +# define PERL_MAGIC_regex_global 'g' +#endif + +#ifndef PERL_MAGIC_isa +# define PERL_MAGIC_isa 'I' +#endif + +#ifndef PERL_MAGIC_isaelem +# define PERL_MAGIC_isaelem 'i' +#endif + +#ifndef PERL_MAGIC_nkeys +# define PERL_MAGIC_nkeys 'k' +#endif + +#ifndef PERL_MAGIC_dbfile +# define PERL_MAGIC_dbfile 'L' +#endif + +#ifndef PERL_MAGIC_dbline +# define PERL_MAGIC_dbline 'l' +#endif + +#ifndef PERL_MAGIC_mutex +# define PERL_MAGIC_mutex 'm' +#endif + +#ifndef PERL_MAGIC_shared +# define PERL_MAGIC_shared 'N' +#endif + +#ifndef PERL_MAGIC_shared_scalar +# define PERL_MAGIC_shared_scalar 'n' +#endif + +#ifndef PERL_MAGIC_collxfrm +# define PERL_MAGIC_collxfrm 'o' +#endif + +#ifndef PERL_MAGIC_tied +# define PERL_MAGIC_tied 'P' +#endif + +#ifndef PERL_MAGIC_tiedelem +# define PERL_MAGIC_tiedelem 'p' +#endif + +#ifndef PERL_MAGIC_tiedscalar +# define PERL_MAGIC_tiedscalar 'q' +#endif + +#ifndef PERL_MAGIC_qr +# define PERL_MAGIC_qr 'r' +#endif + +#ifndef PERL_MAGIC_sig +# define PERL_MAGIC_sig 'S' +#endif + +#ifndef PERL_MAGIC_sigelem +# define PERL_MAGIC_sigelem 's' +#endif + +#ifndef PERL_MAGIC_taint +# define PERL_MAGIC_taint 't' +#endif + +#ifndef PERL_MAGIC_uvar +# define PERL_MAGIC_uvar 'U' +#endif + +#ifndef PERL_MAGIC_uvar_elem +# define PERL_MAGIC_uvar_elem 'u' +#endif + +#ifndef PERL_MAGIC_vstring +# define PERL_MAGIC_vstring 'V' +#endif + +#ifndef PERL_MAGIC_vec +# define PERL_MAGIC_vec 'v' +#endif + +#ifndef PERL_MAGIC_utf8 +# define PERL_MAGIC_utf8 'w' +#endif + +#ifndef PERL_MAGIC_substr +# define PERL_MAGIC_substr 'x' +#endif + +#ifndef PERL_MAGIC_defelem +# define PERL_MAGIC_defelem 'y' +#endif + +#ifndef PERL_MAGIC_glob +# define PERL_MAGIC_glob '*' +#endif + +#ifndef PERL_MAGIC_arylen +# define PERL_MAGIC_arylen '#' +#endif + +#ifndef PERL_MAGIC_pos +# define PERL_MAGIC_pos '.' +#endif + +#ifndef PERL_MAGIC_backref +# define PERL_MAGIC_backref '<' +#endif + +#ifndef PERL_MAGIC_ext +# define PERL_MAGIC_ext '~' +#endif + +/* That's the best we can do... */ +#ifndef sv_catpvn_nomg +# define sv_catpvn_nomg sv_catpvn +#endif + +#ifndef sv_catsv_nomg +# define sv_catsv_nomg sv_catsv +#endif + +#ifndef sv_setsv_nomg +# define sv_setsv_nomg sv_setsv +#endif + +#ifndef sv_pvn_nomg +# define sv_pvn_nomg sv_pvn +#endif + +#ifndef SvIV_nomg +# define SvIV_nomg SvIV +#endif + +#ifndef SvUV_nomg +# define SvUV_nomg SvUV +#endif + +#ifndef sv_catpv_mg +# define sv_catpv_mg(sv, ptr) \ + STMT_START { \ + SV *TeMpSv = sv; \ + sv_catpv(TeMpSv,ptr); \ + SvSETMAGIC(TeMpSv); \ + } STMT_END +#endif + +#ifndef sv_catpvn_mg +# define sv_catpvn_mg(sv, ptr, len) \ + STMT_START { \ + SV *TeMpSv = sv; \ + sv_catpvn(TeMpSv,ptr,len); \ + SvSETMAGIC(TeMpSv); \ + } STMT_END +#endif + +#ifndef sv_catsv_mg +# define sv_catsv_mg(dsv, ssv) \ + STMT_START { \ + SV *TeMpSv = dsv; \ + sv_catsv(TeMpSv,ssv); \ + SvSETMAGIC(TeMpSv); \ + } STMT_END +#endif + +#ifndef sv_setiv_mg +# define sv_setiv_mg(sv, i) \ + STMT_START { \ + SV *TeMpSv = sv; \ + sv_setiv(TeMpSv,i); \ + SvSETMAGIC(TeMpSv); \ + } STMT_END +#endif + +#ifndef sv_setnv_mg +# define sv_setnv_mg(sv, num) \ + STMT_START { \ + SV *TeMpSv = sv; \ + sv_setnv(TeMpSv,num); \ + SvSETMAGIC(TeMpSv); \ + } STMT_END +#endif + +#ifndef sv_setpv_mg +# define sv_setpv_mg(sv, ptr) \ + STMT_START { \ + SV *TeMpSv = sv; \ + sv_setpv(TeMpSv,ptr); \ + SvSETMAGIC(TeMpSv); \ + } STMT_END +#endif + +#ifndef sv_setpvn_mg +# define sv_setpvn_mg(sv, ptr, len) \ + STMT_START { \ + SV *TeMpSv = sv; \ + sv_setpvn(TeMpSv,ptr,len); \ + SvSETMAGIC(TeMpSv); \ + } STMT_END +#endif + +#ifndef sv_setsv_mg +# define sv_setsv_mg(dsv, ssv) \ + STMT_START { \ + SV *TeMpSv = dsv; \ + sv_setsv(TeMpSv,ssv); \ + SvSETMAGIC(TeMpSv); \ + } STMT_END +#endif + +#ifndef sv_setuv_mg +# define sv_setuv_mg(sv, i) \ + STMT_START { \ + SV *TeMpSv = sv; \ + sv_setuv(TeMpSv,i); \ + SvSETMAGIC(TeMpSv); \ + } STMT_END +#endif + +#ifndef sv_usepvn_mg +# define sv_usepvn_mg(sv, ptr, len) \ + STMT_START { \ + SV *TeMpSv = sv; \ + sv_usepvn(TeMpSv,ptr,len); \ + SvSETMAGIC(TeMpSv); \ + } STMT_END +#endif +#ifndef SvVSTRING_mg +# define SvVSTRING_mg(sv) (SvMAGICAL(sv) ? mg_find(sv, PERL_MAGIC_vstring) : NULL) +#endif + +/* Hint: sv_magic_portable + * This is a compatibility function that is only available with + * Devel::PPPort. It is NOT in the perl core. + * Its purpose is to mimic the 5.8.0 behaviour of sv_magic() when + * it is being passed a name pointer with namlen == 0. In that + * case, perl 5.8.0 and later store the pointer, not a copy of it. + * The compatibility can be provided back to perl 5.004. With + * earlier versions, the code will not compile. + */ + +#if (PERL_BCDVERSION < 0x5004000) + + /* code that uses sv_magic_portable will not compile */ + +#elif (PERL_BCDVERSION < 0x5008000) + +# define sv_magic_portable(sv, obj, how, name, namlen) \ + STMT_START { \ + SV *SvMp_sv = (sv); \ + char *SvMp_name = (char *) (name); \ + I32 SvMp_namlen = (namlen); \ + if (SvMp_name && SvMp_namlen == 0) \ + { \ + MAGIC *mg; \ + sv_magic(SvMp_sv, obj, how, 0, 0); \ + mg = SvMAGIC(SvMp_sv); \ + mg->mg_len = -42; /* XXX: this is the tricky part */ \ + mg->mg_ptr = SvMp_name; \ + } \ + else \ + { \ + sv_magic(SvMp_sv, obj, how, SvMp_name, SvMp_namlen); \ + } \ + } STMT_END + +#else + +# define sv_magic_portable(a, b, c, d, e) sv_magic(a, b, c, d, e) + +#endif + +#ifdef USE_ITHREADS +#ifndef CopFILE +# define CopFILE(c) ((c)->cop_file) +#endif + +#ifndef CopFILEGV +# define CopFILEGV(c) (CopFILE(c) ? gv_fetchfile(CopFILE(c)) : Nullgv) +#endif + +#ifndef CopFILE_set +# define CopFILE_set(c,pv) ((c)->cop_file = savepv(pv)) +#endif + +#ifndef CopFILESV +# define CopFILESV(c) (CopFILE(c) ? GvSV(gv_fetchfile(CopFILE(c))) : Nullsv) +#endif + +#ifndef CopFILEAV +# define CopFILEAV(c) (CopFILE(c) ? GvAV(gv_fetchfile(CopFILE(c))) : Nullav) +#endif + +#ifndef CopSTASHPV +# define CopSTASHPV(c) ((c)->cop_stashpv) +#endif + +#ifndef CopSTASHPV_set +# define CopSTASHPV_set(c,pv) ((c)->cop_stashpv = ((pv) ? savepv(pv) : Nullch)) +#endif + +#ifndef CopSTASH +# define CopSTASH(c) (CopSTASHPV(c) ? gv_stashpv(CopSTASHPV(c),GV_ADD) : Nullhv) +#endif + +#ifndef CopSTASH_set +# define CopSTASH_set(c,hv) CopSTASHPV_set(c, (hv) ? HvNAME(hv) : Nullch) +#endif + +#ifndef CopSTASH_eq +# define CopSTASH_eq(c,hv) ((hv) && (CopSTASHPV(c) == HvNAME(hv) \ + || (CopSTASHPV(c) && HvNAME(hv) \ + && strEQ(CopSTASHPV(c), HvNAME(hv))))) +#endif + +#else +#ifndef CopFILEGV +# define CopFILEGV(c) ((c)->cop_filegv) +#endif + +#ifndef CopFILEGV_set +# define CopFILEGV_set(c,gv) ((c)->cop_filegv = (GV*)SvREFCNT_inc(gv)) +#endif + +#ifndef CopFILE_set +# define CopFILE_set(c,pv) CopFILEGV_set((c), gv_fetchfile(pv)) +#endif + +#ifndef CopFILESV +# define CopFILESV(c) (CopFILEGV(c) ? GvSV(CopFILEGV(c)) : Nullsv) +#endif + +#ifndef CopFILEAV +# define CopFILEAV(c) (CopFILEGV(c) ? GvAV(CopFILEGV(c)) : Nullav) +#endif + +#ifndef CopFILE +# define CopFILE(c) (CopFILESV(c) ? SvPVX(CopFILESV(c)) : Nullch) +#endif + +#ifndef CopSTASH +# define CopSTASH(c) ((c)->cop_stash) +#endif + +#ifndef CopSTASH_set +# define CopSTASH_set(c,hv) ((c)->cop_stash = (hv)) +#endif + +#ifndef CopSTASHPV +# define CopSTASHPV(c) (CopSTASH(c) ? HvNAME(CopSTASH(c)) : Nullch) +#endif + +#ifndef CopSTASHPV_set +# define CopSTASHPV_set(c,pv) CopSTASH_set((c), gv_stashpv(pv,GV_ADD)) +#endif + +#ifndef CopSTASH_eq +# define CopSTASH_eq(c,hv) (CopSTASH(c) == (hv)) +#endif + +#endif /* USE_ITHREADS */ +#ifndef IN_PERL_COMPILETIME +# define IN_PERL_COMPILETIME (PL_curcop == &PL_compiling) +#endif + +#ifndef IN_LOCALE_RUNTIME +# define IN_LOCALE_RUNTIME (PL_curcop->op_private & HINT_LOCALE) +#endif + +#ifndef IN_LOCALE_COMPILETIME +# define IN_LOCALE_COMPILETIME (PL_hints & HINT_LOCALE) +#endif + +#ifndef IN_LOCALE +# define IN_LOCALE (IN_PERL_COMPILETIME ? IN_LOCALE_COMPILETIME : IN_LOCALE_RUNTIME) +#endif +#ifndef IS_NUMBER_IN_UV +# define IS_NUMBER_IN_UV 0x01 +#endif + +#ifndef IS_NUMBER_GREATER_THAN_UV_MAX +# define IS_NUMBER_GREATER_THAN_UV_MAX 0x02 +#endif + +#ifndef IS_NUMBER_NOT_INT +# define IS_NUMBER_NOT_INT 0x04 +#endif + +#ifndef IS_NUMBER_NEG +# define IS_NUMBER_NEG 0x08 +#endif + +#ifndef IS_NUMBER_INFINITY +# define IS_NUMBER_INFINITY 0x10 +#endif + +#ifndef IS_NUMBER_NAN +# define IS_NUMBER_NAN 0x20 +#endif +#ifndef GROK_NUMERIC_RADIX +# define GROK_NUMERIC_RADIX(sp, send) grok_numeric_radix(sp, send) +#endif +#ifndef PERL_SCAN_GREATER_THAN_UV_MAX +# define PERL_SCAN_GREATER_THAN_UV_MAX 0x02 +#endif + +#ifndef PERL_SCAN_SILENT_ILLDIGIT +# define PERL_SCAN_SILENT_ILLDIGIT 0x04 +#endif + +#ifndef PERL_SCAN_ALLOW_UNDERSCORES +# define PERL_SCAN_ALLOW_UNDERSCORES 0x01 +#endif + +#ifndef PERL_SCAN_DISALLOW_PREFIX +# define PERL_SCAN_DISALLOW_PREFIX 0x02 +#endif + +#ifndef grok_numeric_radix +#if defined(NEED_grok_numeric_radix) +static bool DPPP_(my_grok_numeric_radix)(pTHX_ const char ** sp, const char * send); +static +#else +extern bool DPPP_(my_grok_numeric_radix)(pTHX_ const char ** sp, const char * send); +#endif + +#ifdef grok_numeric_radix +# undef grok_numeric_radix +#endif +#define grok_numeric_radix(a,b) DPPP_(my_grok_numeric_radix)(aTHX_ a,b) +#define Perl_grok_numeric_radix DPPP_(my_grok_numeric_radix) + +#if defined(NEED_grok_numeric_radix) || defined(NEED_grok_numeric_radix_GLOBAL) +bool +DPPP_(my_grok_numeric_radix)(pTHX_ const char **sp, const char *send) +{ +#ifdef USE_LOCALE_NUMERIC +#ifdef PL_numeric_radix_sv + if (PL_numeric_radix_sv && IN_LOCALE) { + STRLEN len; + char* radix = SvPV(PL_numeric_radix_sv, len); + if (*sp + len <= send && memEQ(*sp, radix, len)) { + *sp += len; + return TRUE; + } + } +#else + /* older perls don't have PL_numeric_radix_sv so the radix + * must manually be requested from locale.h + */ +#include + dTHR; /* needed for older threaded perls */ + struct lconv *lc = localeconv(); + char *radix = lc->decimal_point; + if (radix && IN_LOCALE) { + STRLEN len = strlen(radix); + if (*sp + len <= send && memEQ(*sp, radix, len)) { + *sp += len; + return TRUE; + } + } +#endif +#endif /* USE_LOCALE_NUMERIC */ + /* always try "." if numeric radix didn't match because + * we may have data from different locales mixed */ + if (*sp < send && **sp == '.') { + ++*sp; + return TRUE; + } + return FALSE; +} +#endif +#endif + +#ifndef grok_number +#if defined(NEED_grok_number) +static int DPPP_(my_grok_number)(pTHX_ const char * pv, STRLEN len, UV * valuep); +static +#else +extern int DPPP_(my_grok_number)(pTHX_ const char * pv, STRLEN len, UV * valuep); +#endif + +#ifdef grok_number +# undef grok_number +#endif +#define grok_number(a,b,c) DPPP_(my_grok_number)(aTHX_ a,b,c) +#define Perl_grok_number DPPP_(my_grok_number) + +#if defined(NEED_grok_number) || defined(NEED_grok_number_GLOBAL) +int +DPPP_(my_grok_number)(pTHX_ const char *pv, STRLEN len, UV *valuep) +{ + const char *s = pv; + const char *send = pv + len; + const UV max_div_10 = UV_MAX / 10; + const char max_mod_10 = UV_MAX % 10; + int numtype = 0; + int sawinf = 0; + int sawnan = 0; + + while (s < send && isSPACE(*s)) + s++; + if (s == send) { + return 0; + } else if (*s == '-') { + s++; + numtype = IS_NUMBER_NEG; + } + else if (*s == '+') + s++; + + if (s == send) + return 0; + + /* next must be digit or the radix separator or beginning of infinity */ + if (isDIGIT(*s)) { + /* UVs are at least 32 bits, so the first 9 decimal digits cannot + overflow. */ + UV value = *s - '0'; + /* This construction seems to be more optimiser friendly. + (without it gcc does the isDIGIT test and the *s - '0' separately) + With it gcc on arm is managing 6 instructions (6 cycles) per digit. + In theory the optimiser could deduce how far to unroll the loop + before checking for overflow. */ + if (++s < send) { + int digit = *s - '0'; + if (digit >= 0 && digit <= 9) { + value = value * 10 + digit; + if (++s < send) { + digit = *s - '0'; + if (digit >= 0 && digit <= 9) { + value = value * 10 + digit; + if (++s < send) { + digit = *s - '0'; + if (digit >= 0 && digit <= 9) { + value = value * 10 + digit; + if (++s < send) { + digit = *s - '0'; + if (digit >= 0 && digit <= 9) { + value = value * 10 + digit; + if (++s < send) { + digit = *s - '0'; + if (digit >= 0 && digit <= 9) { + value = value * 10 + digit; + if (++s < send) { + digit = *s - '0'; + if (digit >= 0 && digit <= 9) { + value = value * 10 + digit; + if (++s < send) { + digit = *s - '0'; + if (digit >= 0 && digit <= 9) { + value = value * 10 + digit; + if (++s < send) { + digit = *s - '0'; + if (digit >= 0 && digit <= 9) { + value = value * 10 + digit; + if (++s < send) { + /* Now got 9 digits, so need to check + each time for overflow. */ + digit = *s - '0'; + while (digit >= 0 && digit <= 9 + && (value < max_div_10 + || (value == max_div_10 + && digit <= max_mod_10))) { + value = value * 10 + digit; + if (++s < send) + digit = *s - '0'; + else + break; + } + if (digit >= 0 && digit <= 9 + && (s < send)) { + /* value overflowed. + skip the remaining digits, don't + worry about setting *valuep. */ + do { + s++; + } while (s < send && isDIGIT(*s)); + numtype |= + IS_NUMBER_GREATER_THAN_UV_MAX; + goto skip_value; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + numtype |= IS_NUMBER_IN_UV; + if (valuep) + *valuep = value; + + skip_value: + if (GROK_NUMERIC_RADIX(&s, send)) { + numtype |= IS_NUMBER_NOT_INT; + while (s < send && isDIGIT(*s)) /* optional digits after the radix */ + s++; + } + } + else if (GROK_NUMERIC_RADIX(&s, send)) { + numtype |= IS_NUMBER_NOT_INT | IS_NUMBER_IN_UV; /* valuep assigned below */ + /* no digits before the radix means we need digits after it */ + if (s < send && isDIGIT(*s)) { + do { + s++; + } while (s < send && isDIGIT(*s)); + if (valuep) { + /* integer approximation is valid - it's 0. */ + *valuep = 0; + } + } + else + return 0; + } else if (*s == 'I' || *s == 'i') { + s++; if (s == send || (*s != 'N' && *s != 'n')) return 0; + s++; if (s == send || (*s != 'F' && *s != 'f')) return 0; + s++; if (s < send && (*s == 'I' || *s == 'i')) { + s++; if (s == send || (*s != 'N' && *s != 'n')) return 0; + s++; if (s == send || (*s != 'I' && *s != 'i')) return 0; + s++; if (s == send || (*s != 'T' && *s != 't')) return 0; + s++; if (s == send || (*s != 'Y' && *s != 'y')) return 0; + s++; + } + sawinf = 1; + } else if (*s == 'N' || *s == 'n') { + /* XXX TODO: There are signaling NaNs and quiet NaNs. */ + s++; if (s == send || (*s != 'A' && *s != 'a')) return 0; + s++; if (s == send || (*s != 'N' && *s != 'n')) return 0; + s++; + sawnan = 1; + } else + return 0; + + if (sawinf) { + numtype &= IS_NUMBER_NEG; /* Keep track of sign */ + numtype |= IS_NUMBER_INFINITY | IS_NUMBER_NOT_INT; + } else if (sawnan) { + numtype &= IS_NUMBER_NEG; /* Keep track of sign */ + numtype |= IS_NUMBER_NAN | IS_NUMBER_NOT_INT; + } else if (s < send) { + /* we can have an optional exponent part */ + if (*s == 'e' || *s == 'E') { + /* The only flag we keep is sign. Blow away any "it's UV" */ + numtype &= IS_NUMBER_NEG; + numtype |= IS_NUMBER_NOT_INT; + s++; + if (s < send && (*s == '-' || *s == '+')) + s++; + if (s < send && isDIGIT(*s)) { + do { + s++; + } while (s < send && isDIGIT(*s)); + } + else + return 0; + } + } + while (s < send && isSPACE(*s)) + s++; + if (s >= send) + return numtype; + if (len == 10 && memEQ(pv, "0 but true", 10)) { + if (valuep) + *valuep = 0; + return IS_NUMBER_IN_UV; + } + return 0; +} +#endif +#endif + +/* + * The grok_* routines have been modified to use warn() instead of + * Perl_warner(). Also, 'hexdigit' was the former name of PL_hexdigit, + * which is why the stack variable has been renamed to 'xdigit'. + */ + +#ifndef grok_bin +#if defined(NEED_grok_bin) +static UV DPPP_(my_grok_bin)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result); +static +#else +extern UV DPPP_(my_grok_bin)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result); +#endif + +#ifdef grok_bin +# undef grok_bin +#endif +#define grok_bin(a,b,c,d) DPPP_(my_grok_bin)(aTHX_ a,b,c,d) +#define Perl_grok_bin DPPP_(my_grok_bin) + +#if defined(NEED_grok_bin) || defined(NEED_grok_bin_GLOBAL) +UV +DPPP_(my_grok_bin)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result) +{ + const char *s = start; + STRLEN len = *len_p; + UV value = 0; + NV value_nv = 0; + + const UV max_div_2 = UV_MAX / 2; + bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES; + bool overflowed = FALSE; + + if (!(*flags & PERL_SCAN_DISALLOW_PREFIX)) { + /* strip off leading b or 0b. + for compatibility silently suffer "b" and "0b" as valid binary + numbers. */ + if (len >= 1) { + if (s[0] == 'b') { + s++; + len--; + } + else if (len >= 2 && s[0] == '0' && s[1] == 'b') { + s+=2; + len-=2; + } + } + } + + for (; len-- && *s; s++) { + char bit = *s; + if (bit == '0' || bit == '1') { + /* Write it in this wonky order with a goto to attempt to get the + compiler to make the common case integer-only loop pretty tight. + With gcc seems to be much straighter code than old scan_bin. */ + redo: + if (!overflowed) { + if (value <= max_div_2) { + value = (value << 1) | (bit - '0'); + continue; + } + /* Bah. We're just overflowed. */ + warn("Integer overflow in binary number"); + overflowed = TRUE; + value_nv = (NV) value; + } + value_nv *= 2.0; + /* If an NV has not enough bits in its mantissa to + * represent a UV this summing of small low-order numbers + * is a waste of time (because the NV cannot preserve + * the low-order bits anyway): we could just remember when + * did we overflow and in the end just multiply value_nv by the + * right amount. */ + value_nv += (NV)(bit - '0'); + continue; + } + if (bit == '_' && len && allow_underscores && (bit = s[1]) + && (bit == '0' || bit == '1')) + { + --len; + ++s; + goto redo; + } + if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT)) + warn("Illegal binary digit '%c' ignored", *s); + break; + } + + if ( ( overflowed && value_nv > 4294967295.0) +#if UVSIZE > 4 + || (!overflowed && value > 0xffffffff ) +#endif + ) { + warn("Binary number > 0b11111111111111111111111111111111 non-portable"); + } + *len_p = s - start; + if (!overflowed) { + *flags = 0; + return value; + } + *flags = PERL_SCAN_GREATER_THAN_UV_MAX; + if (result) + *result = value_nv; + return UV_MAX; +} +#endif +#endif + +#ifndef grok_hex +#if defined(NEED_grok_hex) +static UV DPPP_(my_grok_hex)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result); +static +#else +extern UV DPPP_(my_grok_hex)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result); +#endif + +#ifdef grok_hex +# undef grok_hex +#endif +#define grok_hex(a,b,c,d) DPPP_(my_grok_hex)(aTHX_ a,b,c,d) +#define Perl_grok_hex DPPP_(my_grok_hex) + +#if defined(NEED_grok_hex) || defined(NEED_grok_hex_GLOBAL) +UV +DPPP_(my_grok_hex)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result) +{ + const char *s = start; + STRLEN len = *len_p; + UV value = 0; + NV value_nv = 0; + + const UV max_div_16 = UV_MAX / 16; + bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES; + bool overflowed = FALSE; + const char *xdigit; + + if (!(*flags & PERL_SCAN_DISALLOW_PREFIX)) { + /* strip off leading x or 0x. + for compatibility silently suffer "x" and "0x" as valid hex numbers. + */ + if (len >= 1) { + if (s[0] == 'x') { + s++; + len--; + } + else if (len >= 2 && s[0] == '0' && s[1] == 'x') { + s+=2; + len-=2; + } + } + } + + for (; len-- && *s; s++) { + xdigit = strchr((char *) PL_hexdigit, *s); + if (xdigit) { + /* Write it in this wonky order with a goto to attempt to get the + compiler to make the common case integer-only loop pretty tight. + With gcc seems to be much straighter code than old scan_hex. */ + redo: + if (!overflowed) { + if (value <= max_div_16) { + value = (value << 4) | ((xdigit - PL_hexdigit) & 15); + continue; + } + warn("Integer overflow in hexadecimal number"); + overflowed = TRUE; + value_nv = (NV) value; + } + value_nv *= 16.0; + /* If an NV has not enough bits in its mantissa to + * represent a UV this summing of small low-order numbers + * is a waste of time (because the NV cannot preserve + * the low-order bits anyway): we could just remember when + * did we overflow and in the end just multiply value_nv by the + * right amount of 16-tuples. */ + value_nv += (NV)((xdigit - PL_hexdigit) & 15); + continue; + } + if (*s == '_' && len && allow_underscores && s[1] + && (xdigit = strchr((char *) PL_hexdigit, s[1]))) + { + --len; + ++s; + goto redo; + } + if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT)) + warn("Illegal hexadecimal digit '%c' ignored", *s); + break; + } + + if ( ( overflowed && value_nv > 4294967295.0) +#if UVSIZE > 4 + || (!overflowed && value > 0xffffffff ) +#endif + ) { + warn("Hexadecimal number > 0xffffffff non-portable"); + } + *len_p = s - start; + if (!overflowed) { + *flags = 0; + return value; + } + *flags = PERL_SCAN_GREATER_THAN_UV_MAX; + if (result) + *result = value_nv; + return UV_MAX; +} +#endif +#endif + +#ifndef grok_oct +#if defined(NEED_grok_oct) +static UV DPPP_(my_grok_oct)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result); +static +#else +extern UV DPPP_(my_grok_oct)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result); +#endif + +#ifdef grok_oct +# undef grok_oct +#endif +#define grok_oct(a,b,c,d) DPPP_(my_grok_oct)(aTHX_ a,b,c,d) +#define Perl_grok_oct DPPP_(my_grok_oct) + +#if defined(NEED_grok_oct) || defined(NEED_grok_oct_GLOBAL) +UV +DPPP_(my_grok_oct)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result) +{ + const char *s = start; + STRLEN len = *len_p; + UV value = 0; + NV value_nv = 0; + + const UV max_div_8 = UV_MAX / 8; + bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES; + bool overflowed = FALSE; + + for (; len-- && *s; s++) { + /* gcc 2.95 optimiser not smart enough to figure that this subtraction + out front allows slicker code. */ + int digit = *s - '0'; + if (digit >= 0 && digit <= 7) { + /* Write it in this wonky order with a goto to attempt to get the + compiler to make the common case integer-only loop pretty tight. + */ + redo: + if (!overflowed) { + if (value <= max_div_8) { + value = (value << 3) | digit; + continue; + } + /* Bah. We're just overflowed. */ + warn("Integer overflow in octal number"); + overflowed = TRUE; + value_nv = (NV) value; + } + value_nv *= 8.0; + /* If an NV has not enough bits in its mantissa to + * represent a UV this summing of small low-order numbers + * is a waste of time (because the NV cannot preserve + * the low-order bits anyway): we could just remember when + * did we overflow and in the end just multiply value_nv by the + * right amount of 8-tuples. */ + value_nv += (NV)digit; + continue; + } + if (digit == ('_' - '0') && len && allow_underscores + && (digit = s[1] - '0') && (digit >= 0 && digit <= 7)) + { + --len; + ++s; + goto redo; + } + /* Allow \octal to work the DWIM way (that is, stop scanning + * as soon as non-octal characters are seen, complain only iff + * someone seems to want to use the digits eight and nine). */ + if (digit == 8 || digit == 9) { + if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT)) + warn("Illegal octal digit '%c' ignored", *s); + } + break; + } + + if ( ( overflowed && value_nv > 4294967295.0) +#if UVSIZE > 4 + || (!overflowed && value > 0xffffffff ) +#endif + ) { + warn("Octal number > 037777777777 non-portable"); + } + *len_p = s - start; + if (!overflowed) { + *flags = 0; + return value; + } + *flags = PERL_SCAN_GREATER_THAN_UV_MAX; + if (result) + *result = value_nv; + return UV_MAX; +} +#endif +#endif + +#if !defined(my_snprintf) +#if defined(NEED_my_snprintf) +static int DPPP_(my_my_snprintf)(char * buffer, const Size_t len, const char * format, ...); +static +#else +extern int DPPP_(my_my_snprintf)(char * buffer, const Size_t len, const char * format, ...); +#endif + +#define my_snprintf DPPP_(my_my_snprintf) +#define Perl_my_snprintf DPPP_(my_my_snprintf) + +#if defined(NEED_my_snprintf) || defined(NEED_my_snprintf_GLOBAL) + +int +DPPP_(my_my_snprintf)(char *buffer, const Size_t len, const char *format, ...) +{ + dTHX; + int retval; + va_list ap; + va_start(ap, format); +#ifdef HAS_VSNPRINTF + retval = vsnprintf(buffer, len, format, ap); +#else + retval = vsprintf(buffer, format, ap); +#endif + va_end(ap); + if (retval >= (int)len) + Perl_croak(aTHX_ "panic: my_snprintf buffer overflow"); + return retval; +} + +#endif +#endif + +#ifdef NO_XSLOCKS +# ifdef dJMPENV +# define dXCPT dJMPENV; int rEtV = 0 +# define XCPT_TRY_START JMPENV_PUSH(rEtV); if (rEtV == 0) +# define XCPT_TRY_END JMPENV_POP; +# define XCPT_CATCH if (rEtV != 0) +# define XCPT_RETHROW JMPENV_JUMP(rEtV) +# else +# define dXCPT Sigjmp_buf oldTOP; int rEtV = 0 +# define XCPT_TRY_START Copy(top_env, oldTOP, 1, Sigjmp_buf); rEtV = Sigsetjmp(top_env, 1); if (rEtV == 0) +# define XCPT_TRY_END Copy(oldTOP, top_env, 1, Sigjmp_buf); +# define XCPT_CATCH if (rEtV != 0) +# define XCPT_RETHROW Siglongjmp(top_env, rEtV) +# endif +#endif + +#if !defined(my_strlcat) +#if defined(NEED_my_strlcat) +static Size_t DPPP_(my_my_strlcat)(char * dst, const char * src, Size_t size); +static +#else +extern Size_t DPPP_(my_my_strlcat)(char * dst, const char * src, Size_t size); +#endif + +#define my_strlcat DPPP_(my_my_strlcat) +#define Perl_my_strlcat DPPP_(my_my_strlcat) + +#if defined(NEED_my_strlcat) || defined(NEED_my_strlcat_GLOBAL) + +Size_t +DPPP_(my_my_strlcat)(char *dst, const char *src, Size_t size) +{ + Size_t used, length, copy; + + used = strlen(dst); + length = strlen(src); + if (size > 0 && used < size - 1) { + copy = (length >= size - used) ? size - used - 1 : length; + memcpy(dst + used, src, copy); + dst[used + copy] = '\0'; + } + return used + length; +} +#endif +#endif + +#if !defined(my_strlcpy) +#if defined(NEED_my_strlcpy) +static Size_t DPPP_(my_my_strlcpy)(char * dst, const char * src, Size_t size); +static +#else +extern Size_t DPPP_(my_my_strlcpy)(char * dst, const char * src, Size_t size); +#endif + +#define my_strlcpy DPPP_(my_my_strlcpy) +#define Perl_my_strlcpy DPPP_(my_my_strlcpy) + +#if defined(NEED_my_strlcpy) || defined(NEED_my_strlcpy_GLOBAL) + +Size_t +DPPP_(my_my_strlcpy)(char *dst, const char *src, Size_t size) +{ + Size_t length, copy; + + length = strlen(src); + if (size > 0) { + copy = (length >= size) ? size - 1 : length; + memcpy(dst, src, copy); + dst[copy] = '\0'; + } + return length; +} + +#endif +#endif + +#endif /* _P_P_PORTABILITY_H_ */ + +/* End of File ppport.h */ + diff --git a/Curses-1.23/t/00-load.t b/Curses-1.23/t/00-load.t new file mode 100644 index 0000000..405f7ab --- /dev/null +++ b/Curses-1.23/t/00-load.t @@ -0,0 +1,9 @@ +#!perl + +use Test::More tests => 1; + +BEGIN { + use_ok( 'Curses' ); +} + +diag( "Testing Curses $Curses::VERSION, Perl $]" ); diff --git a/Curses-1.23/test.syms b/Curses-1.23/test.syms new file mode 100755 index 0000000..227c309 --- /dev/null +++ b/Curses-1.23/test.syms @@ -0,0 +1,310 @@ +#!../../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 + +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 () { + + 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 () { + 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 < Create file and dump output into it. +EOM +} + +__END__ diff --git a/Curses-1.23/testint.c b/Curses-1.23/testint.c new file mode 100644 index 0000000..7d0eb29 --- /dev/null +++ b/Curses-1.23/testint.c @@ -0,0 +1,7 @@ +#include "c-config.h" + +main() { + int ret; + + ret = SYM; +} diff --git a/Curses-1.23/testsym.c b/Curses-1.23/testsym.c new file mode 100644 index 0000000..212d055 --- /dev/null +++ b/Curses-1.23/testsym.c @@ -0,0 +1,5 @@ +#include "c-config.h" + +main() { + SYM; +} diff --git a/Curses-1.23/testtyp.c b/Curses-1.23/testtyp.c new file mode 100644 index 0000000..e7c31da --- /dev/null +++ b/Curses-1.23/testtyp.c @@ -0,0 +1,5 @@ +#include "c-config.h" + +main() { + typedef SYM c_sym_t; +}