view dpp_common.h @ 12:7f2db1e1bf2f default tip

use CBC_COMPILER environment val
author anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Thu, 04 Jul 2019 18:53:38 +0900
parents a15437a1e94c
children
line wrap: on
line source

#ifndef _DPP_COMMON_H_
#define _DPP_COMMON_H_

#include<stdio.h>
#include<stdlib.h>

enum Action {
    PutDownLeftFork,
    PutDownRightFork,
    Eating,
    WaitLeftFork,
    WaitRightFork,
    PickUpLeftFork,
    PickUpRightFork,
    Thinking,
    PutDownFork
};

typedef struct phils {
    int id;
    struct fork *right_fork;
    struct fork *left_fork;
    struct phils *right;
    struct phils *left;
    enum Action next;
} Phils, *PhilsPtr;

typedef struct fork {
    int id;
    struct phils *owner;
} Fork, *ForkPtr;

typedef struct task {
    struct task *next;
    struct phils *phils;
} Task, *TaskPtr;

#endif