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KO}ӽmSşذqsOy?\[,d@'73'j%kOe`1.g2"e =YIzS2|zŐƄa\U,dP;jhhhaxǶ?КZ՚.q SE+XrbOu%\GتX(H,N^~]JyEZQKceTQ]VGYqnah;y$cQahT&QPZ*iZ8UQQM.qo/T\7X"u?Mttl2Xq(IoW{R^ ux*SYJ! 4S.Jy~ BROS[V|žKNɛP(L6V^|cR7i7nZW1Fd@ Ara{詑|(T*dN]Ko?s=@ |_EvF]׍kR)eBJc" MUUbY6`~V޴dJKß&~'d3i WWWWWW
Current Directory: /home/.cpan/build/Curses-1.45-0
Viewing File: /home/.cpan/build/Curses-1.45-0/gen.tar
gen/0000700000076400000000000000000010535566626010652 5ustar bryanhrootgen/make.list.syms0000750000076400000000000000266707326707316013476 0ustar bryanhroot#!/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 gen/make.CursesBoot.c0000750000076400000000000000532707327603154014032 0ustar bryanhroot#!/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); } gen/make.CursesFun.c0000750000076400000000000000607607327603724013664 0ustar bryanhroot#!/usr/local/bin/perl ## ## make.CursesFun.c -- make CursesFun.c ## ## Copyright (c) 2000 William Setzer ## ## You may distribute under the terms of either the Artistic License ## or the GNU General Public License, as specified in the README file. use lib 'gen'; use Gen; open OUT, "> CursesFun.c" or die "Can't open CursesFun.c: $!\n"; process_DATA_chunk \&print_line; process_functions \&print_function; close OUT; ### ## The helpers # sub print_line { print OUT @_ } sub print_function { my $fun = shift; unless ($fun->{DOIT}) { print OUT $fun->{LINE}; return; } my @decl; my @retn; my @argv; if ($fun->{UNI}) { push @decl, "WINDOW *win\t= c_win ? c_sv2window(ST(0), 0) : stdscr;"; push @decl, "int\tc_mret\t= c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK;"; push @argv, "win"; } foreach my $arg (@{$fun->{ARGV}}) { my $pos = $fun->{UNI} ? $arg->{NUM} ? "c_arg+$arg->{NUM}" : "c_arg" : $arg->{NUM}; my $A = "ST($pos)"; my $B = $arg->{SPEC}{B} || $pos; my $N = $arg->{NAME}; my $T = length($arg->{DECL}) < 8 ? "\t" : ""; my $D = eval qq("$arg->{DECL}$T$arg->{NAME}\t= $arg->{M_DECL};"); if ($arg->{SPEC}{SHIFT}) { splice @decl, $arg->{SPEC}{SHIFT}, 0, $D; } else { push @decl, $D; } if ($arg->{M_RETN}) { push @retn, eval qq("$arg->{M_RETN};"); } push @argv, $arg->{SPEC}{AMP} ? "&" . $arg->{NAME} : $arg->{NAME}; } my $pref = $fun->{SPEC}{CAST} ? "($fun->{DECL})" . $fun->{W} : $fun->{W}; my $call = $pref . $fun->{NAME} . "(" . join(", ", @argv) . ");"; if ($fun->{UNI}) { if ($fun->{DECL} eq 'void') { $call = "if (c_mret == OK) { $call }"; } else { $call = eval qq("c_mret == ERR ? $fun->{M_NULL} : $call"); } } if ($fun->{DECL} eq 'void') { unshift @retn, $call; } else { my $A = "ST(0)"; my $N = "ret"; push @decl, "$fun->{DECL}\tret\t= $call"; push @retn, "ST(0) = sv_newmortal();"; push @retn, eval qq("$fun->{M_RETN};"); } push @decl, '' if @decl; my $count = $fun->{UNI} ? "count" : "exact"; my $body = join "\n\t", @decl, @retn; my $xsret = $fun->{DECL} ne 'void' ? 1 : 0; print OUT Q<<AAA; ################ # XS(XS_Curses_$fun->{NAME}) # { # dXSARGS; # #ifdef C_\U$fun->{NAME}\E # c_${count}args("$fun->{NAME}", items, $fun->{ARGC}); # { # $body # } # XSRETURN($xsret); # #else # c_fun_not_there("$fun->{NAME}"); # XSRETURN(0); # #endif # } # ################ AAA } sub print_function2 { my $fun = shift; return unless $fun->{DOIT}; return if $fun->{SPEC}{DUP}; my $S = " " x (3 - length $fun->{NUM}); print OUT Q<<AAA; ################ # #ifdef C_\U$fun->{NAME}\E # case $S$fun->{NUM}: ret = 1; break; # #endif ################ AAA } __END__ /* This file can be automatically generated; changes may be lost. ** ** ** CursesFun.c -- the functions ** ** Copyright (c) 1994-2000 William Setzer ** ** You may distribute under the terms of either the Artistic License ** or the GNU General Public License, as specified in the README file. */ PAUSE gen/make.Curses.pm0000750000076400000000000003370707327605651013407 0ustar bryanhroot#!/usr/local/bin/perl ## ## make.Curses.pm -- make Curses.pm ## ## Copyright (c) 2000 William Setzer ## ## You may distribute under the terms of either the Artistic License ## or the GNU General Public License, as specified in the README file. require 5.005; use lib 'gen'; use Gen; my $roff = 0; open OUT, "> Curses.pm" or die "Can't open Curses.pm: $!\n"; process_DATA_chunk \&print_line; process_variables \&print_variable1; process_DATA_chunk \&print_line; process_variables \&print_variable2; print OUT "\n"; $roff = 0; process_DATA_chunk \&print_line; process_functions \&print_function1; print OUT "\n"; $roff = 0; process_DATA_chunk \&print_line; process_constants \&print_constant1; print OUT "\n"; $roff = 0; process_DATA_chunk \&print_line; process_functions \&print_function2; print OUT "\n"; $roff = 0; process_DATA_chunk \&print_line; process_functions \&print_function3; process_DATA_chunk \&print_line; process_variables \&print_variable3; print OUT "\n"; $roff = 0; process_DATA_chunk \&print_line; process_constants \&print_constant2; print OUT "\n"; $roff = 0; process_DATA_chunk \&print_line; close OUT; ### ## Helpers # sub print_line { print OUT @_ } sub print_function1 { my $fun = shift; return unless $fun->{DOIT}; return if $fun->{SPEC}{DUP}; my $L = 1 + length $fun->{NAME}; if ($roff < 4) { print OUT " "; $roff = 4 } if ($roff + $L > 76) { print OUT "\n "; $roff = 4 } print OUT ' ', $fun->{NAME}; $roff += $L; } sub print_function2 { my $fun = shift; return unless $fun->{DOIT}; return if $fun->{SPEC}{DUP}; return unless $fun->{W}; my $L = 2 + length $fun->{NAME}; if ($roff < 8) { print OUT " "; $roff = 8 } if ($roff + $L > 76) { print OUT "\n "; $roff = 8 } print OUT ' w', $fun->{NAME}; $roff += $L; if ($fun->{UNI} =~ /mv/) { $L += 2; if ($roff < 8) { print OUT " "; $roff = 8 } if ($roff + $L > 76) { print OUT "\n "; $roff = 8 } print OUT ' mv', $fun->{NAME}; $roff += $L; $L ++; if ($roff < 8) { print OUT " "; $roff = 8 } if ($roff + $L > 76) { print OUT "\n "; $roff = 8 } print OUT ' mvw', $fun->{NAME}; $roff += $L; } } sub print_function3 { my $fun = shift; return unless $fun->{DOIT}; return if $fun->{SPEC}{DUP}; my $S = " " x (23 - length $fun->{NAME}); print OUT " ", $fun->{NAME}, $S, $fun->{UNI} ? "Yes" : " No"; if ($fun->{W}) { print OUT " w$fun->{NAME}"; if ($fun->{UNI} =~ /mv/) { print OUT " mv$fun->{NAME} mvw$fun->{NAME}"; } } print OUT "\n"; } sub print_variable1 { my $var = shift; return unless $var->{DOIT}; my $S = " " x (12 - length $var->{NAME}); print OUT qq{tie \$$var->{NAME},}, $S, qq{Curses::Vars, $var->{NUM};\n}; } sub print_variable2 { my $var = shift; return unless $var->{DOIT}; my $L = 1 + length $var->{NAME}; if ($roff < 4) { print OUT " "; $roff = 4 } if ($roff + $L > 76) { print OUT "\n "; $roff = 4 } print OUT ' ', $var->{NAME}; $roff += $L; $L++; if ($roff < 4) { print OUT " "; $roff = 4 } if ($roff + $L > 76) { print OUT "\n "; $roff = 4 } print OUT ' $', $var->{NAME}; $roff += $L; } sub print_variable3 { my $var = shift; return unless $var->{DOIT}; my $L = length $var->{NAME}; my $M = 24 - $L % 24; if ($roff < 4) { print OUT " "; $roff = 4 } if ($roff > 52) { print OUT "\n "; $roff = 4 } print OUT $var->{NAME}; $roff += $L; if ($M < 2) { $M += 24 } if ($roff + $M <= 52) { print OUT " " x $M } $roff += $M; } sub print_constant1 { my $con = shift; return unless $con->{DOIT}; my $L = 1 + length $con->{NAME}; if ($roff < 4) { print OUT " "; $roff = 4 } if ($roff + $L > 76) { print OUT "\n "; $roff = 4 } print OUT ' ', $con->{NAME}; $roff += $L; } sub print_constant2 { my $con = shift; return unless $con->{DOIT}; my $L = length $con->{NAME}; my $M = 24 - $L % 24; if ($roff < 4) { print OUT " "; $roff = 4 } if ($roff > 52) { print OUT "\n "; $roff = 4 } print OUT $con->{NAME}; $roff += $L; if ($M < 2) { $M += 24 } if ($roff + $M <= 52) { print OUT " " x $M } $roff += $M; } __END__ ## This file can be automatically generated; changes may be lost. ## ## ## CursesFun.c -- the functions ## ## Copyright (c) 1994-2000 William Setzer ## ## You may distribute under the terms of either the Artistic License ## or the GNU General Public License, as specified in the README file. ### ## For the brave object-using person # package Curses::Window; @ISA = qw(Curses); package Curses::Screen; @ISA = qw(Curses); sub new { newterm(@_) } sub DESTROY { } package Curses::Panel; @ISA = qw(Curses); sub new { new_panel(@_) } sub DESTROY { } package Curses::Menu; @ISA = qw(Curses); sub new { new_menu(@_) } sub DESTROY { } package Curses::Item; @ISA = qw(Curses); sub new { new_item(@_) } sub DESTROY { } package Curses::Form; @ISA = qw(Curses); sub new { new_form(@_) } sub DESTROY { } package Curses::Field; @ISA = qw(Curses); sub new { new_field(@_) } sub DESTROY { } package Curses; $VERSION = 1.06; use Carp; require Exporter; require DynaLoader; @ISA = qw(Exporter DynaLoader); bootstrap Curses; sub new { my $pkg = shift; my ($nl, $nc, $by, $bx) = (@_,0,0,0,0); unless ($_initscr++) { initscr() } return newwin($nl, $nc, $by, $bx); } sub DESTROY { } sub AUTOLOAD { my $N = $AUTOLOAD; $N =~ s/^.*:://; croak "Curses constant '$N' is not defined by your vendor"; } sub printw { addstr(sprintf shift, @_) } PAUSE @EXPORT = qw( printw PAUSE PAUSE PAUSE ); if ($OldCurses) { @_OLD = qw( wprintw mvprintw wmvprintw PAUSE ); push (@EXPORT, @_OLD); for (@_OLD) { /^(?:mv)?(?:w)?(.*)/; eval "sub $_ { $1(\@_); }"; } eval <<EOS; sub wprintw { addstr(shift, sprintf shift, @_) } sub mvprintw { addstr(shift, shift, sprintf shift, @_) } sub mvwprintw { addstr(shift, shift, shift, sprintf shift, @_) } EOS } 1; __END__ =head1 NAME Curses - terminal screen handling and optimization =head1 SYNOPSIS use Curses; initscr; ... endwin; Curses::supports_function($function); Curses::supports_contsant($constant); =head1 DESCRIPTION C<Curses> is the interface between Perl and your system's curses(3) library. For descriptions on the usage of a given function, variable, or constant, consult your system's documentation, as such information invariably varies (:-) between different curses(3) libraries and operating systems. This document describes the interface itself, and assumes that you already know how your system's curses(3) library works. =head2 Unified Functions Many curses(3) functions have variants starting with the prefixes I<w->, I<mv->, and/or I<wmv->. These variants differ only in the explicit addition of a window, or by the addition of two coordinates that are used to move the cursor first. For example, C<addch()> has three other variants: C<waddch()>, C<mvaddch()>, and C<mvwaddch()>. The variants aren't very interesting; in fact, we could roll all of the variants into original function by allowing a variable number of arguments and analyzing the argument list for which variant the user wanted to call. Unfortunately, curses(3) predates varargs(3), so in C we were stuck with all the variants. However, C<Curses> is a Perl interface, so we are free to "unify" these variants into one function. The section L<"Supported Functions"> below lists all curses(3) function supported by C<Curses>, along with a column listing if it is I<unified>. If so, it takes a varying number of arguments as follows: =over 4 C<function( [win], [y, x], args );> I<win> is an optional window argument, defaulting to C<stdscr> if not specified. I<y, x> is an optional coordinate pair used to move the cursor, defaulting to no move if not specified. I<args> are the required arguments of the function. These are the arguments you would specify if you were just calling the base function and not any of the variants. =back This makes the variants obsolete, since their functionality has been merged into a single function, so C<Curses> does not define them by default. You can still get them if you want, by setting the variable C<$Curses::OldCurses> to a non-zero value before using the C<Curses> package. See L<"Perl 4.X C<cursperl> Compatibility"> for an example of this. =head2 Objects Objects are supported. Example: $win = new Curses; $win->addstr(10, 10, 'foo'); $win->refresh; ... Any function that has been marked as I<unified> (see L<"Supported Functions"> below and L<"Unified Functions"> above) can be called as a method for a Curses object. Do not use C<initscr()> if using objects, as the first call to get a C<new Curses> will do it for you. =head2 Security Concerns It has always been the case with the curses functions, but please note that the following functions: getstr() (and optional wgetstr(), mvgetstr(), and mvwgetstr()) inchstr() (and optional winchstr(), mvinchstr(), and mvwinchstr()) instr() (and optional winstr(), mvinstr(), and mvwinstr()) are subject to buffer overflow attack. This is because you pass in the buffer to be filled in, which has to be of finite length, but there is no way to stop a bad guy from typing. In order to avoid this problem, use the alternate functions: getnstr() inchnstr() innstr() which take an extra "size of buffer" argument. =head1 COMPATIBILITY =head2 Perl 4.X C<cursperl> Compatibility C<Curses> has been written to take advantage of the new features of Perl. I felt it better to provide an improved curses programming environment rather than to be 100% compatible. However, many old C<curseperl> applications will probably still work by starting the script with: BEGIN { $Curses::OldCurses = 1; } use Curses; Any old application that still does not work should print an understandable error message explaining the problem. Some functions and variables are not supported by C<Curses>, even with the C<BEGIN> line. They are listed under L<"curses(3) items not supported by Curses">. The variables C<$stdscr> and C<$curscr> are also available as functions C<stdscr> and C<curscr>. This is because of a Perl bug. See the L<BUGS> section for details. =head2 Incompatibilities with previous versions of C<Curses> In previous versions of this software, some Perl functions took a different set of parameters than their C counterparts. This is no longer true. You should now use C<getstr($str)> and C<getyx($y, $x)> instead of C<$str = getstr()> and C<($y, $x) = getyx()>. =head2 Incompatibilities with other Perl programs menu.pl, v3.0 and v3.1 There were various interaction problems between these two releases and Curses. Please upgrade to the latest version (v3.3 as of 3/16/96). =head1 DIAGNOSTICS =over 4 =item * Curses function '%s' called with too %s arguments at ... You have called a C<Curses> function with a wrong number of arguments. =item * argument %d to Curses function '%s' is not a Curses %s at ... =item * argument is not a Curses %s at ... The argument you gave to the function wasn't what it wanted. This probably means that you didn't give the right arguments to a I<unified> function. See the DESCRIPTION section on L<Unified Functions> for more information. =item * Curses function '%s' is not defined by your vendor at ... You have a C<Curses> function in your code that your system's curses(3) library doesn't define. =item * Curses variable '%s' is not defined by your vendor at ... You have a C<Curses> variable in your code that your system's curses(3) library doesn't define. =item * Curses constant '%s' is not defined by your vendor at ... You have a C<Curses> constant in your code that your system's curses(3) library doesn't define. =item * Curses::Vars::FETCH called with bad index at ... =item * Curses::Vars::STORE called with bad index at ... You've been playing with the C<tie> interface to the C<Curses> variables. Don't do that. :-) =item * Anything else Check out the F<perldiag> man page to see if the error is in there. =back =head1 BUGS If you use the variables C<$stdscr> and C<$curscr> instead of their functional counterparts (C<stdscr> and C<curscr>), you might run into a bug in Perl where the "magic" isn't called early enough. This is manifested by the C<Curses> package telling you C<$stdscr> isn't a window. One workaround is to put a line like C<$stdscr = $stdscr> near the front of your program. Probably many more. =head1 AUTHOR William Setzer <William_Setzer@ncsu.edu> =head1 SYNOPSIS OF PERL CURSES SUPPORT =head2 Supported Functions Supported Unified? Supported via $OldCurses[*] --------- -------- ------------------------ PAUSE [*] To use any functions in this column, the variable C<$Curses::OldCurses> must be set to a non-zero value before using the C<Curses> package. See L<"Perl 4.X cursperl Compatibility"> for an example of this. =head2 Supported Variables PAUSE =head2 Supported Constants PAUSE =head2 curses(3) functions not supported by C<Curses> tstp _putchar fullname scanw wscanw mvscanw mvwscanw ripoffline setupterm setterm set_curterm del_curterm restartterm tparm tputs putp vidputs vidattr mvcur tigetflag tigetnum tigetstr tgetent tgetflag tgetnum tgetstr tgoto tputs =head2 menu(3) functions not supported by C<Curses> set_item_init item_init set_item_term item_term set_menu_init menu_init set_menu_term menu_term =head2 form(3) functions not supported by C<Curses> new_fieldtype free_fieldtype set_fieldtype_arg set_fieldtype_choice link_fieldtype set_form_init form_init set_form_term form_term set_field_init field_init set_field_term field_term set_field_type field_type gen/make.CursesVar.c0000750000076400000000000000607207326727762013670 0ustar bryanhroot#!/usr/local/bin/perl ## ## make.CursesVar.c -- make CursesVar.c ## ## Copyright (c) 2000 William Setzer ## ## You may distribute under the terms of either the Artistic License ## or the GNU General Public License, as specified in the README file. use lib 'gen'; use Gen; open OUT, "> CursesVar.c" or die "Can't open CursesVar.c: $!\n"; process_DATA_chunk \&print_line; process_variables \&print_function; process_DATA_chunk \&print_line; process_variables \&print_fetch; process_DATA_chunk \&print_line; process_variables \&print_store; process_DATA_chunk \&print_line; close OUT; ### ## Helpers # sub print_line { print OUT @_ } sub print_function { my $var = shift; return unless $var->{DOIT}; my $A = "ST(0)"; my $N = $var->{NAME}; my $body = eval qq("$var->{M_RETN}"); print OUT Q<<AAA; ################ # XS(XS_Curses_$var->{NAME}) # { # dXSARGS; # #ifdef \UC_$var->{NAME}\E # c_exactargs("$var->{NAME}", items, 0); # { # ST(0) = sv_newmortal(); # $body; # } # XSRETURN(1); # #else # c_var_not_there("$var->{NAME}"); # XSRETURN(0); # #endif # } # ################ AAA } sub print_fetch { my $var = shift; return unless $var->{DOIT}; my $A = "ST(0)"; my $N = $var->{NAME}; my $body = eval qq("$var->{M_RETN}"); print OUT Q<<AAA; ################ # case $var->{NUM}: # #ifdef \UC_$var->{NAME}\E # $body; # #else # c_var_not_there("$var->{NAME}"); # #endif # break; ################ AAA } sub print_store { my $var = shift; return unless $var->{DOIT}; my $A = "ST(1)"; my $B = -1; my $N = $var->{NAME}; my $body = eval qq("$var->{M_DECL}"); print OUT Q<<AAA; ################ # case $var->{NUM}: # #ifdef \UC_$var->{NAME}\E # $var->{NAME} = $body; # #else # c_var_not_there("$var->{NAME}"); # #endif # break; ################ AAA } ### ## Templates # __END__ /* This file can be automatically generated; changes may be lost. ** ** ** CursesVar.c -- the variables ** ** Copyright (c) 1994-2000 William Setzer ** ** You may distribute under the terms of either the Artistic License ** or the GNU General Public License, as specified in the README file. */ PAUSE XS(XS_Curses_Vars_TIESCALAR) { dXSARGS; c_exactargs("TIESCALAR", items, 2); { char * pack = (char *)SvPV(ST(0),PL_na); int n = (int)SvIV(ST(1)); ST(0) = sv_newmortal(); sv_setref_iv(ST(0), pack, n); } XSRETURN(1); } XS(XS_Curses_Vars_FETCH) { dXSARGS; { int num = (int)SvIV(SvRV((SV*)ST(0))); ST(0) = sv_newmortal(); switch (num) { PAUSE default: croak("Curses::Vars::FETCH called with bad index"); /* NOTREACHED */ } } XSRETURN(1); } XS(XS_Curses_Vars_STORE) { dXSARGS; { int num = (int)SvIV((SV*)SvRV(ST(0))); switch (num) { PAUSE default: croak("Curses::Vars::STORE called with bad index"); /* NOTREACHED */ } ST(0) = &PL_sv_yes; } XSRETURN(1); } XS(XS_Curses_Vars_DESTROY) { dXSARGS; { SV * rv = ST(0); ST(0) = &PL_sv_yes; } XSRETURN(1); } gen/list.typ0000640000076400000000000000013207326643577012372 0ustar bryanhroot> attr_t sym; > bool sym; > chtype sym; > MEVENT sym; > mmask_t sym; > SCREEN sym; gen/make.CursesCon.c0000750000076400000000000000240007327576137013645 0ustar bryanhroot#!/usr/local/bin/perl ## ## make.CursesFun.c -- make CursesFun.c ## ## Copyright (c) 2000 William Setzer ## ## You may distribute under the terms of either the Artistic License ## or the GNU General Public License, as specified in the README file. use lib 'gen'; use Gen; use Data::Dumper; open OUT, "> CursesCon.c" or die "Can't open CursesCon.c: $!\n"; process_DATA_chunk \&print_line; process_constants \&print_constant; close OUT; ### ## The helpers # sub print_line { print OUT @_ } sub print_constant { my $con = shift; return unless $con->{DOIT}; return unless $con->{SPEC}{DEFER}; print OUT Q<<AAA; ################ # XS(XS_Curses_$con->{NAME}) # { # dXSARGS; # #ifdef $con->{NAME} # { # int ret = $con->{NAME}; # # ST(0) = sv_newmortal(); # sv_setiv(ST(0), (IV)ret); # } # XSRETURN(1); # #else # c_con_not_there("$con->{NAME}"); # XSRETURN(0); # #endif # } # ################ AAA } __END__ /* This file can be automatically generated; changes may be lost. ** ** ** CursesCon.c -- non-trivial constants ** ** Copyright (c) 1994-2000 William Setzer ** ** You may distribute under the terms of either the Artistic License ** or the GNU General Public License, as specified in the README file. */ PAUSE gen/list.fun0000640000076400000000000003726507327363272012357 0ustar bryanhroot!! Note 1: "void *" declarations are always set to zero. !! Note 2: "void *"s meant to handle real pointers were made "{cast} char *". !! Note 3: "{out}{amp} <decl> <var>" were all originally "decl *var". !! Note 4: "{cast}"ing a function is usually to shut up the compiler !! complaining about discarding const from pointer. !! Note 5: Some insane curses return "char *" for standout()/standend(). !! I don't feel like handling it, hence the "{cast}". ! /* curs_addch */ > int {mvw}addch(chtype ch); > int {w}echochar(chtype ch); /* curs_addchstr */ > int {mvw}addchstr(const chtype *str); > int {mvw}addchnstr(const chtype *str, int n); /* curs_addstr */ > int {mvw}addstr(const char *str); > int {mvw}addnstr(const char *str, int n); /* curs_attr */ > int {w}attroff(int attrs); > int {w}attron(int attrs); > int {w}attrset(int attrs); > {cast} int {w}standend(void); > {cast} int {w}standout(void); > int {w}attr_get({out}{amp} attr_t attrs, {out}{amp} short color, void *opts); > int {w}attr_off(attr_t attrs, void *opts); > int {w}attr_on(attr_t attrs, void *opts); > int {w}attr_set(attr_t attrs, short color, void *opts); > int {mvw}chgat(int n, attr_t attrs, short color, \ const void *opts); > int COLOR_PAIR(int n); > int PAIR_NUMBER(int attrs); /* curs_beep */ > int beep(void); > int flash(void); /* curs_bkgd */ > int {w}bkgd(chtype ch); > void {w}bkgdset(chtype ch); > chtype <w>getbkgd(void); /* curs_border */ > int {w}border(chtype ls, chtype rs_, chtype ts, chtype bs, \ chtype tl, chtype tr, chtype bl, chtype br); > int <w>box(chtype verch, chtype horch); > int {mvw}hline(chtype ch, int n); > int {mvw}vline(chtype ch, int n); /* curs_clear */ > int {w}erase(void); > int {w}clear(void); > int {w}clrtobot(void); > int {w}clrtoeol(void); /* curs_color */ > int start_color(void); > int init_pair(short pair, short f, short b); > int init_color(short color, short r, short g, short b); > bool has_colors(void); > bool can_change_color(void); > int color_content(short color, {out}{amp} short r, {out}{amp} short g, \ {out}{amp} short b); > int pair_content(short pair, {out}{amp} short f, {out}{amp} short b); /* curs_delch */ > int {mvw}delch(void); /* curs_deleteln */ > int {w}deleteln(void); > int {w}insdelln(int n); > int {w}insertln(void); /* curs_getch */ > chtype {mvw}getch(void); > int ungetch(chtype ch); > int has_key(int ch); > chtype KEY_F(int n); /* curs_getstr */ > int {mvw}getstr({b=250}{out} char *str); > int {mvw}getnstr({b=n+1}{out} char *str, {shift=-1} int n); /* curs_getyx */ > void <w>getyx({out} int y, {out} int x); > void <w>getparyx({out} int y, {out} int x); > void <w>getbegyx({out} int y, {out} int x); > void <w>getmaxyx({out} int y, {out} int x); /* curs_inch */ > chtype {mvw}inch(void); /* curs_inchstr */ > int {mvw}inchstr({b=250}{out} chtype *str); > int {mvw}inchnstr({b=n+1}{out} chtype *str, {shift=-1} int n); /* curs_initscr */ > WINDOW *initscr(void); > int endwin(void); > int isendwin(void); > SCREEN *newterm({opt} char *type, FILE *outfd, FILE *infd); > SCREEN *set_term(SCREEN *new); > void delscreen(SCREEN *sp); /* curs_inopts */ #ifdef C_INTCBREAK > {itest} int cbreak(void); #else > {dup} void cbreak(void); #endif #ifdef C_INTNOCBREAK > {itest} int nocbreak(void); #else > {dup} void nocbreak(void); #endif #ifdef C_INTECHO > {itest} int echo(void); #else > {dup} void echo(void); #endif #ifdef C_INTNOECHO > {itest} int noecho(void); #else > {dup} void noecho(void); #endif > int halfdelay(int tenths); > int <w>intrflush(bool bf); > int <w>keypad(bool bf); > int <w>meta(bool bf); > int <w>nodelay(bool bf); > int <w>notimeout(bool bf); #ifdef C_INTRAW > {itest} int raw(void); #else > {dup} void raw(void); #endif #ifdef C_INTNORAW > {itest} int noraw(void); #else > {dup} void noraw(void); #endif > void qiflush(void); > void noqiflush(void); > void {w}timeout(int delay); > int typeahead(int fd); /* curs_insch */ > int {mvw}insch(chtype ch); /* curs_insstr */ > int {mvw}insstr(const char *str); > int {mvw}insnstr(const char *str, int n); /* curs_instr */ > int {mvw}instr({b=250}{out} char *str); > int {mvw}innstr({b=n+1}{out} char *str, {shift=-1} int n); /* curs_kernel */ > int def_prog_mode(void); > int def_shell_mode(void); > int reset_prog_mode(void); > int reset_shell_mode(void); > int resetty(void); > int savetty(void); #ifdef C_INTGETSYX > {itest} int getsyx({out} int y, {out} int x); #else > {dup} void getsyx({out} int y, {out} int x); #endif #ifdef C_INTSETSYX > {itest} int setsyx(int y, int x); #else > {dup} void setsyx(int y, int x); #endif > int curs_set(int visibility); > int napms(int ms); /* curs_move */ > int {w}move(int y, int x); /* curs_outopts */ > int <w>clearok(bool bf); #ifdef C_INTIDLOK > {itest} int <w>idlok(bool bf); #else > {dup} void <w>idlok(bool bf); #endif > void <w>idcok(bool bf); > void <w>immedok(bool bf); > int <w>leaveok(bool bf); > int {w}setscrreg(int top, int bot); > int <w>scrollok(bool bf); #ifdef C_INTNL > {itest} int nl(void); #else > {dup} void nl(void); #endif #ifdef C_INTNONL > {itest} int nonl(void); #else > {dup} void nonl(void); #endif /* curs_overlay */ > int overlay(WINDOW *srcwin, WINDOW *dstwin); > int overwrite(WINDOW *srcwin, WINDOW *dstwin); > int copywin(WINDOW *srcwin, WINDOW *dstwin, int sminrow, int smincol, \ int dminrow, int dmincol, int dmaxrow, int dmaxcol, \ int overlay); /* curs_pad */ > WINDOW *newpad(int lines_, int cols); > WINDOW *subpad(WINDOW *orig, int lines_, int cols, int beginy, int beginx); > int prefresh(WINDOW *pad, int pminrow, int pmincol, int sminrow, \ int smincol, int smaxrow, int smaxcol); > int pnoutrefresh(WINDOW *pad, int pminrow, int pmincol, int sminrow, \ int smincol, int smaxrow, int smaxcol); > int pechochar(WINDOW *pad, chtype ch); /* curs_printw */ /* done in perl */ /* curs_refresh */ > int {w}refresh(void); > int |w|noutrefresh(void); > int doupdate(void); > int <w>redrawwin(void); > int |w|redrawln(int beg_line, int num_lines); /* curs_scanw */ /* done in perl */ /* curs_scr_dump */ > int scr_dump(const char *filename); > int scr_restore(const char *filename); > int scr_init(const char *filename); > int scr_set(const char *filename); /* curs_scroll */ > int <w>scroll(void); > int {w}scrl(int n); /* curs_slk */ > int slk_init(int fmt); > int slk_set(int labnum, char *label, int fmt); > int slk_refresh(void); > int slk_noutrefresh(void); > char *slk_label(int labnum); > int slk_clear(void); > int slk_restore(void); > int slk_touch(void); > int slk_attron(chtype attrs); > int slk_attrset(chtype attrs); > attr_t slk_attr(void); > int slk_attroff(chtype attrs); > int slk_color(short color_pair_number); /* curs_termattrs */ > int baudrate(void); > char erasechar(void); > int has_ic(void); > int has_il(void); > char killchar(void); #ifdef C_LONG0ARGS > {notest} char *longname(void); #else > {dup} char *longname(char *a, char *b); #endif > chtype termattrs(void); > char *termname(void); /* curs_touch */ > int <w>touchwin(void); #ifdef C_TOUCH3ARGS > {notest} int <w>touchline(int start, int count); #else > {dup} int <w>touchline(int y, int sx, int ex); #endif > int <w>untouchwin(void); > int |w|touchln(int y, int n, int changed); > int <w>is_linetouched(int line); > int <w>is_wintouched(void); /* curs_util */ > char *unctrl(chtype ch); > {cast} char *keyname(int k); #ifdef C_INTFILTER > {itest} int filter(void); #else > {dup} void filter(void); #endif > void use_env(bool bf); > int putwin(WINDOW *win, FILE *filep); > WINDOW *getwin(FILE *filep); > int delay_output(int ms); > int flushinp(void); /* curs_window */ > WINDOW *newwin(int nlines, int ncols, int beginy, int beginx); > int <w>delwin(void); > int <w>mvwin(int y, int x); > WINDOW *<w>subwin(int nlines, int ncols, int beginy, int beginx); > WINDOW *<w>derwin(int nlines, int ncols, int beginy, int beginx); > int <w>mvderwin(int par_y, int par_x); > WINDOW *<w>dupwin(void); > void |w|syncup(void); > int <w>syncok(bool bf); > void |w|cursyncup(void); > void |w|syncdown(void); /* ncurses extension functions */ > int getmouse({out} MEVENT *event); > int ungetmouse(MEVENT *event); > mmask_t mousemask(mmask_t newmask, {out}{amp} mmask_t oldmask); > bool |w|enclose(int y, int x); > bool |w|mouse_trafo({out}{amp} int pY, {out}{amp} int pX, bool to_screen); > int mouseinterval(int erval); > int BUTTON_RELEASE(mmask_t e, int x); > int BUTTON_PRESS(mmask_t e, int x); > int BUTTON_CLICK(mmask_t e, int x); > int BUTTON_DOUBLE_CLICK(mmask_t e, int x); > int BUTTON_TRIPLE_CLICK(mmask_t e, int x); > int BUTTON_RESERVED_EVENT(mmask_t e, int x); > int use_default_colors(void); > int assume_default_colors(int fg, int bg); > int define_key(char *definition, int keycode); > char *keybound(int keycode, int count); > int keyok(int keycode, bool enable); > int resizeterm(int lines, int cols); > int {w}resize(int lines_, int columns); /* DEC curses, I think */ > int <w>getmaxy(void); > int <w>getmaxx(void); /* old BSD curses calls */ > void <w>flusok(bool bf); > {cast} char *getcap(char *term); > int touchoverlap(WINDOW *src, WINDOW *dst); /* Panel support */ > PANEL *new_panel(WINDOW *win); > int bottom_panel(PANEL *pan); > int top_panel(PANEL *pan); > int show_panel(PANEL *pan); > void update_panels(void); > int hide_panel(PANEL *pan); > WINDOW *panel_window(const PANEL *pan); > int replace_panel(PANEL *pan, WINDOW *window); > int move_panel(PANEL *pan, int starty, int startx); > int panel_hidden(const PANEL *pan); > PANEL *panel_above(const {opt} PANEL *pan); > PANEL *panel_below(const {opt} PANEL *pan); > int set_panel_userptr(PANEL *pan, const {cast} char *ptr); > const {cast} char *panel_userptr(const PANEL *pan); > int del_panel(PANEL *pan); /* Menu support */ /* menu_attributes */ > int set_menu_fore(MENU *menu, chtype attr); > chtype menu_fore(MENU *menu); > int set_menu_back(MENU *menu, chtype attr); > chtype menu_back(MENU *menu); > int set_menu_grey(MENU *menu, chtype attr); > chtype menu_grey(MENU *menu); > int set_menu_pad(MENU *menu, int pad); > int menu_pad(MENU *menu); /* menu_cursor */ > int pos_menu_cursor(MENU *menu); /* menu_driver */ > int menu_driver(MENU *menu, int c); /* menu_format */ > int set_menu_format(MENU *menu, int rows, int cols); > void menu_format(MENU *menu, {out}{amp} int rows, {out}{amp} int cols); /* menu_items */ > int set_menu_items(MENU *menu, ITEM **items); > ITEM **menu_items(MENU *menu); > int item_count(MENU *menu); /* menu_mark */ > int set_menu_mark(MENU *menu, char *mark); > const {cast} char *menu_mark( const MENU *menu); /* menu_new */ > MENU *new_menu(ITEM **items); > int free_menu(MENU *menu); /* menu_opts */ > int menu_opts(MENU *menu); > int set_menu_opts(MENU *menu, int opts); > int menu_opts_on(MENU *menu, int opts); > int menu_opts_off(MENU *menu, int opts); /* menu_pattern */ > int set_menu_pattern(MENU *menu, const char *pattern); > char *menu_pattern(const MENU *menu); /* menu_post */ > int post_menu(MENU *menu); > int unpost_menu(MENU *menu); /* menu_userptr */ > int set_menu_userptr(MENU *item, char *userptr); > char *menu_userptr(MENU *item); /* menu_win */ > int set_menu_win(MENU *menu, WINDOW *win); > WINDOW *menu_win(MENU *menu); > int set_menu_sub(MENU *menu, WINDOW *win); > WINDOW *menu_sub(MENU *menu); > int scale_menu(MENU *menu, {out}{amp} int rows, {out}{amp} int cols); /* menu_item_current */ > int set_current_item(MENU *menu, const ITEM *item); > ITEM *current_item(const MENU *menu); > int set_top_row(MENU *menu, int row); > int top_row(const MENU *menu); > int item_index(const ITEM *item); /* menu_item_name */ > const {cast} char *item_name( const ITEM *item); > const {cast} char *item_description( const ITEM *item); /* menu_item_new */ > ITEM *new_item(const char *name, const char *descr); > int free_item(ITEM *item); /* menu_item_opts */ > int set_item_opts(ITEM *item, int opts); > int item_opts_on(ITEM *item, int opts); > int item_opts_off(ITEM *item, int opts); > int item_opts(ITEM *item); /* menu_item_userptr */ > const {cast} char *item_userptr(const ITEM *item); > int set_item_userptr(ITEM *item, const {cast} char *ptr); /* menu_item_value */ > int set_item_value(ITEM *item, bool val); > bool item_value(ITEM *item); /* menu_item_visible */ > bool item_visible(ITEM *item); /* ncurses menu extension functions */ > const {cast} char *menu_request_name(int request); > int menu_request_by_name(const char *name); > int set_menu_spacing(MENU *menu, int descr, int rows, int cols); > int menu_spacing(const MENU *menu, {out}{amp} int descr, \ {out}{amp} int rows, {out}{amp} int cols); /* Form support */ /* form_cursor */ > int pos_form_cursor(FORM *form); /* form_data */ > bool data_ahead(const FORM *form); > bool data_behind(const FORM *form); /* form_driver */ > int form_driver(FORM *form, int c); /* form_field */ > int set_form_fields(FORM *form, FIELD **fields); > FIELD **form_fields(const FORM *form); > int field_count(const FORM *form); > int move_field(FIELD *field, int frow, int fcol); /* form_new */ > FORM *new_form(FIELD **fields); > int free_form(FORM *form); /* form_new_page */ > int set_new_page(FIELD *field, bool new_page_flag); > bool new_page(const FIELD *field); /* form_opts */ > int set_form_opts(FORM *form, int opts); > int form_opts_on(FORM *form, int opts); > int form_opts_off(FORM *form, int opts); > int form_opts(const FORM *form); /* form_page */ > int set_current_field(FORM *form, FIELD *field); > FIELD *current_field(const FORM *form); > int set_form_page(FORM *form, int n); > int form_page(const FORM *form); > int field_index(const FIELD *field); /* form_post */ > int post_form(FORM *form); > int unpost_form(FORM *form); /* form_userptr */ > int set_form_userptr(FORM *form, char *userptr); > char *form_userptr(const FORM *form); /* form_win */ > int set_form_win(FORM *form, WINDOW *win); > WINDOW *form_win(const FORM *form); > int set_form_sub(FORM *form, WINDOW *sub); > WINDOW *form_sub(const FORM *form); > int scale_form(const FORM *form, {out}{amp} int rows, {out}{amp} int cols); /* form_field_attributes */ > int set_field_fore(FIELD *field, chtype attr); > chtype field_fore(const FIELD *field); > int set_field_back(FIELD *field, chtype attr); > chtype field_back(const FIELD *field); > int set_field_pad(FIELD *field, int pad); > chtype field_pad(const FIELD *field); /* form_field_buffer */ > int set_field_buffer(FIELD *field, int buf, const char *value); > char *field_buffer(const FIELD *field, int buffer); > int set_field_status(FIELD *field, bool status); > bool field_status(const FIELD *field); > int set_max_field(FIELD *field, int max); /* form_field_info */ > int field_info(const FIELD *field, {out}{amp} int rows, \ {out}{amp} int cols, {out}{amp} int frow, \ {out}{amp} int fcol, {out}{amp} int nrow, \ {out}{amp} int nbuf); > int dynamic_field_info(const FIELD *field, {out}{amp} int rows, \ {out}{amp} int cols, {out}{amp} int max); /* form_field_just */ > int set_field_just(FIELD *field, int justif); > int field_just(const FIELD *field); /* form_field_new */ > FIELD *new_field(int height, int width, int toprow, int leftcol, \ int offscreen, int nbuffers); > FIELD *dup_field(FIELD *field, int toprow, int leftcol); > FIELD *link_field(FIELD *field, int toprow, int leftcol); > int free_field(FIELD *field); /* form_field_opts */ > int set_field_opts(FIELD *field, int opts); > int field_opts_on(FIELD *field, int opts); > int field_opts_off(FIELD *field, int opts); > int field_opts(const FIELD *field); /* form_field_userptr */ > int set_field_userptr(FIELD *field, char *userptr); > char *field_userptr(const FIELD *field); /* form_field_validation */ > char *field_arg(const FIELD *field); /* ncurses form extension functions */ > const {cast} char *form_request_name(int request); > int form_request_by_name(const char *name); gen/increase-version0000750000076400000000000000113607134401117014042 0ustar bryanhroot#!/bin/sh ## ## incrase-version -- Increases version number everywhere ## ## Copyright (c) 2000 William Setzer ## ## You may distribute under the terms of either the Artistic License ## or the GNU General Public License, as specified in the README file. ## ## (but why would you want to?) if [ "$1" = "" ]; then echo "Usage: $0 <version>" exit 1 fi vers=$1 perl="/usr/local/bin/perl -p -i.bak -e" $perl "s/^(.VERSION = )\d+\.\d+/\${1}$vers/" gen/make.Curses.pm $perl "s/(Curses-)\d+\.\d+/\${1}$vers/" INSTALL $perl "s/(VERSION\s+=>\s+')\d+\.\d+/\${1}$vers/" Makefile.PL gen/make.CursesTyp.h0000750000076400000000000000176307327050427013707 0ustar bryanhroot#!/usr/local/bin/perl ## ## make.CursesTyp.h -- make CursesTyp.h ## ## Copyright (c) 2001 William Setzer ## ## You may distribute under the terms of either the Artistic License ## or the GNU General Public License, as specified in the README file. use lib 'gen'; use Gen; open OUT, "> CursesTyp.h" or die "Can't open CursesTyp.h: $!\n"; process_DATA_chunk \&print_line; process_typedefs \&print_typedef; close OUT; ### ## Helpers # sub print_line { print OUT @_ } sub print_typedef { my $typ = shift; return unless $typ->{DOIT}; print OUT Q<<AAA; ################ # #ifndef \UC_TYP$typ->{DECL}\E # #define $typ->{DECL} int # #endif # ################ AAA } __END__ /* This file can be automatically generated; changes may be lost. ** ** ** CursesTyp.c -- typedef handlers ** ** Copyright (c) 1994-2001 William Setzer ** ** You may distribute under the terms of either the Artistic License ** or the GNU General Public License, as specified in the README file. */ PAUSE gen/list.con0000640000076400000000000001344207327575416012342 0ustar bryanhroot> 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; gen/list.var0000640000076400000000000000023507117231716012334 0ustar bryanhroot> int LINES; > int COLS; > WINDOW *stdscr; > WINDOW *curscr; > int COLORS; > int COLOR_PAIRS; /* char *ttytype; */ /* char *Def_term; */ /* bool My_term; */ gen/README0000640000076400000000000000022507120200711011507 0ustar bryanhrootThe 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 gen/Gen.pm0000640000076400000000000002254307327575701011734 0ustar bryanhrootpackage Gen; @ISA = qw(Exporter); @EXPORT = qw(lookup Q process_DATA_chunk process_functions process_variables process_constants process_typedefs); my $list_fun = "gen/list.fun"; my $list_var = "gen/list.var"; my $list_con = "gen/list.con"; my $list_typ = "gen/list.typ"; ### ## Declaration entries # my $MAP = { 'attr_t' => { 'DECL_NOR' => '(attr_t)SvIV($A)', 'RETN_NOR' => 'sv_setiv($A, (IV)$N)', 'TEST_NOR' => '0', 'DECL_OUT' => '0', 'RETN_OUT' => 'sv_setiv($A, (IV)$N);', 'TEST_OUT' => 'LINES', 'RETN_NUL' => 'ERR', }, 'bool' => { 'DECL_NOR' => '(int)SvIV($A)', 'RETN_NOR' => 'sv_setiv($A, (IV)$N)', 'TEST_NOR' => '0', 'RETN_NUL' => 'ERR', }, 'char' => { 'RETN_NOR' => 'sv_setpvn($A, (char *)&$N, 1)', 'RETN_NUL' => 'ERR', }, 'char *' => { 'DECL_NOR' => '(char *)SvPV($A,PL_na)', 'RETN_NOR' => 'sv_setpv((SV*)$A, $N)', 'TEST_NOR' => '0', 'DECL_OUT' => '(char *)sv_grow($A, $B)', 'RETN_OUT' => 'c_setchar($A, $N)', 'TEST_OUT' => '0', 'DECL_OPT' => '$A != &PL_sv_undef ? (char *)SvPV($A,PL_na) : NULL', 'TEST_OPT' => '0', 'RETN_NUL' => 'NULL', }, 'chtype' => { 'DECL_NOR' => 'c_sv2chtype($A)', 'RETN_NOR' => 'c_chtype2sv($A, $N)', 'TEST_NOR' => '0', 'RETN_NUL' => 'ERR', }, 'chtype *' => { 'DECL_NOR' => '(chtype *)SvPV($A,PL_na)', 'TEST_NOR' => '0', 'DECL_OUT' => '(chtype *)sv_grow($A, ($B)*sizeof(chtype))', 'RETN_OUT' => 'c_setchtype($A, $N)', 'TEST_OUT' => '0', }, 'FIELD *' => { 'DECL_NOR' => 'c_sv2field($A, $B)', 'RETN_NOR' => 'c_field2sv($A, $N)', 'TEST_NOR' => '0', 'RETN_NUL' => 'NULL', }, 'FIELD **' => { 'DECL_NOR' => '(FIELD **)SvPV($A,PL_na)', 'RETN_NOR' => 'sv_setpv((SV*)$A, (char *)$N)', 'TEST_NOR' => '0', 'RETN_NUL' => '0', }, 'FILE *' => { 'DECL_NOR' => 'IoIFP(sv_2io($A))', 'TEST_NOR' => '0', }, 'FORM *' => { 'DECL_NOR' => 'c_sv2form($A, $B)', 'RETN_NOR' => 'c_form2sv($A, $N)', 'TEST_NOR' => '0', 'RETN_NUL' => 'NULL', }, 'int' => { 'DECL_NOR' => '(int)SvIV($A)', 'RETN_NOR' => 'sv_setiv($A, (IV)$N)', 'TEST_NOR' => '0', 'DECL_OUT' => '0', 'RETN_OUT' => 'sv_setiv($A, (IV)$N);', 'TEST_OUT' => 'LINES', 'RETN_NUL' => 'ERR', }, 'ITEM *' => { 'DECL_NOR' => 'c_sv2item($A, $B)', 'RETN_NOR' => 'c_item2sv($A, $N)', 'TEST_NOR' => '0', 'RETN_NUL' => 'NULL', }, 'ITEM **' => { 'DECL_NOR' => '(ITEM **)SvPV($A,PL_na)', 'RETN_NOR' => 'sv_setpv((SV*)$A, (char *)$N)', 'TEST_NOR' => '0', 'RETN_NUL' => '0', }, 'MENU *' => { 'DECL_NOR' => 'c_sv2menu($A, $B)', 'RETN_NOR' => 'c_menu2sv($A, $N)', 'TEST_NOR' => '0', 'RETN_NUL' => 'NULL', }, 'MEVENT *' => { 'DECL_NOR' => '(MEVENT *)SvPV($A,PL_na)', 'TEST_NOR' => '0', 'DECL_OUT' => '(MEVENT *)sv_grow($A, 2 * sizeof(MEVENT))', 'RETN_OUT' => 'c_setmevent($A, $N)', 'TEST_OUT' => '0', }, 'mmask_t' => { 'DECL_NOR' => '(mmask_t)SvIV($A)', 'RETN_NOR' => 'sv_setiv($A, (IV)$N)', 'TEST_NOR' => '0', 'DECL_OUT' => '0', 'RETN_OUT' => 'sv_setiv($A, (IV)$N);', 'TEST_OUT' => 'LINES', 'RETN_NUL' => 'ERR', }, 'PANEL *' => { 'DECL_NOR' => 'c_sv2panel($A, $B)', 'RETN_NOR' => 'c_panel2sv($A, $N)', 'TEST_NOR' => '0', 'DECL_OPT' => '$A != &PL_sv_undef ? c_sv2panel($A, $B) : NULL', 'TEST_OPT' => '0', 'RETN_NUL' => 'NULL', }, 'SCREEN *' => { 'DECL_NOR' => 'c_sv2screen($A, $B)', 'RETN_NOR' => 'c_screen2sv($A, $N)', 'TEST_NOR' => '0', 'RETN_NUL' => 'NULL', }, 'short' => { 'DECL_NOR' => '(short)SvIV($A)', 'TEST_NOR' => '0', 'DECL_OUT' => '0', 'RETN_OUT' => 'sv_setiv($A, (IV)$N);', 'TEST_OUT' => 'LINES', }, 'void' => { 'RETN_NOR' => 'not gonna happen', 'RETN_NUL' => 'not gonna happen', }, 'void *' => { 'DECL_NOR' => '0', 'TEST_NOR' => '0', }, 'WINDOW *' => { 'DECL_NOR' => 'c_sv2window($A, $B)', 'RETN_NOR' => 'c_window2sv($A, $N)', 'TEST_NOR' => 'stdscr', 'RETN_NUL' => 'NULL', } }; ## Allow us to put some quoting around here documents to make them stand out # sub Q { my $text = shift; $text =~ s/^#{16}\n//mg; $text =~ s/^#\t?//mg; $text; } ## Print a chunk of data, 'til we hit PAUSE # sub process_DATA_chunk { my $proc = shift; my ($pkg) = (caller)[0]; *DATA = *{"${pkg}::DATA"}; while (<DATA>) { last if /^PAUSE$/; &{$proc}($_); } } my $pattern = '^\s* (?:const \s+)? ( (?:[{<|] [^}>|]+ [}>|])* )' . '\s* (\S+ (?: \s+ \*+)?) \s* ( [{<|] \w+ [}>|] )* \s* (\w+)'; sub process_functions { my $proc = shift; my $numf = 1; open INF, $list_fun or die "Can't open $list_fun: $!\n"; FCN: while (<INF>) { next if /^!/; while (s/\\\n//) { $_ .= <INF>; die "$list_fun: Unterminated backslash\n" if eof; } my $fun = { LINE => $_, DOIT => 0 }; if (/^> (.+) \( (.+) \) ; /x) { my $lhs = $1; my $args = $2; unless ($lhs =~ /$pattern/xo) { warn "$lhs($args): bad function prototype\n"; next FCN; } $fun->{SPEC} = $1; $fun->{DECL} = $2; $fun->{UNI} = $3; $fun->{NAME} = $4; $fun->{DOIT} = 1; $fun->{NUM} = $numf++; $fun->{ARGV} = [ ]; $fun->{SPEC} = { map { uc($_) => 1 } $fun->{SPEC} =~ /{(.+?)}/g }; $fun->{W} = $fun->{UNI} && $fun->{UNI} =~ /[{|]/ ? 'w' : ''; my $argc = 0; foreach my $entry (split /\s*,\s*/, $args) { next if $entry eq 'void'; unless ($entry =~ /$pattern/xo) { warn "$fun->{NAME}( $entry ): bad arg prototype\n"; next FCN; } my $arg = $fun->{ARGV}[$argc] = { }; $arg->{SPEC} = $1; $arg->{DECL} = $2; $arg->{NAME} = $4; $arg->{SPEC} = { map { /=/ ? (uc($`) => $') : (uc($_) => 1) } $arg->{SPEC} =~ /{(.+?(?:=.+?)?)}/g }; $arg->{MAP} = { }; $arg->{NUM} = $argc++; my $typ = 'NOR'; if ($arg->{SPEC}{OUT}) { $typ = 'OUT' } elsif ($arg->{SPEC}{OPT}) { $typ = 'OPT' } my $decl = $MAP->{$arg->{DECL}}{"DECL_$typ"}; if (not defined $decl) { warn "$fun->{NAME}( $arg->{DECL} $arg->{NAME} ): " . "no map rewrite for DECL_$typ\n"; next FCN; } $arg->{M_DECL} = $decl; if ($typ eq 'OUT') { my $retn = $MAP->{$arg->{DECL}}{"RETN_$typ"}; if (not defined $retn) { warn "$fun->{NAME}( $arg->{DECL} $arg->{NAME} ): " . "no map rewrite for RETN_$typ\n"; next FCN; } $arg->{M_RETN} = $retn; } my $test = $MAP->{$arg->{DECL}}{"TEST_$typ"}; if (not defined $test) { warn "$fun->{NAME}( $arg->{DECL} $arg->{NAME} ): " . "no map rewrite for TEST_$typ\n"; next FCN; } $arg->{M_TEST} = $test; } my $retn = $MAP->{$fun->{DECL}}{RETN_NOR}; if (not defined $retn) { warn "$fun->{DECL} $fun->{NAME}( ): " . "no map rewrite for RETN_NOR\n"; next FCN; } my $null = $MAP->{$fun->{DECL}}{RETN_NUL}; if (not defined $null) { warn "$fun->{DECL} $fun->{NAME}( ): " . "no map rewrite for RETN_NUL\n"; next FCN; } $fun->{M_RETN} = $retn; $fun->{M_NULL} = $null; $fun->{ARGC} = $argc; } &{$proc}($fun); } close INF; } sub process_variables { my $proc = shift; my $numv = 1; open INV, $list_var or die "Can't open $list_var: $!\n"; while (<INV>) { next if /^!/; while (s/\\\n//) { $_ .= <INV>; die "$list_var: Unterminated backslash\n" if eof; } my $var = { LINE => $_, DOIT => 0 }; if (/^> (.+) ; /x) { my $lhs = $1; unless ($lhs =~ /$pattern/xo) { warn "$lhs: bad variable prototype\n"; next; } $var->{SPEC} = $1; $var->{DECL} = $2; $var->{NAME} = $4; $var->{DOIT} = 1; $var->{NUM} = $numv++; $var->{SPEC} = { map { uc($_) => 1 } $var->{SPEC} =~ /{(.+?)}/g }; my $decl = $MAP->{$var->{DECL}}{DECL_NOR}; if (not defined $decl) { warn "$var->{DECL} $var->{NAME}: " . "no map rewrite for DECL_$typ\n"; next; } my $retn = $MAP->{$var->{DECL}}{RETN_NOR}; if (not defined $retn) { warn "$var->{DECL} $var->{NAME}: " . "no map rewrite for RETN_NOR\n"; next; } $var->{M_DECL} = $decl; $var->{M_RETN} = $retn; } &{$proc}($var); } close INV; } sub process_constants { my $proc = shift; my $numc = 1; open INC, $list_con or die "Can't open $list_con: $!\n"; while (<INC>) { next if /^!/; while (s/\\\n//) { $_ .= <INC>; die "$list_con: Unterminated backslash\n" if eof; } my $con = { LINE => $_, DOIT => 0 }; if (/^> (.+) ; /x) { my $lhs = $1; unless ($lhs =~ /$pattern/xo) { warn "$lhs: bad variable prototype\n"; next; } $con->{SPEC} = $1; $con->{DECL} = $2; $con->{NAME} = $4; $con->{DOIT} = 1; $con->{NUM} = $numc++; $con->{SPEC} = { map { uc($_) => 1 } $con->{SPEC} =~ /{(.+?)}/g }; } &{$proc}($con); } close INC; } sub process_typedefs { my $proc = shift; my $numt = 1; open INT, $list_typ or die "Can't open $list_typ: $!\n"; while (<INT>) { next if /^!/; while (s/\\\n//) { $_ .= <INT>; die "$list_typ: Unterminated backslash\n" if eof; } my $typ = { LINE => $_, DOIT => 0 }; if (/^> \s+ (.+) /x) { my $lhs = $1; unless ($lhs =~ /$pattern/xo) { warn "$lhs: bad typedef prototype\n"; next; } $typ->{SPEC} = $1; $typ->{DECL} = $2; $typ->{NAME} = $4; $typ->{DOIT} = 1; $typ->{NUM} = $numt++; $typ->{SPEC} = { map { uc($_) => 1 } $typ->{SPEC} =~ /{(.+?)}/g }; } &{$proc}($typ); } close INT; } 1;