1 /* 2 * Copyright (C) 2017 The Android Open Source Project 3 * 4 * SPDX-License-Identifier: BSD-2-Clause 5 */ 6 7 #ifndef __ANDROID_CMDS_H 8 #define __ANDROID_CMDS_H 9 10 #include <common.h> 11 12 /** 13 * part_get_info_by_dev_and_name_or_num - Parse a device number and partition 14 * description (either name or number) in the form of device number plus 15 * partition name separated by a ";" (like "device_num;partition_name") or 16 * a device number plus a partition number separated by a ":". For example both 17 * "0;misc" and "0:1" can be valid partition descriptions for a given interface. 18 * If the partition is found, sets dev_desc and part_info accordingly with the 19 * information of the partition. 20 * 21 * @dev_iface: Device interface. 22 * @dev_part_str: Input partition description, like "0;misc" or "0:1". 23 * @dev_desc: Place to store the device description pointer. 24 * @part_info: Place to store the partition information. 25 * @return 0 on success, or -1 on error 26 */ 27 int part_get_info_by_dev_and_name_or_num(const char *dev_iface, 28 const char *dev_part_str, 29 struct blk_desc **dev_desc, 30 disk_partition_t *part_info); 31 32 #endif 33