public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Dirk Gouders <dirk.gouders@w-hs.de>
Cc: linux-kbuild@vger.kernel.org
Subject: Re: [RFC] mconf: make extensive use of ncurses' variables LINES and COLS.
Date: Sat, 11 May 2013 11:48:18 +0200	[thread overview]
Message-ID: <20130511094818.GA3222@free.fr> (raw)
In-Reply-To: <gid2szuh1p.fsf@karga.hank.lab>

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@gouders.net>
> 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.  |
'------------------------------^-------^------------------^--------------------'

  reply	other threads:[~2013-05-11  9:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-10 12:59 [RFC] mconf: make extensive use of ncurses' variables LINES and COLS Dirk Gouders
2013-05-11  9:48 ` Yann E. MORIN [this message]
2013-05-11 11:20   ` Dirk Gouders
2013-05-11 11:27     ` Dirk Gouders
2013-05-11 20:58       ` Yann E. MORIN
2013-05-12 10:30         ` [PATCH v4] mconf: use function calls instead " Dirk Gouders
2013-05-12 12:55           ` Yann E. MORIN
2013-05-12 13:41             ` Dirk Gouders
2013-05-12 14:22               ` Yann E. MORIN
2013-05-13  9:23                 ` [PATCH] nconf: " Dirk Gouders
2013-05-13 16:39                   ` Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130511094818.GA3222@free.fr \
    --to=yann.morin.1998@free.fr \
    --cc=dirk.gouders@w-hs.de \
    --cc=linux-kbuild@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox