bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

header file for cchar_t?


From: Felix Natter
Subject: header file for cchar_t?
Date: Thu, 07 Jul 2011 20:39:39 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

hi,

I am not 100% sure this is a bug, but I haven't got an answer
telling me that I'm wrong, so I try my luck here:

When trying to compile:
------------
#include <wchar.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <locale.h>
#include <ncursesw/curses.h>

int main()
{
  setlocale(LC_ALL,"de_DE.UTF-8");

  const wchar_t* WCS = L"aäaäαλ";
  
  initscr();
  clear();
  refresh();

  move(0,0);
  addwstr(WCS);

  move(1,0);
  int i;
  cchar_t c;
  for (i = 0; i < wcslen(WCS); i++)
    {
      c.attr = 0;
      c.chars[0] = WCS[i];
      c.chars[1] = L'\0';
      add_wch(&c);
    }

  getch();
  endwin();

  return 0;
}
------------

with ncursesw 5.9 I get:

gcc -Wall -O0 -g -lncursesw -o t testUTF8-3.c
testUTF8-3.c: In function ‘main’:
testUTF8-3.c:30:3: warning: implicit declaration of function ‘addwstr’ 
[-Wimplicit-function-declaration]
testUTF8-3.c:34:3: error: unknown type name ‘cchar_t’
testUTF8-3.c:37:8: error: request for member ‘attr’ in something not a 
structure or union
testUTF8-3.c:38:8: error: request for member ‘chars’ in something not a 
structure or union
testUTF8-3.c:39:8: error: request for member ‘chars’ in something not a 
structure or union
testUTF8-3.c:40:7: warning: implicit declaration of function ‘add_wch’
[-Wimplicit-function-declaration]

It works when I insert:

#define CCHARW_MAX      5
typedef struct
{
    attr_t      attr;
    wchar_t     chars[CCHARW_MAX];
}
cchar_t;

It seems that cchar_t is in ncurses.h. I also tried to do
#define NCURSES_WIDECHAR 1
before including the header, but that doesn't help.
What am I missing?

Thanks,
-- 
Felix Natter




reply via email to

[Prev in Thread] Current Thread [Next in Thread]