Added inline function vfs_path_get_last_path_vfs()
...to simple get VFS class for last path element without malloc/free operations. Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Этот коммит содержится в:
родитель
02f31f4db6
Коммит
ff69719304
@ -91,4 +91,16 @@ vfs_path_get_last_path_str (const vfs_path_t * vpath)
|
|||||||
return (element != NULL) ? element->path : NULL;
|
return (element != NULL) ? element->path : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
static inline struct vfs_class *
|
||||||
|
vfs_path_get_last_path_vfs (const vfs_path_t * vpath)
|
||||||
|
{
|
||||||
|
const vfs_path_element_t *element;
|
||||||
|
if (vpath == NULL)
|
||||||
|
return NULL;
|
||||||
|
element = vfs_path_get_by_index (vpath, -1);
|
||||||
|
return (element != NULL) ? element->class : NULL;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user