|
|
|
@ -26,7 +26,7 @@ enum process_status {
|
|
|
|
|
PROC_WAIT_SLEEP = 3,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// process structure:
|
|
|
|
|
// forward define structs for recursive references
|
|
|
|
|
typedef struct ProcessControlBlock ProcessControlBlock;
|
|
|
|
|
struct loaded_binary;
|
|
|
|
|
|
|
|
|
@ -82,7 +82,7 @@ typedef struct loaded_binary {
|
|
|
|
|
* we get global errno variables.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#define CreateOptionalOfType(type)\
|
|
|
|
|
#define CreateOptionalOfType(type) \
|
|
|
|
|
typedef struct Optional##type { \
|
|
|
|
|
enum error_code error; \
|
|
|
|
|
type value; \
|
|
|
|
@ -91,10 +91,12 @@ typedef struct Optional##type { \
|
|
|
|
|
#define has_value(optional) (optional.error == 0)
|
|
|
|
|
#define has_error(optional) (!has_value(optional))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef unsigned int size_t;
|
|
|
|
|
// define some type aliases that only contain ascii character
|
|
|
|
|
// they are used in the name of the struct optional_<name>
|
|
|
|
|
typedef void* voidptr;
|
|
|
|
|
typedef ProcessControlBlock* pcbptr;
|
|
|
|
|
// size_t is another standard type
|
|
|
|
|
typedef unsigned int size_t;
|
|
|
|
|
|
|
|
|
|
// create optionals for required types
|
|
|
|
|
CreateOptionalOfType(int);
|
|
|
|
|