/****************************************************************************
- * Copyright (c) 2009-2016,2017 Free Software Foundation, Inc. *
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2009-2016,2017 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 *
* authorization. *
****************************************************************************/
/*
- * $Id: test_addchstr.c,v 1.20 2017/04/08 23:11:55 tom Exp $
+ * $Id: test_addchstr.c,v 1.25 2020/02/02 23:34:34 tom Exp $
*
* Demonstrate the waddchstr() and waddch functions.
* Thomas Dickey - 2009/9/12
*/
#include <test.priv.h>
-
#include <linedata.h>
+/*
+ * redefinitions to simplify comparison between test_*str programs
+ */
#undef MvAddStr
#undef MvWAddStr
#define WAddNStr waddchnstr
#define WAddStr waddchstr
-#define AddCh addch
-#define WAddCh waddch
-
#define MY_TABSIZE 8
typedef enum {
static bool w_opt = FALSE;
static int n_opt = -1;
-static attr_t show_attr;
+static chtype show_attr;
static chtype *temp_buffer;
static size_t temp_length;
#define LEN(n) ((length - (n) > n_opt) ? n_opt : (length - (n)))
static void
-test_adds(int level)
+recursive_test(int level)
{
static bool first = TRUE;
doupdate();
if (has_colors()) {
- show_attr = (attr_t) COLOR_PAIR(1);
+ show_attr = (chtype) COLOR_PAIR(1);
wbkgdset(work, show_attr | ' ');
} else {
show_attr = A_STANDOUT;
wmove(work, row, margin + 1);
switch (ch) {
case key_RECUR:
- test_adds(level + 1);
+ recursive_test(level + 1);
if (look)
touchwin(look);
if (optind < argc)
usage();
- test_adds(0);
+ recursive_test(0);
endwin();
#if NO_LEAKS
free(temp_buffer);