diff options
author | 2023-03-14 18:17:23 +0100 | |
---|---|---|
committer | 2023-03-14 18:17:23 +0100 | |
commit | 53a32c2aeb0e1f95ecbe5693e6c297495f5bba80 (patch) | |
tree | 8bc20d0409734a3ce86f3af1b58a7e0b81694551 /src | |
parent | c9cb97f8acb76b317dd4d913438c1098e752e90c (diff) | |
download | utils-53a32c2aeb0e1f95ecbe5693e6c297495f5bba80.tar.gz utils-53a32c2aeb0e1f95ecbe5693e6c297495f5bba80.zip |
Generify the function to get the version
Diffstat (limited to 'src')
-rw-r--r-- | src/list.c | 6 | ||||
-rw-r--r-- | src/list.h | 3 | ||||
-rw-r--r-- | src/version.c | 24 | ||||
-rw-r--r-- | src/version.h | 25 |
4 files changed, 51 insertions, 7 deletions
@@ -115,9 +115,3 @@ clist_iterator_next(iterator_t *i) return data; } - -char * -clist_version(void) -{ - return VERSION; -} @@ -20,6 +20,8 @@ #ifndef _LIST_H_ #define _LIST_H_ +#include "version.h" + typedef struct list_item_t { void *data; struct list_item_t *next; @@ -42,6 +44,5 @@ void clist_remove (list_t *, list_item_t *); iterator_t clist_iterator (list_t *); int clist_iterator_has_next(iterator_t); void *clist_iterator_next (iterator_t *); -char* clist_version (void); #endif diff --git a/src/version.c b/src/version.c new file mode 100644 index 0000000..9255e7c --- /dev/null +++ b/src/version.c @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2022-2023 Alessandro Iezzi <aiezzi AT alessandroiezzi PERIOD it> + * + * This file is part of libutils. + * + * libutils is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * libutils is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with libutils. If not, see <https://www.gnu.org/licenses/>. + */ + +char * +utils_version() +{ + return VERSION; +} diff --git a/src/version.h b/src/version.h new file mode 100644 index 0000000..cc42a65 --- /dev/null +++ b/src/version.h @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2022-2023 Alessandro Iezzi <aiezzi AT alessandroiezzi PERIOD it> + * + * This file is part of libutils. + * + * libutils is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * libutils is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with libutils. If not, see <https://www.gnu.org/licenses/>. + */ + +#ifndef _VERSION_H_ +#define _VERSION_H_ + +char *utils_version(); + +#endif /* _VERSION_H_ */ |