/*
Author: G.D. van Albada
Date:   August 26, 2009
(c) Universiteit van Amsterdam

In this file the data types and functions exported by the file
interval.c for the first assignment in the OS course for 2009
are defined.
*/

/* interval is a pointer to a struct used by the functions
   in the file interval.c. As such it constitutes an opaque data type */

typedef struct intervalData *interval;

/* the function newInterval creates and initialises a new
   intervalData struct and returns its address */

interval newInterval(void);

/* The function delInterval frees the memory for an interval
   variable and NULLs its value to prevent accidental reuse.
   It returns zero on success, -1 when an invalid pointer
   is passed as an argument. */

int delInterval(interval *intervalPtr);

/* the function timeInterval returns the wall clock time,
   user CPU time and system CPU time for the calling process
   and its children consumed since the previous call for the
   specified interval.
   It returns zero on success, -1 when an invalid pointer
   is passed as an argument. */

int timeInterval(interval id, double *wct, double *ust, double *syt);
