32 lines
696 B
C
32 lines
696 B
C
#ifndef A_STATION_H
|
|
#define A_STATION_H
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
#define SIZE 100
|
|
#define STATION_SIZE 10
|
|
|
|
struct car {
|
|
int capacity;
|
|
char value[SIZE];
|
|
struct car* next;
|
|
};
|
|
|
|
struct station {
|
|
struct car** tracks;
|
|
int track_count;
|
|
};
|
|
|
|
struct station* create_station();
|
|
void destroy_station(struct station* s);
|
|
int select_track(struct station* s, const char* target);
|
|
void add_target_capacity(struct station* s, const char* target, int capacity);
|
|
struct car* find_target(struct station* s, const char* target);
|
|
int get_total_targets(struct station* s);
|
|
int get_total_capacity(struct station* s);
|
|
void print_station(struct station* s);
|
|
|
|
#endif
|