~ubuntu-branches/ubuntu/natty/ncurses/natty

« back to all changes in this revision

Viewing changes to test/railroad.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-05-17 09:00:42 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070517090042-86fgxrr6j5jzagot
Tags: 5.6-0ubuntu1
* New upstream version.
  - Remove patches applied upstream: ncurses.upstream, signed-chars.
  - Update patches: debian-backspace.
* Build-depend on g++-multilib instead of lib{32,64}c*-dev-*.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/****************************************************************************
2
 
 * Copyright (c) 2000-2001,2002 Free Software Foundation, Inc.              *
 
2
 * Copyright (c) 2000-2005,2006 Free Software Foundation, Inc.              *
3
3
 *                                                                          *
4
4
 * Permission is hereby granted, free of charge, to any person obtaining a  *
5
5
 * copy of this software and associated documentation files (the            *
27
27
 ****************************************************************************/
28
28
 
29
29
/*
30
 
 * Author: Thomas E. Dickey <dickey@clark.net> 2000
 
30
 * Author: Thomas E. Dickey - 2000
31
31
 *
32
 
 * $Id: railroad.c,v 1.11 2002/10/19 22:11:24 tom Exp $
 
32
 * $Id: railroad.c,v 1.14 2006/05/20 16:02:04 tom Exp $
33
33
 *
34
34
 * A simple demo of the termcap interface.
35
35
 */
36
36
#include <test.priv.h>
37
37
 
 
38
#if HAVE_TGETENT
 
39
 
38
40
static char *wipeit;
39
41
static char *moveit;
40
42
static int length;
180
182
    NCURSES_CONST char *name = getenv("TERM");
181
183
    char buffer[1024];
182
184
    char area[1024], *ap = area;
183
 
    int j;
184
185
 
185
186
    if (name == 0)
186
187
        name = "dumb";
187
 
    if (tgetent(buffer, name)) {
 
188
    if (tgetent(buffer, name) >= 0) {
188
189
 
189
190
        wipeit = tgetstr("ce", &ap);
190
191
        height = tgetnum("li");
214
215
 
215
216
        ShowCursor(0);
216
217
 
217
 
        for (j = SIGHUP; j <= SIGTERM; j++)
218
 
            if (signal(j, SIG_IGN) != SIG_IGN)
219
 
                signal(j, onsig);
 
218
        CATCHALL(onsig);
220
219
 
221
220
        while (*args) {
222
221
            ShowSign(*args++);
238
237
    }
239
238
    ExitProgram(EXIT_SUCCESS);
240
239
}
 
240
 
 
241
#else
 
242
int
 
243
main(int argc GCC_UNUSED,
 
244
     char *argv[]GCC_UNUSED)
 
245
{
 
246
    printf("This program requires termcap\n");
 
247
    exit(EXIT_FAILURE);
 
248
}
 
249
#endif