aboutsummaryrefslogtreecommitdiffstats
path: root/src/cklist.c
diff options
context:
space:
mode:
authorAnastasis Grammenos <anastasis.gramm2@gmail.com>2018-10-07 20:00:43 +0300
committerAnastasis Grammenos <anastasis.gramm2@gmail.com>2018-10-07 20:00:43 +0300
commitf67f2c3d5b67f54dae2c2c2754f43b4351445c80 (patch)
treea980a065833e49d84ddd56994b1720adf100a06e /src/cklist.c
parent02aa2496d9eaf5c6f1234df1f91b8e312ee10022 (diff)
downloadck-f67f2c3d5b67f54dae2c2c2754f43b4351445c80.tar.gz
ck-f67f2c3d5b67f54dae2c2c2754f43b4351445c80.tar.bz2
ck-f67f2c3d5b67f54dae2c2c2754f43b4351445c80.zip
add list_exists fucntion
Diffstat (limited to 'src/cklist.c')
-rw-r--r--src/cklist.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cklist.c b/src/cklist.c
index 14d5d82..e142feb 100644
--- a/src/cklist.c
+++ b/src/cklist.c
@@ -186,6 +186,18 @@ void list_print_concat(cklist *ckl) {
}
}
+int list_exists(cklist *ckl, char *str) {
+ if (ckl->size > 0) {
+ list_rewind(ckl);
+ do {
+ if (strcmp(list_get(ckl), str) == 0) {
+ return 1;
+ }
+ } while (list_next(ckl));
+ }
+ return 0;
+}
+
int list_size(cklist *ckl) {
return ckl->size;
}