/****************************************************************************
- * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2010,2011 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 *
#include <tic.h>
#include <ctype.h>
-#include <term_entry.h>
-
#ifndef CUR
#define CUR SP_TERMTYPE
#endif
-MODULE_ID("$Id: lib_termcap.c,v 1.69 2009/07/11 18:14:21 tom Exp $")
+MODULE_ID("$Id: lib_termcap.c,v 1.76 2011/10/22 17:12:41 tom Exp $")
NCURSES_EXPORT_VAR(char *) UP = 0;
NCURSES_EXPORT_VAR(char *) BC = 0;
NCURSES_EXPORT(int)
NCURSES_SP_NAME(tgetent) (NCURSES_SP_DCLx char *bufp, const char *name)
{
- int errcode = ERR;
+ int rc = ERR;
int n;
bool found_cache = FALSE;
#ifdef USE_TERM_DRIVER
START_TRACE();
T((T_CALLED("tgetent()")));
-#ifdef USE_TERM_DRIVER
- _nc_setupterm_ex(&termp, (NCURSES_CONST char *) name,
- STDOUT_FILENO, &errcode, TRUE);
+ TINFO_SETUP_TERM(&termp, (NCURSES_CONST char *) name,
+ STDOUT_FILENO, &rc, TRUE);
+#ifdef USE_TERM_DRIVER
if (termp == 0 ||
!((TERMINAL_CONTROL_BLOCK *) termp)->drv->isTerminfo)
- return (errcode);
-#else
- _nc_setupterm((NCURSES_CONST char *) name, STDOUT_FILENO, &errcode, TRUE);
+ returnCode(rc);
#endif
/*
BC = 0;
FIX_SGR0 = 0; /* don't free it - application may still use */
- if (errcode == 1) {
+ if (rc == 1) {
if (cursor_left)
if ((backspaces_with_bs = (char) !strcmp(cursor_left, "\b")) == 0)
#endif*/
}
- returnCode(errcode);
+ returnCode(rc);
}
#if NCURSES_SP_FUNCS
same_tcname(const char *a, const char *b)
{
fprintf(stderr, "compare(%s,%s)\n", a, b);
- return !strncmp(a, b, 2);
+ return !strncmp(a, b, (size_t) 2);
}
+
#else
-#define same_tcname(a,b) !strncmp(a,b,2)
+#define same_tcname(a,b) !strncmp(a, b, (size_t) 2)
#endif
/***************************************************************************
int result = 0; /* Solaris returns zero for missing flag */
int i, j;
- T((T_CALLED("tgetflag(%p, %s)"), SP_PARM, id));
+ T((T_CALLED("tgetflag(%p, %s)"), (void *) SP_PARM, id));
if (HasTInfoTerminal(SP_PARM)) {
TERMTYPE *tp = &(TerminalOf(SP_PARM)->type);
struct name_table_entry const *entry_ptr;
int result = ABSENT_NUMERIC;
int i, j;
- T((T_CALLED("tgetnum(%p, %s)"), SP_PARM, id));
+ T((T_CALLED("tgetnum(%p, %s)"), (void *) SP_PARM, id));
if (HasTInfoTerminal(SP_PARM)) {
TERMTYPE *tp = &(TerminalOf(SP_PARM)->type);
struct name_table_entry const *entry_ptr;
char *result = NULL;
int i, j;
- T((T_CALLED("tgetstr(%s,%p)"), id, area));
+ T((T_CALLED("tgetstr(%s,%p)"), id, (void *) area));
if (HasTInfoTerminal(SP_PARM)) {
TERMTYPE *tp = &(TerminalOf(SP_PARM)->type);
struct name_table_entry const *entry_ptr;
#endif
if (j >= 0) {
result = tp->Strings[j];
- TR(TRACE_DATABASE, ("found match : %s", _nc_visbuf(result)));
+ TR(TRACE_DATABASE, ("found match %d: %s", j, _nc_visbuf(result)));
/* setupterm forces canceled strings to null */
if (VALID_STRING(result)) {
if (result == exit_attribute_mode