From 6dddea178d1e4b5d8bc405018a13e3f5b14e1d39 Mon Sep 17 00:00:00 2001 From: Lukas Heiligenbrunner Date: Tue, 28 Apr 2020 19:21:43 +0000 Subject: [PATCH] Upload New File --- chained_functions.h | 73 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 chained_functions.h diff --git a/chained_functions.h b/chained_functions.h new file mode 100644 index 0000000..0fab93d --- /dev/null +++ b/chained_functions.h @@ -0,0 +1,73 @@ +/* + ============================================================================ + Name : chained_list.c + Author : Lukas Heiligenbrunner + Version : 0.1.5 BETA + Copyright : My copyright + Description : C programme to manage chained lists + ============================================================================ + */ + +#ifndef CHAINED_FUNCTIONS_H +#define CHAINED_FUNCTIONS_H + + +typedef struct messdaten +{ + struct messdaten * next; + char sensorname[10]; + float messwert; +}messdaten; + + +/* functon to insert the first element + * in: firstelem; newelement + * out: newelement + * changed: firstelem + */ +messdaten* insertFirst(messdaten* firstelem, messdaten* newelement); + +/* functon to insert the last element + * in: firstelem; newelement + * out: newelement (why!?!) + * changed: lastelement + */ +messdaten* insertLast(messdaten* firstelem, messdaten* newelement); + +/* functon to insert the element on a specific position + * in: firstelem; newelement; position + * out: newelement + * changed: one more item in chained list... + */ +messdaten* insertPos(messdaten* firstelem, messdaten* newelement, int pos); + +/* functon to delete the first element + * in: firstelem; + * out: newelement + * changed: firstelem + */ +messdaten* deleteFirst(messdaten* firstelem); + +/* functon to delete the last element + * in: firstelem + * out: newelement + * changed: lastelement + */ +messdaten* deleteLast(messdaten* firstelem); + +/* functon to delete the element of a specific element + * in: firstelem; newelement + * out: newelement + * changed: firstelem + */ +messdaten* deletePos(messdaten* firstelem, int pos); + +/* functon to delete all the list elements + * in: firstelem + * out: newelement + * changed: the whole list XD + */ +messdaten* deleteAll(messdaten* firstelem); + + +#endif