Lines Matching refs:path

125 static inline void fixPath(char *path)  in fixPath()  argument
127 int i, len = strlen(path); in fixPath()
132 if (path[i] == '\\') in fixPath()
133 path[i] = '/'; in fixPath()
134 else if (path[i] == '\r' || path[i] == '\n') in fixPath()
135 path[i] = '\0'; in fixPath()
139 start = strstr(path, gLegacyPath); in fixPath()
146 strcat(path, gNewPath); in fixPath()
147 strcat(path, tmp); in fixPath()
149 strcpy(tmp, path); in fixPath()
150 strcpy(path, gNewPath); in fixPath()
151 strcat(path, tmp); in fixPath()
153 } else if ((ulong)path != (ulong)gOpts.outPath && /* ignore output */ in fixPath()
154 gPrePath && strncmp(path, gPrePath, strlen(gPrePath))) { in fixPath()
155 strcpy(tmp, path); in fixPath()
156 strcpy(path, gPrePath); in fixPath()
157 strcat(path, tmp); in fixPath()
304 strcpy(gOpts.loader[j].path, buf2); in parseLoader()
305 LOGD("%s=%s\n", gOpts.loader[j].name, gOpts.loader[j].path); in parseLoader()
354 fprintf(out, "%s=%s\n", gOpts.loader[i].name, gOpts.loader[i].path); in printOpts()
466 snprintf(gOpts.loader[0].path, sizeof(gOpts.loader[0].path), "%s", in parseOpts_from_cmdline()
471 snprintf(gOpts.loader[1].path, sizeof(gOpts.loader[1].path), "%s", in parseOpts_from_cmdline()
486 sscanf(gOpts.loader[0].path, "%*[^v]v%d.%d.bin", &v0, &v1); in parseOpts_from_cmdline()
487 sscanf(gOpts.loader[1].path, "%*[^v]v%d.%d.bin", &v2, &v3); in parseOpts_from_cmdline()
514 strcpy(gOpts.loader[0].path, DEF_LOADER0_PATH); in initOpts()
516 strcpy(gOpts.loader[1].path, DEF_LOADER1_PATH); in initOpts()
556 static inline void getName(char *path, uint16_t *dst) in getName() argument
561 if (!path || !dst) in getName()
563 start = strrchr(path, '/'); in getName()
565 start = path; in getName()
568 end = strrchr(path, '.'); in getName()
570 end = path + strlen(path); in getName()
580 LOGD("path:%s, name:%s\n", path, name); in getName()
584 static inline bool getFileSize(const char *path, uint32_t *size) in getFileSize() argument
587 if (stat(path, &st) < 0) in getFileSize()
590 LOGD("path:%s, size:%d\n", path, *size); in getFileSize()
612 static bool writeFile(FILE *outFile, const char *path, bool fix) in writeFile() argument
618 FILE *inFile = fopen(path, "rb"); in writeFile()
622 if (!getFileSize(path, &size)) in writeFile()
661 LOGE("write entry(%s) failed\n", path); in writeFile()
665 static bool saveEntry(FILE *outFile, char *path, rk_entry_type type, in saveEntry() argument
669 LOGD("write:%s\n", path); in saveEntry()
674 LOGD("write:%s\n", path); in saveEntry()
676 getName(fixName ? fixName : path, entry.name); in saveEntry()
680 if (!getFileSize(path, &size)) { in saveEntry()
681 LOGE("save entry(%s) failed:\n\tcannot get file size.\n", path); in saveEntry()
778 static inline uint32_t getCrc(const char *path) in getCrc() argument
782 FILE *file = fopen(path, "rb"); in getCrc()
783 getFileSize(path, &size); in getCrc()
852 if (!saveEntry(outFile, gOpts.loader[i].path, ENTRY_LOADER, 0, &dataOffset, in mergeBoot()
869 if (!writeFile(outFile, gOpts.loader[i].path, true)) in mergeBoot()
928 static bool unpackBoot(char *path) in unpackBoot() argument
931 FILE *inFile = fopen(path, "rb"); in unpackBoot()
936 fprintf(stderr, "loader(%s) not found\n", path); in unpackBoot()