static int tar_find(mount_t *mnt, const char *filename, mtar_header_t *h) { /* Hash filename and linear search map for matching hash, read header and * check against filename if the hashes match */ tar_mount_t *tm = mnt->udata; unsigned hash = hash_string_ignore_case(filename); int i; for (i = 0; i < tm->nfiles; i++) { if (tm->map[i].hash == hash) { /* Seek to and load header */ mtar_seek(&tm->tar, tm->map[i].pos); mtar_read_header(&tm->tar, h); /* Compare names */ strip_trailing_slash(h->name); if (strings_equal_ignore_case(h->name, filename)) { return FILESYSTEM_ESUCCESS; } } } return FILESYSTEM_EFAILURE; }
int get_bootstrapper_option_arg_count(const dnx::char_t* option_name) { if (strings_equal_ignore_case(option_name, _X("--appbase")) || strings_equal_ignore_case(option_name, _X("--lib")) || strings_equal_ignore_case(option_name, _X("--packages")) || strings_equal_ignore_case(option_name, _X("--configuration")) || strings_equal_ignore_case(option_name, _X("--framework")) || strings_equal_ignore_case(option_name, _X("--port")) || strings_equal_ignore_case(option_name, _X("--project")) || strings_equal_ignore_case(option_name, _X("-p"))) { return 1; } if (strings_equal_ignore_case(option_name, _X("--watch")) || strings_equal_ignore_case(option_name, _X("--debug")) || strings_equal_ignore_case(option_name, _X("--bootstrapper-debug")) || strings_equal_ignore_case(option_name, _X("--help")) || strings_equal_ignore_case(option_name, _X("-h")) || strings_equal_ignore_case(option_name, _X("-?")) || strings_equal_ignore_case(option_name, _X("--version"))) { return 0; } // It isn't a bootstrapper option return -1; }