~ubuntu-branches/debian/sid/ncurses/sid

« back to all changes in this revision

Viewing changes to progs/dump_entry.c

  • Committer: Package Import Robot
  • Author(s): Sven Joachim
  • Date: 2015-08-17 18:01:53 UTC
  • mfrom: (1.32.11)
  • Revision ID: package-import@ubuntu.com-20150817180153-ywf02awpkuzvqwdv
Tags: 6.0+20150810-1
* New upstream release.
  - Fix comparison against "/usr/include" in misc/gen-pkgconfig.in
    (Closes: #790548).
* Configure with "--with-abi-version=5", upstream defaults to abi 6 now.
* Configure with "--with-versioned-syms" (Closes: #788610).
  - Bump minimal versions of all symbols as well as shlibs to 6.
* After building the wide library, install it into a temporary
  scratchdir so that test/configure can find the necessary auxiliary
  files (see #786436).
* Drop the libncursesw5-dev build-dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/****************************************************************************
2
 
 * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc.              *
 
2
 * Copyright (c) 1998-2014,2015 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            *
39
39
#include "termsort.c"           /* this C file is generated */
40
40
#include <parametrized.h>       /* so is this */
41
41
 
42
 
MODULE_ID("$Id: dump_entry.c,v 1.114 2014/10/18 09:32:54 tom Exp $")
 
42
MODULE_ID("$Id: dump_entry.c,v 1.118 2015/07/07 08:06:39 Werner.Fink Exp $")
43
43
 
44
44
#define INDENT                  8
45
45
#define DISCARD(string) string = ABSENT_STRING
61
61
static int column;              /* current column, limited by 'width' */
62
62
static int oldcol;              /* last value of column before wrap */
63
63
static bool pretty;             /* true if we format if-then-else strings */
 
64
static bool checking;           /* true if we are checking for tic */
64
65
 
65
66
static char *save_sgr;
66
67
 
155
156
#endif
156
157
 
157
158
#define NameTrans(check,result) \
158
 
            if (OkIndex(np->nte_index, check) \
 
159
            if ((np->nte_index <= OK_ ## check) \
159
160
                && check[np->nte_index]) \
160
161
                return (result[np->nte_index])
161
162
 
162
163
NCURSES_CONST char *
163
164
nametrans(const char *name)
164
 
/* translate a capability name from termcap to terminfo */
 
165
/* translate a capability name to termcap from terminfo */
165
166
{
166
167
    const struct name_table_entry *np;
167
168
 
168
 
    if ((np = _nc_find_entry(name, _nc_get_hash_table(0))) != 0)
 
169
    if ((np = _nc_find_entry(name, _nc_get_hash_table(0))) != 0) {
169
170
        switch (np->nte_type) {
170
171
        case BOOLEAN:
171
172
            NameTrans(bool_from_termcap, boolcodes);
179
180
            NameTrans(str_from_termcap, strcodes);
180
181
            break;
181
182
        }
 
183
    }
182
184
 
183
185
    return (0);
184
186
}
190
192
          int twidth,
191
193
          int theight,
192
194
          unsigned traceval,
193
 
          bool formatted)
 
195
          bool formatted,
 
196
          bool check)
194
197
/* set up for entry display */
195
198
{
196
199
    width = twidth;
197
200
    height = theight;
198
201
    pretty = formatted;
 
202
    checking = check;
199
203
 
200
204
    /* versions */
201
205
    if (version == 0)
537
541
                            indent_DYN(&tmpbuf, level + 1);
538
542
                        }
539
543
                    } else if (level == 1) {
540
 
                        _nc_warning("%s: %%%c without %%? in %s",
541
 
                                    _nc_first_name(tterm->term_names),
542
 
                                    *src, capability);
 
544
                        if (checking)
 
545
                            _nc_warning("%s: %%%c without %%? in %s",
 
546
                                        _nc_first_name(tterm->term_names),
 
547
                                        *src, capability);
543
548
                    }
544
549
                }
545
550
                continue;
561
566
                    }
562
567
                    return src;
563
568
                }
564
 
                _nc_warning("%s: %%; without %%? in %s",
565
 
                            _nc_first_name(tterm->term_names),
566
 
                            capability);
 
569
                if (checking)
 
570
                    _nc_warning("%s: %%; without %%? in %s",
 
571
                                _nc_first_name(tterm->term_names),
 
572
                                capability);
567
573
            }
568
574
            break;
569
575
        case 'p':
772
778
                    trimmed_sgr0 = _nc_trim_sgr0(tterm);
773
779
                    if (strcmp(capability, trimmed_sgr0))
774
780
                        capability = trimmed_sgr0;
 
781
                    else {
 
782
                        if (trimmed_sgr0 != exit_attribute_mode)
 
783
                            free(trimmed_sgr0);
 
784
                    }
775
785
 
776
786
                    set_attributes = my_sgr;
777
787
                }