comp.lang.ada
 help / color / mirror / Atom feed
From: blakemor@software.ORG (Alex Blakemore)
Subject: (none)
Date: Tue, 15-Sep-87 15:39:18 EDT	[thread overview]
Date: Tue Sep 15 15:39:18 1987
Message-ID: <8709152214.AA00945@ucbvax.Berkeley.EDU> (raw)


    Paul Attermier at Sandia National Labs
wanted to know about using Ada with X windows.

    You can pass a callback array easily in Ada,
assuming your compiler supports the most basic
features from Chapter 13 of the LRM. (Most do).
An example follows :

with system;
procedure main is

  type call_back_arrays is array (1 .. 2) of system.address;
  call_back_array : call_back_arrays;

  procedure X_routine (call_back : system.address); -- passed as system.address
  pragma interface (C, X_routine);                  -- due to Verdix limitation
 
  procedure user_routine_1 is
  begin ...

  procedure user_routine_2 is
  begin ...

begin
  call_back_array (1) := user_routine_1'address;
  call_back_array (2) := user_routine_2'address;
  X_routine (call_back_array'address);
end main;

    We've successfully used this technique to bind Ada programs
to our Apollo X substitutes.  I don't believe this violates
the spirit of Ada, but like most Chapt 13 stuff, it should be
well isolated. What IS difficult in Ada is to call a routine
from an address known only at run time (ie. make a callback).
However, that doesn't appear quite as often and you can always
use a layer of C.  Or maybe try some unchecked conversion and
generics with subprogram formal parameters ... ?

                            Alex Blakemore
                            Software Productivity Consortium
                            Reston, VA

             reply	other threads:[~1987-09-15 19:39 UTC|newest]

Thread overview: 109+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1987-09-15 19:39 Alex Blakemore [this message]
  -- strict thread matches above, loose matches on Subject: below --
1996-07-23  0:00 <None> **
1993-09-01  7:24 (none) N.B. Hedd
1993-01-27 23:32 <none> xim
1993-01-27 23:09 <none> xim
1993-01-27 16:39 <none> xim
1993-01-27 16:29 <none> slava
1993-01-26 23:13 <none> xim
1992-12-04  4:03 (none) Michael Feldman
1992-12-03 16:57 (none) dog.ee.lbl.gov!overload.lbl.gov!agate!linus!linus.mitre.org!news!emery
1992-12-03 15:59 (none) Tuck er Taft
1992-12-03 14:43 (none) dog.ee.lbl.gov!overload.lbl.gov!agate!usenet.ins.cwru.edu!magnus.acs.ohio
1992-04-03 15:57 <none> David Emery
1991-09-20 18:58 <None> cis.ohio-state.edu!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!usen
1991-06-20 13:18 (none) Eric E. Mays 52202
1991-06-20 13:18 (none) Eric E. Mays 52202
1991-05-27  8:20 (none) Giorgio del rio
1991-05-14 13:35 <None> Ace Stewart
1991-03-26 20:38 (none) Eric E. Mays 52202
1991-02-28 17:50 (none) Giorgio del rio
1991-01-10 16:38 (none) GS-09 Ken McCook;SCDD
1990-09-20 18:21 (none) "John P. Solomond, Director, AJPO"
1990-09-24  8:52 ` (none) Richard A. O'Keefe
1990-08-08 21:12 (none) Jose_Duarte
1990-05-07 18:37 (none) Ken McCook;SCDQ;
1990-02-14 16:43 (none) Dave Williamson
1989-09-02 22:13 (none) cdonalds
1989-09-04  1:43 ` (none) Richard O'Keefe
1989-04-14 11:43 (none) jrovert
1989-04-03 13:23 (none) Norman Cohen
1989-03-09 22:07 (none) Norman Cohen
1989-03-08 13:59 (none) Norman Cohen
1989-03-06 19:20 (none) TSIGLER
1989-03-06 14:49 (none) Javier Romanach / GMV
1989-02-24  0:46 (none) Marie T. Minogue
1989-02-16 17:05 (none) Richard.S.D'Ippolito
1989-01-13 17:11 (none) NCOHEN
1988-11-21 22:34 (none) Mark Nelson
1988-11-07 12:52 (none) gita R. Rajan
1988-10-20 18:40 (none) sdl
1988-09-16  9:51 (none) TVOVERBE
1988-06-03 12:08 (none) Greg Gicca
1988-04-07 20:15 (none) sdl
1988-03-17  1:24 (none) sdl
1988-03-12  2:48 (none) sdl
1988-03-09  3:18 (none) sdl
1988-03-07 15:16 (none) amb
1987-12-23 10:54 (none) CARNAL
1987-08-28 15:31 (none) LOUBOUTIN
1987-08-25 16:58 (none) LOUBOUTIN
1987-08-25 16:58 (none) LOUBOUTIN
1987-06-09 17:17 (none) SARX
1987-06-04 16:21 (none) seafac
1987-05-29  4:57 (none) postmaster
1987-05-27  3:03 (none) jklemens
1987-03-14  1:22 (none) CONTR47
1987-01-16 16:24 (none) FRASER
1986-12-21 23:16 (none) diby
1986-09-22 16:36 (none) "Pat Rogers, High Tech Lab"
1986-09-22 16:36 (none) "Pat Rogers, High Tech Lab"
1986-06-05 19:39 (none) info-ada-request
1986-06-05 12:15 (none) info-ada-request
1986-04-08 14:54 (none) Stephen.Hutchinson
1986-03-16 18:52 (none) info-ada-request
1986-02-03 19:07 (none) GAUSTIN
1985-12-05 21:42 (none) , , 
1985-12-05 20:54 (none) , 
1985-12-05 20:50 (none) info-ada
1985-12-05 17:45 (none) info-ada
1985-12-08 21:08 ` (none) Jay R. Ashworth
1985-12-05 15:46 (none) info-ada
1985-12-05  6:09 (none) info-ada
1985-12-06  1:04 ` (none) info-ada
1985-12-06  1:37 ` (none) info-ada
1985-12-06  1:47 ` (none) info-ada
1985-12-04 18:34 (none) RCONN
1985-12-06  1:02 ` (none) info-ada
1985-12-06  1:32 ` (none) info-ada
1985-12-06  1:46 ` (none) info-ada
1985-12-04 16:41 (none) RCONN
1985-12-06  0:59 ` (none) info-ada
1985-12-06  1:29 ` (none) info-ada
1985-12-06  1:46 ` (none) info-ada
1985-12-04  7:50 (none) , 
1985-12-06  0:47 ` (none) info-ada
1985-12-06  1:13 ` (none) info-ada
1985-12-06  1:44 ` (none) info-ada
1985-12-03 22:07 (none) , 
1985-12-06  0:47 ` (none) info-ada
1985-12-06  1:10 ` (none) info-ada
1985-12-06  1:42 ` (none) info-ada
1985-12-03 11:13 (none) , 
1985-12-06  0:42 ` (none) info-ada
1985-12-06  1:08 ` (none) info-ada
1985-12-06  1:41 ` (none) info-ada
1985-12-03  4:24 (none) info-ada
1985-12-06  0:41 ` (none) info-ada
1985-12-06  1:06 ` (none) info-ada
1985-12-06  1:40 ` (none) info-ada
1985-12-06  1:48 ` (none) info-ada
1985-12-12 22:22   ` (none) info-ada
1985-12-02 20:44 (none) Stachour.CSC_RP
1985-12-06  0:41 ` (none) info-ada
1985-11-29 14:35 Ada Professionalism Document Edward V. Berard
1985-12-04  9:09 ` (none) , 
1985-12-06  0:49   ` (none) info-ada
1985-12-10 11:32     ` (none) info-ada
1985-12-06  1:15   ` (none) info-ada
1985-12-06  1:45   ` (none) info-ada
1985-12-06  5:04   ` (none)??? Dick Dunn
replies disabled

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