Appendix A. Virtual System API

This module is a set of virtual "system calls". This is an ANSI-C code, but the ANSI standard C library does not support some useful features of modern OSes (e.g. no multi-thread support is present). To make modules free of system dependent system calls (i.e. to make the project more portable) module "Virtual System API" is used in any other module when it must use non-ANSI features. The following structures are present:

To use shared data the following structures were prepared: semaphore_struct and ssp, defined as

	typedef struct semaphore_struct *ssp;
These structures are used to manage a "semaphore structure". The variable of the type ssp is returned by function creating this structure and used later to protect some shared data. There is no need to introduce the field of the structure. In Windows environment they are implemented using Mutexes and Events.

To manage multiple threads the following structures are used: thread_id and tidp, defined as:

	typedef struct thread_id *tidp;

The following API has been prepared: