comp.lang.ada
 help / color / mirror / Atom feed
From: hagerp@iuvax.cs.indiana.edu
Subject: S/W Engineering question
Date: 28 Dec 89 15:02:00 GMT	[thread overview]
Message-ID: <15800008@iuvax> (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

                 reply	other threads:[~1989-12-28 15:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
replies disabled

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