]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - tack/charset.c
ncurses 5.5
[ncurses.git] / tack / charset.c
index c31b78b5686303ce12884a468ae7904c7ec1b06f..f1a066e23e616ea40ee4ff8a20775c762d315cbb 100644 (file)
@@ -1,27 +1,27 @@
 /*
-** Copyright (C) 1991, 1997 Free Software Foundation, Inc.
-** 
+** Copyright (C) 1991, 1997-2000 Free Software Foundation, Inc.
+**
 ** This file is part of TACK.
-** 
+**
 ** TACK is free software; you can redistribute it and/or modify
 ** it under the terms of the GNU General Public License as published by
 ** the Free Software Foundation; either version 2, or (at your option)
 ** any later version.
-** 
+**
 ** TACK is distributed in the hope that it will be useful,
 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ** GNU General Public License for more details.
-** 
+**
 ** You should have received a copy of the GNU General Public License
 ** along with TACK; see the file COPYING.  If not, write to
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-** Boston, MA 02111-1307, USA.
+** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+** Boston, MA 02110-1301, USA
 */
 
 #include <tack.h>
 
-MODULE_ID("$Id: charset.c,v 1.2 1999/05/09 18:30:49 tom Exp $")
+MODULE_ID("$Id: charset.c,v 1.10 2005/09/17 19:49:16 tom Exp $")
 
 /*
        Menu definitions for alternate character set and SGR tests.
@@ -40,7 +40,7 @@ static void charset_smacs(struct test_list *t, int *state, int *ch);
 static void charset_attributes(struct test_list *t, int *state, int *ch);
 static void charset_sgr(struct test_list *t, int *state, int *ch);
 
-const struct test_list acs_test_list[] = {
+struct test_list acs_test_list[] = {
        {0, 0, 0, 0, "e) edit terminfo", 0, &edit_menu},
        {MENU_NEXT, 3, "bel", 0, 0, charset_bel, 0},
        {MENU_NEXT, 3, "flash", 0, 0, charset_flash, 0},
@@ -194,7 +194,7 @@ charset_dsl(
 }
 
 
-void 
+void
 eat_cookie(void)
 {                              /* put a blank if this is not a magic cookie
                                   terminal */
@@ -203,7 +203,7 @@ eat_cookie(void)
 }
 
 
-void 
+void
 put_mode(char *s)
 {                              /* send the attribute string (with or without
                                   % execution) */
@@ -285,10 +285,12 @@ charset_sgr(
        }
        put_crlf();
 
+#ifdef max_attributes
        if (max_attributes >= 0) {
                sprintf(temp, "(ma) Maximum attributes %d  ", max_attributes);
                ptext(temp);
        }
+#endif
        generic_done_message(t, state, ch);
 }
 
@@ -369,7 +371,7 @@ charset_attributes(
 /*
 **     charset_smacs(test_list, status, ch)
 **
-**     display all posible acs characters
+**     display all possible acs characters
 **     (smacs) (rmacs)
 */
 static void
@@ -433,12 +435,12 @@ test_acs(
                                        break;
                                }
                                if (glyph[j].name[0] == '\0') {
-                                       if (isgraph(acs_chars[i])) {
+                                       if (isgraph(UChar(acs_chars[i]))) {
                                                sprintf(temp, "    %c",
                                                        acs_chars[i]);
                                        } else {
                                                sprintf(temp, " 0x%02x",
-                                                       (acs_chars[i] & 0xff));
+                                                       UChar(acs_chars[i]));
                                        }
                                        strcpy(&temp[5], " *** has no mapping ***");
                                        putln(temp);
@@ -486,20 +488,20 @@ test_acs(
 #ifdef ACS_ULCORNER
        maybe_wait(5);
        put_mode(enter_alt_charset_mode);
-       put_this(ACS_ULCORNER);
-       put_this(ACS_TTEE);
-       put_this(ACS_URCORNER);
-       put_this(ACS_ULCORNER);
-       put_this(ACS_HLINE);
-       put_this(ACS_URCORNER);
+       put_that(ACS_ULCORNER);
+       put_that(ACS_TTEE);
+       put_that(ACS_URCORNER);
+       put_that(ACS_ULCORNER);
+       put_that(ACS_HLINE);
+       put_that(ACS_URCORNER);
        char_count += 6;
        put_mode(exit_alt_charset_mode);
        put_crlf();
        put_mode(enter_alt_charset_mode);
-       put_this(ACS_LTEE);
-       put_this(ACS_PLUS);
-       put_this(ACS_RTEE);
-       put_this(ACS_VLINE);
+       put_that(ACS_LTEE);
+       put_that(ACS_PLUS);
+       put_that(ACS_RTEE);
+       put_that(ACS_VLINE);
        if (magic_cookie_glitch >= 1)
                put_this(' ');
        else {
@@ -507,18 +509,18 @@ test_acs(
                put_this(' ');
                put_mode(enter_alt_charset_mode);
        }
-       put_this(ACS_VLINE);
+       put_that(ACS_VLINE);
        char_count += 6;
        put_mode(exit_alt_charset_mode);
        put_str("   Here are 2 boxes");
        put_crlf();
        put_mode(enter_alt_charset_mode);
-       put_this(ACS_LLCORNER);
-       put_this(ACS_BTEE);
-       put_this(ACS_LRCORNER);
-       put_this(ACS_LLCORNER);
-       put_this(ACS_HLINE);
-       put_this(ACS_LRCORNER);
+       put_that(ACS_LLCORNER);
+       put_that(ACS_BTEE);
+       put_that(ACS_LRCORNER);
+       put_that(ACS_LLCORNER);
+       put_that(ACS_HLINE);
+       put_that(ACS_LRCORNER);
        char_count += 6;
        put_mode(exit_alt_charset_mode);
        put_crlf();