-- This package defines two types MYTASK and MYTASKSET, with pointers -- to each, for use by the topological sort algorithm. Public -- functions are available that initialize a MYTASKSET given a -- properly formatted input file, determine whether a taskset is -- ill-formed, and topologically sort a taskset. -- The input file is expected to consist of a sequence of lines, each -- containing a single task. The resulting taskset will be ill-formed -- if and only if this file consists of an odd number of lines. with TEXT_IO; use TEXT_IO; package mytask is type mytask is private; type mytask_ptr is private; type mytaskset is private; type mytaskset_ptr is access mytaskset; NAME_SIZE: constant integer:= 32; subtype taskid is string(1..NAME_SIZE); type taskid_ptr is access taskid; procedure init_taskset(ts:in out mytaskset_ptr; ft:FILE_TYPE); -- creates a taskset from a file function bad(ts:mytaskset_ptr) return boolean; -- tests for an ill-formed taskset procedure topsort(ts:mytaskset_ptr; ft:FILE_TYPE); -- topologically sorts a taskset, with output to FT -- private -- your type definitions go here -- your procedure & function definitions go in the package body -- (preferably in a separate *.adb file) end mytask;