bug-ncurses
[Top][All Lists]
Advanced

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

Re: cast char to chtype ?


From: Johann 'Myrkraverk' Oskarsson
Subject: Re: cast char to chtype ?
Date: Wed, 5 Aug 2015 08:20:29 +0800

On Wed, Aug 5, 2015 at 6:50 AM, Patrick <address@hidden> wrote:
>
> Hi Everyone
>
> I haven't tried to do this yet because I was unsure if it was safe even if it 
> appeared to work. Is it safe to cast a char to a chtype ? I have a situation 
> were the input is from a piece of code that has not yet resolved ncurses and 
> needs to use the basic C types.

>From reading

  http://pubs.opengroup.org/onlinepubs/7908799/xcurses/curses.h.html

We have

chtype  A character, attributes  and a colour-pair

So I'm not sure it's "always safe" but if you're writing for ncurses
only, then take a look at the implementation.

I did not see a macro or function to convert a plain character to
chtype, with my quick look.

-- 
Johann

 I'm not from the internet, I just work there.



reply via email to

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