From b122d16c441e450900a650b12e470e79ff28db8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dami=C3=A1n=20Korpesio?= Date: Sun, 24 Oct 2021 17:00:34 +0200 Subject: [PATCH] prvy --- .idea/.gitignore | 8 ++++++++ .idea/modules.xml | 8 ++++++++ .idea/usaa21.iml | 8 ++++++++ .idea/vcs.xml | 6 ++++++ cv2/program | Bin 0 -> 17056 bytes cv3/program | Bin 0 -> 17056 bytes cv4/Makefile | 13 ++++++++++++ cv4/a_train.c | 18 ++++++++++++++++ cv4/a_train.h | 51 ++++++++++++++++++++++++++++++++++++++++++++++ cv4/main.c | 17 ++++++++++++++++ 10 files changed, 129 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/modules.xml create mode 100644 .idea/usaa21.iml create mode 100644 .idea/vcs.xml create mode 100644 cv2/program create mode 100644 cv3/program create mode 100644 cv4/Makefile create mode 100644 cv4/a_train.c create mode 100644 cv4/a_train.h create mode 100644 cv4/main.c 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 0000000000000000000000000000000000000000..c41275b87633209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gwyLIdoMjH(>H`O32_8m5QI2qSFLa{LIzG>VF zEo}YKQ^^QMVJ3hyl#pAJN##cF@6mN^-r+H%T|HU1>e#ml*_$T($=)s_)B-dTCU$TR zn~x%iZsCu`jflTJmhxlzbVm|KuZ3z!MX}2*8dg-Wrm@@zwF{}<5lVIlf4Db>DoivI zX371L1idn{2|CIWkv#75 z2g<%iIplRQw9sFMjN>=XDJu z>*umR;IJQ428{h|sF3|J{=#9;&lilR9UW#ncKfQsp4U^1{Qnr%ceoR;DSIA&;ZvFl zE0xILw0|1~G=6NKYrk|Z`}Z97Jw8*Dv51^o63-u|K1PPtM7;dw=YHN#?bK(P@iW+Z zE%v-Fe54#C66=}LjLiHw6wut|`guLV`{Son`|13n#CAN6&w?Wrw&(vt^{WTWew0}g z+cVO7#A+`BO1r{Du7`cF9m~ZqCXVap=hBiK_D+ALs(z);ZUx(~&M;<%+DgfaJa^0z z^EaRz9#t2HFM-C#|C#vl^_Tv?#%(t(&EGOw_#!>yaL)CbrL;E4ZvU%|rp8i-fkPDk E1P)`@-T(jq literal 0 HcmV?d00001 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; +}