mirror of
https://github.com/Aigor44/ncursesw-morphos.git
synced 2025-01-12 14:54:25 +08:00
ncurses 5.6 - patch 20070331
+ modify Ada95 binding to build with --enable-reentrant by wrapping global variables (bug: acs_map does not yet work). + modify Ada95 binding to use the new access-functions, allowing it to build/run when NCURSES_OPAQUE is set. + add access-functions and macros to return properties of the WINDOW structure, e.g., when NCURSES_OPAQUE is set. + improved install-sh's quoting. + use mkdirs.sh rather than mkinstalldirs, e.g., to use fixes from other programs. NCURSES_OPAQUE set, since we cannot pass a reference to
This commit is contained in:
parent
33b3156f43
commit
5a9c046f10
@ -28,7 +28,7 @@
|
||||
#
|
||||
# Author: Juergen Pfeifer, 1996
|
||||
#
|
||||
# $Id: Makefile.in,v 1.53 2007/02/04 00:42:40 tom Exp $
|
||||
# $Id: Makefile.in,v 1.54 2007/03/31 21:53:14 tom Exp $
|
||||
#
|
||||
.SUFFIXES:
|
||||
|
||||
@ -92,17 +92,18 @@ ADA_SRCDIR = ../src
|
||||
|
||||
GEN_FILES0 = Base_Defs
|
||||
|
||||
GEN_FILES1 = Key_Definitions \
|
||||
Old_Keys \
|
||||
Character_Attribute_Set_Rep \
|
||||
GEN_FILES1 = ACS_Map \
|
||||
AC_Rep \
|
||||
Color_Defs \
|
||||
ACS_Map \
|
||||
Linker_Options \
|
||||
Base_Defs \
|
||||
Window_Offsets \
|
||||
Character_Attribute_Set_Rep \
|
||||
Color_Defs \
|
||||
Key_Definitions \
|
||||
Linker_Options \
|
||||
Old_Keys \
|
||||
Public_Variables \
|
||||
Trace_Defs \
|
||||
Version_Info \
|
||||
Trace_Defs
|
||||
Window_Offsets
|
||||
|
||||
GEN_FILES2 = Menu_Opt_Rep \
|
||||
Menu_Base_Defs \
|
||||
@ -123,6 +124,7 @@ GEN_FILES5 = Chtype_Def \
|
||||
Eti_Defs
|
||||
|
||||
GEN_TARGETS = $(ADA_SRCDIR)/$(ABASE).ads \
|
||||
$(ADA_SRCDIR)/$(ABASE).adb \
|
||||
$(ADA_SRCDIR)/$(ABASE)-aux.ads \
|
||||
$(ADA_SRCDIR)/$(ABASE)-trace.ads \
|
||||
$(ADA_SRCDIR)/$(ABASE)-menus.ads \
|
||||
@ -137,6 +139,7 @@ GEN_TARGETS = $(ADA_SRCDIR)/$(ABASE).ads \
|
||||
$(ADA_SRCDIR)/$(ABASE)-panels-user_data.ads
|
||||
|
||||
GEN_SRC = $(srcdir)/$(ABASE).ads.m4 \
|
||||
$(srcdir)/$(ABASE).adb.m4 \
|
||||
$(srcdir)/$(ABASE)-aux.ads.m4 \
|
||||
$(srcdir)/$(ABASE)-trace.ads.m4 \
|
||||
$(srcdir)/$(ABASE)-menus.ads.m4 \
|
||||
@ -192,7 +195,7 @@ gen$x: gen.o
|
||||
|
||||
gen.o: $(srcdir)/gen.c
|
||||
$(HOST_CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/gen.c
|
||||
|
||||
################################################################################
|
||||
Character_Attribute_Set_Rep: gen$x
|
||||
$(GENERATE) B A >$@
|
||||
|
||||
@ -202,30 +205,33 @@ Base_Defs: gen$x
|
||||
Color_Defs: gen$x
|
||||
$(GENERATE) B C >$@
|
||||
|
||||
Window_Offsets: gen$x
|
||||
$(GENERATE) B D >$@
|
||||
|
||||
Key_Definitions: gen$x
|
||||
$(GENERATE) B K >$@
|
||||
|
||||
Old_Keys: gen$x
|
||||
$(GENERATE) B O >$@
|
||||
|
||||
ACS_Map: gen$x
|
||||
$(GENERATE) B M >$@
|
||||
|
||||
AC_Rep: gen$x
|
||||
$(GENERATE) B R >$@
|
||||
|
||||
Linker_Options: gen$x
|
||||
$(GENERATE) B L >$@
|
||||
|
||||
ACS_Map: gen$x
|
||||
$(GENERATE) B M >$@
|
||||
|
||||
Old_Keys: gen$x
|
||||
$(GENERATE) B O >$@
|
||||
|
||||
Public_Variables: gen$x
|
||||
$(GENERATE) B P >$@
|
||||
|
||||
AC_Rep: gen$x
|
||||
$(GENERATE) B R >$@
|
||||
|
||||
Version_Info: gen$x
|
||||
$(GENERATE) B V >$@
|
||||
|
||||
Window_Offsets: gen$x
|
||||
$(GENERATE) B D >$@
|
||||
|
||||
Trace_Defs: gen$x
|
||||
$(GENERATE) B T >$@
|
||||
|
||||
################################################################################
|
||||
Menu_Opt_Rep: gen$x
|
||||
$(GENERATE) M R >$@
|
||||
|
||||
@ -237,7 +243,7 @@ Menu_Linker_Options: gen$x
|
||||
|
||||
Item_Rep: gen$x
|
||||
$(GENERATE) M I >$@
|
||||
|
||||
################################################################################
|
||||
Form_Opt_Rep: gen$x
|
||||
$(GENERATE) F R >$@
|
||||
|
||||
@ -249,7 +255,7 @@ Form_Linker_Options: gen$x
|
||||
|
||||
Field_Rep: gen$x
|
||||
$(GENERATE) F I >$@
|
||||
|
||||
################################################################################
|
||||
Mouse_Base_Defs: gen$x
|
||||
$(GENERATE) P B >$@
|
||||
|
||||
@ -267,13 +273,19 @@ Chtype_Def: gen$x
|
||||
|
||||
Eti_Defs: gen$x
|
||||
$(GENERATE) E E >$@
|
||||
|
||||
################################################################################
|
||||
$(ADA_SRCDIR)/$(ABASE).ads: $(srcdir)/$(ABASE).ads.m4 \
|
||||
$(GEN_FILES1) $(srcdir)/normal.m4
|
||||
$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
|
||||
$(srcdir)/$(ABASE).ads.m4 |\
|
||||
$(DEL_ADAMODE) >$@
|
||||
|
||||
$(ADA_SRCDIR)/$(ABASE).adb: $(srcdir)/$(ABASE).adb.m4 \
|
||||
$(GEN_FILES1) $(srcdir)/normal.m4
|
||||
$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
|
||||
$(srcdir)/$(ABASE).adb.m4 |\
|
||||
$(DEL_ADAMODE) >$@
|
||||
|
||||
$(ADA_SRCDIR)/$(ABASE)-aux.ads: $(srcdir)/$(ABASE)-aux.ads.m4 \
|
||||
$(GEN_FILES5) $(srcdir)/normal.m4
|
||||
$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
|
||||
|
143
Ada95/gen/gen.c
143
Ada95/gen/gen.c
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2004,2005 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998,2005,2007 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -32,7 +32,7 @@
|
||||
|
||||
/*
|
||||
Version Control
|
||||
$Id: gen.c,v 1.40 2005/01/22 17:03:48 tom Exp $
|
||||
$Id: gen.c,v 1.46 2007/03/31 23:39:15 tom Exp $
|
||||
--------------------------------------------------------------------------*/
|
||||
/*
|
||||
This program generates various record structures and constants from the
|
||||
@ -41,6 +41,8 @@
|
||||
to produce the real source.
|
||||
*/
|
||||
|
||||
#include <ncurses_cfg.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
@ -771,6 +773,22 @@ acs_def(const char *name, chtype *a)
|
||||
static void
|
||||
gen_acs(void)
|
||||
{
|
||||
printf(" type C_ACS_Map is array (Character'Val (0) .. Character'Val (127))\n");
|
||||
printf(" of Attributed_Character;\n");
|
||||
#if USE_REENTRANT
|
||||
printf(" function ACS_Map return C_ACS_Map;\n");
|
||||
printf(" pragma Import (C, ACS_Map, \"_nc_acs_map\");\n");
|
||||
#else
|
||||
printf(" ACS_Map : C_ACS_Map;\n");
|
||||
printf(" pragma Import (C, ACS_Map, \"acs_map\");\n");
|
||||
#endif
|
||||
printf(" --\n");
|
||||
printf(" --\n");
|
||||
printf(" -- Constants for several characters from the Alternate Character Set\n");
|
||||
printf(" -- You must use these constants as indices into the ACS_Map array\n");
|
||||
printf(" -- to get the corresponding attributed character at runtime.\n");
|
||||
printf(" --\n");
|
||||
|
||||
#ifdef ACS_ULCORNER
|
||||
acs_def("ACS_Upper_Left_Corner", &ACS_ULCORNER);
|
||||
#endif
|
||||
@ -877,8 +895,7 @@ gen_acs(void)
|
||||
printf(" %-25s : constant Event_Mask := 8#%011lo#;\n", \
|
||||
#name, name)
|
||||
|
||||
static
|
||||
void
|
||||
static void
|
||||
gen_mouse_events(void)
|
||||
{
|
||||
mmask_t all1 = 0;
|
||||
@ -1004,6 +1021,56 @@ gen_mouse_events(void)
|
||||
GEN_EVENT(BUTTON4_EVENTS, all4);
|
||||
}
|
||||
|
||||
static void
|
||||
wrap_one_var(const char *c_var,
|
||||
const char *c_type,
|
||||
const char *ada_func,
|
||||
const char *ada_type)
|
||||
{
|
||||
#if USE_REENTRANT
|
||||
/* must wrap variables */
|
||||
printf("\n");
|
||||
printf(" function %s return %s\n", ada_func, ada_type);
|
||||
printf(" is\n");
|
||||
printf(" function Result return %s;\n", c_type);
|
||||
printf(" pragma Import (C, Result, \"_nc_%s\");\n", c_var);
|
||||
printf(" begin\n");
|
||||
if (strcmp(c_type, ada_type))
|
||||
printf(" return %s (Result);\n", ada_type);
|
||||
else
|
||||
printf(" return Result;\n");
|
||||
printf(" end %s;\n", ada_func);
|
||||
#else
|
||||
/* global variables are really global */
|
||||
printf("\n");
|
||||
printf(" function %s return %s\n", ada_func, ada_type);
|
||||
printf(" is\n");
|
||||
printf(" Result : %s;\n", c_type);
|
||||
printf(" pragma Import (C, Result, \"%s\");\n", c_var);
|
||||
printf(" begin\n");
|
||||
if (strcmp(c_type, ada_type))
|
||||
printf(" return %s (Result);\n", ada_type);
|
||||
else
|
||||
printf(" return Result;\n");
|
||||
printf(" end %s;\n", ada_func);
|
||||
#endif
|
||||
}
|
||||
|
||||
#define GEN_PUBLIC_VAR(c_var, c_type, ada_func, ada_type) \
|
||||
wrap_one_var(#c_var, #c_type, #ada_func, #ada_type)
|
||||
|
||||
static void
|
||||
gen_public_vars(void)
|
||||
{
|
||||
GEN_PUBLIC_VAR(stdscr, Window, Standard_Window, Window);
|
||||
GEN_PUBLIC_VAR(curscr, Window, Current_Window, Window);
|
||||
GEN_PUBLIC_VAR(LINES, C_Int, Lines, Line_Count);
|
||||
GEN_PUBLIC_VAR(COLS, C_Int, Columns, Column_Count);
|
||||
GEN_PUBLIC_VAR(TABSIZE, C_Int, Tab_Size, Natural);
|
||||
GEN_PUBLIC_VAR(COLORS, C_Int, Number_Of_Colors, Natural);
|
||||
GEN_PUBLIC_VAR(COLOR_PAIRS, C_Int, Number_Of_Color_Pairs, Natural);
|
||||
}
|
||||
|
||||
/*
|
||||
* Output some comment lines indicating that the file is generated.
|
||||
* The name parameter is the name of the facility to be used in
|
||||
@ -1178,70 +1245,21 @@ eti_gen(char *buf, int code, const char *name, int *etimin, int *etimax)
|
||||
return strlen(buf);
|
||||
}
|
||||
|
||||
#define GEN_OFFSET(member,itype) \
|
||||
if (sizeof(((WINDOW*)0)->member)==sizeof(itype)) { \
|
||||
o = offsetof(WINDOW, member); \
|
||||
if ((o%sizeof(itype) == 0)) { \
|
||||
printf(" Offset%-*s : constant Natural := %2ld; -- %s\n", \
|
||||
12, #member, (long)(o/sizeof(itype)),#itype); \
|
||||
} \
|
||||
}
|
||||
|
||||
static void
|
||||
gen_offsets(void)
|
||||
{
|
||||
long o;
|
||||
const char *s_bool = "";
|
||||
|
||||
GEN_OFFSET(_maxy, short);
|
||||
GEN_OFFSET(_maxx, short);
|
||||
GEN_OFFSET(_begy, short);
|
||||
GEN_OFFSET(_begx, short);
|
||||
GEN_OFFSET(_cury, short);
|
||||
GEN_OFFSET(_curx, short);
|
||||
GEN_OFFSET(_yoffset, short);
|
||||
GEN_OFFSET(_pary, int);
|
||||
GEN_OFFSET(_parx, int);
|
||||
if (sizeof(bool) == sizeof(char))
|
||||
{
|
||||
GEN_OFFSET(_notimeout, char);
|
||||
GEN_OFFSET(_clear, char);
|
||||
GEN_OFFSET(_leaveok, char);
|
||||
GEN_OFFSET(_scroll, char);
|
||||
GEN_OFFSET(_idlok, char);
|
||||
GEN_OFFSET(_idcok, char);
|
||||
GEN_OFFSET(_immed, char);
|
||||
GEN_OFFSET(_sync, char);
|
||||
GEN_OFFSET(_use_keypad, char);
|
||||
|
||||
s_bool = "char";
|
||||
}
|
||||
else if (sizeof(bool) == sizeof(short))
|
||||
{
|
||||
GEN_OFFSET(_notimeout, short);
|
||||
GEN_OFFSET(_clear, short);
|
||||
GEN_OFFSET(_leaveok, short);
|
||||
GEN_OFFSET(_scroll, short);
|
||||
GEN_OFFSET(_idlok, short);
|
||||
GEN_OFFSET(_idcok, short);
|
||||
GEN_OFFSET(_immed, short);
|
||||
GEN_OFFSET(_sync, short);
|
||||
GEN_OFFSET(_use_keypad, short);
|
||||
|
||||
s_bool = "short";
|
||||
}
|
||||
else if (sizeof(bool) == sizeof(int))
|
||||
{
|
||||
GEN_OFFSET(_notimeout, int);
|
||||
GEN_OFFSET(_clear, int);
|
||||
GEN_OFFSET(_leaveok, int);
|
||||
GEN_OFFSET(_scroll, int);
|
||||
GEN_OFFSET(_idlok, int);
|
||||
GEN_OFFSET(_idcok, int);
|
||||
GEN_OFFSET(_immed, int);
|
||||
GEN_OFFSET(_sync, int);
|
||||
GEN_OFFSET(_use_keypad, int);
|
||||
|
||||
s_bool = "int";
|
||||
}
|
||||
printf(" Sizeof%-*s : constant Natural := %2ld; -- %s\n",
|
||||
@ -1291,9 +1309,6 @@ main(int argc, char *argv[])
|
||||
case 'A': /* chtype translation into Ada95 record type */
|
||||
gen_attr_set("Character_Attribute_Set");
|
||||
break;
|
||||
case 'K': /* translation of keycodes */
|
||||
gen_keydefs(0);
|
||||
break;
|
||||
case 'B': /* write some initial comment lines */
|
||||
basedefs();
|
||||
break;
|
||||
@ -1306,24 +1321,30 @@ main(int argc, char *argv[])
|
||||
case 'E': /* generate Mouse Event codes */
|
||||
gen_mouse_events();
|
||||
break;
|
||||
case 'M': /* generate constants for the ACS characters */
|
||||
gen_acs();
|
||||
case 'K': /* translation of keycodes */
|
||||
gen_keydefs(0);
|
||||
break;
|
||||
case 'L': /* generate the Linker_Options pragma */
|
||||
gen_linkopts();
|
||||
break;
|
||||
case 'M': /* generate constants for the ACS characters */
|
||||
gen_acs();
|
||||
break;
|
||||
case 'O': /* generate definitions of the old key code names */
|
||||
gen_keydefs(1);
|
||||
break;
|
||||
case 'P': /* generate definitions of the public variables */
|
||||
gen_public_vars();
|
||||
break;
|
||||
case 'R': /* generate representation clause for Attributed character */
|
||||
gen_chtype_rep("Attributed_Character");
|
||||
break;
|
||||
case 'V': /* generate version info */
|
||||
gen_version_info();
|
||||
break;
|
||||
case 'T': /* generate the Trace info */
|
||||
gen_trace("Trace_Attribute_Set");
|
||||
break;
|
||||
case 'V': /* generate version info */
|
||||
gen_version_info();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -1,4 +1,6 @@
|
||||
------------------------------------------------------------------------------
|
||||
-- -*- ada -*-
|
||||
define(`HTMLNAME',`terminal_interface-curses__adb.htm')dnl
|
||||
include(M4MACRO)------------------------------------------------------------------------------
|
||||
-- --
|
||||
-- GNAT ncurses Binding --
|
||||
-- --
|
||||
@ -35,8 +37,8 @@
|
||||
------------------------------------------------------------------------------
|
||||
-- Author: Juergen Pfeifer, 1996
|
||||
-- Version Control:
|
||||
-- $Revision: 1.35 $
|
||||
-- $Date: 2007/03/24 23:03:56 $
|
||||
-- $Revision: 1.2 $
|
||||
-- $Date: 2007/03/31 23:02:22 $
|
||||
-- Binding Version 01.00
|
||||
------------------------------------------------------------------------------
|
||||
with System;
|
||||
@ -44,10 +46,8 @@ with System;
|
||||
with Terminal_Interface.Curses.Aux;
|
||||
with Interfaces.C; use Interfaces.C;
|
||||
with Interfaces.C.Strings; use Interfaces.C.Strings;
|
||||
with Interfaces.C.Pointers;
|
||||
with Ada.Characters.Handling; use Ada.Characters.Handling;
|
||||
with Ada.Strings.Fixed;
|
||||
with Ada.Unchecked_Conversion;
|
||||
|
||||
package body Terminal_Interface.Curses is
|
||||
|
||||
@ -60,57 +60,6 @@ package body Terminal_Interface.Curses is
|
||||
of aliased Attributed_Character;
|
||||
pragma Convention (C, chtype_array);
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
generic
|
||||
type Element is (<>);
|
||||
function W_Get_Element (Win : in Window;
|
||||
Offset : in Natural) return Element;
|
||||
|
||||
function W_Get_Element (Win : in Window;
|
||||
Offset : in Natural) return Element is
|
||||
type E_Array is array (Natural range <>) of aliased Element;
|
||||
package C_E_Array is new
|
||||
Interfaces.C.Pointers (Natural, Element, E_Array, Element'Val (0));
|
||||
use C_E_Array;
|
||||
|
||||
function To_Pointer is new
|
||||
Ada.Unchecked_Conversion (Window, Pointer);
|
||||
|
||||
P : Pointer := To_Pointer (Win);
|
||||
begin
|
||||
if Win = Null_Window then
|
||||
raise Curses_Exception;
|
||||
else
|
||||
P := P + ptrdiff_t (Offset);
|
||||
return P.all;
|
||||
end if;
|
||||
end W_Get_Element;
|
||||
|
||||
function W_Get_Int is new W_Get_Element (C_Int);
|
||||
function W_Get_Short is new W_Get_Element (C_Short);
|
||||
function W_Get_Byte is new W_Get_Element (Interfaces.C.unsigned_char);
|
||||
|
||||
function Get_Flag (Win : Window;
|
||||
Offset : Natural) return Boolean;
|
||||
|
||||
function Get_Flag (Win : Window;
|
||||
Offset : Natural) return Boolean
|
||||
is
|
||||
Res : C_Int;
|
||||
begin
|
||||
case Sizeof_bool is
|
||||
when 1 => Res := C_Int (W_Get_Byte (Win, Offset));
|
||||
when 2 => Res := C_Int (W_Get_Short (Win, Offset));
|
||||
when 4 => Res := C_Int (W_Get_Int (Win, Offset));
|
||||
when others => raise Curses_Exception;
|
||||
end case;
|
||||
|
||||
case Res is
|
||||
when 0 => return False;
|
||||
when others => return True;
|
||||
end case;
|
||||
end Get_Flag;
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
function Key_Name (Key : in Real_Key_Code) return String
|
||||
is
|
||||
@ -901,8 +850,10 @@ package body Terminal_Interface.Curses is
|
||||
function Get_KeyPad_Mode (Win : in Window := Standard_Window)
|
||||
return Boolean
|
||||
is
|
||||
function Is_Keypad (W : Window) return Curses_Bool;
|
||||
pragma Import (C, Is_Keypad, "is_keypad");
|
||||
begin
|
||||
return Get_Flag (Win, Offset_use_keypad);
|
||||
return (Is_Keypad (Win) /= Curses_Bool_False);
|
||||
end Get_KeyPad_Mode;
|
||||
|
||||
procedure Half_Delay (Amount : in Half_Delay_Amount)
|
||||
@ -1089,8 +1040,10 @@ package body Terminal_Interface.Curses is
|
||||
function Scrolling_Allowed (Win : Window := Standard_Window)
|
||||
return Boolean
|
||||
is
|
||||
function Is_Scroll_Ok (W : Window) return Curses_Bool;
|
||||
pragma Import (C, Is_Scroll_Ok, "is_scrollok");
|
||||
begin
|
||||
return Get_Flag (Win, Offset_scroll);
|
||||
return (Is_Scroll_Ok (Win) /= Curses_Bool_False);
|
||||
end Scrolling_Allowed;
|
||||
|
||||
procedure Set_Scroll_Region
|
||||
@ -2389,54 +2342,7 @@ package body Terminal_Interface.Curses is
|
||||
end if;
|
||||
end Nap_Milli_Seconds;
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
function Standard_Window return Window
|
||||
is
|
||||
Stdscr : Window;
|
||||
pragma Import (C, Stdscr, "stdscr");
|
||||
begin
|
||||
return Stdscr;
|
||||
end Standard_Window;
|
||||
|
||||
function Lines return Line_Count
|
||||
is
|
||||
C_Lines : C_Int;
|
||||
pragma Import (C, C_Lines, "LINES");
|
||||
begin
|
||||
return Line_Count (C_Lines);
|
||||
end Lines;
|
||||
|
||||
function Columns return Column_Count
|
||||
is
|
||||
C_Columns : C_Int;
|
||||
pragma Import (C, C_Columns, "COLS");
|
||||
begin
|
||||
return Column_Count (C_Columns);
|
||||
end Columns;
|
||||
|
||||
function Tab_Size return Natural
|
||||
is
|
||||
C_Tab_Size : C_Int;
|
||||
pragma Import (C, C_Tab_Size, "TABSIZE");
|
||||
begin
|
||||
return Natural (C_Tab_Size);
|
||||
end Tab_Size;
|
||||
|
||||
function Number_Of_Colors return Natural
|
||||
is
|
||||
C_Number_Of_Colors : C_Int;
|
||||
pragma Import (C, C_Number_Of_Colors, "COLORS");
|
||||
begin
|
||||
return Natural (C_Number_Of_Colors);
|
||||
end Number_Of_Colors;
|
||||
|
||||
function Number_Of_Color_Pairs return Natural
|
||||
is
|
||||
C_Number_Of_Color_Pairs : C_Int;
|
||||
pragma Import (C, C_Number_Of_Color_Pairs, "COLOR_PAIRS");
|
||||
begin
|
||||
return Natural (C_Number_Of_Color_Pairs);
|
||||
end Number_Of_Color_Pairs;
|
||||
include(`Public_Variables')
|
||||
------------------------------------------------------------------------------
|
||||
procedure Transform_Coordinates
|
||||
(W : in Window := Standard_Window;
|
@ -9,7 +9,7 @@ include(M4MACRO)----------------------------------------------------------------
|
||||
-- S P E C --
|
||||
-- --
|
||||
------------------------------------------------------------------------------
|
||||
-- Copyright (c) 1998-2004,2006 Free Software Foundation, Inc. --
|
||||
-- Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. --
|
||||
-- --
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a --
|
||||
-- copy of this software and associated documentation files (the --
|
||||
@ -37,8 +37,8 @@ include(M4MACRO)----------------------------------------------------------------
|
||||
------------------------------------------------------------------------------
|
||||
-- Author: Juergen Pfeifer, 1996
|
||||
-- Version Control:
|
||||
-- $Revision: 1.37 $
|
||||
-- $Date: 2006/06/25 14:30:22 $
|
||||
-- $Revision: 1.39 $
|
||||
-- $Date: 2007/03/31 23:36:32 $
|
||||
-- Binding Version 01.00
|
||||
------------------------------------------------------------------------------
|
||||
include(`Base_Defs')
|
||||
@ -188,25 +188,21 @@ include(`AC_Rep')
|
||||
function Number_Of_Color_Pairs return Natural;
|
||||
pragma Inline (Number_Of_Color_Pairs);
|
||||
|
||||
ACS_Map : array (Character'Val (0) .. Character'Val (127)) of
|
||||
Attributed_Character;
|
||||
pragma Import (C, ACS_Map, "acs_map");
|
||||
--
|
||||
--
|
||||
-- Constants for several characters from the Alternate Character Set
|
||||
-- You must use this constants as indices into the ACS_Map array
|
||||
-- to get the corresponding attributed character at runtime.
|
||||
--
|
||||
include(`ACS_Map')dnl
|
||||
|
||||
-- MANPAGE(`curs_initscr.3x')
|
||||
-- | Not implemented: newterm, set_term, delscreen, curscr
|
||||
-- | Not implemented: newterm, set_term, delscreen
|
||||
|
||||
-- ANCHOR(`stdscr',`Standard_Window')
|
||||
function Standard_Window return Window;
|
||||
-- AKA
|
||||
pragma Inline (Standard_Window);
|
||||
|
||||
-- ANCHOR(`curscr',`Current_Window')
|
||||
function Current_Window return Window;
|
||||
-- AKA
|
||||
pragma Inline (Current_Window);
|
||||
|
||||
-- ANCHOR(`initscr()',`Init_Screen')
|
||||
procedure Init_Screen;
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
-- B O D Y --
|
||||
-- --
|
||||
------------------------------------------------------------------------------
|
||||
-- Copyright (c) 2000-2004,2006 Free Software Foundation, Inc. --
|
||||
-- Copyright (c) 2000-2006,2007 Free Software Foundation, Inc. --
|
||||
-- --
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a --
|
||||
-- copy of this software and associated documentation files (the --
|
||||
@ -35,8 +35,8 @@
|
||||
------------------------------------------------------------------------------
|
||||
-- Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
|
||||
-- Version Control
|
||||
-- $Revision: 1.6 $
|
||||
-- $Date: 2006/06/25 14:24:40 $
|
||||
-- $Revision: 1.7 $
|
||||
-- $Date: 2007/03/31 23:45:22 $
|
||||
-- Binding Version 01.00
|
||||
------------------------------------------------------------------------------
|
||||
with ncurses2.util; use ncurses2.util;
|
||||
@ -237,16 +237,13 @@ procedure ncurses2.attr_test is
|
||||
result : out Boolean) is
|
||||
ch : constant Key_Code := Getchar;
|
||||
nc : constant Color_Number := Color_Number (Number_Of_Colors);
|
||||
curscr : Window;
|
||||
pragma Import (C, curscr, "curscr");
|
||||
-- curscr is not implemented in the Ada binding
|
||||
begin
|
||||
result := True;
|
||||
if Ada.Characters.Handling.Is_Digit (Character'Val (ch)) then
|
||||
skip := ctoi (Code_To_Char (ch));
|
||||
elsif ch = CTRL ('L') then
|
||||
Touch;
|
||||
Touch (curscr);
|
||||
Touch (Current_Window);
|
||||
Refresh;
|
||||
elsif Has_Colors then
|
||||
case ch is
|
||||
|
4
MANIFEST
4
MANIFEST
@ -20,6 +20,7 @@
|
||||
./Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4
|
||||
./Ada95/gen/terminal_interface-curses-panels.ads.m4
|
||||
./Ada95/gen/terminal_interface-curses-trace.ads.m4
|
||||
./Ada95/gen/terminal_interface-curses.adb.m4
|
||||
./Ada95/gen/terminal_interface-curses.ads.m4
|
||||
./Ada95/samples/Makefile.in
|
||||
./Ada95/samples/README
|
||||
@ -163,7 +164,6 @@
|
||||
./Ada95/src/terminal_interface-curses-text_io.adb
|
||||
./Ada95/src/terminal_interface-curses-text_io.ads
|
||||
./Ada95/src/terminal_interface-curses-trace.adb_p
|
||||
./Ada95/src/terminal_interface-curses.adb
|
||||
./Ada95/src/terminal_interface.ads
|
||||
./INSTALL
|
||||
./MANIFEST
|
||||
@ -710,7 +710,7 @@
|
||||
./mk-1st.awk
|
||||
./mk-2nd.awk
|
||||
./mk-hdr.awk
|
||||
./mkinstalldirs
|
||||
./mkdirs.sh
|
||||
./ncurses/Makefile.in
|
||||
./ncurses/README
|
||||
./ncurses/README.IZ
|
||||
|
15
NEWS
15
NEWS
@ -25,7 +25,7 @@
|
||||
-- sale, use or other dealings in this Software without prior written --
|
||||
-- authorization. --
|
||||
-------------------------------------------------------------------------------
|
||||
-- $Id: NEWS,v 1.1106 2007/03/24 22:58:37 tom Exp $
|
||||
-- $Id: NEWS,v 1.1109 2007/04/01 00:30:22 tom Exp $
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
This is a log of changes that ncurses has gone through since Zeyd started
|
||||
@ -45,12 +45,23 @@ See the AUTHORS file for the corresponding full names.
|
||||
Changes through 1.9.9e did not credit all contributions;
|
||||
it is not possible to add this information.
|
||||
|
||||
20070331
|
||||
+ modify Ada95 binding to build with --enable-reentrant by wrapping
|
||||
global variables (bug: acs_map does not yet work).
|
||||
+ modify Ada95 binding to use the new access-functions, allowing it
|
||||
to build/run when NCURSES_OPAQUE is set.
|
||||
+ add access-functions and macros to return properties of the WINDOW
|
||||
structure, e.g., when NCURSES_OPAQUE is set.
|
||||
+ improved install-sh's quoting.
|
||||
+ use mkdirs.sh rather than mkinstalldirs, e.g., to use fixes from
|
||||
other programs.
|
||||
|
||||
20070324
|
||||
+ eliminate part of the direct use of WINDOW data from Ada95 interface.
|
||||
+ fix substitutions for termlib filename to make configure option
|
||||
--enable-reentrant work with --with-termlib.
|
||||
+ change a constructor for NCursesWindow to allow compiling with
|
||||
NCURSES_OPAQUE defined, since we cannot pass a reference to
|
||||
NCURSES_OPAQUE set, since we cannot pass a reference to
|
||||
an opaque pointer.
|
||||
|
||||
20070317
|
||||
|
10
aclocal.m4
vendored
10
aclocal.m4
vendored
@ -28,7 +28,7 @@ dnl***************************************************************************
|
||||
dnl
|
||||
dnl Author: Thomas E. Dickey 1995-on
|
||||
dnl
|
||||
dnl $Id: aclocal.m4,v 1.427 2007/03/24 22:29:27 tom Exp $
|
||||
dnl $Id: aclocal.m4,v 1.428 2007/03/31 15:53:01 tom Exp $
|
||||
dnl Macros used in NCURSES auto-configuration script.
|
||||
dnl
|
||||
dnl These macros are maintained separately from NCURSES. The copyright on
|
||||
@ -2691,7 +2691,7 @@ AC_ARG_WITH(manpage-tbl,
|
||||
AC_MSG_RESULT($MANPAGE_TBL)
|
||||
])dnl
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl CF_MAN_PAGES version: 34 updated: 2007/03/17 16:15:10
|
||||
dnl CF_MAN_PAGES version: 35 updated: 2007/03/31 11:47:29
|
||||
dnl ------------
|
||||
dnl Try to determine if the man-pages on the system are compressed, and if
|
||||
dnl so, what format is used. Use this information to construct a script that
|
||||
@ -2757,7 +2757,7 @@ NCURSES_PATCH="$NCURSES_PATCH"
|
||||
NCURSES_OSPEED="$NCURSES_OSPEED"
|
||||
TERMINFO="$TERMINFO"
|
||||
|
||||
MKDIRS="sh `cd $srcdir && pwd`/mkinstalldirs"
|
||||
MKDIRS="sh `cd $srcdir && pwd`/mkdirs.sh"
|
||||
|
||||
INSTALL="$INSTALL"
|
||||
INSTALL_DATA="$INSTALL_DATA"
|
||||
@ -4592,7 +4592,7 @@ if test "$with_gpm" != no ; then
|
||||
fi
|
||||
])
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl CF_WITH_LIBTOOL version: 15 updated: 2007/03/17 16:15:10
|
||||
dnl CF_WITH_LIBTOOL version: 16 updated: 2007/03/25 18:05:48
|
||||
dnl ---------------
|
||||
dnl Provide a configure option to incorporate libtool. Define several useful
|
||||
dnl symbols for the makefile rules.
|
||||
@ -4668,7 +4668,7 @@ ifdef([AC_PROG_LIBTOOL],[
|
||||
fi
|
||||
])dnl
|
||||
LIB_CREATE='${LIBTOOL} --mode=link ${CC} -rpath ${DESTDIR}${libdir} -version-info `cut -f1 ${srcdir}/VERSION` -o'
|
||||
LIB_OBJECT='${OBJECTS}.o=.lo)'
|
||||
LIB_OBJECT='${OBJECTS:.o=.lo}'
|
||||
LIB_SUFFIX=.la
|
||||
LIB_CLEAN='${LIBTOOL} --mode=clean'
|
||||
LIB_COMPILE='${LIBTOOL} --mode=compile'
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $Id: Makefile.in,v 1.80 2007/03/17 18:28:05 tom Exp $
|
||||
# $Id: Makefile.in,v 1.81 2007/03/31 15:46:42 tom Exp $
|
||||
##############################################################################
|
||||
# Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. #
|
||||
# #
|
||||
@ -174,7 +174,7 @@ etip.h: $(srcdir)/etip.h.in $(srcdir)/edit_cfg.sh
|
||||
sh $(srcdir)/edit_cfg.sh ../include/ncurses_cfg.h $@
|
||||
|
||||
$(DESTDIR)$(libdir) :
|
||||
sh $(srcdir)/../mkinstalldirs $@
|
||||
sh $(srcdir)/../mkdirs.sh $@
|
||||
|
||||
install \
|
||||
install.libs:: ../lib/$(LIBNAME) $(DESTDIR)$(libdir)
|
||||
|
4
configure
vendored
4
configure
vendored
@ -4123,7 +4123,7 @@ echo "$as_me: error: Cannot find libtool" >&2;}
|
||||
{ (exit 1); exit 1; }; }
|
||||
fi
|
||||
LIB_CREATE='${LIBTOOL} --mode=link ${CC} -rpath ${DESTDIR}${libdir} -version-info `cut -f1 ${srcdir}/VERSION` -o'
|
||||
LIB_OBJECT='${OBJECTS}.o=.lo)'
|
||||
LIB_OBJECT='${OBJECTS:.o=.lo}'
|
||||
LIB_SUFFIX=.la
|
||||
LIB_CLEAN='${LIBTOOL} --mode=clean'
|
||||
LIB_COMPILE='${LIBTOOL} --mode=compile'
|
||||
@ -8116,7 +8116,7 @@ NCURSES_PATCH="$NCURSES_PATCH"
|
||||
NCURSES_OSPEED="$NCURSES_OSPEED"
|
||||
TERMINFO="$TERMINFO"
|
||||
|
||||
MKDIRS="sh `cd $srcdir && pwd`/mkinstalldirs"
|
||||
MKDIRS="sh `cd $srcdir && pwd`/mkdirs.sh"
|
||||
|
||||
INSTALL="$INSTALL"
|
||||
INSTALL_DATA="$INSTALL_DATA"
|
||||
|
6
dist.mk
6
dist.mk
@ -1,5 +1,5 @@
|
||||
##############################################################################
|
||||
# Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. #
|
||||
# Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
# copy of this software and associated documentation files (the "Software"), #
|
||||
@ -25,7 +25,7 @@
|
||||
# use or other dealings in this Software without prior written #
|
||||
# authorization. #
|
||||
##############################################################################
|
||||
# $Id: dist.mk,v 1.585 2007/03/24 15:38:05 tom Exp $
|
||||
# $Id: dist.mk,v 1.587 2007/04/01 00:32:37 tom Exp $
|
||||
# Makefile for creating ncurses distributions.
|
||||
#
|
||||
# This only needs to be used directly as a makefile by developers, but
|
||||
@ -37,7 +37,7 @@ SHELL = /bin/sh
|
||||
# These define the major/minor/patch versions of ncurses.
|
||||
NCURSES_MAJOR = 5
|
||||
NCURSES_MINOR = 6
|
||||
NCURSES_PATCH = 20070324
|
||||
NCURSES_PATCH = 20070331
|
||||
|
||||
# We don't append the patch to the version, since this only applies to releases
|
||||
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $Id: Makefile.in,v 1.44 2007/03/03 20:51:25 tom Exp $
|
||||
# $Id: Makefile.in,v 1.45 2007/03/31 15:46:42 tom Exp $
|
||||
##############################################################################
|
||||
# Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. #
|
||||
# #
|
||||
@ -124,7 +124,7 @@ sources : $(AUTO_SRC)
|
||||
|
||||
$(DESTDIR)$(bindir) \
|
||||
$(DESTDIR)$(libdir) :
|
||||
sh $(srcdir)/../mkinstalldirs $@
|
||||
sh $(srcdir)/../mkdirs.sh $@
|
||||
|
||||
# make copies to simplify include-paths while still keeping form's include
|
||||
# file in this directory.
|
||||
|
@ -32,7 +32,7 @@
|
||||
* and: Thomas E. Dickey 1996-on *
|
||||
****************************************************************************/
|
||||
|
||||
/* $Id: curses.h.in,v 1.170 2007/03/10 18:15:33 tom Exp $ */
|
||||
/* $Id: curses.h.in,v 1.172 2007/03/31 20:46:06 tom Exp $ */
|
||||
|
||||
#ifndef __NCURSES_H
|
||||
#define __NCURSES_H
|
||||
@ -144,7 +144,7 @@ typedef unsigned @cf_cv_typeof_mmask_t@ mmask_t;
|
||||
#include <stddef.h> /* we want wchar_t */
|
||||
#endif /* _XOPEN_SOURCE_EXTENDED */
|
||||
|
||||
/* XSI and SVr4 specify that curses implements 'bool'. However, C++ may also
|
||||
/* X/Open and SVr4 specify that curses implements 'bool'. However, C++ may also
|
||||
* implement it. If so, we must use the C++ compiler's type to avoid conflict
|
||||
* with other interfaces.
|
||||
*
|
||||
@ -191,7 +191,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* XSI attributes. In the ncurses implementation, they are identical to the
|
||||
* X/Open attributes. In the ncurses implementation, they are identical to the
|
||||
* A_ attributes.
|
||||
*/
|
||||
#define WA_ATTRIBUTES A_ATTRIBUTES
|
||||
@ -416,28 +416,6 @@ struct _win_st
|
||||
};
|
||||
#endif /* NCURSES_OPAQUE */
|
||||
|
||||
/*
|
||||
* These functions are extensions - not in XSI Curses.
|
||||
*/
|
||||
#if @NCURSES_EXT_FUNCS@
|
||||
extern NCURSES_EXPORT(bool) is_term_resized (int, int);
|
||||
extern NCURSES_EXPORT(char *) keybound (int, int);
|
||||
extern NCURSES_EXPORT(const char *) curses_version (void);
|
||||
extern NCURSES_EXPORT(int) assume_default_colors (int, int);
|
||||
extern NCURSES_EXPORT(int) define_key (const char *, int);
|
||||
extern NCURSES_EXPORT(int) key_defined (const char *);
|
||||
extern NCURSES_EXPORT(int) keyok (int, bool);
|
||||
extern NCURSES_EXPORT(int) resize_term (int, int);
|
||||
extern NCURSES_EXPORT(int) resizeterm (int, int);
|
||||
extern NCURSES_EXPORT(int) use_default_colors (void);
|
||||
extern NCURSES_EXPORT(int) use_extended_names (bool);
|
||||
extern NCURSES_EXPORT(int) use_legacy_coding (int);
|
||||
extern NCURSES_EXPORT(int) wresize (WINDOW *, int, int);
|
||||
extern NCURSES_EXPORT(void) nofilter(void);
|
||||
#else
|
||||
#define curses_version() NCURSES_VERSION
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This is an extension to support events...
|
||||
*/
|
||||
@ -530,7 +508,7 @@ extern NCURSES_EXPORT(int) wgetnstr_events(WINDOW *,char *,int,_nc_eventlist *);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Function prototypes. This is the complete XSI Curses list of required
|
||||
* Function prototypes. This is the complete X/Open Curses list of required
|
||||
* functions. Those marked `generated' will have sources generated from the
|
||||
* macro definitions later in this file, in order to satisfy XPG4.2
|
||||
* requirements.
|
||||
@ -838,12 +816,50 @@ extern NCURSES_EXPORT(int) getparx (const WINDOW *); /* generated */
|
||||
extern NCURSES_EXPORT(int) getpary (const WINDOW *); /* generated */
|
||||
|
||||
/*
|
||||
* vid_attr() was implemented originally based on a draft of XSI curses.
|
||||
* vid_attr() was implemented originally based on a draft of X/Open curses.
|
||||
*/
|
||||
#ifndef _XOPEN_SOURCE_EXTENDED
|
||||
#define vid_attr(a,pair,opts) vidattr(a)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* These functions are extensions - not in X/Open Curses.
|
||||
*/
|
||||
#if @NCURSES_EXT_FUNCS@
|
||||
extern NCURSES_EXPORT(bool) is_term_resized (int, int);
|
||||
extern NCURSES_EXPORT(char *) keybound (int, int);
|
||||
extern NCURSES_EXPORT(const char *) curses_version (void);
|
||||
extern NCURSES_EXPORT(int) assume_default_colors (int, int);
|
||||
extern NCURSES_EXPORT(int) define_key (const char *, int);
|
||||
extern NCURSES_EXPORT(int) key_defined (const char *);
|
||||
extern NCURSES_EXPORT(int) keyok (int, bool);
|
||||
extern NCURSES_EXPORT(int) resize_term (int, int);
|
||||
extern NCURSES_EXPORT(int) resizeterm (int, int);
|
||||
extern NCURSES_EXPORT(int) use_default_colors (void);
|
||||
extern NCURSES_EXPORT(int) use_extended_names (bool);
|
||||
extern NCURSES_EXPORT(int) use_legacy_coding (int);
|
||||
extern NCURSES_EXPORT(int) wresize (WINDOW *, int, int);
|
||||
extern NCURSES_EXPORT(void) nofilter(void);
|
||||
|
||||
/*
|
||||
* These extensions provide access to information stored in the WINDOW even
|
||||
* when NCURSES_OPAQUE is set:
|
||||
*/
|
||||
extern NCURSES_EXPORT(bool) is_cleared (WINDOW *); /* generated */
|
||||
extern NCURSES_EXPORT(bool) is_idcok (WINDOW *); /* generated */
|
||||
extern NCURSES_EXPORT(bool) is_idlok (WINDOW *); /* generated */
|
||||
extern NCURSES_EXPORT(bool) is_immedok (WINDOW *); /* generated */
|
||||
extern NCURSES_EXPORT(bool) is_keypad (WINDOW *); /* generated */
|
||||
extern NCURSES_EXPORT(bool) is_leaveok (WINDOW *); /* generated */
|
||||
extern NCURSES_EXPORT(bool) is_nodelay (WINDOW *); /* generated */
|
||||
extern NCURSES_EXPORT(bool) is_notimeout (WINDOW *); /* generated */
|
||||
extern NCURSES_EXPORT(bool) is_scrollok (WINDOW *); /* generated */
|
||||
extern NCURSES_EXPORT(bool) is_syncok (WINDOW *); /* generated */
|
||||
|
||||
#else
|
||||
#define curses_version() NCURSES_VERSION
|
||||
#endif
|
||||
|
||||
/* attributes */
|
||||
|
||||
#define NCURSES_ATTR_SHIFT 8
|
||||
@ -1089,7 +1105,7 @@ extern NCURSES_EXPORT(int) getpary (const WINDOW *); /* generated */
|
||||
#endif /* NCURSES_OPAQUE */
|
||||
|
||||
/*
|
||||
* XSI curses deprecates SVr4 vwprintw/vwscanw, which are supposed to use
|
||||
* X/Open curses deprecates SVr4 vwprintw/vwscanw, which are supposed to use
|
||||
* varargs.h. It adds new calls vw_printw/vw_scanw, which are supposed to
|
||||
* use POSIX stdarg.h. The ncurses versions of vwprintw/vwscanw already
|
||||
* use stdarg.h, so...
|
||||
@ -1105,6 +1121,24 @@ extern NCURSES_EXPORT(int) getpary (const WINDOW *); /* generated */
|
||||
NCURSES_EXPORT(int) vsscanf(const char *, const char *, va_list);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* These macros are extensions - not in X/Open Curses.
|
||||
*/
|
||||
#if @NCURSES_EXT_FUNCS@
|
||||
#if !NCURSES_OPAQUE
|
||||
#define is_cleared(win) ((win)->_clear)
|
||||
#define is_idcok(win) ((win)->_idcok)
|
||||
#define is_idlok(win) ((win)->_idlok)
|
||||
#define is_immedok(win) ((win)->_immed)
|
||||
#define is_keypad(win) ((win)->_use_keypad)
|
||||
#define is_leaveok(win) ((win)->_leaveok)
|
||||
#define is_nodelay(win) ((win)->_delay == 0)
|
||||
#define is_notimeout(win) ((win)->_notimeout)
|
||||
#define is_scrollok(win) ((win)->_scroll)
|
||||
#define is_syncok(win) ((win)->_sync)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* NCURSES_NOMACROS */
|
||||
|
||||
/*
|
||||
|
139
install-sh
139
install-sh
@ -1,19 +1,37 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# install - install a program, script, or datafile
|
||||
# This comes from X11R5 (mit/util/scripts/install.sh).
|
||||
#
|
||||
# Copyright 1991 by the Massachusetts Institute of Technology
|
||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||
# following copyright and license.
|
||||
#
|
||||
# Permission to use, copy, modify, distribute, and sell this software and its
|
||||
# documentation for any purpose is hereby granted without fee, provided that
|
||||
# the above copyright notice appear in all copies and that both that
|
||||
# copyright notice and this permission notice appear in supporting
|
||||
# documentation, and that the name of M.I.T. not be used in advertising or
|
||||
# publicity pertaining to distribution of the software without specific,
|
||||
# written prior permission. M.I.T. makes no representations about the
|
||||
# suitability of this software for any purpose. It is provided "as is"
|
||||
# without express or implied warranty.
|
||||
# Copyright (C) 1994 X Consortium
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
# Except as contained in this notice, the name of the X Consortium shall not
|
||||
# be used in advertising or otherwise to promote the sale, use or other deal-
|
||||
# ings in this Software without prior written authorization from the X Consor-
|
||||
# tium.
|
||||
#
|
||||
#
|
||||
# FSF changes to this file are in the public domain.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
@ -56,7 +74,7 @@ dir_arg=""
|
||||
|
||||
while [ x"$1" != x ]; do
|
||||
case $1 in
|
||||
-c) instcmd="$cpprog"
|
||||
-c) instcmd=$cpprog
|
||||
shift
|
||||
continue;;
|
||||
|
||||
@ -79,7 +97,7 @@ while [ x"$1" != x ]; do
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-s) stripcmd="$stripprog"
|
||||
-s) stripcmd=$stripprog
|
||||
shift
|
||||
continue;;
|
||||
|
||||
@ -106,7 +124,7 @@ done
|
||||
|
||||
if [ x"$src" = x ]
|
||||
then
|
||||
echo "install: no input file specified"
|
||||
echo "$0: no input file specified" >&2
|
||||
exit 1
|
||||
else
|
||||
:
|
||||
@ -116,7 +134,7 @@ if [ x"$dir_arg" != x ]; then
|
||||
dst=$src
|
||||
src=""
|
||||
|
||||
if [ -d $dst ]; then
|
||||
if [ -d "$dst" ]; then
|
||||
instcmd=:
|
||||
chmodcmd=""
|
||||
else
|
||||
@ -128,17 +146,17 @@ else
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
|
||||
if [ -f $src -o -d $src ]
|
||||
if [ -f "$src" ] || [ -d "$src" ]
|
||||
then
|
||||
:
|
||||
else
|
||||
echo "install: $src does not exist"
|
||||
echo "$0: $src does not exist" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ x"$dst" = x ]
|
||||
then
|
||||
echo "install: no destination specified"
|
||||
echo "$0: no destination specified" >&2
|
||||
exit 1
|
||||
else
|
||||
:
|
||||
@ -147,16 +165,16 @@ else
|
||||
# If destination is a directory, append the input filename; if your system
|
||||
# does not like double slashes in filenames, you may need to add some logic
|
||||
|
||||
if [ -d $dst ]
|
||||
if [ -d "$dst" ]
|
||||
then
|
||||
dst="$dst"/`basename $src`
|
||||
dst=$dst/`basename "$src"`
|
||||
else
|
||||
:
|
||||
fi
|
||||
fi
|
||||
|
||||
## this sed command emulates the dirname command
|
||||
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||
dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||
|
||||
# Make sure that the destination directory exists.
|
||||
# this part is taken from Noah Friedman's mkinstalldirs script
|
||||
@ -165,48 +183,48 @@ dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||
if [ ! -d "$dstdir" ]; then
|
||||
defaultIFS='
|
||||
'
|
||||
IFS="${IFS-${defaultIFS}}"
|
||||
IFS="${IFS-$defaultIFS}"
|
||||
|
||||
oIFS="${IFS}"
|
||||
oIFS=$IFS
|
||||
# Some sh's can't handle IFS=/ for some reason.
|
||||
IFS='%'
|
||||
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||
IFS="${oIFS}"
|
||||
set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||
IFS=$oIFS
|
||||
|
||||
pathcomp=''
|
||||
|
||||
while [ $# -ne 0 ] ; do
|
||||
pathcomp="${pathcomp}${1}"
|
||||
pathcomp=$pathcomp$1
|
||||
shift
|
||||
|
||||
if [ ! -d "${pathcomp}" ] ;
|
||||
if [ ! -d "$pathcomp" ] ;
|
||||
then
|
||||
$mkdirprog "${pathcomp}"
|
||||
$mkdirprog "$pathcomp"
|
||||
else
|
||||
:
|
||||
fi
|
||||
|
||||
pathcomp="${pathcomp}/"
|
||||
pathcomp=$pathcomp/
|
||||
done
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]
|
||||
then
|
||||
$doit $instcmd $dst &&
|
||||
$doit $instcmd "$dst" &&
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi
|
||||
else
|
||||
|
||||
# If we're going to rename the final executable, determine the name now.
|
||||
|
||||
if [ x"$transformarg" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
dstfile=`basename "$dst"`
|
||||
else
|
||||
dstfile=`basename $dst $transformbasename |
|
||||
dstfile=`basename "$dst" $transformbasename |
|
||||
sed $transformarg`$transformbasename
|
||||
fi
|
||||
|
||||
@ -214,20 +232,24 @@ else
|
||||
|
||||
if [ x"$dstfile" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
dstfile=`basename "$dst"`
|
||||
else
|
||||
:
|
||||
fi
|
||||
|
||||
# Make a temp file name in the proper directory.
|
||||
# Make a couple of temp file names in the proper directory.
|
||||
|
||||
dsttmp=$dstdir/#inst.$$#
|
||||
rmtmp=$dstdir/#rm.$$#
|
||||
|
||||
# Trap to clean up temp files at exit.
|
||||
|
||||
trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
|
||||
trap '(exit $?); exit' 1 2 13 15
|
||||
|
||||
# Move or copy the file name to the temp name
|
||||
|
||||
$doit $instcmd $src $dsttmp &&
|
||||
|
||||
trap "rm -f ${dsttmp}" 0 &&
|
||||
$doit $instcmd "$src" "$dsttmp" &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits
|
||||
|
||||
@ -235,17 +257,38 @@ else
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $instcmd $src $dsttmp" command.
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi &&
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi &&
|
||||
|
||||
# Now remove or move aside any old file at destination location. We try this
|
||||
# two ways since rm can't unlink itself on some systems and the destination
|
||||
# file might be busy for other reasons. In this case, the final cleanup
|
||||
# might fail but the new file should still install successfully.
|
||||
|
||||
{
|
||||
if [ -f "$dstdir/$dstfile" ]
|
||||
then
|
||||
$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null ||
|
||||
$doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null ||
|
||||
{
|
||||
echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
|
||||
(exit 1); exit
|
||||
}
|
||||
else
|
||||
:
|
||||
fi
|
||||
} &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
|
||||
$doit $rmcmd -f $dstdir/$dstfile &&
|
||||
$doit $mvcmd $dsttmp $dstdir/$dstfile
|
||||
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
|
||||
|
||||
fi &&
|
||||
|
||||
# The final little trick to "correctly" pass the exit status to the exit trap.
|
||||
|
||||
exit 0
|
||||
{
|
||||
(exit 0); exit
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
# $Id: Makefile.in,v 1.40 2006/12/24 20:16:32 tom Exp $
|
||||
# $Id: Makefile.in,v 1.41 2007/03/31 15:54:06 tom Exp $
|
||||
##############################################################################
|
||||
# Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. #
|
||||
# Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
# copy of this software and associated documentation files (the "Software"), #
|
||||
@ -52,7 +52,7 @@ depend :
|
||||
tags :
|
||||
|
||||
$(DESTDIR)$(mandir) :
|
||||
sh $(srcdir)/../mkinstalldirs $@
|
||||
sh $(srcdir)/../mkdirs.sh $@
|
||||
|
||||
EDITARGS = $(DESTDIR)$(mandir) $(srcdir) terminfo.5 $(srcdir)/*.[0-9]*
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $Id: Makefile.in,v 1.45 2007/03/03 20:51:25 tom Exp $
|
||||
# $Id: Makefile.in,v 1.46 2007/03/31 15:46:42 tom Exp $
|
||||
##############################################################################
|
||||
# Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. #
|
||||
# #
|
||||
@ -126,7 +126,7 @@ sources : $(AUTO_SRC)
|
||||
|
||||
$(DESTDIR)$(bindir) \
|
||||
$(DESTDIR)$(libdir) :
|
||||
sh $(srcdir)/../mkinstalldirs $@
|
||||
sh $(srcdir)/../mkdirs.sh $@
|
||||
|
||||
# make copies to simplify include-paths while still keeping menu's include
|
||||
# file in this directory.
|
||||
|
@ -1,6 +1,6 @@
|
||||
# $Id: Makefile.in,v 1.42 2006/12/31 00:11:06 tom Exp $
|
||||
# $Id: Makefile.in,v 1.43 2007/03/31 15:54:17 tom Exp $
|
||||
##############################################################################
|
||||
# Copyright (c) 1998-2004,2006 Free Software Foundation, Inc. #
|
||||
# Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
# copy of this software and associated documentation files (the "Software"), #
|
||||
@ -119,7 +119,7 @@ $(DESTDIR)$(bindir) \
|
||||
$(DESTDIR)$(libdir) \
|
||||
$(DESTDIR)$(datadir) \
|
||||
$(DESTDIR)$(tabsetdir) :
|
||||
$(SHELL) $(top_srcdir)/mkinstalldirs $@
|
||||
$(SHELL) $(top_srcdir)/mkdirs.sh $@
|
||||
|
||||
uninstall : uninstall.data uninstall.libs
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# $Id: mk-hdr.awk,v 1.1 2007/01/13 19:44:22 tom Exp $
|
||||
# $Id: mk-hdr.awk,v 1.2 2007/03/31 15:48:45 tom Exp $
|
||||
##############################################################################
|
||||
# Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. #
|
||||
# Copyright (c) 2007 Free Software Foundation, Inc. #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
# copy of this software and associated documentation files (the "Software"), #
|
||||
@ -74,7 +74,7 @@ END {
|
||||
if ( count > 0 )
|
||||
{
|
||||
print "${DESTDIR}${includedir} :"
|
||||
print " sh ${srcdir}/../mkinstalldirs $@"
|
||||
print " sh ${srcdir}/../mkdirs.sh $@"
|
||||
print ""
|
||||
print "install \\"
|
||||
print "install.libs \\"
|
||||
|
19
mkinstalldirs → mkdirs.sh
Executable file → Normal file
19
mkinstalldirs → mkdirs.sh
Executable file → Normal file
@ -1,10 +1,12 @@
|
||||
#! /bin/sh
|
||||
# $Id: mkdirs.sh,v 1.5 2007/03/25 22:29:46 tom Exp $
|
||||
# -----------------------------------------------------------------------------
|
||||
# mkinstalldirs --- make directory hierarchy
|
||||
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
|
||||
# Created: 1993-05-16
|
||||
# Last modified: 1994-03-25
|
||||
# Public domain
|
||||
#
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
errstatus=0
|
||||
umask 022
|
||||
@ -24,8 +26,19 @@ for file in ${1+"$@"} ; do
|
||||
echo "mkdir $pathcomp" 1>&2
|
||||
case "$pathcomp" in
|
||||
[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]: )
|
||||
;; # DOSISH systems
|
||||
* ) mkdir "$pathcomp" || errstatus=$? ;;
|
||||
;; # DOSISH systems
|
||||
* )
|
||||
mkdir "$pathcomp"
|
||||
errstatus=$?
|
||||
if test $errstatus != 0
|
||||
then
|
||||
# may have failed if invoked in a parallel "make -j# install"
|
||||
if test -d "$pathcomp"
|
||||
then
|
||||
errstatus=0
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $Id: Makefile.in,v 1.103 2007/02/24 21:50:17 tom Exp $
|
||||
# $Id: Makefile.in,v 1.104 2007/03/31 15:46:42 tom Exp $
|
||||
##############################################################################
|
||||
# Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. #
|
||||
# #
|
||||
@ -178,7 +178,7 @@ sources: $(AUTO_SRC)
|
||||
|
||||
$(DESTDIR)$(bindir) \
|
||||
$(DESTDIR)$(libdir) :
|
||||
sh $(srcdir)/../mkinstalldirs $@
|
||||
sh $(srcdir)/../mkdirs.sh $@
|
||||
|
||||
../lib : ; mkdir $@
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $Id: Makefile.in,v 1.49 2007/03/03 20:51:25 tom Exp $
|
||||
# $Id: Makefile.in,v 1.50 2007/03/31 15:46:42 tom Exp $
|
||||
##############################################################################
|
||||
# Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. #
|
||||
# #
|
||||
@ -125,7 +125,7 @@ sources: $(AUTO_SRC)
|
||||
|
||||
$(DESTDIR)$(bindir) \
|
||||
$(DESTDIR)$(libdir) :
|
||||
sh $(srcdir)/../mkinstalldirs $@
|
||||
sh $(srcdir)/../mkdirs.sh $@
|
||||
|
||||
# make a copy to simplify include-paths while still keeping panel's include
|
||||
# file in this directory.
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $Id: Makefile.in,v 1.71 2007/01/13 17:33:52 tom Exp $
|
||||
# $Id: Makefile.in,v 1.72 2007/03/31 15:46:42 tom Exp $
|
||||
##############################################################################
|
||||
# Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. #
|
||||
# #
|
||||
@ -200,7 +200,7 @@ uninstall.progs:
|
||||
-@rm -f $(DESTDIR)$(bindir)/$(actual_reset)
|
||||
|
||||
$(DESTDIR)$(bindir) :
|
||||
sh $(srcdir)/../mkinstalldirs $@
|
||||
sh $(srcdir)/../mkdirs.sh $@
|
||||
|
||||
#
|
||||
# Utilities normally built by make all start here
|
||||
|
Loading…
Reference in New Issue
Block a user