From e3a7b20c1d25019175718e66ed95b56a08d57807 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 3 Jul 2009 00:53:20 +0200 Subject: Use fz_getopt & co. --- apps/pdfclean.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'apps/pdfclean.c') diff --git a/apps/pdfclean.c b/apps/pdfclean.c index 211c461d..f008992f 100644 --- a/apps/pdfclean.c +++ b/apps/pdfclean.c @@ -357,39 +357,39 @@ int main(int argc, char **argv) int lastfree; - while ((c = getopt(argc, argv, "d:egn:o:p:u:x")) != -1) + while ((c = fz_getopt(argc, argv, "d:egn:o:p:u:x")) != -1) { switch (c) { case 'p': /* see TABLE 3.15 User access permissions */ perms = 0xfffff0c0; - if (strchr(optarg, 'p')) /* print */ + if (strchr(fz_optarg, 'p')) /* print */ perms |= (1 << 2) | (1 << 11); - if (strchr(optarg, 'm')) /* modify */ + if (strchr(fz_optarg, 'm')) /* modify */ perms |= (1 << 3) | (1 << 10); - if (strchr(optarg, 'c')) /* copy */ + if (strchr(fz_optarg, 'c')) /* copy */ perms |= (1 << 4) | (1 << 9); - if (strchr(optarg, 'a')) /* annotate / forms */ + if (strchr(fz_optarg, 'a')) /* annotate / forms */ perms |= (1 << 5) | (1 << 8); break; - case 'd': password = optarg; break; + case 'd': password = fz_optarg; break; case 'e': doencrypt ++; break; case 'g': dogarbage ++; break; - case 'n': keylen = atoi(optarg); break; - case 'o': ownerpw = optarg; break; - case 'u': userpw = optarg; break; + case 'n': keylen = atoi(fz_optarg); break; + case 'o': ownerpw = fz_optarg; break; + case 'u': userpw = fz_optarg; break; case 'x': doexpand ++; break; default: cleanusage(); break; } } - if (argc - optind < 1) + if (argc - fz_optind < 1) cleanusage(); - infile = argv[optind++]; - if (argc - optind > 0) - outfile = argv[optind++]; + infile = argv[fz_optind++]; + if (argc - fz_optind > 0) + outfile = argv[fz_optind++]; openxref(infile, password); -- cgit v1.2.3