Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1373)

Unified Diff: third_party/fuzzymatch/fuzzymatch.c

Issue 14187: Allow command-line argument to fuzzy matcher for output file. (Closed)
Patch Set: Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/fuzzymatch/fuzzymatch.c
diff --git a/third_party/fuzzymatch/fuzzymatch.c b/third_party/fuzzymatch/fuzzymatch.c
index 889fc870b4f5f9db39d1587ed397c2a876f4f86f..572940fcefd6ff15939361473b5481aa433e4608 100644
--- a/third_party/fuzzymatch/fuzzymatch.c
+++ b/third_party/fuzzymatch/fuzzymatch.c
@@ -53,6 +53,7 @@
static int
usage(const char *argv0) {
fprintf(stderr, "Usage: %s [--highlight] [--no-ignore-scrollbars] "
+ "[--output filename] "
"<input a> <input b>\n", argv0);
return 1;
}
@@ -64,6 +65,7 @@ main(int argc, char **argv) {
char highlight = 0;
char ignore_scrollbars = 1;
+ char *output_filename = "highlight.png"; /* Default output filename. */
agl 2008/12/17 03:18:58 const
int argi = 1;
@@ -72,6 +74,8 @@ main(int argc, char **argv) {
highlight = 1;
} else if (strcmp("--no-ignore-scrollbars", argv[argi]) == 0) {
ignore_scrollbars = 0;
+ } else if (strcmp("--output", argv[argi]) == 0) {
+ output_filename = argv[++argi];
agl 2008/12/17 03:18:58 if (argi + 1 >= argc) { fprintf(stderr, "--outpu
} else {
break;
}
@@ -142,7 +146,7 @@ main(int argc, char **argv) {
pixInvert(d2, d2);
pixAnd(d1, d1, d2);
pixPaintThroughMask(a, d1, 0, 0, 0xff << 24);
- pixWrite("highlight.png", a, IFF_PNG);
+ pixWrite(output_filename, a, IFF_PNG);
}
return count > 0;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698