diff options
author | David Walter Seikel | 2012-01-23 23:30:42 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-23 23:30:42 +1000 |
commit | 825a3d837a33f226c879cd02ad15c3fba57e8b2c (patch) | |
tree | 75f57bd9c4253508d338dc79ba8e57a7abc42255 /libraries/eet/src/bin | |
parent | Add ability to disable the test harness, or the Lua compile test. (diff) | |
download | SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.zip SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.gz SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.bz2 SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.xz |
Update the EFL to what I'm actually using, coz I'm using some stuff not yet released.
Diffstat (limited to 'libraries/eet/src/bin')
-rw-r--r-- | libraries/eet/src/bin/Makefile.in | 2 | ||||
-rw-r--r-- | libraries/eet/src/bin/eet_main.c | 88 |
2 files changed, 61 insertions, 29 deletions
diff --git a/libraries/eet/src/bin/Makefile.in b/libraries/eet/src/bin/Makefile.in index 9273fac..4a899f5 100644 --- a/libraries/eet/src/bin/Makefile.in +++ b/libraries/eet/src/bin/Makefile.in | |||
@@ -177,8 +177,6 @@ PACKAGE_URL = @PACKAGE_URL@ | |||
177 | PACKAGE_VERSION = @PACKAGE_VERSION@ | 177 | PACKAGE_VERSION = @PACKAGE_VERSION@ |
178 | PATH_SEPARATOR = @PATH_SEPARATOR@ | 178 | PATH_SEPARATOR = @PATH_SEPARATOR@ |
179 | PKG_CONFIG = @PKG_CONFIG@ | 179 | PKG_CONFIG = @PKG_CONFIG@ |
180 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
181 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
182 | RANLIB = @RANLIB@ | 180 | RANLIB = @RANLIB@ |
183 | SED = @SED@ | 181 | SED = @SED@ |
184 | SET_MAKE = @SET_MAKE@ | 182 | SET_MAKE = @SET_MAKE@ |
diff --git a/libraries/eet/src/bin/eet_main.c b/libraries/eet/src/bin/eet_main.c index 7ab5555..0d577ad 100644 --- a/libraries/eet/src/bin/eet_main.c +++ b/libraries/eet/src/bin/eet_main.c | |||
@@ -77,7 +77,7 @@ do_eet_extract(const char *file, | |||
77 | Eet_File *ef; | 77 | Eet_File *ef; |
78 | void *data; | 78 | void *data; |
79 | int size = 0; | 79 | int size = 0; |
80 | FILE *f; | 80 | FILE *f = stdout; |
81 | 81 | ||
82 | ef = eet_open(file, EET_FILE_MODE_READ); | 82 | ef = eet_open(file, EET_FILE_MODE_READ); |
83 | if (!ef) | 83 | if (!ef) |
@@ -93,20 +93,23 @@ do_eet_extract(const char *file, | |||
93 | exit(-1); | 93 | exit(-1); |
94 | } | 94 | } |
95 | 95 | ||
96 | f = fopen(out, "wb"); | 96 | if (out) |
97 | if (!f) | ||
98 | { | 97 | { |
99 | ERR("cannot open %s", out); | 98 | f = fopen(out, "wb"); |
100 | exit(-1); | 99 | if (!f) |
100 | { | ||
101 | ERR("cannot open %s", out); | ||
102 | exit(-1); | ||
103 | } | ||
101 | } | 104 | } |
102 | 105 | ||
103 | if (fwrite(data, size, 1, f) != 1) | 106 | if (fwrite(data, size, 1, f) != 1) |
104 | { | 107 | { |
105 | ERR("cannot write to %s", out); | 108 | ERR("cannot write to %s", out ? out : "standard output"); |
106 | exit(-1); | 109 | exit(-1); |
107 | } | 110 | } |
108 | 111 | ||
109 | fclose(f); | 112 | if (out) fclose(f); |
110 | free(data); | 113 | free(data); |
111 | eet_close(ef); | 114 | eet_close(ef); |
112 | } /* do_eet_extract */ | 115 | } /* do_eet_extract */ |
@@ -125,7 +128,7 @@ do_eet_decode(const char *file, | |||
125 | const char *crypto_key) | 128 | const char *crypto_key) |
126 | { | 129 | { |
127 | Eet_File *ef; | 130 | Eet_File *ef; |
128 | FILE *f; | 131 | FILE *f = stdout; |
129 | 132 | ||
130 | ef = eet_open(file, EET_FILE_MODE_READ); | 133 | ef = eet_open(file, EET_FILE_MODE_READ); |
131 | if (!ef) | 134 | if (!ef) |
@@ -134,20 +137,23 @@ do_eet_decode(const char *file, | |||
134 | exit(-1); | 137 | exit(-1); |
135 | } | 138 | } |
136 | 139 | ||
137 | f = fopen(out, "wb"); | 140 | if (out) |
138 | if (!f) | ||
139 | { | 141 | { |
140 | ERR("cannot open %s", out); | 142 | f = fopen(out, "wb"); |
141 | exit(-1); | 143 | if (!f) |
144 | { | ||
145 | ERR("cannot open %s", out); | ||
146 | exit(-1); | ||
147 | } | ||
142 | } | 148 | } |
143 | 149 | ||
144 | if (!eet_data_dump_cipher(ef, key, crypto_key, do_eet_decode_dump, f)) | 150 | if (!eet_data_dump_cipher(ef, key, crypto_key, do_eet_decode_dump, f)) |
145 | { | 151 | { |
146 | ERR("cannot write to %s", out); | 152 | ERR("cannot write to %s", out ? out : "standard output"); |
147 | exit(-1); | 153 | exit(-1); |
148 | } | 154 | } |
149 | 155 | ||
150 | fclose(f); | 156 | if (out) fclose(f); |
151 | eet_close(ef); | 157 | eet_close(ef); |
152 | } /* do_eet_decode */ | 158 | } /* do_eet_decode */ |
153 | 159 | ||
@@ -352,9 +358,9 @@ main(int argc, | |||
352 | help: | 358 | help: |
353 | printf( | 359 | printf( |
354 | "Usage:\n" | 360 | "Usage:\n" |
355 | " eet -l FILE.EET list all keys in FILE.EET\n" | 361 | " eet -l FILE.EET list all keys in FILE.EET\n" |
356 | " eet -x FILE.EET KEY OUT-FILE [CRYPTO_KEY] extract data stored in KEY in FILE.EET and write to OUT-FILE\n" | 362 | " eet -x FILE.EET KEY [OUT-FILE] [CRYPTO_KEY] extract data stored in KEY in FILE.EET and write to OUT-FILE or standard output\n" |
357 | " eet -d FILE.EET KEY OUT-FILE [CRYPTO_KEY] extract and decode data stored in KEY in FILE.EET and write to OUT-FILE\n" | 363 | " eet -d FILE.EET KEY [OUT-FILE] [CRYPTO_KEY] extract and decode data stored in KEY in FILE.EET and write to OUT-FILE or standard output\n" |
358 | " eet -i FILE.EET KEY IN-FILE COMPRESS [CRYPTO_KEY] insert data to KEY in FILE.EET from IN-FILE and if COMPRESS is 1, compress it\n" | 364 | " eet -i FILE.EET KEY IN-FILE COMPRESS [CRYPTO_KEY] insert data to KEY in FILE.EET from IN-FILE and if COMPRESS is 1, compress it\n" |
359 | " eet -e FILE.EET KEY IN-FILE COMPRESS [CRYPTO_KEY] insert and encode to KEY in FILE.EET from IN-FILE and if COMPRESS is 1, compress it\n" | 365 | " eet -e FILE.EET KEY IN-FILE COMPRESS [CRYPTO_KEY] insert and encode to KEY in FILE.EET from IN-FILE and if COMPRESS is 1, compress it\n" |
360 | " eet -r FILE.EET KEY remove KEY in FILE.EET\n" | 366 | " eet -r FILE.EET KEY remove KEY in FILE.EET\n" |
@@ -369,19 +375,47 @@ help: | |||
369 | goto help; | 375 | goto help; |
370 | else if ((!strcmp(argv[1], "-l")) && (argc > 2)) | 376 | else if ((!strcmp(argv[1], "-l")) && (argc > 2)) |
371 | do_eet_list(argv[2]); | 377 | do_eet_list(argv[2]); |
372 | else if ((!strcmp(argv[1], "-x")) && (argc > 4)) | 378 | else if ((!strcmp(argv[1], "-x")) && (argc > 3)) |
373 | { | 379 | { |
374 | if (argc > 5) | 380 | switch (argc) |
375 | do_eet_extract(argv[2], argv[3], argv[4], argv[5]); | 381 | { |
376 | else | 382 | case 4: |
377 | do_eet_extract(argv[2], argv[3], argv[4], NULL); | 383 | { |
384 | do_eet_extract(argv[2], argv[3], NULL, NULL); | ||
385 | break; | ||
386 | } | ||
387 | case 5: | ||
388 | { | ||
389 | do_eet_extract(argv[2], argv[3], argv[4], NULL); | ||
390 | break; | ||
391 | } | ||
392 | default: | ||
393 | { | ||
394 | do_eet_extract(argv[2], argv[3], argv[4], argv[5]); | ||
395 | break; | ||
396 | } | ||
397 | } | ||
378 | } | 398 | } |
379 | else if ((!strcmp(argv[1], "-d")) && (argc > 4)) | 399 | else if ((!strcmp(argv[1], "-d")) && (argc > 3)) |
380 | { | 400 | { |
381 | if (argc > 5) | 401 | switch (argc) |
382 | do_eet_decode(argv[2], argv[3], argv[4], argv[5]); | 402 | { |
383 | else | 403 | case 4: |
384 | do_eet_decode(argv[2], argv[3], argv[4], NULL); | 404 | { |
405 | do_eet_decode(argv[2], argv[3], NULL, NULL); | ||
406 | break; | ||
407 | } | ||
408 | case 5: | ||
409 | { | ||
410 | do_eet_decode(argv[2], argv[3], argv[4], NULL); | ||
411 | break; | ||
412 | } | ||
413 | default: | ||
414 | { | ||
415 | do_eet_decode(argv[2], argv[3], argv[4], argv[5]); | ||
416 | break; | ||
417 | } | ||
418 | } | ||
385 | } | 419 | } |
386 | else if ((!strcmp(argv[1], "-i")) && (argc > 5)) | 420 | else if ((!strcmp(argv[1], "-i")) && (argc > 5)) |
387 | { | 421 | { |