Re: [RFC] mconf: make extensive use of ncurses' variables LINES and COLS.

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

 



Dirk, All,

On 2013-05-10 14:59 +0200, Dirk Gouders spake thusly:
> From 882aa6595cbb2683a43bf24f1b9741263641ec9b Mon Sep 17 00:00:00 2001
> From: Dirk Gouders <dirk@xxxxxxxxxxx>
> Date: Fri, 10 May 2013 12:26:23 +0200
> Subject: [PATCH] mconf: make extensive use of ncurses' variables LINES and
>  COLS.
> 
> The manual page of ncurses states that the variables LINES and COLS
> are initialized by initscr().  So, in init_dialog() there is no need
> to use local variables `height' and `width' and initialize them using
> function calls.

If we read the manpage strictly, the LINES and COLS are set by initsrc,
and nothing else updates them. So the manpage does not state what
happens when the terminal is resized. The only mention of 'COLS' in the
man page is this paragraph:

    ---8<---
    The integer variables LINES and COLS are defined in <curses.h>
    and will be filled in by initscr with the size of the screen.
    ---8<---

After looking at the code of ncurses, the LINES and COLS are also
updated upon a resize. But as this is not documented, I think we should
*not* rely on that behaviour.

I believe we should use the functions, not the variables.

Also note that the getmaxyx() familly are not functions, they are macros.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux