comp.lang.ada
 help / color / mirror / Atom feed
* Using gnat & ncurses
@ 2010-03-15 20:59 Warren
  2010-03-16 18:03 ` Dirk Heinrichs
  2010-03-18 13:45 ` Nomen Nescio
  0 siblings, 2 replies; 6+ messages in thread
From: Warren @ 2010-03-15 20:59 UTC (permalink / raw)


On the weekend I stumbled across a rather annoying
surprise. The culprit was the implementation of 
ncurses lib. I've only ever [recently] used it in
C and always assumed it was a C-only library. I
am aware that there is also a ncurses C++ interface 
as well, but I thought that was isolated. Well, maybe
not.

It turns out that if I use an Ada main program and
link with ncurses,  Ada exceptions fail (under
Cygwin) with an abort (Access violation IIRC). You
don't actually have to invoke any ncurses routines,
but simply reference something to cause it to link
in.

After some experimentation, I discovered that I could 
overcome the problem by making the main program
a C++ program and invoking the usual adainit/adafinal
routines. Annoying, but at least it is no longer
a "show stopper" that it initially appeared to be.

It just occurred to me that there was some sort 
of Ada binding in ncurses IIRC. Has anyone here 
had any experience with it?  Maybe that would
circumvent this main program annoyance among other
things.

Warren



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Using gnat & ncurses
  2010-03-15 20:59 Using gnat & ncurses Warren
@ 2010-03-16 18:03 ` Dirk Heinrichs
  2010-03-16 18:35   ` Ludovic Brenta
  2010-03-18 13:45 ` Nomen Nescio
  1 sibling, 1 reply; 6+ messages in thread
From: Dirk Heinrichs @ 2010-03-16 18:03 UTC (permalink / raw)


Warren wrote:

> It just occurred to me that there was some sort
> of Ada binding in ncurses IIRC. Has anyone here
> had any experience with it?  Maybe that would
> circumvent this main program annoyance among other
> things.

Most distributions don't seem to package the Ada bindings, although they 
exist since years. Interestingly, libncurses5-dev in Debian contains the 
docs for them.

Bug?

Bye...

	Dirk



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Using gnat & ncurses
  2010-03-16 18:03 ` Dirk Heinrichs
@ 2010-03-16 18:35   ` Ludovic Brenta
  2010-03-16 19:45     ` Warren
  0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Brenta @ 2010-03-16 18:35 UTC (permalink / raw)


Dirk Heinrichs writes:
> Warren wrote:
>
>> It just occurred to me that there was some sort
>> of Ada binding in ncurses IIRC. Has anyone here
>> had any experience with it?  Maybe that would
>> circumvent this main program annoyance among other
>> things.
>
> Most distributions don't seem to package the Ada bindings, although they 
> exist since years. Interestingly, libncurses5-dev in Debian contains the 
> docs for them.

Debian 5.0 "Lenny" has libtexttools-dev, 6.0 "Squeeze" has
libtexttools2-dev.  They provide a thick binding to curses with
additional functionality.

-- 
Ludovic Brenta.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Using gnat & ncurses
  2010-03-16 18:35   ` Ludovic Brenta
@ 2010-03-16 19:45     ` Warren
  0 siblings, 0 replies; 6+ messages in thread
From: Warren @ 2010-03-16 19:45 UTC (permalink / raw)


Ludovic Brenta expounded in news:87iq8w3yij.fsf@ludovic-brenta.org:

> Dirk Heinrichs writes:
>> Warren wrote:
>>
>>> It just occurred to me that there was some sort
>>> of Ada binding in ncurses IIRC. Has anyone here
>>> had any experience with it?  Maybe that would
>>> circumvent this main program annoyance among other
>>> things.
>>
>> Most distributions don't seem to package the Ada bindings, although
>> they exist since years. Interestingly, libncurses5-dev in Debian
>> contains the docs for them.
> 
> Debian 5.0 "Lenny" has libtexttools-dev, 6.0 "Squeeze" has
> libtexttools2-dev.  They provide a thick binding to curses with
> additional functionality.

The last time I downloaded ncurses to install on HPUX, I
recall turning off the build for it. But at the time, I
wasn't curious (time was short).

Warren



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Using gnat & ncurses
  2010-03-15 20:59 Using gnat & ncurses Warren
  2010-03-16 18:03 ` Dirk Heinrichs
@ 2010-03-18 13:45 ` Nomen Nescio
  2010-03-18 16:38   ` Warren
  1 sibling, 1 reply; 6+ messages in thread
From: Nomen Nescio @ 2010-03-18 13:45 UTC (permalink / raw)


Warren <ve3wwg@gmail.com> wrote:

> It just occurred to me that there was some sort 
> of Ada binding in ncurses IIRC. Has anyone here 
> had any experience with it?  Maybe that would
> circumvent this main program annoyance among other
> things.

I have used it and I was very impressed with it, Juergen did a bang-up job
in my opinion. It's not completely faithful to ncurses in that some of the
functions are implemented (and work) very differently, but I think, better,
than the C version. Definitely worth trying.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Using gnat & ncurses
  2010-03-18 13:45 ` Nomen Nescio
@ 2010-03-18 16:38   ` Warren
  0 siblings, 0 replies; 6+ messages in thread
From: Warren @ 2010-03-18 16:38 UTC (permalink / raw)


Nomen Nescio expounded in
news:938a6efb4f04eececb1934844199fa16@dizum.com: 

> Warren <ve3wwg@gmail.com> wrote:
>> It just occurred to me that there was some sort 
>> of Ada binding in ncurses IIRC. Has anyone here 
>> had any experience with it?  Maybe that would
>> circumvent this main program annoyance among other
>> things.
> 
> I have used it and I was very impressed with it, Juergen did a bang-up
> job in my opinion. It's not completely faithful to ncurses in that
> some of the functions are implemented (and work) very differently, but
> I think, better, than the C version. Definitely worth trying.

I would certainly consider using it in future
projects. However, with my current project I had already
done a thick binding with a thin C layer underneath. The
idea behind that was so that I could still use another
implementation of curses (like HP's) without seeing changes 
in the constants etc. (like attribute bit definitions).

But having said that, perhaps that was already addressed.
More research (for me) on that is definitely in order.

Warren



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-03-18 16:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-15 20:59 Using gnat & ncurses Warren
2010-03-16 18:03 ` Dirk Heinrichs
2010-03-16 18:35   ` Ludovic Brenta
2010-03-16 19:45     ` Warren
2010-03-18 13:45 ` Nomen Nescio
2010-03-18 16:38   ` Warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox