List gnuports@2rosenthals.com Arkiverade meddelande #31

Från: "Steven Levine" <gnuports@2rosenthals.com> Meddelandehuvud
Oavkodat meddelande
Ämne: Re: [GNU Ports] Terminal width?
Datum: Sat, 14 May 2022 23:00:01 -0700
Till: "GNU Ports for eCS Mailing List" <gnuports@2rosenthals.com>

In <list-3690769@2rosenthals.com>, on 05/14/22
   at 06:52 PM, "Dave Yeo" <gnuports@2rosenthals.com> said:

Hi Dave,

>void _scrsize (int *dst);

And for reference the actual source at

  src\emx\src\lib\sys\scrsize.c

>Does this code make sense?

You have the right idea, but what you have written is probably going to
trap.

>int term_width(int fd)
>{
>         int dst[1];
>         void _scrsize (int *dst);
>                  return dst[0];
>}

What you want is:

int term_width(int fd)
{
         int dst[2];
         void _scrsize (dst);       /* Get columns and rows */
                  return dst[0];    /* Return columns */
}


For your needs, _srcsize is better than using VioGetMode directly because
it deals with the 16-bit code issues.

Steven

--
----------------------------------------------------------------------
"Steven Levine" <steve53@earthlink.net>  Warp/DIY/BlueLion etc.
www.scoug.com www.arcanoae.com www.warpcave.com
----------------------------------------------------------------------


Prenumerera: Sändning, Uppsamling, Index.
Stoppa prenumeration
Meddelande till ListMaster