aboutsummaryrefslogtreecommitdiffstats
path: root/src/ck.c
diff options
context:
space:
mode:
authorgramanas <anastasis.gramm2@gmail.com>2018-05-08 03:32:44 +0300
committergramanas <anastasis.gramm2@gmail.com>2018-05-08 03:32:44 +0300
commit1f30b63db9aeab2332d269939c46c2fd9a0f0f8d (patch)
treea0ec8aae21f42be4716ecb6fa5b685583c01e2cd /src/ck.c
parent3a3424774944a421e1b93cbaf533a3500a4d613c (diff)
downloadck-1f30b63db9aeab2332d269939c46c2fd9a0f0f8d.tar.gz
ck-1f30b63db9aeab2332d269939c46c2fd9a0f0f8d.tar.bz2
ck-1f30b63db9aeab2332d269939c46c2fd9a0f0f8d.zip
Some work on lists
Diffstat (limited to 'src/ck.c')
-rw-r--r--src/ck.c26
1 files changed, 26 insertions, 0 deletions
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)) {