summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-11-28 08:54:27 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-11-28 08:54:27 +0900
commitcccce16986ae239d9434ad8dea78e3364c58bc7c (patch)
treebd091c50f8a4acb4738523f24075495c74af6d39
parent9ca7239be7fe35f3d3dd6baa541838f52d08a2e2 (diff)
add percentages during build and cllean up warnings
-rwxr-xr-xbuild.sh2
-rw-r--r--mrk.c26
-rw-r--r--mrklib.h2
-rw-r--r--mrklib_buildfile.c77
-rw-r--r--mrklib_index.c8
-rw-r--r--mrklib_priv.h1
-rw-r--r--mrklib_repodb.c8
-rw-r--r--mrklib_serv.c16
-rw-r--r--mrklib_svc.c8
9 files changed, 96 insertions, 52 deletions
diff --git a/build.sh b/build.sh
index 90bde3d..be98bd8 100755
--- a/build.sh
+++ b/build.sh
@@ -1,2 +1,2 @@
1#!/bin/sh 1#!/bin/sh
2gcc mrklib*.c mrk.c -o mrk `pkg-config --cflags --libs eina ecore ecore-file ecore-ipc eet` 2gcc -g $CFLAGS mrklib*.c mrk.c -o mrk `pkg-config --cflags --libs eina ecore ecore-file ecore-ipc eet`
diff --git a/mrk.c b/mrk.c
index 4237395..5c31fab 100644
--- a/mrk.c
+++ b/mrk.c
@@ -22,12 +22,12 @@ static Eina_Bool move_to_cwd = EINA_FALSE;
22static Eina_Bool install_bin = EINA_FALSE; 22static Eina_Bool install_bin = EINA_FALSE;
23 23
24static void 24static void
25_cb_connect(void *data, Mrk *server) 25_cb_connect(void *data EINA_UNUSED, Mrk *server EINA_UNUSED)
26{ 26{
27} 27}
28 28
29static void 29static void
30_cb_disconnect(void *data, Mrk *server) 30_cb_disconnect(void *data EINA_UNUSED, Mrk *server EINA_UNUSED)
31{ 31{
32 _mrk_err("Disconnect\n"); 32 _mrk_err("Disconnect\n");
33} 33}
@@ -45,21 +45,21 @@ status(double pos)
45} 45}
46 46
47static void 47static void
48_cb_upload_begin(void *data, Mrk *server) 48_cb_upload_begin(void *data EINA_UNUSED, Mrk *server EINA_UNUSED)
49{ 49{
50 status(0.0); 50 status(0.0);
51 fflush(stdout); 51 fflush(stdout);
52} 52}
53 53
54static void 54static void
55_cb_upload_progress(void *data, Mrk *server, double pos) 55_cb_upload_progress(void *data EINA_UNUSED, Mrk *server EINA_UNUSED, double pos)
56{ 56{
57 status(pos); 57 status(pos);
58 fflush(stdout); 58 fflush(stdout);
59} 59}
60 60
61static void 61static void
62_cb_upload_end(void *data, Mrk *server) 62_cb_upload_end(void *data EINA_UNUSED, Mrk *server EINA_UNUSED)
63{ 63{
64 status(1.0); 64 status(1.0);
65 printf("\n"); 65 printf("\n");
@@ -67,28 +67,28 @@ _cb_upload_end(void *data, Mrk *server)
67} 67}
68 68
69static void 69static void
70_cb_upload_success(void *data, Mrk *server, Eina_Bool success) 70_cb_upload_success(void *data EINA_UNUSED, Mrk *server EINA_UNUSED, Eina_Bool success)
71{ 71{
72 if (!success) _mrk_err("Upload Failed\n"); 72 if (!success) _mrk_err("Upload Failed\n");
73 ecore_main_loop_quit(); 73 ecore_main_loop_quit();
74} 74}
75 75
76static void 76static void
77_cb_download_begin(void *data, Mrk *server) 77_cb_download_begin(void *data EINA_UNUSED, Mrk *server EINA_UNUSED)
78{ 78{
79 status(0.0); 79 status(0.0);
80 fflush(stdout); 80 fflush(stdout);
81} 81}
82 82
83static void 83static void
84_cb_download_progress(void *data, Mrk *server, double pos) 84_cb_download_progress(void *data EINA_UNUSED, Mrk *server EINA_UNUSED, double pos)
85{ 85{
86 status(pos); 86 status(pos);
87 fflush(stdout); 87 fflush(stdout);
88} 88}
89 89
90static void 90static void
91_cb_download_end(void *data, Mrk *server) 91_cb_download_end(void *data EINA_UNUSED, Mrk *server EINA_UNUSED)
92{ 92{
93 status(1.0); 93 status(1.0);
94 printf("\n"); 94 printf("\n");
@@ -96,7 +96,7 @@ _cb_download_end(void *data, Mrk *server)
96} 96}
97 97
98static void 98static void
99_cb_download_success(void *data, Mrk *server, const char *file) 99_cb_download_success(void *data EINA_UNUSED, Mrk *server EINA_UNUSED, const char *file)
100{ 100{
101 if (!file) _mrk_err("Download Failed\n"); 101 if (!file) _mrk_err("Download Failed\n");
102 if (move_to_cwd) 102 if (move_to_cwd)
@@ -125,18 +125,18 @@ _cb_download_success(void *data, Mrk *server, const char *file)
125} 125}
126 126
127static void 127static void
128_cb_answer_begin(void *data, Mrk *server) 128_cb_answer_begin(void *data EINA_UNUSED, Mrk *server EINA_UNUSED)
129{ 129{
130} 130}
131 131
132static void 132static void
133_cb_answer_progress(void *data, Mrk *server, const char *result) 133_cb_answer_progress(void *data EINA_UNUSED, Mrk *server EINA_UNUSED, const char *result)
134{ 134{
135 printf("%s\n", result); 135 printf("%s\n", result);
136} 136}
137 137
138static void 138static void
139_cb_answer_end(void *data, Mrk *server) 139_cb_answer_end(void *data EINA_UNUSED, Mrk *server EINA_UNUSED)
140{ 140{
141 ecore_main_loop_quit(); 141 ecore_main_loop_quit();
142} 142}
diff --git a/mrklib.h b/mrklib.h
index 570ae58..78281e0 100644
--- a/mrklib.h
+++ b/mrklib.h
@@ -129,7 +129,7 @@ struct _Mrk_Build
129EAPI Mrk_Build *mrk_build_load(const char *file); 129EAPI Mrk_Build *mrk_build_load(const char *file);
130EAPI void mrk_build_free(Mrk_Build *bld); 130EAPI void mrk_build_free(Mrk_Build *bld);
131EAPI Eina_Bool mrk_build_do(Mrk_Build *bld, const char *tmpd, const char *objd); 131EAPI Eina_Bool mrk_build_do(Mrk_Build *bld, const char *tmpd, const char *objd);
132EAPI Eina_Bool mrk_build_pakage_bin(Mrk_Build *bld, const char *file, const char *tmpd, const char *os, const char *arch); 132EAPI Eina_Bool mrk_build_package_bin(Mrk_Build *bld, const char *file, const char *tmpd, const char *os, const char *arch);
133EAPI Eina_Bool mrk_build_package_src(Mrk_Build *bld, const char *buildfile, const char *file); 133EAPI Eina_Bool mrk_build_package_src(Mrk_Build *bld, const char *buildfile, const char *file);
134 134
135EAPI Eina_Bool mrk_package_src_extract(const char *file, const char *dst); 135EAPI Eina_Bool mrk_package_src_extract(const char *file, const char *dst);
diff --git a/mrklib_buildfile.c b/mrklib_buildfile.c
index 2894d99..c7f8036 100644
--- a/mrklib_buildfile.c
+++ b/mrklib_buildfile.c
@@ -367,7 +367,6 @@ mrk_build_load(const char *file)
367 Eina_File *ef; 367 Eina_File *ef;
368 char *mem; 368 char *mem;
369 size_t size; 369 size_t size;
370 int ret;
371 370
372 ef = eina_file_open(file, EINA_FALSE); 371 ef = eina_file_open(file, EINA_FALSE);
373 if (!ef) return NULL; 372 if (!ef) return NULL;
@@ -435,9 +434,17 @@ mrk_build_do(Mrk_Build *bld, const char *tmpd, const char *objd)
435 char tmp[4096]; 434 char tmp[4096];
436 char tmp2[4096]; 435 char tmp2[4096];
437 const char *ss, *cc; 436 const char *ss, *cc;
438 int res; 437 int res, total, current;
439#define err(reason) do { fprintf(stderr, "%s\n", reason); goto error; } while (0) 438#define err(reason) do { fprintf(stderr, "%s\n", reason); goto error; } while (0)
440 439
440 total =
441 eina_list_count(bld->po) +
442 eina_list_count(bld->data) +
443 eina_list_count(bld->desktops) +
444 eina_list_count(bld->icons) +
445 eina_list_count(bld->copying);
446 if (total < 1) total = 1;
447 current = 0;
441 if (!(buf = eina_strbuf_new())) goto error; 448 if (!(buf = eina_strbuf_new())) goto error;
442 snprintf(tmp, sizeof(tmp), "%s", tmpd); 449 snprintf(tmp, sizeof(tmp), "%s", tmpd);
443 ecore_file_mkpath(tmp); 450 ecore_file_mkpath(tmp);
@@ -445,6 +452,7 @@ mrk_build_do(Mrk_Build *bld, const char *tmpd, const char *objd)
445 ecore_file_mkpath(tmp); 452 ecore_file_mkpath(tmp);
446 EINA_LIST_FOREACH(bld->po, l, s) 453 EINA_LIST_FOREACH(bld->po, l, s)
447 { 454 {
455 current++;
448 snprintf(tmp, sizeof(tmp), "%s/share/locale/%s/LC_MESSAGES/", tmpd, s); 456 snprintf(tmp, sizeof(tmp), "%s/share/locale/%s/LC_MESSAGES/", tmpd, s);
449 ecore_file_mkpath(tmp); 457 ecore_file_mkpath(tmp);
450 snprintf(tmp2, sizeof(tmp2), "po/%s.gmo", s); 458 snprintf(tmp2, sizeof(tmp2), "po/%s.gmo", s);
@@ -452,12 +460,16 @@ mrk_build_do(Mrk_Build *bld, const char *tmpd, const char *objd)
452 if ((!ecore_file_exists(tmp)) || 460 if ((!ecore_file_exists(tmp)) ||
453 (ecore_file_mod_time(tmp2) >= ecore_file_mod_time(tmp))) 461 (ecore_file_mod_time(tmp2) >= ecore_file_mod_time(tmp)))
454 { 462 {
455 printf("%c[36;01m%s%c[0m%c[35m -%c[1m>%c[0m\n", 27, tmp2, 27, 27, 27, 27); 463 printf("%c[32m%3i%c[37;01m%%%c[0m "
464 "%c[36;01m%s%c[0m%c[35m -%c[1m>%c[0m\n",
465 27, (current * 100) / total, 27, 27,
466 27, tmp2, 27, 27, 27, 27);
456 ecore_file_cp(tmp2, tmp); 467 ecore_file_cp(tmp2, tmp);
457 } 468 }
458 } 469 }
459 EINA_LIST_FOREACH(bld->data, l, data) 470 EINA_LIST_FOREACH(bld->data, l, data)
460 { 471 {
472 current++;
461 s = ecore_file_dir_get(data->dest); 473 s = ecore_file_dir_get(data->dest);
462 if (s) 474 if (s)
463 { 475 {
@@ -469,7 +481,10 @@ mrk_build_do(Mrk_Build *bld, const char *tmpd, const char *objd)
469 if ((!ecore_file_exists(tmp)) || 481 if ((!ecore_file_exists(tmp)) ||
470 (ecore_file_mod_time(data->src) >= ecore_file_mod_time(tmp))) 482 (ecore_file_mod_time(data->src) >= ecore_file_mod_time(tmp)))
471 { 483 {
472 printf("%c[36;01m%s%c[0m%c[35m -%c[1m>%c[0m\n", 27, data->src, 27, 27, 27, 27); 484 printf("%c[32m%3i%c[37;01m%%%c[0m "
485 "%c[36;01m%s%c[0m%c[35m -%c[1m>%c[0m\n",
486 27, (current * 100) / total, 27, 27,
487 27, data->src, 27, 27, 27, 27);
473 ecore_file_cp(data->src, tmp); 488 ecore_file_cp(data->src, tmp);
474 } 489 }
475 } 490 }
@@ -477,6 +492,7 @@ mrk_build_do(Mrk_Build *bld, const char *tmpd, const char *objd)
477 ecore_file_mkpath(tmp); 492 ecore_file_mkpath(tmp);
478 EINA_LIST_FOREACH(bld->desktops, l, s) 493 EINA_LIST_FOREACH(bld->desktops, l, s)
479 { 494 {
495 current++;
480 ss = ecore_file_file_get(s); 496 ss = ecore_file_file_get(s);
481 if (!(!strncmp(ss, bld->domain, strlen(bld->domain)))) 497 if (!(!strncmp(ss, bld->domain, strlen(bld->domain))))
482 err("destkop file wrong domain"); 498 err("destkop file wrong domain");
@@ -484,7 +500,10 @@ mrk_build_do(Mrk_Build *bld, const char *tmpd, const char *objd)
484 if ((!ecore_file_exists(tmp)) || 500 if ((!ecore_file_exists(tmp)) ||
485 (ecore_file_mod_time(s) >= ecore_file_mod_time(tmp))) 501 (ecore_file_mod_time(s) >= ecore_file_mod_time(tmp)))
486 { 502 {
487 printf("%c[36;01m%s%c[0m%c[35m -%c[1m>%c[0m\n", 27, s, 27, 27, 27, 27); 503 printf("%c[32m%3i%c[37;01m%%%c[0m "
504 "%c[36;01m%s%c[0m%c[35m -%c[1m>%c[0m\n",
505 27, (current * 100) / total, 27, 27,
506 27, s, 27, 27, 27, 27);
488 ecore_file_cp(s, tmp); 507 ecore_file_cp(s, tmp);
489 } 508 }
490 } 509 }
@@ -492,6 +511,7 @@ mrk_build_do(Mrk_Build *bld, const char *tmpd, const char *objd)
492 ecore_file_mkpath(tmp); 511 ecore_file_mkpath(tmp);
493 EINA_LIST_FOREACH(bld->icons, l, s) 512 EINA_LIST_FOREACH(bld->icons, l, s)
494 { 513 {
514 current++;
495 ss = ecore_file_file_get(s); 515 ss = ecore_file_file_get(s);
496 if (!(!strncmp(ss, bld->domain, strlen(bld->domain)))) 516 if (!(!strncmp(ss, bld->domain, strlen(bld->domain))))
497 err("icon file wrong domain"); 517 err("icon file wrong domain");
@@ -499,12 +519,16 @@ mrk_build_do(Mrk_Build *bld, const char *tmpd, const char *objd)
499 if ((!ecore_file_exists(tmp)) || 519 if ((!ecore_file_exists(tmp)) ||
500 (ecore_file_mod_time(s) >= ecore_file_mod_time(tmp))) 520 (ecore_file_mod_time(s) >= ecore_file_mod_time(tmp)))
501 { 521 {
502 printf("%c[36;01m%s%c[0m%c[35m -%c[1m>%c[0m\n", 27, s, 27, 27, 27, 27); 522 printf("%c[32m%3i%c[37;01m%%%c[0m "
523 "%c[36;01m%s%c[0m%c[35m -%c[1m>%c[0m\n",
524 27, (current * 100) / total, 27, 27,
525 27, s, 27, 27, 27, 27);
503 ecore_file_cp(s, tmp); 526 ecore_file_cp(s, tmp);
504 } 527 }
505 } 528 }
506 EINA_LIST_FOREACH(bld->copying, l, s) 529 EINA_LIST_FOREACH(bld->copying, l, s)
507 { 530 {
531 current++;
508 if (strchr(s, '/')) 532 if (strchr(s, '/'))
509 { 533 {
510 s2 = ecore_file_dir_get(s); 534 s2 = ecore_file_dir_get(s);
@@ -518,7 +542,10 @@ mrk_build_do(Mrk_Build *bld, const char *tmpd, const char *objd)
518 if ((!ecore_file_exists(tmp)) || 542 if ((!ecore_file_exists(tmp)) ||
519 (ecore_file_mod_time(s) >= ecore_file_mod_time(tmp))) 543 (ecore_file_mod_time(s) >= ecore_file_mod_time(tmp)))
520 { 544 {
521 printf("%c[36;01m%s%c[0m%c[35m -%c[1m>%c[0m\n", 27, s, 27, 27, 27, 27); 545 printf("%c[32m%3i%c[37;01m%%%c[0m "
546 "%c[36;01m%s%c[0m%c[35m -%c[1m>%c[0m\n",
547 27, (current * 100) / total, 27, 27,
548 27, s, 27, 27, 27, 27);
522 ecore_file_cp(s, tmp); 549 ecore_file_cp(s, tmp);
523 } 550 }
524 } 551 }
@@ -526,6 +553,13 @@ mrk_build_do(Mrk_Build *bld, const char *tmpd, const char *objd)
526 cc = getenv("CC"); 553 cc = getenv("CC");
527 if (!cc) cc = "gcc"; 554 if (!cc) cc = "gcc";
528 555
556 total = 0;
557 EINA_LIST_FOREACH(bld->bins, l, bin)
558 {
559 total++;
560 total += eina_list_count(bin->srcs);
561 }
562 current = 0;
529 EINA_LIST_FOREACH(bld->bins, l, bin) 563 EINA_LIST_FOREACH(bld->bins, l, bin)
530 { 564 {
531 Eina_Bool rebuild, rebuild2, touchme; 565 Eina_Bool rebuild, rebuild2, touchme;
@@ -569,6 +603,7 @@ mrk_build_do(Mrk_Build *bld, const char *tmpd, const char *objd)
569 } 603 }
570 EINA_LIST_FOREACH(bin->srcs, ll, s) 604 EINA_LIST_FOREACH(bin->srcs, ll, s)
571 { 605 {
606 current++;
572 touchme = EINA_FALSE; 607 touchme = EINA_FALSE;
573 rebuild2 = EINA_FALSE; 608 rebuild2 = EINA_FALSE;
574 snprintf(tmp, sizeof(tmp), "%s-%s", bin->bin, s); 609 snprintf(tmp, sizeof(tmp), "%s-%s", bin->bin, s);
@@ -629,7 +664,10 @@ mrk_build_do(Mrk_Build *bld, const char *tmpd, const char *objd)
629 s2 = (char *)eina_strbuf_string_get(buf); 664 s2 = (char *)eina_strbuf_string_get(buf);
630 if (s2) 665 if (s2)
631 { 666 {
632 printf(" %c[31mCC%c[33m %s%c[0m\n", 27, 27, s, 27); 667 printf("%c[32m%3i%c[37;01m%%%c[0m "
668 " %c[31mCC%c[33m %s%c[0m\n",
669 27, (current * 100) / total, 27, 27,
670 27, 27, s, 27);
633 if (getenv("V")) printf("%s\n", s2); 671 if (getenv("V")) printf("%s\n", s2);
634 printf("%c[34m", 27); 672 printf("%c[34m", 27);
635 fflush(stdout); 673 fflush(stdout);
@@ -651,6 +689,7 @@ mrk_build_do(Mrk_Build *bld, const char *tmpd, const char *objd)
651 fclose(f); 689 fclose(f);
652 } 690 }
653 } 691 }
692 current++;
654 eina_strbuf_reset(buf); 693 eina_strbuf_reset(buf);
655 eina_strbuf_append(buf, cc); 694 eina_strbuf_append(buf, cc);
656 eina_strbuf_append(buf, " -lm -o "); 695 eina_strbuf_append(buf, " -lm -o ");
@@ -685,8 +724,11 @@ mrk_build_do(Mrk_Build *bld, const char *tmpd, const char *objd)
685 s = (char *)eina_strbuf_string_get(buf); 724 s = (char *)eina_strbuf_string_get(buf);
686 if (s) 725 if (s)
687 { 726 {
688 printf(" %c[1;31mLD%c[1;33m %s%c[0m\n", 27, 27, bin->bin, 27); 727 printf("%c[32m%3i%c[37;01m%%%c[0m "
689 if (getenv("V")) printf("%s\n", s2); 728 " %c[1;31mLD%c[1;33m %s%c[0m\n",
729 27, (current * 100) / total, 27, 27,
730 27, 27, bin->bin, 27);
731 if (getenv("V")) printf("%s\n", s);
690 printf("%c[34m", 27); 732 printf("%c[34m", 27);
691 fflush(stdout); 733 fflush(stdout);
692 res = system(s); 734 res = system(s);
@@ -698,6 +740,8 @@ mrk_build_do(Mrk_Build *bld, const char *tmpd, const char *objd)
698 } 740 }
699 } 741 }
700 } 742 }
743 else
744 current += 1 + eina_list_count(bin->srcs);
701 } 745 }
702 eina_strbuf_free(buf); 746 eina_strbuf_free(buf);
703 return EINA_TRUE; 747 return EINA_TRUE;
@@ -727,7 +771,6 @@ static void
727package_bin_iter(Eet_File *ef, const char *dir, const char *key) 771package_bin_iter(Eet_File *ef, const char *dir, const char *key)
728{ 772{
729 Eina_List *files; 773 Eina_List *files;
730 Eina_File *enf;
731 char *s; 774 char *s;
732 char tmp[4096]; 775 char tmp[4096];
733 char tmp2[4096]; 776 char tmp2[4096];
@@ -763,12 +806,11 @@ mrk_build_package_bin(Mrk_Build *bld, const char *file, const char *tmpd, const
763 char *s; 806 char *s;
764 int i; 807 int i;
765 808
766// snprintf(tmp, sizeof(tmp), "%s-%s.mkb", bld->name, bld->version);
767 ef = eet_open(file, EET_FILE_MODE_WRITE); 809 ef = eet_open(file, EET_FILE_MODE_WRITE);
768 if (ef) 810 if (ef)
769 { 811 {
770#define WRTS(key, var) \ 812#define WRTA(key, var) eet_write(ef, key, var, strlen(var), EET_COMPRESSION_VERYFAST)
771 if (var) eet_write(ef, key, var, strlen(var), EET_COMPRESSION_VERYFAST) 813#define WRTS(key, var) if (var) WRTA(key, var)
772 WRTS("name", bld->name); 814 WRTS("name", bld->name);
773 if (bld->icon) package_file(ef, bld->icon, "icon"); 815 if (bld->icon) package_file(ef, bld->icon, "icon");
774 if (bld->splash) package_file(ef, bld->splash, "splash"); 816 if (bld->splash) package_file(ef, bld->splash, "splash");
@@ -780,7 +822,7 @@ mrk_build_package_bin(Mrk_Build *bld, const char *file, const char *tmpd, const
780 WRTS("contact", bld->contact); 822 WRTS("contact", bld->contact);
781 WRTS("needs", bld->needs); 823 WRTS("needs", bld->needs);
782 snprintf(tmp, sizeof(tmp), "%s-%s", os, arch); 824 snprintf(tmp, sizeof(tmp), "%s-%s", os, arch);
783 WRTS("arch", tmp); 825 WRTA("arch", tmp);
784 i = 0; 826 i = 0;
785 EINA_LIST_FOREACH(bld->tags, l, s) 827 EINA_LIST_FOREACH(bld->tags, l, s)
786 { 828 {
@@ -807,7 +849,7 @@ mrk_build_package_src(Mrk_Build *bld, const char *buildfile, const char *file)
807 char tmp[4096]; 849 char tmp[4096];
808 char tmp2[4096]; 850 char tmp2[4096];
809 851
810// snprintf(tmp, sizeof(tmp), "%s-%s.mks", bld->name, bld->version); 852#define err(reason) do { fprintf(stderr, "%s\n", reason); goto error; } while (0)
811 ef = eet_open(file, EET_FILE_MODE_WRITE); 853 ef = eet_open(file, EET_FILE_MODE_WRITE);
812 if (ef) 854 if (ef)
813 { 855 {
@@ -864,5 +906,8 @@ mrk_build_package_src(Mrk_Build *bld, const char *buildfile, const char *file)
864 eet_close(ef); 906 eet_close(ef);
865 return EINA_TRUE; 907 return EINA_TRUE;
866 } 908 }
909#undef err
910error:
911 if (ef) eet_close(ef);
867 return EINA_FALSE; 912 return EINA_FALSE;
868} 913}
diff --git a/mrklib_index.c b/mrklib_index.c
index 2f249b2..e14a9d6 100644
--- a/mrklib_index.c
+++ b/mrklib_index.c
@@ -46,7 +46,7 @@ typedef struct
46} Inf; 46} Inf;
47 47
48static Eina_Bool 48static Eina_Bool
49key_enter_cb(const Eina_Hash *hash, const void *key, void *data, void *fdata) 49key_enter_cb(const Eina_Hash *hash EINA_UNUSED, const void *key, void *data EINA_UNUSED, void *fdata)
50{ 50{
51 Inf *inf = fdata; 51 Inf *inf = fdata;
52 key_register(inf->master, key, inf->entry); 52 key_register(inf->master, key, inf->entry);
@@ -84,7 +84,7 @@ static void
84key_str_add(Eina_Hash *hash, const char *str) 84key_str_add(Eina_Hash *hash, const char *str)
85{ 85{
86 char *ts = strdup(str); 86 char *ts = strdup(str);
87 char *p, *pe; 87 char *p, *pe = ts;
88 if (!ts) return; 88 if (!ts) return;
89 for (p = ts; *p; p++) 89 for (p = ts; *p; p++)
90 { 90 {
@@ -106,7 +106,7 @@ key_str_add(Eina_Hash *hash, const char *str)
106} 106}
107 107
108static Eina_Bool 108static Eina_Bool
109key_merge_cb(const Eina_Hash *hash, const void *key, void *data, void *fdata) 109key_merge_cb(const Eina_Hash *hash EINA_UNUSED, const void *key, void *data EINA_UNUSED, void *fdata)
110{ 110{
111 key_add(fdata, key); 111 key_add(fdata, key);
112 return EINA_TRUE; 112 return EINA_TRUE;
@@ -194,7 +194,7 @@ index_file(Mdb *db, const char *file, const char *fname)
194} 194}
195 195
196static Eina_Bool 196static Eina_Bool
197index_out_cb(const Eina_Hash *hash, const void *key, void *data, void *fdata) 197index_out_cb(const Eina_Hash *hash EINA_UNUSED, const void *key, void *data, void *fdata)
198{ 198{
199 FILE *f = fdata; 199 FILE *f = fdata;
200 const char *s; 200 const char *s;
diff --git a/mrklib_priv.h b/mrklib_priv.h
index 7c0095c..a20b012 100644
--- a/mrklib_priv.h
+++ b/mrklib_priv.h
@@ -13,6 +13,7 @@
13#include <sys/types.h> 13#include <sys/types.h>
14#include <sys/stat.h> 14#include <sys/stat.h>
15#include <fcntl.h> 15#include <fcntl.h>
16#include <ctype.h>
16 17
17#define MRK_SERVER_HOST "devs.enlightenment.org" 18#define MRK_SERVER_HOST "devs.enlightenment.org"
18#define MRK_SERVER_PORT 10077 19#define MRK_SERVER_PORT 10077
diff --git a/mrklib_repodb.c b/mrklib_repodb.c
index 0ac1652..a555b15 100644
--- a/mrklib_repodb.c
+++ b/mrklib_repodb.c
@@ -58,7 +58,7 @@ db_load_hash(Eina_Hash *hash, FILE *f)
58} 58}
59 59
60static Eina_Bool 60static Eina_Bool
61db_clear_hash_cb(const Eina_Hash *hash, const void *key, void *data, void *fdata) 61db_clear_hash_cb(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED, void *data, void *fdata EINA_UNUSED)
62{ 62{
63 const char *s; 63 const char *s;
64 64
@@ -210,8 +210,7 @@ db_search(Eina_Hash *hash, const char *search)
210 Eina_List *list = NULL, *tl, *l; 210 Eina_List *list = NULL, *tl, *l;
211 const char *s; 211 const char *s;
212 char *ts = strdup(search); 212 char *ts = strdup(search);
213 char *p, *end; 213 char *p, *end = ts;
214 int i;
215 214
216 if (!ts) return NULL; 215 if (!ts) return NULL;
217 for (p = ts; *p; p++) 216 for (p = ts; *p; p++)
@@ -239,7 +238,7 @@ db_search(Eina_Hash *hash, const char *search)
239} 238}
240 239
241static Eina_Bool 240static Eina_Bool
242_mrk_cb_exe_del(void *data, int type, void *event) 241_mrk_cb_exe_del(void *data, int type EINA_UNUSED, void *event)
243{ 242{
244 Ecore_Exe_Event_Del *e = event; 243 Ecore_Exe_Event_Del *e = event;
245 Mrk_Repodb *rdb = data; 244 Mrk_Repodb *rdb = data;
@@ -321,7 +320,6 @@ EAPI const Eina_List *
321mrk_repodb_category_list(Mrk_Repodb *rdb, const char *arch, const char *category) 320mrk_repodb_category_list(Mrk_Repodb *rdb, const char *arch, const char *category)
322{ 321{
323 Db *db = db_arch_find(rdb, arch); 322 Db *db = db_arch_find(rdb, arch);
324 Eina_List *list;
325 323
326 if (!db) return NULL; 324 if (!db) return NULL;
327 if (!category) category = "@"; // @ is the "everything" category and list 325 if (!category) category = "@"; // @ is the "everything" category and list
diff --git a/mrklib_serv.c b/mrklib_serv.c
index 69e191c..9cb7fbf 100644
--- a/mrklib_serv.c
+++ b/mrklib_serv.c
@@ -133,7 +133,7 @@ client_send(Client *c, const char *subrepo, const char *name, int op_start, int
133} 133}
134 134
135static Eina_Bool 135static Eina_Bool
136_mrk_id_data(Mrk_Serve *server, Client *c, Ecore_Ipc_Event_Client_Data *e) 136_mrk_id_data(Mrk_Serve *server EINA_UNUSED, Client *c, Ecore_Ipc_Event_Client_Data *e)
137{ 137{
138 if (e->minor == M_ID_UUID) 138 if (e->minor == M_ID_UUID)
139 { 139 {
@@ -170,7 +170,7 @@ _mrk_id_data(Mrk_Serve *server, Client *c, Ecore_Ipc_Event_Client_Data *e)
170} 170}
171 171
172static Eina_Bool 172static Eina_Bool
173_mrk_upload_data(Mrk_Serve *server, Client *c, Ecore_Ipc_Event_Client_Data *e) 173_mrk_upload_data(Mrk_Serve *server EINA_UNUSED, Client *c, Ecore_Ipc_Event_Client_Data *e)
174{ 174{
175 if ((!c->uuid) || (!c->version) || (!c->arch)) return EINA_FALSE; 175 if ((!c->uuid) || (!c->version) || (!c->arch)) return EINA_FALSE;
176 if (e->minor == M_UP_START) 176 if (e->minor == M_UP_START)
@@ -199,7 +199,7 @@ _mrk_upload_data(Mrk_Serve *server, Client *c, Ecore_Ipc_Event_Client_Data *e)
199} 199}
200 200
201static Eina_Bool 201static Eina_Bool
202_mrk_query_data(Mrk_Serve *server, Client *c, Ecore_Ipc_Event_Client_Data *e) 202_mrk_query_data(Mrk_Serve *server EINA_UNUSED, Client *c, Ecore_Ipc_Event_Client_Data *e)
203{ 203{
204 if ((!c->uuid) || (!c->version) || (!c->arch)) return EINA_FALSE; 204 if ((!c->uuid) || (!c->version) || (!c->arch)) return EINA_FALSE;
205 if (e->minor == M_QRY_LIST) 205 if (e->minor == M_QRY_LIST)
@@ -286,7 +286,7 @@ _mrk_query_data(Mrk_Serve *server, Client *c, Ecore_Ipc_Event_Client_Data *e)
286} 286}
287 287
288static Eina_Bool 288static Eina_Bool
289_mrk_inf_data(Mrk_Serve *server, Client *c, Ecore_Ipc_Event_Client_Data *e) 289_mrk_inf_data(Mrk_Serve *server EINA_UNUSED, Client *c, Ecore_Ipc_Event_Client_Data *e)
290{ 290{
291 if ((!c->uuid) || (!c->version) || (!c->arch)) return EINA_FALSE; 291 if ((!c->uuid) || (!c->version) || (!c->arch)) return EINA_FALSE;
292 if (e->minor == M_INF_GET_IC) 292 if (e->minor == M_INF_GET_IC)
@@ -328,7 +328,7 @@ _mrk_data_handle(Mrk_Serve *server, Client *c, Ecore_Ipc_Event_Client_Data *e)
328} 328}
329 329
330static Eina_Bool 330static Eina_Bool
331_mrk_cb_add(void *data, int type, void *event) 331_mrk_cb_add(void *data, int type EINA_UNUSED, void *event)
332{ 332{
333 Ecore_Ipc_Event_Client_Add *e = event; 333 Ecore_Ipc_Event_Client_Add *e = event;
334 Mrk_Serve *server = data; 334 Mrk_Serve *server = data;
@@ -344,7 +344,7 @@ _mrk_cb_add(void *data, int type, void *event)
344} 344}
345 345
346static Eina_Bool 346static Eina_Bool
347_mrk_cb_del(void *data, int type, void *event) 347_mrk_cb_del(void *data, int type EINA_UNUSED, void *event)
348{ 348{
349 Ecore_Ipc_Event_Client_Del *e = event; 349 Ecore_Ipc_Event_Client_Del *e = event;
350 Mrk_Serve *server = data; 350 Mrk_Serve *server = data;
@@ -367,7 +367,7 @@ _mrk_cb_del(void *data, int type, void *event)
367} 367}
368 368
369static Eina_Bool 369static Eina_Bool
370_mrk_cb_data(void *data, int type, void *event) 370_mrk_cb_data(void *data, int type EINA_UNUSED, void *event)
371{ 371{
372 Ecore_Ipc_Event_Client_Data *e = event; 372 Ecore_Ipc_Event_Client_Data *e = event;
373 Mrk_Serve *server = data; 373 Mrk_Serve *server = data;
@@ -382,7 +382,7 @@ _mrk_cb_data(void *data, int type, void *event)
382} 382}
383 383
384static Eina_Bool 384static Eina_Bool
385_mrk_cb_exe_del(void *data, int type, void *event) 385_mrk_cb_exe_del(void *data, int type EINA_UNUSED, void *event)
386{ 386{
387 Ecore_Exe_Event_Del *e = event; 387 Ecore_Exe_Event_Del *e = event;
388 Mrk_Serve *server = data; 388 Mrk_Serve *server = data;
diff --git a/mrklib_svc.c b/mrklib_svc.c
index 0532e3d..45daab8 100644
--- a/mrklib_svc.c
+++ b/mrklib_svc.c
@@ -85,7 +85,7 @@ _mrk_upload(Mrk *server, const char *file)
85 if ((server->f) || (server->query)) return EINA_FALSE; 85 if ((server->f) || (server->query)) return EINA_FALSE;
86 // XXX: adjust protocol so we get ack's for each buf 86 // XXX: adjust protocol so we get ack's for each buf
87 f = fopen(file, "rb"); 87 f = fopen(file, "rb");
88 if (!f) return; 88 if (!f) return EINA_FALSE;
89 server->f = f; 89 server->f = f;
90 fname = ecore_file_file_get(file); 90 fname = ecore_file_file_get(file);
91 if (!fname) goto done; 91 if (!fname) goto done;
@@ -304,7 +304,7 @@ _mrk_data_handle(Mrk *server, Ecore_Ipc_Event_Server_Data *e)
304} 304}
305 305
306static Eina_Bool 306static Eina_Bool
307_mrk_cb_add(void *data, int type, void *event) 307_mrk_cb_add(void *data, int type EINA_UNUSED, void *event)
308{ 308{
309 Ecore_Ipc_Event_Server_Add *e = event; 309 Ecore_Ipc_Event_Server_Add *e = event;
310 Mrk *server = data; 310 Mrk *server = data;
@@ -316,7 +316,7 @@ _mrk_cb_add(void *data, int type, void *event)
316} 316}
317 317
318static Eina_Bool 318static Eina_Bool
319_mrk_cb_del(void *data, int type, void *event) 319_mrk_cb_del(void *data, int type EINA_UNUSED, void *event)
320{ 320{
321 Ecore_Ipc_Event_Server_Del *e = event; 321 Ecore_Ipc_Event_Server_Del *e = event;
322 Mrk *server = data; 322 Mrk *server = data;
@@ -328,7 +328,7 @@ _mrk_cb_del(void *data, int type, void *event)
328} 328}
329 329
330static Eina_Bool 330static Eina_Bool
331_mrk_cb_data(void *data, int type, void *event) 331_mrk_cb_data(void *data, int type EINA_UNUSED, void *event)
332{ 332{
333 Ecore_Ipc_Event_Server_Data *e = event; 333 Ecore_Ipc_Event_Server_Data *e = event;
334 Mrk *server = data; 334 Mrk *server = data;