int dm_split_lvm_name(struct dm_pool *mem, const char *dmname, char **vgname, char **lvname, char **layer) { if (mem && !(*vgname = dm_pool_strdup(mem, dmname))) return 0; _unquote(*layer = _unquote(*lvname = _unquote(*vgname))); return 1; }
int dm_split_lvm_name(struct dm_pool *mem, const char *dmname, char **vgname, char **lvname, char **layer) { if (!vgname || !lvname || !layer) { log_error(INTERNAL_ERROR "dm_split_lvm_name: Forbidden NULL parameter detected."); return 0; } if (mem && (!dmname || !(*vgname = dm_pool_strdup(mem, dmname)))) { log_error("Failed to duplicate lvm name."); return 0; } else if (!*vgname) { log_error("Missing lvm name for split."); return 0; } _unquote(*layer = _unquote(*lvname = _unquote(*vgname))); return 1; }