comp.lang.ada
 help / color / mirror / Atom feed
* S/W Engineering question
@ 1989-12-28 15:02 hagerp
  0 siblings, 0 replies; only message in thread
From: hagerp @ 1989-12-28 15:02 UTC (permalink / raw)



I am interested in getting some feedback on the ramifications of the
following design decision and one example of the implementation.

An operating system is designed and written in C.  It is desired that
all application programs that run on this system, however, be written
in Ada.  Therefore, all necessary system calls are encapsulated in
a set of Ada interface packages.

The system provides a facility to allocate a buffer for a user application
called "Get".  "Get" is similar to "malloc" in that it returns a pointer
(this is C, remember) to the buffer.  The Ada interface defines a 
routine "GET_BUF" (that actually calls "Get") as follows:

	generic
	    type BUFFER_TYPE is private;
	    type POINTER_TYPE is access BUFFER_TYPE;
	package ALLOCATE_BUFFER is
	    procedure GET_BUF (PTR_BUFFER : in out POINTER_TYPE);

	    procedure FREE_BUF (PTR_BUFFER : in POINTER_TYPE);
	end ALLOCATE_BUFFER;

After an application instantiates the ALLOCATE_BUFFER package, a
call to "GET_BUF" returns an access type for BUFFER_TYPE.

I'm very interested in any comments.

--paul hager		hagerp@iuvax.cs.indiana.edu

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1989-12-28 15:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1989-12-28 15:02 S/W Engineering question hagerp

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