mirror of
https://github.com/Aigor44/ncursesw-morphos.git
synced 2024-11-27 06:49:54 +08:00
ncurses 5.6 - patch 20070812
+ amend treatment of infocmp "-r" option to retain the 1023-byte limit unless "-T" is given (cf: 981017). + modify comp_captab.c generation to use big-strings. + make _nc_capalias_table and _nc_infoalias_table private accessed via _nc_get_alias_table() since the tables are used only within the tic library. + modify configure script to skip Intel compiler in CF_C_INLINE. + make _nc_info_hash_table and _nc_cap_hash_table private accessed via _nc_get_hash_table() since the tables are used only within the tic library.
This commit is contained in:
parent
03a795bde5
commit
cd858895e9
14
NEWS
14
NEWS
@ -25,7 +25,7 @@
|
||||
-- sale, use or other dealings in this Software without prior written --
|
||||
-- authorization. --
|
||||
-------------------------------------------------------------------------------
|
||||
-- $Id: NEWS,v 1.1148 2007/07/28 22:19:17 tom Exp $
|
||||
-- $Id: NEWS,v 1.1151 2007/08/12 13:56:58 tom Exp $
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
This is a log of changes that ncurses has gone through since Zeyd started
|
||||
@ -45,6 +45,18 @@ 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.
|
||||
|
||||
20070812
|
||||
+ amend treatment of infocmp "-r" option to retain the 1023-byte limit
|
||||
unless "-T" is given (cf: 981017).
|
||||
+ modify comp_captab.c generation to use big-strings.
|
||||
+ make _nc_capalias_table and _nc_infoalias_table private accessed via
|
||||
_nc_get_alias_table() since the tables are used only within the tic
|
||||
library.
|
||||
+ modify configure script to skip Intel compiler in CF_C_INLINE.
|
||||
+ make _nc_info_hash_table and _nc_cap_hash_table private accessed via
|
||||
_nc_get_hash_table() since the tables are used only within the tic
|
||||
library.
|
||||
|
||||
20070728
|
||||
+ make _nc_capalias_table and _nc_infoalias_table private, accessed via
|
||||
_nc_get_alias_table() since they are used only by parse_entry.c
|
||||
|
54
aclocal.m4
vendored
54
aclocal.m4
vendored
@ -28,7 +28,7 @@ dnl***************************************************************************
|
||||
dnl
|
||||
dnl Author: Thomas E. Dickey 1995-on
|
||||
dnl
|
||||
dnl $Id: aclocal.m4,v 1.435 2007/07/14 13:40:10 tom Exp $
|
||||
dnl $Id: aclocal.m4,v 1.436 2007/08/11 18:12:19 tom Exp $
|
||||
dnl Macros used in NCURSES auto-configuration script.
|
||||
dnl
|
||||
dnl These macros are maintained separately from NCURSES. The copyright on
|
||||
@ -747,7 +747,7 @@ fi
|
||||
test "$cf_cv_cpp_static_cast" = yes && AC_DEFINE(CPP_HAS_STATIC_CAST)
|
||||
])dnl
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl CF_C_INLINE version: 1 updated: 2007/04/28 15:03:44
|
||||
dnl CF_C_INLINE version: 2 updated: 2007/08/11 14:09:50
|
||||
dnl -----------
|
||||
dnl Check if the C compiler supports "inline".
|
||||
dnl $1 is the name of a shell variable to set if inline is supported
|
||||
@ -756,22 +756,25 @@ AC_DEFUN([CF_C_INLINE],[
|
||||
AC_C_INLINE
|
||||
$1=
|
||||
if test "$ac_cv_c_inline" != no ; then
|
||||
$1=inline
|
||||
if test "$GCC" = yes
|
||||
then
|
||||
AC_CACHE_CHECK(if gcc supports options to tune inlining,cf_cv_gcc_inline,[
|
||||
cf_save_CFLAGS=$CFLAGS
|
||||
CFLAGS="$CFLAGS --param max-inline-insns-single=$2"
|
||||
AC_TRY_COMPILE([inline int foo(void) { return 1; }],
|
||||
[${cf_cv_main_return:-return} foo()],
|
||||
[cf_cv_gcc_inline=yes],
|
||||
[cf_cv_gcc_inline=no])
|
||||
CFLAGS=$cf_save_CFLAGS
|
||||
])
|
||||
if test "$cf_cv_gcc_inline" = yes ; then
|
||||
CF_ADD_CFLAGS([--param max-inline-insns-single=$2])
|
||||
fi
|
||||
fi
|
||||
$1=inline
|
||||
if test "$INTEL_COMPILER" = yes
|
||||
then
|
||||
:
|
||||
elif test "$GCC" = yes
|
||||
then
|
||||
AC_CACHE_CHECK(if gcc supports options to tune inlining,cf_cv_gcc_inline,[
|
||||
cf_save_CFLAGS=$CFLAGS
|
||||
CFLAGS="$CFLAGS --param max-inline-insns-single=$2"
|
||||
AC_TRY_COMPILE([inline int foo(void) { return 1; }],
|
||||
[${cf_cv_main_return:-return} foo()],
|
||||
[cf_cv_gcc_inline=yes],
|
||||
[cf_cv_gcc_inline=no])
|
||||
CFLAGS=$cf_save_CFLAGS
|
||||
])
|
||||
if test "$cf_cv_gcc_inline" = yes ; then
|
||||
CF_ADD_CFLAGS([--param max-inline-insns-single=$2])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
AC_SUBST($1)
|
||||
])dnl
|
||||
@ -1065,7 +1068,7 @@ esac
|
||||
|
||||
])dnl
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl CF_GCC_ATTRIBUTES version: 10 updated: 2005/05/28 13:16:28
|
||||
dnl CF_GCC_ATTRIBUTES version: 11 updated: 2007/07/29 09:55:12
|
||||
dnl -----------------
|
||||
dnl Test for availability of useful gcc __attribute__ directives to quiet
|
||||
dnl compiler warnings. Though useful, not all are supported -- and contrary
|
||||
@ -1092,7 +1095,7 @@ if test "$GCC" = yes
|
||||
then
|
||||
AC_CHECKING([for $CC __attribute__ directives])
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line __oline__ "configure"
|
||||
#line __oline__ "${as_me-configure}"
|
||||
#include "confdefs.h"
|
||||
#include "conftest.h"
|
||||
#include "conftest.i"
|
||||
@ -1154,7 +1157,7 @@ if test "$GCC" = yes ; then
|
||||
fi
|
||||
])dnl
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl CF_GCC_WARNINGS version: 21 updated: 2007/06/27 18:12:15
|
||||
dnl CF_GCC_WARNINGS version: 22 updated: 2007/07/29 09:55:12
|
||||
dnl ---------------
|
||||
dnl Check if the compiler supports useful warning options. There's a few that
|
||||
dnl we don't use, simply because they're too noisy:
|
||||
@ -1179,7 +1182,7 @@ AC_REQUIRE([CF_GCC_VERSION])
|
||||
CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS)
|
||||
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line __oline__ "configure"
|
||||
#line __oline__ "${as_me-configure}"
|
||||
int main(int argc, char *argv[[]]) { return (argv[[argc-1]] == 0) ; }
|
||||
EOF
|
||||
|
||||
@ -3231,12 +3234,12 @@ if test "$cf_cv_func_mkstemp" = yes ; then
|
||||
fi
|
||||
])dnl
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl CF_MSG_LOG version: 3 updated: 1997/09/07 14:05:52
|
||||
dnl CF_MSG_LOG version: 4 updated: 2007/07/29 09:55:12
|
||||
dnl ----------
|
||||
dnl Write a debug message to config.log, along with the line number in the
|
||||
dnl configure script.
|
||||
AC_DEFUN([CF_MSG_LOG],[
|
||||
echo "(line __oline__) testing $* ..." 1>&AC_FD_CC
|
||||
echo "${as_me-configure}:__oline__: testing $* ..." 1>&AC_FD_CC
|
||||
])dnl
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl CF_NCURSES_ABI_6 version: 1 updated: 2005/09/17 18:42:49
|
||||
@ -4603,11 +4606,12 @@ AC_DEFUN([CF_UPPER],
|
||||
$1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
|
||||
])dnl
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl CF_VERBOSE version: 2 updated: 1997/09/05 10:45:14
|
||||
dnl CF_VERBOSE version: 3 updated: 2007/07/29 09:55:12
|
||||
dnl ----------
|
||||
dnl Use AC_VERBOSE w/o the warnings
|
||||
AC_DEFUN([CF_VERBOSE],
|
||||
[test -n "$verbose" && echo " $1" 1>&AC_FD_MSG
|
||||
CF_MSG_LOG([$1])
|
||||
])dnl
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl CF_WCHAR_TYPE version: 2 updated: 2004/01/17 19:18:20
|
||||
|
4
dist.mk
4
dist.mk
@ -25,7 +25,7 @@
|
||||
# use or other dealings in this Software without prior written #
|
||||
# authorization. #
|
||||
##############################################################################
|
||||
# $Id: dist.mk,v 1.604 2007/07/28 17:07:07 tom Exp $
|
||||
# $Id: dist.mk,v 1.606 2007/08/12 12:34:46 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 = 20070728
|
||||
NCURSES_PATCH = 20070812
|
||||
|
||||
# We don't append the patch to the version, since this only applies to releases
|
||||
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
|
||||
|
@ -33,7 +33,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Id: tic.h,v 1.61 2007/07/28 22:20:07 tom Exp $
|
||||
* $Id: tic.h,v 1.62 2007/08/11 16:12:43 tom Exp $
|
||||
* tic.h - Global variables and structures for the terminfo
|
||||
* compiler.
|
||||
*/
|
||||
@ -204,9 +204,6 @@ struct alias
|
||||
const char *source;
|
||||
};
|
||||
|
||||
extern NCURSES_EXPORT_VAR(const short) _nc_info_hash_table[];
|
||||
extern NCURSES_EXPORT_VAR(const short) _nc_cap_hash_table[];
|
||||
|
||||
extern NCURSES_EXPORT(const struct name_table_entry *) _nc_get_table (bool);
|
||||
extern NCURSES_EXPORT(const short *) _nc_get_hash_table (bool);
|
||||
extern NCURSES_EXPORT(const struct alias *) _nc_get_alias_table (bool);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2000,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 *
|
||||
@ -28,7 +28,7 @@
|
||||
|
||||
#include <curses.priv.h>
|
||||
|
||||
MODULE_ID("$Id: memmove.c,v 1.4 2000/12/10 02:43:28 tom Exp $")
|
||||
MODULE_ID("$Id: memmove.c,v 1.5 2007/08/11 17:12:43 tom Exp $")
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Thomas E. Dickey <dickey@clark.net> 1998 *
|
||||
@ -51,7 +51,7 @@ _nc_memmove(void *s1, const void *s2, size_t n)
|
||||
}
|
||||
for (j = 0; j < n; j++)
|
||||
bfr[j] = SRC[j];
|
||||
SRC = bfr;
|
||||
s2 = bfr;
|
||||
}
|
||||
while (n-- != 0)
|
||||
DST[n] = SRC[n];
|
||||
|
@ -34,7 +34,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* $Id: curses.priv.h,v 1.335 2007/07/16 20:32:12 tom Exp $
|
||||
* $Id: curses.priv.h,v 1.337 2007/08/12 13:14:12 tom Exp $
|
||||
*
|
||||
* curses.priv.h
|
||||
*
|
||||
@ -1262,6 +1262,21 @@ extern NCURSES_EXPORT(int) _nc_to_char(wint_t);
|
||||
extern NCURSES_EXPORT(wint_t) _nc_to_widechar(int);
|
||||
#endif
|
||||
|
||||
/* comp_captab.c */
|
||||
typedef struct {
|
||||
short nte_name; /* offset of name to hash on */
|
||||
int nte_type; /* BOOLEAN, NUMBER or STRING */
|
||||
short nte_index; /* index of associated variable in its array */
|
||||
short nte_link; /* index in table of next hash, or -1 */
|
||||
} name_table_data;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
short from;
|
||||
short to;
|
||||
short source;
|
||||
} alias_table_data;
|
||||
|
||||
/* doupdate.c */
|
||||
#if USE_XMC_SUPPORT
|
||||
extern NCURSES_EXPORT(void) _nc_do_xmc_glitch (attr_t);
|
||||
@ -1395,6 +1410,7 @@ extern NCURSES_EXPORT(void) _nc_trace_tries (TRIES *);
|
||||
#if NO_LEAKS
|
||||
extern NCURSES_EXPORT(void) _nc_alloc_entry_leaks(void);
|
||||
extern NCURSES_EXPORT(void) _nc_captoinfo_leaks(void);
|
||||
extern NCURSES_EXPORT(void) _nc_comp_captab_leaks(void);
|
||||
extern NCURSES_EXPORT(void) _nc_comp_scan_leaks(void);
|
||||
extern NCURSES_EXPORT(void) _nc_keyname_leaks(void);
|
||||
extern NCURSES_EXPORT(void) _nc_tgetent_leaks(void);
|
||||
|
@ -1,5 +1,5 @@
|
||||
##############################################################################
|
||||
# Copyright (c) 1998-2000,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,27 +25,70 @@
|
||||
# use or other dealings in this Software without prior written #
|
||||
# authorization. #
|
||||
##############################################################################
|
||||
# $Id: MKcaptab.awk,v 1.17 2007/07/28 20:43:37 tom Exp $
|
||||
# $Id: MKcaptab.awk,v 1.20 2007/08/12 00:26:15 tom Exp $
|
||||
function add_string(text) {
|
||||
if (text != "IGNORE") {
|
||||
offsets[num_strings] = offset;
|
||||
offset = offset + length(text) + 1;
|
||||
printf "%s\\0", text;
|
||||
} else {
|
||||
offsets[num_strings] = -1;
|
||||
}
|
||||
num_strings = num_strings + 1;
|
||||
if ((num_strings % 3) == 0) {
|
||||
printf "\\\n";
|
||||
}
|
||||
return offsets[num_strings - 1];
|
||||
}
|
||||
BEGIN {
|
||||
first = 1;
|
||||
num_aliases = 0;
|
||||
num_strings = 0;
|
||||
offset = 0;
|
||||
}
|
||||
|
||||
/^[^#]/ {
|
||||
if (first) {
|
||||
printf "/* generated by MKcaptab.awk %s(%d) */\n", tablename, bigstrings;
|
||||
printf "const struct alias _nc_%s_table[] =\n", tablename;
|
||||
printf "{\n";
|
||||
print ""
|
||||
if (bigstrings) {
|
||||
printf "static struct alias *_nc_%s_table = 0;\n", tablename;
|
||||
print "";
|
||||
printf "static const char %s_text[] = \"\\\n", tablename;
|
||||
} else {
|
||||
printf "static const struct alias _nc_%s_table[] =\n", tablename;
|
||||
printf "{\n";
|
||||
}
|
||||
first = 0;
|
||||
}
|
||||
if ($1 == tablename) {
|
||||
if ($3 == "IGNORE")
|
||||
if ($3 == "IGNORE") {
|
||||
to = "(char *)NULL";
|
||||
else
|
||||
} else {
|
||||
to = "\"" $3 "\"";
|
||||
printf "\t{\"%s\", %s, \"%s\"},\t /* %s */\n", $2, to, $4, $5;
|
||||
}
|
||||
if (bigstrings) {
|
||||
c1 = add_string($2);
|
||||
c2 = add_string($3);
|
||||
c3 = add_string($4);
|
||||
aliases[num_aliases] = sprintf("\t{%5d, %5d, %5d},\t /* %s */", c1, c2, c3, $5);
|
||||
num_aliases = num_aliases + 1;
|
||||
} else {
|
||||
printf "\t{\"%s\", %s, \"%s\"},\t /* %s */\n", $2, to, $4, $5;
|
||||
}
|
||||
}
|
||||
}
|
||||
END {
|
||||
printf "\t{(char *)NULL, (char *)NULL, (char *)NULL}\n";
|
||||
printf "};\n\n";
|
||||
if (bigstrings) {
|
||||
printf "\";\n\n";
|
||||
printf "static const alias_table_data %s_data[] = {\n", tablename;
|
||||
for (n = 0; n < num_aliases; ++n) {
|
||||
printf "%s\n", aliases[n];
|
||||
}
|
||||
printf "};\n\n";
|
||||
} else {
|
||||
printf "\t{(char *)NULL, (char *)NULL, (char *)NULL}\n";
|
||||
printf "};\n\n";
|
||||
}
|
||||
}
|
||||
# vile:sw=4:
|
||||
|
@ -26,7 +26,7 @@
|
||||
# use or other dealings in this Software without prior written #
|
||||
# authorization. #
|
||||
##############################################################################
|
||||
# $Id: MKcaptab.sh,v 1.3 2007/07/28 22:14:57 tom Exp $
|
||||
# $Id: MKcaptab.sh,v 1.8 2007/08/12 13:13:51 tom Exp $
|
||||
AWK=${1-awk}
|
||||
OPT1=${2-0}
|
||||
OPT2=${3-tinfo/MKcaptab.awk}
|
||||
@ -39,25 +39,90 @@ cat <<'EOF'
|
||||
*
|
||||
*/
|
||||
|
||||
#include <ncurses_cfg.h>
|
||||
#include <curses.priv.h>
|
||||
#include <tic.h>
|
||||
#include <term.h>
|
||||
#include <hashsize.h>
|
||||
|
||||
EOF
|
||||
|
||||
./make_hash 1 info <$DATA
|
||||
./make_hash 3 cap <$DATA
|
||||
./make_hash 1 info $OPT1 <$DATA
|
||||
./make_hash 3 cap $OPT1 <$DATA
|
||||
|
||||
$AWK -f $OPT2 bigstrings=$OPT1 tablename=capalias <$DATA
|
||||
|
||||
$AWK -f $OPT2 bigstrings=$OPT1 tablename=infoalias <$DATA
|
||||
|
||||
cat <<'EOF'
|
||||
cat <<EOF
|
||||
|
||||
#if $OPT1
|
||||
static void
|
||||
next_string(const char *strings, unsigned *offset)
|
||||
{
|
||||
*offset += strlen(strings + *offset) + 1;
|
||||
}
|
||||
|
||||
static const struct name_table_entry *
|
||||
_nc_build_names(struct name_table_entry **actual,
|
||||
const name_table_data *source,
|
||||
const char *strings)
|
||||
{
|
||||
if (*actual == 0) {
|
||||
*actual = typeCalloc(struct name_table_entry, CAPTABSIZE);
|
||||
if (*actual != 0) {
|
||||
unsigned n;
|
||||
unsigned len = 0;
|
||||
for (n = 0; n < CAPTABSIZE; ++n) {
|
||||
(*actual)[n].nte_name = strings + len;
|
||||
(*actual)[n].nte_type = source[n].nte_type;
|
||||
(*actual)[n].nte_index = source[n].nte_index;
|
||||
(*actual)[n].nte_link = source[n].nte_link;
|
||||
next_string(strings, &len);
|
||||
}
|
||||
}
|
||||
}
|
||||
return *actual;
|
||||
}
|
||||
|
||||
#define add_alias(field) \\
|
||||
if (source[n].field >= 0) { \\
|
||||
(*actual)[n].field = strings + source[n].field; \\
|
||||
}
|
||||
|
||||
static const struct alias *
|
||||
_nc_build_alias(struct alias **actual,
|
||||
const alias_table_data *source,
|
||||
const char *strings,
|
||||
unsigned tablesize)
|
||||
{
|
||||
if (*actual == 0) {
|
||||
*actual = typeCalloc(struct alias, tablesize + 1);
|
||||
if (*actual != 0) {
|
||||
unsigned n;
|
||||
for (n = 0; n < tablesize; ++n) {
|
||||
add_alias(from);
|
||||
add_alias(to);
|
||||
add_alias(source);
|
||||
}
|
||||
}
|
||||
}
|
||||
return *actual;
|
||||
}
|
||||
|
||||
#define build_names(root) _nc_build_names(&_nc_##root##_table, \\
|
||||
root##_names_data, \\
|
||||
root##_names_text)
|
||||
#define build_alias(root) _nc_build_alias(&_nc_##root##alias_table, \\
|
||||
root##alias_data, \\
|
||||
root##alias_text, \\
|
||||
SIZEOF(root##alias_data))
|
||||
#else
|
||||
#define build_names(root) _nc_ ## root ## _table
|
||||
#define build_alias(root) _nc_ ## root ## alias_table
|
||||
#endif
|
||||
|
||||
NCURSES_EXPORT(const struct name_table_entry *) _nc_get_table (bool termcap)
|
||||
{
|
||||
return termcap ? _nc_cap_table: _nc_info_table ;
|
||||
return termcap ? build_names(cap) : build_names(info) ;
|
||||
}
|
||||
|
||||
NCURSES_EXPORT(const short *) _nc_get_hash_table (bool termcap)
|
||||
@ -67,6 +132,18 @@ NCURSES_EXPORT(const short *) _nc_get_hash_table (bool termcap)
|
||||
|
||||
NCURSES_EXPORT(const struct alias *) _nc_get_alias_table (bool termcap)
|
||||
{
|
||||
return termcap ? _nc_capalias_table: _nc_infoalias_table ;
|
||||
return termcap ? build_alias(cap) : build_alias(info) ;
|
||||
}
|
||||
|
||||
#if NO_LEAKS
|
||||
NCURSES_EXPORT(void) _nc_comp_captab_leaks(void)
|
||||
{
|
||||
#if $OPT1
|
||||
FreeIfNeeded(_nc_cap_table);
|
||||
FreeIfNeeded(_nc_info_table);
|
||||
FreeIfNeeded(_nc_capalias_table);
|
||||
FreeIfNeeded(_nc_infoalias_table);
|
||||
#endif
|
||||
}
|
||||
#endif /* NO_LEAKS */
|
||||
EOF
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998-2003,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 *
|
||||
@ -50,7 +50,7 @@
|
||||
#define DEBUG(level, params) /*nothing */
|
||||
#endif
|
||||
|
||||
MODULE_ID("$Id: comp_hash.c,v 1.29 2007/07/28 19:44:40 tom Exp $")
|
||||
MODULE_ID("$Id: comp_hash.c,v 1.32 2007/08/12 00:40:27 tom Exp $")
|
||||
|
||||
static int hash_function(const char *);
|
||||
|
||||
@ -240,6 +240,7 @@ main(int argc, char **argv)
|
||||
short *hash_table = typeCalloc(short, HASHTABSIZE);
|
||||
const char *root_name = "";
|
||||
int column = 0;
|
||||
int bigstring = 0;
|
||||
int n;
|
||||
char buffer[BUFSIZ];
|
||||
|
||||
@ -253,11 +254,12 @@ main(int argc, char **argv)
|
||||
/* The first argument is the column-number (starting with 0).
|
||||
* The second is the root name of the tables to generate.
|
||||
*/
|
||||
if (argc <= 2
|
||||
if (argc <= 3
|
||||
|| (column = atoi(argv[1])) <= 0
|
||||
|| (column >= MAX_COLUMNS)
|
||||
|| *(root_name = argv[2]) == 0) {
|
||||
fprintf(stderr, "usage: make_hash column root_name\n");
|
||||
|| *(root_name = argv[2]) == 0
|
||||
|| (bigstring = atoi(argv[3])) < 0) {
|
||||
fprintf(stderr, "usage: make_hash column root_name bigstring\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
@ -293,22 +295,57 @@ main(int argc, char **argv)
|
||||
/*
|
||||
* Write the compiled tables to standard output
|
||||
*/
|
||||
printf("static struct name_table_entry const _nc_%s_table[] =\n",
|
||||
root_name);
|
||||
printf("{\n");
|
||||
for (n = 0; n < CAPTABSIZE; n++) {
|
||||
sprintf(buffer, "\"%s\"",
|
||||
name_table[n].nte_name);
|
||||
printf("\t{ %15s,\t%10s,\t%3d, %3d }%c\n",
|
||||
buffer,
|
||||
typenames[name_table[n].nte_type],
|
||||
name_table[n].nte_index,
|
||||
name_table[n].nte_link,
|
||||
n < CAPTABSIZE - 1 ? ',' : ' ');
|
||||
}
|
||||
printf("};\n\n");
|
||||
if (bigstring) {
|
||||
int len = 0;
|
||||
int nxt;
|
||||
|
||||
printf("const short _nc_%s_hash_table[%d] =\n",
|
||||
printf("static const char %s_names_text[] = \"\\\n", root_name);
|
||||
for (n = 0; n < CAPTABSIZE; n++) {
|
||||
nxt = strlen(name_table[n].nte_name) + 2;
|
||||
if (nxt + len > 72) {
|
||||
printf("\\\n");
|
||||
len = 0;
|
||||
}
|
||||
printf("%s\\0", name_table[n].nte_name);
|
||||
len += nxt;
|
||||
}
|
||||
printf("\";\n\n");
|
||||
|
||||
len = 0;
|
||||
printf("static name_table_data const %s_names_data[] =\n",
|
||||
root_name);
|
||||
printf("{\n");
|
||||
for (n = 0; n < CAPTABSIZE; n++) {
|
||||
printf("\t{ %15d,\t%10s,\t%3d, %3d }%c\n",
|
||||
len,
|
||||
typenames[name_table[n].nte_type],
|
||||
name_table[n].nte_index,
|
||||
name_table[n].nte_link,
|
||||
n < CAPTABSIZE - 1 ? ',' : ' ');
|
||||
len += strlen(name_table[n].nte_name) + 1;
|
||||
}
|
||||
printf("};\n\n");
|
||||
printf("static struct name_table_entry *_nc_%s_table = 0;\n\n", root_name);
|
||||
} else {
|
||||
|
||||
printf("static struct name_table_entry %s _nc_%s_table[] =\n",
|
||||
bigstring ? "" : "const",
|
||||
root_name);
|
||||
printf("{\n");
|
||||
for (n = 0; n < CAPTABSIZE; n++) {
|
||||
sprintf(buffer, "\"%s\"",
|
||||
name_table[n].nte_name);
|
||||
printf("\t{ %15s,\t%10s,\t%3d, %3d }%c\n",
|
||||
buffer,
|
||||
typenames[name_table[n].nte_type],
|
||||
name_table[n].nte_index,
|
||||
name_table[n].nte_link,
|
||||
n < CAPTABSIZE - 1 ? ',' : ' ');
|
||||
}
|
||||
printf("};\n\n");
|
||||
}
|
||||
|
||||
printf("static const short _nc_%s_hash_table[%d] =\n",
|
||||
root_name,
|
||||
HASHTABSIZE + 1);
|
||||
printf("{\n");
|
||||
|
@ -53,7 +53,7 @@
|
||||
#include <tic.h>
|
||||
#include <term_entry.h>
|
||||
|
||||
MODULE_ID("$Id: comp_parse.c,v 1.66 2007/02/03 18:43:31 tom Exp $")
|
||||
MODULE_ID("$Id: comp_parse.c,v 1.67 2007/08/12 13:10:45 tom Exp $")
|
||||
|
||||
static void sanity_check2(TERMTYPE *, bool);
|
||||
NCURSES_IMPEXP void NCURSES_API(*_nc_check_termtype2) (TERMTYPE *, bool) = sanity_check2;
|
||||
@ -472,6 +472,7 @@ _nc_leaks_tic(void)
|
||||
{
|
||||
_nc_alloc_entry_leaks();
|
||||
_nc_captoinfo_leaks();
|
||||
_nc_comp_captab_leaks();
|
||||
_nc_comp_scan_leaks();
|
||||
_nc_tic_expand(0, FALSE, 0);
|
||||
}
|
||||
|
@ -48,7 +48,7 @@
|
||||
#include <tic.h>
|
||||
#include <term_entry.h>
|
||||
|
||||
MODULE_ID("$Id: parse_entry.c,v 1.64 2007/07/28 22:21:22 tom Exp $")
|
||||
MODULE_ID("$Id: parse_entry.c,v 1.65 2007/08/11 16:19:02 tom Exp $")
|
||||
|
||||
#ifdef LINT
|
||||
static short const parametrized[] =
|
||||
@ -283,7 +283,7 @@ _nc_parse_entry(struct entry *entryp, int literal, bool silent)
|
||||
} else {
|
||||
/* normal token lookup */
|
||||
entry_ptr = _nc_find_entry(_nc_curr_token.tk_name,
|
||||
_nc_syntax ? _nc_cap_hash_table : _nc_info_hash_table);
|
||||
_nc_get_hash_table(_nc_syntax));
|
||||
|
||||
/*
|
||||
* Our kluge to handle aliasing. The reason it's done
|
||||
@ -308,7 +308,8 @@ _nc_parse_entry(struct entry *entryp, int literal, bool silent)
|
||||
goto nexttok;
|
||||
}
|
||||
|
||||
entry_ptr = _nc_find_entry(ap->to, _nc_cap_hash_table);
|
||||
entry_ptr = _nc_find_entry(ap->to,
|
||||
_nc_get_hash_table(TRUE));
|
||||
if (entry_ptr && !silent)
|
||||
_nc_warning("%s (%s termcap extension) aliased to %s",
|
||||
ap->from, ap->source, ap->to);
|
||||
@ -323,7 +324,8 @@ _nc_parse_entry(struct entry *entryp, int literal, bool silent)
|
||||
goto nexttok;
|
||||
}
|
||||
|
||||
entry_ptr = _nc_find_entry(ap->to, _nc_info_hash_table);
|
||||
entry_ptr = _nc_find_entry(ap->to,
|
||||
_nc_get_hash_table(FALSE));
|
||||
if (entry_ptr && !silent)
|
||||
_nc_warning("%s (%s terminfo extension) aliased to %s",
|
||||
ap->from, ap->source, ap->to);
|
||||
@ -796,8 +798,8 @@ postprocess_termcap(TERMTYPE *tp, bool has_base)
|
||||
|
||||
/* now we know we found a match in ko_table, so... */
|
||||
|
||||
from_ptr = _nc_find_entry(ap->from, _nc_cap_hash_table);
|
||||
to_ptr = _nc_find_entry(ap->to, _nc_info_hash_table);
|
||||
from_ptr = _nc_find_entry(ap->from, _nc_get_hash_table(TRUE));
|
||||
to_ptr = _nc_find_entry(ap->to, _nc_get_hash_table(FALSE));
|
||||
|
||||
if (!from_ptr || !to_ptr) /* should never happen! */
|
||||
_nc_err_abort("ko translation table is invalid, I give up");
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 2000,2003 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 2000-2003,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 *
|
||||
@ -36,7 +36,7 @@
|
||||
|
||||
#include <curses.priv.h>
|
||||
|
||||
MODULE_ID("$Id: strings.c,v 1.5 2003/08/16 23:46:00 tom Exp $")
|
||||
MODULE_ID("$Id: strings.c,v 1.6 2007/08/11 17:12:17 tom Exp $")
|
||||
|
||||
/****************************************************************************
|
||||
* Useful string functions (especially for mvcur)
|
||||
@ -52,7 +52,7 @@ _nc_strstr(const char *haystack, const char *needle)
|
||||
|
||||
while ((len1 != 0) && (len1-- >= len2)) {
|
||||
if (!strncmp(haystack, needle, len2)) {
|
||||
result = haystack;
|
||||
result = (char *) haystack;
|
||||
break;
|
||||
}
|
||||
haystack++;
|
||||
|
@ -155,7 +155,7 @@
|
||||
#include <term.h>
|
||||
#include <ctype.h>
|
||||
|
||||
MODULE_ID("$Id: lib_mvcur.c,v 1.109 2007/05/05 21:47:03 tom Exp $")
|
||||
MODULE_ID("$Id: lib_mvcur.c,v 1.110 2007/08/11 16:15:57 tom Exp $")
|
||||
|
||||
#define WANT_CHAR(y, x) SP->_newscr->_line[y].text[x] /* desired state */
|
||||
#define BAUDRATE cur_term->_baudrate /* bits per second */
|
||||
@ -1089,7 +1089,7 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
|
||||
load_term();
|
||||
} else if (sscanf(buf, "d %s", capname) == 1) {
|
||||
struct name_table_entry const *np = _nc_find_entry(capname,
|
||||
_nc_info_hash_table);
|
||||
_nc_get_hash_table(FALSE));
|
||||
|
||||
if (np == NULL)
|
||||
(void) printf("No such capability as \"%s\"\n", capname);
|
||||
|
@ -62,7 +62,7 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
MODULE_ID("$Id: lib_twait.c,v 1.53 2007/05/12 19:02:31 tom Exp $")
|
||||
MODULE_ID("$Id: lib_twait.c,v 1.54 2007/08/11 16:32:48 tom Exp $")
|
||||
|
||||
#if HAVE_GETTIMEOFDAY
|
||||
# define PRECISE_GETTIME 1
|
||||
@ -152,7 +152,7 @@ _nc_timed_wait(int mode,
|
||||
{
|
||||
int fd;
|
||||
int count;
|
||||
int result;
|
||||
int result = 0;
|
||||
TimeType t0;
|
||||
|
||||
#ifdef NCURSES_WGETCH_EVENTS
|
||||
|
@ -42,7 +42,7 @@
|
||||
|
||||
#include <dump_entry.h>
|
||||
|
||||
MODULE_ID("$Id: infocmp.c,v 1.91 2007/07/28 23:00:19 tom Exp $")
|
||||
MODULE_ID("$Id: infocmp.c,v 1.93 2007/08/12 13:53:44 tom Exp $")
|
||||
|
||||
#define L_CURL "{"
|
||||
#define R_CURL "}"
|
||||
@ -1261,6 +1261,8 @@ main(int argc, char *argv[])
|
||||
char **tname = 0;
|
||||
int maxterms;
|
||||
|
||||
char **myargv;
|
||||
|
||||
char *firstdir, *restdir;
|
||||
int c, i, len;
|
||||
bool formatted = FALSE;
|
||||
@ -1278,6 +1280,11 @@ main(int argc, char *argv[])
|
||||
|
||||
_nc_progname = _nc_rootname(argv[0]);
|
||||
|
||||
/* make sure we have enough space to add two terminal entries */
|
||||
myargv = typeCalloc(char *, argc + 3);
|
||||
memcpy(myargv, argv, sizeof(char *) * argc);
|
||||
argv = myargv;
|
||||
|
||||
while ((c = getopt(argc,
|
||||
argv,
|
||||
"1A:aB:CcdEeFfGgIiLlnpqR:rs:TtUuVv:w:x")) != -1) {
|
||||
@ -1381,7 +1388,6 @@ main(int argc, char *argv[])
|
||||
|
||||
case 'r':
|
||||
tversion = 0;
|
||||
limited = FALSE;
|
||||
break;
|
||||
|
||||
case 's':
|
||||
@ -1629,6 +1635,7 @@ main(int argc, char *argv[])
|
||||
file_comparison(argc - optind, argv + optind);
|
||||
|
||||
#if NO_LEAKS
|
||||
free(myargv);
|
||||
free(tfile);
|
||||
free(tname);
|
||||
#endif
|
||||
|
@ -29,7 +29,7 @@
|
||||
/*
|
||||
* Author: Thomas E. Dickey
|
||||
*
|
||||
* $Id: cardfile.c,v 1.31 2007/07/21 17:41:55 tom Exp $
|
||||
* $Id: cardfile.c,v 1.32 2007/08/11 16:34:27 tom Exp $
|
||||
*
|
||||
* File format: text beginning in column 1 is a title; other text is content.
|
||||
*/
|
||||
@ -71,7 +71,7 @@ static char default_name[] = "cardfile.dat";
|
||||
#if !HAVE_STRDUP
|
||||
#define strdup my_strdup
|
||||
static char *
|
||||
strdup(char *s)
|
||||
strdup(const char *s)
|
||||
{
|
||||
char *p = (char *) malloc(strlen(s) + 1);
|
||||
if (p)
|
||||
|
@ -26,7 +26,7 @@
|
||||
* authorization. *
|
||||
****************************************************************************/
|
||||
/*
|
||||
* $Id: demo_panels.c,v 1.27 2007/07/21 17:41:55 tom Exp $
|
||||
* $Id: demo_panels.c,v 1.28 2007/08/11 16:34:49 tom Exp $
|
||||
*
|
||||
* Demonstrate a variety of functions from the panel library.
|
||||
*/
|
||||
@ -234,7 +234,7 @@ my_remove_panel(PANEL ** pans, int which)
|
||||
if (pans[which] != 0) {
|
||||
PANEL *pan = pans[which];
|
||||
WINDOW *win = panel_window(pan);
|
||||
char *user = panel_userptr(pan);
|
||||
char *user = (char *) panel_userptr(pan);
|
||||
|
||||
free(user);
|
||||
del_panel(pan);
|
||||
|
@ -26,7 +26,7 @@
|
||||
* authorization. *
|
||||
****************************************************************************/
|
||||
/*
|
||||
* $Id: test_get_wstr.c,v 1.4 2007/07/28 19:46:34 tom Exp $
|
||||
* $Id: test_get_wstr.c,v 1.5 2007/08/11 17:01:43 tom Exp $
|
||||
*
|
||||
* Author: Thomas E Dickey
|
||||
*
|
||||
@ -89,7 +89,7 @@ MovePrompt(WINDOW *txtwin, int limit, int y, int x)
|
||||
}
|
||||
|
||||
static int
|
||||
ShowFlavor(WINDOW *strwin, WINDOW *txtwin, Flavors flavor, int limit)
|
||||
ShowFlavor(WINDOW *strwin, WINDOW *txtwin, int flavor, int limit)
|
||||
{
|
||||
const char *name = "?";
|
||||
bool limited = FALSE;
|
||||
|
@ -26,7 +26,7 @@
|
||||
* authorization. *
|
||||
****************************************************************************/
|
||||
/*
|
||||
* $Id: test_getstr.c,v 1.6 2007/07/28 19:46:43 tom Exp $
|
||||
* $Id: test_getstr.c,v 1.7 2007/08/11 16:56:25 tom Exp $
|
||||
*
|
||||
* Author: Thomas E Dickey
|
||||
*
|
||||
@ -87,7 +87,7 @@ MovePrompt(WINDOW *txtwin, int limit, int y, int x)
|
||||
}
|
||||
|
||||
static int
|
||||
ShowFlavor(WINDOW *strwin, WINDOW *txtwin, Flavors flavor, int limit)
|
||||
ShowFlavor(WINDOW *strwin, WINDOW *txtwin, int flavor, int limit)
|
||||
{
|
||||
const char *name = "?";
|
||||
bool limited = FALSE;
|
||||
|
Loading…
Reference in New Issue
Block a user