Lines Matching refs:argv

26 int CheckMode(int argc, char** argv) {  in CheckMode()  argument
30 return applypatch_check(argv[2], argc-3, argv+3); in CheckMode()
33 int SpaceMode(int argc, char** argv) { in SpaceMode() argument
38 size_t bytes = strtol(argv[2], &endptr, 10); in SpaceMode()
39 if (bytes == 0 && endptr == argv[2]) { in SpaceMode()
40 printf("can't parse \"%s\" as byte count\n\n", argv[2]); in SpaceMode()
50 static int ParsePatchArgs(int argc, char** argv, in ParsePatchArgs() argument
61 char* colon = strchr(argv[i], ':'); in ParsePatchArgs()
67 if (ParseSha1(argv[i], digest) != 0) { in ParsePatchArgs()
68 printf("failed to parse sha1 \"%s\"\n", argv[i]); in ParsePatchArgs()
72 (*sha1s)[i] = argv[i]; in ParsePatchArgs()
102 int PatchMode(int argc, char** argv) { in PatchMode() argument
104 if (argc >= 3 && strcmp(argv[1], "-b") == 0) { in PatchMode()
106 if (LoadFileContents(argv[2], &fc) != 0) { in PatchMode()
107 printf("failed to load bonus file %s\n", argv[2]); in PatchMode()
115 argv += 2; in PatchMode()
123 size_t target_size = strtol(argv[4], &endptr, 10); in PatchMode()
124 if (target_size == 0 && endptr == argv[4]) { in PatchMode()
125 printf("can't parse \"%s\" as byte count\n\n", argv[4]); in PatchMode()
132 if (ParsePatchArgs(argc-5, argv+5, &sha1s, &patches, &num_patches) != 0) { in PatchMode()
137 int result = applypatch(argv[1], argv[2], argv[3], target_size, in PatchMode()
181 int main(int argc, char** argv) { in main() argument
194 argv[0], argv[0], argv[0], argv[0]); in main()
200 if (strncmp(argv[1], "-l", 3) == 0) { in main()
202 } else if (strncmp(argv[1], "-c", 3) == 0) { in main()
203 result = CheckMode(argc, argv); in main()
204 } else if (strncmp(argv[1], "-s", 3) == 0) { in main()
205 result = SpaceMode(argc, argv); in main()
207 result = PatchMode(argc, argv); in main()