Home | History | Annotate | Download | only in applypatch

Lines Matching refs:argv

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