From 1f30b63db9aeab2332d269939c46c2fd9a0f0f8d Mon Sep 17 00:00:00 2001 From: gramanas Date: Tue, 8 May 2018 03:32:44 +0300 Subject: Some work on lists --- src/ck.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/ck.c') diff --git a/src/ck.c b/src/ck.c index 4861c06..972dc7e 100644 --- a/src/ck.c +++ b/src/ck.c @@ -30,6 +30,7 @@ #include "actions.h" #include "dblayer.h" +#include "cklist.h" #include "ckutil.h" void free_res(UserOpt *opt, Conf *conf) { @@ -42,6 +43,31 @@ void free_res(UserOpt *opt, Conf *conf) { } int main(int argc, char *argv[]) { + + cklist *p; + p = list_make_and_add("0"); + list_add(p, "1"); + list_add(p, "2"); + list_add(p, "3"); + list_add(p, "4"); + list_add(p, "5"); + list_add(p, "6"); + list_add(p, "7"); + list_add(p, "8"); + list_print_lisp(p); + cklist *po = list_move(p); + cklist *po_l = list_copy_until(po, 4); + list_print_lisp(po_l); + cklist *po_r = list_copy_from(po, 5); + list_print_lisp(po_r); + cklist *po_part = list_copy_part(po, 2, 4); + list_print_lisp(po_part); + list_print(po); + list_free(po_part); + list_free(po); + list_free(po_l); + list_free(po_r); + UserOpt opt; /* get user opt */ switch(parse_action(argc, argv, &opt)) { -- cgit v1.2.3