From c963d75dfdeec11f82e79e727062fbf89afa2c04 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sun, 22 Apr 2012 09:19:23 +1000 Subject: Update EFL to latest beta. --- libraries/eet/src/bin/Makefile.am | 2 +- libraries/eet/src/bin/Makefile.in | 6 +++- libraries/eet/src/bin/eet_main.c | 60 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+), 2 deletions(-) (limited to 'libraries/eet/src/bin') diff --git a/libraries/eet/src/bin/Makefile.am b/libraries/eet/src/bin/Makefile.am index ba7d67e..89c68f1 100644 --- a/libraries/eet/src/bin/Makefile.am +++ b/libraries/eet/src/bin/Makefile.am @@ -17,5 +17,5 @@ EXTRA_PROGRAMS = eet eet_SOURCES = eet_main.c eet_CFLAGS = @EET_CFLAGS@ -eet_LDADD = $(top_builddir)/src/lib/libeet.la @EINA_LIBS@ @EVIL_LIBS@ +eet_LDADD = $(top_builddir)/src/lib/libeet.la @EINA_LIBS@ @EVIL_LIBS@ @EXOTIC_LIBS@ eet_LDFLAGS = @lt_enable_auto_import@ diff --git a/libraries/eet/src/bin/Makefile.in b/libraries/eet/src/bin/Makefile.in index 4a899f5..a7e94cb 100644 --- a/libraries/eet/src/bin/Makefile.in +++ b/libraries/eet/src/bin/Makefile.in @@ -138,6 +138,8 @@ EINA_LIBS = @EINA_LIBS@ EVIL_CFLAGS = @EVIL_CFLAGS@ EVIL_LIBS = @EVIL_LIBS@ EXEEXT = @EXEEXT@ +EXOTIC_CFLAGS = @EXOTIC_CFLAGS@ +EXOTIC_LIBS = @EXOTIC_LIBS@ FGREP = @FGREP@ GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ GNUTLS_LIBS = @GNUTLS_LIBS@ @@ -177,6 +179,8 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -259,7 +263,7 @@ AM_CPPFLAGS = \ bin_PROGRAMS = @EET_PRG@ eet_SOURCES = eet_main.c eet_CFLAGS = @EET_CFLAGS@ -eet_LDADD = $(top_builddir)/src/lib/libeet.la @EINA_LIBS@ @EVIL_LIBS@ +eet_LDADD = $(top_builddir)/src/lib/libeet.la @EINA_LIBS@ @EVIL_LIBS@ @EXOTIC_LIBS@ eet_LDFLAGS = @lt_enable_auto_import@ all: all-am diff --git a/libraries/eet/src/bin/eet_main.c b/libraries/eet/src/bin/eet_main.c index 0d577ad..8a93d11 100644 --- a/libraries/eet/src/bin/eet_main.c +++ b/libraries/eet/src/bin/eet_main.c @@ -69,6 +69,63 @@ do_eet_list(const char *file) } /* do_eet_list */ static void +do_eet_stats(const char *file) +{ + int i, num; + int count[2] = { 0, 0 }; + int size[2] = { 0, 0 }; + char **list; + Eet_File *ef; + Eet_Dictionary *ed; + + ef = eet_open(file, EET_FILE_MODE_READ); + if (!ef) + { + ERR("cannot open for reading: %s", file); + exit(-1); + } + + printf("*** sections stats ***\n"); + list = eet_list(ef, "*", &num); + if (list) + { + for (i = 0; i < num; i++) + { + const void *ro = NULL; + void *rw = NULL; + int tsize; + + ro = eet_read_direct(ef, list[i], &tsize); + if (!ro) rw = eet_read(ef, list[i], &tsize); + printf(rw ? "%s of size %i is compressed.\n" : "%s of size %i is not compressed.\n", list[i], tsize); + count[rw ? 0 : 1]++; + size[rw ? 0 : 1] += tsize; + free(rw); + } + free(list); + } + + printf("*** dictionary ***\n"); + ed = eet_dictionary_get(ef); + if (ed) + { + printf("%i strings inside the dictionary.\n", eet_dictionary_count(ed)); + } + else + { + printf("no dictionary in this file.\n"); + } + printf("*** global ***\n"); + printf("%i sections\n", num); + printf("- %i of them are compressed (%02.2f%%) expanding in %i bytes.\n", + count[0], (float) count[0] * 100 / (float) num, size[0]); + printf("- %i of them are directly mappable in memory (%02.2f%%) representing %i bytes.\n", + count[1], (float) count[1] * 100 / (float) num, size[1]); + + eet_close(ef); +} + +static void do_eet_extract(const char *file, const char *key, const char *out, @@ -366,6 +423,7 @@ help: " eet -r FILE.EET KEY remove KEY in FILE.EET\n" " eet -c FILE.EET report and check the signature information of an eet file\n" " eet -s FILE.EET PRIVATE_KEY PUBLIC_KEY sign FILE.EET with PRIVATE_KEY and attach PUBLIC_KEY as it's certificate\n" + " eet -t FILE.EET give some statistic about a file\n" ); eet_shutdown(); return -1; @@ -437,6 +495,8 @@ help: do_eet_check(argv[2]); else if ((!strcmp(argv[1], "-s")) && (argc > 4)) do_eet_sign(argv[2], argv[3], argv[4]); + else if ((!strcmp(argv[1], "-t")) && (argc > 2)) + do_eet_stats(argv[2]); else goto help; -- cgit v1.1