diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..70ebff0 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/usaa21.iml b/.idea/usaa21.iml new file mode 100644 index 0000000..bc2cd87 --- /dev/null +++ b/.idea/usaa21.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/cv2/program b/cv2/program new file mode 100644 index 0000000..c41275b Binary files /dev/null and b/cv2/program differ diff --git a/cv3/program b/cv3/program new file mode 100644 index 0000000..f8fb079 Binary files /dev/null and b/cv3/program differ diff --git a/cv4/Makefile b/cv4/Makefile new file mode 100644 index 0000000..3c2c463 --- /dev/null +++ b/cv4/Makefile @@ -0,0 +1,13 @@ +CFLAGS= -std=c99 -g -Wall + +all: train + +%.o: %.c + gcc -c -o $@ $< $(CFLAGS) + +train: main.o a_train.o + gcc main.o a_train.o -o train + +clean: + rm *.o train + diff --git a/cv4/a_train.c b/cv4/a_train.c new file mode 100644 index 0000000..3ecfbc8 --- /dev/null +++ b/cv4/a_train.c @@ -0,0 +1,18 @@ +#include "a_train.h" +#include + +struct car* add_car(struct car* first,const char* target) { + return NULL; +} + +void print_train(struct car* first) { +} + +void cancel_train(struct car* first) { +} + + +struct car* clear_train(struct car* first, const char* target) { + return NULL; +} + diff --git a/cv4/a_train.h b/cv4/a_train.h new file mode 100644 index 0000000..5982bfe --- /dev/null +++ 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 diff --git a/cv4/main.c b/cv4/main.c new file mode 100644 index 0000000..d64f05a --- /dev/null +++ b/cv4/main.c @@ -0,0 +1,17 @@ +#include "a_train.h" +#include + +// Testovaci subor pre vlak +int main(){ + struct car* train = NULL; + train = add_car(train,"Presov"); + train = add_car(train,"Bratislava"); + train = add_car(train,"Levoca"); + train = add_car(train,"Spiska Nova Ves"); + print_train(train); + clear_train(train,"Levoca"); + print_train(train); + cancel_train(train); + + return 0; +}