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

« back to all changes in this revision

Viewing changes to ncurses/widechar/lib_wacs.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) 2002 Free Software Foundation, Inc.                        *
 
2
 * Copyright (c) 2002,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            *
33
33
#include <curses.priv.h>
34
34
#include <term.h>
35
35
 
36
 
MODULE_ID("$Id: lib_wacs.c,v 1.6 2002/12/21 12:30:19 tom Exp $")
 
36
MODULE_ID("$Id: lib_wacs.c,v 1.7 2006/12/17 15:16:17 tom Exp $")
37
37
 
38
38
NCURSES_EXPORT_VAR(cchar_t) * _nc_wacs = 0;
39
39
 
98
98
 
99
99
    _nc_wacs = typeCalloc(cchar_t, ACS_LEN);
100
100
    for (n = 0; n < SIZEOF(table); ++n) {
 
101
        int wide = wcwidth(table[n].value[active]);
 
102
 
101
103
        m = table[n].map;
102
 
        if (active) {
 
104
        if (active && (wide == 1)) {
103
105
            SetChar(_nc_wacs[m], table[n].value[active], A_NORMAL);
104
106
        } else if (acs_map[m] & A_ALTCHARSET) {
105
107
            SetChar(_nc_wacs[m], m, A_ALTCHARSET);
106
108
        } else {
107
109
            SetChar(_nc_wacs[m], table[n].value[0], A_NORMAL);
108
110
        }
 
111
 
109
112
        T(("#%d, SetChar(%c, %#04x) = %s",
110
113
           n, m,
111
114
           table[n].value[active],