]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/tinfo/lib_ti.c
ncurses 6.1 - patch 20190126
[ncurses.git] / ncurses / tinfo / lib_ti.c
index e41234210c85de5993eabf088d26896654e599e1..bf8fc9cc39444bb6043e7e40b6ff2b5a81ec37c1 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2017,2018 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            *
  *                                                                          *
  * 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 <tic.h>
 
 
 #include <tic.h>
 
-MODULE_ID("$Id: lib_ti.c,v 1.29 2010/01/23 17:57:43 tom Exp $")
+MODULE_ID("$Id: lib_ti.c,v 1.33 2018/04/07 20:36:41 tom Exp $")
 
 #if 0
 static bool
 
 #if 0
 static bool
@@ -50,16 +50,16 @@ same_name(const char *a, const char *b)
 #endif
 
 NCURSES_EXPORT(int)
 #endif
 
 NCURSES_EXPORT(int)
-NCURSES_SP_NAME(tigetflag) (NCURSES_SP_DCLx NCURSES_CONST char *str)
+NCURSES_SP_NAME(tigetflag) (NCURSES_SP_DCLx const char *str)
 {
     int result = ABSENT_BOOLEAN;
 {
     int result = ABSENT_BOOLEAN;
-    int i, j;
 
     T((T_CALLED("tigetflag(%p, %s)"), (void *) SP_PARM, str));
 
     if (HasTInfoTerminal(SP_PARM)) {
 
     T((T_CALLED("tigetflag(%p, %s)"), (void *) SP_PARM, str));
 
     if (HasTInfoTerminal(SP_PARM)) {
-       TERMTYPE *tp = &(TerminalOf(SP_PARM)->type);
+       TERMTYPE2 *tp = &TerminalType(TerminalOf(SP_PARM));
        struct name_table_entry const *entry_ptr;
        struct name_table_entry const *entry_ptr;
+       int j = -1;
 
        entry_ptr = _nc_find_type_entry(str, BOOLEAN, FALSE);
        if (entry_ptr != 0) {
 
        entry_ptr = _nc_find_type_entry(str, BOOLEAN, FALSE);
        if (entry_ptr != 0) {
@@ -67,7 +67,7 @@ NCURSES_SP_NAME(tigetflag) (NCURSES_SP_DCLx NCURSES_CONST char *str)
        }
 #if NCURSES_XNAMES
        else {
        }
 #if NCURSES_XNAMES
        else {
-           j = -1;
+           int i;
            for_each_ext_boolean(i, tp) {
                const char *capname = ExtBoolname(tp, i, boolnames);
                if (same_name(str, capname)) {
            for_each_ext_boolean(i, tp) {
                const char *capname = ExtBoolname(tp, i, boolnames);
                if (same_name(str, capname)) {
@@ -88,23 +88,23 @@ NCURSES_SP_NAME(tigetflag) (NCURSES_SP_DCLx NCURSES_CONST char *str)
 
 #if NCURSES_SP_FUNCS
 NCURSES_EXPORT(int)
 
 #if NCURSES_SP_FUNCS
 NCURSES_EXPORT(int)
-tigetflag(NCURSES_CONST char *str)
+tigetflag(const char *str)
 {
     return NCURSES_SP_NAME(tigetflag) (CURRENT_SCREEN, str);
 }
 #endif
 
 NCURSES_EXPORT(int)
 {
     return NCURSES_SP_NAME(tigetflag) (CURRENT_SCREEN, str);
 }
 #endif
 
 NCURSES_EXPORT(int)
-NCURSES_SP_NAME(tigetnum) (NCURSES_SP_DCLx NCURSES_CONST char *str)
+NCURSES_SP_NAME(tigetnum) (NCURSES_SP_DCLx const char *str)
 {
 {
-    int i, j;
     int result = CANCELLED_NUMERIC;    /* Solaris returns a -1 on error */
 
     T((T_CALLED("tigetnum(%p, %s)"), (void *) SP_PARM, str));
 
     if (HasTInfoTerminal(SP_PARM)) {
     int result = CANCELLED_NUMERIC;    /* Solaris returns a -1 on error */
 
     T((T_CALLED("tigetnum(%p, %s)"), (void *) SP_PARM, str));
 
     if (HasTInfoTerminal(SP_PARM)) {
-       TERMTYPE *tp = &(TerminalOf(SP_PARM)->type);
+       TERMTYPE2 *tp = &TerminalType(TerminalOf(SP_PARM));
        struct name_table_entry const *entry_ptr;
        struct name_table_entry const *entry_ptr;
+       int j = -1;
 
        entry_ptr = _nc_find_type_entry(str, NUMBER, FALSE);
        if (entry_ptr != 0) {
 
        entry_ptr = _nc_find_type_entry(str, NUMBER, FALSE);
        if (entry_ptr != 0) {
@@ -112,7 +112,7 @@ NCURSES_SP_NAME(tigetnum) (NCURSES_SP_DCLx NCURSES_CONST char *str)
        }
 #if NCURSES_XNAMES
        else {
        }
 #if NCURSES_XNAMES
        else {
-           j = -1;
+           int i;
            for_each_ext_number(i, tp) {
                const char *capname = ExtNumname(tp, i, numnames);
                if (same_name(str, capname)) {
            for_each_ext_number(i, tp) {
                const char *capname = ExtNumname(tp, i, numnames);
                if (same_name(str, capname)) {
@@ -135,23 +135,23 @@ NCURSES_SP_NAME(tigetnum) (NCURSES_SP_DCLx NCURSES_CONST char *str)
 
 #if NCURSES_SP_FUNCS
 NCURSES_EXPORT(int)
 
 #if NCURSES_SP_FUNCS
 NCURSES_EXPORT(int)
-tigetnum(NCURSES_CONST char *str)
+tigetnum(const char *str)
 {
     return NCURSES_SP_NAME(tigetnum) (CURRENT_SCREEN, str);
 }
 #endif
 
 NCURSES_EXPORT(char *)
 {
     return NCURSES_SP_NAME(tigetnum) (CURRENT_SCREEN, str);
 }
 #endif
 
 NCURSES_EXPORT(char *)
-NCURSES_SP_NAME(tigetstr) (NCURSES_SP_DCLx NCURSES_CONST char *str)
+NCURSES_SP_NAME(tigetstr) (NCURSES_SP_DCLx const char *str)
 {
     char *result = CANCELLED_STRING;
 {
     char *result = CANCELLED_STRING;
-    int i, j;
 
     T((T_CALLED("tigetstr(%p, %s)"), (void *) SP_PARM, str));
 
     if (HasTInfoTerminal(SP_PARM)) {
 
     T((T_CALLED("tigetstr(%p, %s)"), (void *) SP_PARM, str));
 
     if (HasTInfoTerminal(SP_PARM)) {
-       TERMTYPE *tp = &(TerminalOf(SP_PARM)->type);
+       TERMTYPE2 *tp = &TerminalType(TerminalOf(SP_PARM));
        struct name_table_entry const *entry_ptr;
        struct name_table_entry const *entry_ptr;
+       int j = -1;
 
        entry_ptr = _nc_find_type_entry(str, STRING, FALSE);
        if (entry_ptr != 0) {
 
        entry_ptr = _nc_find_type_entry(str, STRING, FALSE);
        if (entry_ptr != 0) {
@@ -159,7 +159,7 @@ NCURSES_SP_NAME(tigetstr) (NCURSES_SP_DCLx NCURSES_CONST char *str)
        }
 #if NCURSES_XNAMES
        else {
        }
 #if NCURSES_XNAMES
        else {
-           j = -1;
+           int i;
            for_each_ext_string(i, tp) {
                const char *capname = ExtStrname(tp, i, strnames);
                if (same_name(str, capname)) {
            for_each_ext_string(i, tp) {
                const char *capname = ExtStrname(tp, i, strnames);
                if (same_name(str, capname)) {
@@ -180,7 +180,7 @@ NCURSES_SP_NAME(tigetstr) (NCURSES_SP_DCLx NCURSES_CONST char *str)
 
 #if NCURSES_SP_FUNCS
 NCURSES_EXPORT(char *)
 
 #if NCURSES_SP_FUNCS
 NCURSES_EXPORT(char *)
-tigetstr(NCURSES_CONST char *str)
+tigetstr(const char *str)
 {
     return NCURSES_SP_NAME(tigetstr) (CURRENT_SCREEN, str);
 }
 {
     return NCURSES_SP_NAME(tigetstr) (CURRENT_SCREEN, str);
 }