From bfc58540372abda96ce3b5a4e629badc96cd02ac Mon Sep 17 00:00:00 2001 From: Yevhen Kozirovskyi Date: Fri, 25 Oct 2024 01:55:09 +0000 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20cv4/a=5Ftrain.h?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cv4/a_train.h | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/cv4/a_train.h b/cv4/a_train.h index e69de29..5982bfe 100644 --- a/cv4/a_train.h +++ b/cv4/a_train.h @@ -0,0 +1,51 @@ +#ifndef TRAIN_H +#define TRAIN_H +#define SIZE 100 + +/** + * Jeden vozen vlaku + */ +struct car { + /** + * Nazov cielovej stanice + */ + char value[SIZE]; + /** + * Smenik na dalsi vozen + */ + struct car* next; +}; + +/** + * Prida vozen na koniec vlaku. + * + * @arg nazov cielovej stanice, ktory sa ma priradit novemu voznu. + * @return smernik na zaciatok vlaku. + */ +struct car* add_car(struct car* first,const char* target); + + +/** + * Vypise vsetky vozne vo vlaku + * + * @arg smernik na prvy vozen + */ +void print_train(struct car* first); + +/** + * Zrusenie vsetkych voznov vo vlaku. + * @arg smernik na prvy vozen + */ +void cancel_train(struct car* first); + +/** + * Vyradenie vsetkych voznov, ktorych cielova stanica je target + * + * @arg smernik na prvy vozen + * @arg cielova stanica, ktora sa ma vyradit z vlaku. + * @return smernik na novy prvy vozen + * + */ +struct car* clear_train(struct car* first,const char* target); + +#endif // TRAIN_H