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


typedef struct car_
{
  int door_state[5];
  int hand_brake_pos;
  int gear_pos;
} car;

void init(car *c)
{
  c->hand_brake_pos = 0;
  c->gear_pos = 0;
  int i;
  for (i = 0; i < 5; i++)
    {
      //c->door_state[i] = 0;
    }
}

int start_ok(car *c)
{
 
  if (c->hand_brake_pos != 0)
    return 1;
  
  if (c->gear_pos != 0)
    return 1;
  
  int i;
  for (i = 0; i < 5; i++)
    {
      if (c->door_state[i] != 0)
	return 1;
    }
  return 0;
}


int main (void)
{
  car *car1;
  car1 = malloc(sizeof(car));


  init(car1);
  int ret;
  ret = start_ok(car1);
  
  if (ret == 0)
    printf("start ok\n");
  else
    printf("somwthing went wrong...\n");

  return 0;
}
