Re: exu 3, key.ex

new topic     » goto parent     » topic index » view thread      » older message » newer message

Robert Craig wrote:
> 
> Michael J. Sabal wrote:
> > I only just got the pre-alpha-2 to test now.  I'm using Slackware 10.1 with
> > 
> > 2.4.29 kernel.  I have no problems with keymappings without curses, but the
> > bright colors don't come out on my console.  
> 
> Yes, I'm aware of that.
> I couldn't figure out how to get the brighter versions
> of the colors using ANSI codes. Maybe someone has an idea.
> 
> > Also, under the official 2.5
> > exu, ed.ex fills my 112x30 console screen, where the no-curses version only
> > fills 80x25.  Besides those little quibbles, I have no complaints.
> 
> Yes, I'm aware of that too.
> exu looks for the environment variables, LINES and COLUMNS,
> which I can see when I type:
>    set | more
> but for some reason those variables do not show up when
> I do a C getenv() call. Maybe someone has an idea there too.
> 
> Regards,
>    Rob Craig
>    Rapid Deployment Software
>    <a href="http://www.RapidEuphoria.com">http://www.RapidEuphoria.com</a>
Hi

Will this help

#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <unistd.h>

struct winsize ws;

int main()
{
char *buffer, *env;
int lines;
int rows, cols;

buffer = getenv("LINES");
if (buffer != NULL )
    printf("LINES are %s\n", buffer);
//lines = atoi("400");
//printf("Lines number :%d\n", lines);

if (ioctl(1, TIOCGWINSZ, &ws) == -1) 
	{
	rows = 24;
	cols = 80;
	} 
else 
	{
	if (!ioctl(STDIN_FILENO, TIOCGWINSZ, &ws)) 
		{
		 rows = ws.ws_row;
		 cols = ws.ws_col;
		 if (!rows) 
			 {
			  env = getenv("LINES");
			  if (env)
				rows = atoi(env);
			  if (!rows)
				rows = 24;
		     }
		if (!cols) 
			{
			 env = getenv("COLUMNS");
			 if (env)
				cols = atoi(env);
			 if (!cols)
				cols = 80;
		    }
		}
	}

if (!rows) 
	{
	env = getenv("LINES");
	if (env)
		rows = atoi(env);
	if (!rows)
		rows = 24;
	}

if (!cols) 
	{
	env = getenv("COLUMNS");
	if (env)
		cols = atoi(env);
	if (!cols)
		cols = 80;
	}

printf("%d %d\n", rows, cols);

printf("Program completed successfully\n");

}


Note, this was trawled off the net, and involves very little in the way of
personal knowledge


Chris



http://members.aol.com/chriscrylex/euphoria.htm
http://uboard.proboards32.com/
http://members.aol.com/chriscrylex/EUSQLite/eusql.html

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu