Skip to content
Snippets Groups Projects
Commit edd0f71e authored by Brian Carrier's avatar Brian Carrier
Browse files

Internal method to return names of images in IMG_INFO

parent c6373b7c
No related branches found
No related tags found
No related merge requests found
...@@ -418,3 +418,52 @@ tsk_img_close(TSK_IMG_INFO * a_img_info) ...@@ -418,3 +418,52 @@ tsk_img_close(TSK_IMG_INFO * a_img_info)
} }
a_img_info->close(a_img_info); a_img_info->close(a_img_info);
} }
/**
* \internal
* Return the list of names for this open images.
* This is sort of a hack implementation and is internal only at this
* point. Returns pointers into the IMG_INFO structs and should not be
* modified or freed.
* @param a_img_info Image to pull names from
* @param a_num_imgs Will contain number of elements in the return array.
* @returns List of names.
*/
const TSK_TCHAR **
tsk_img_get_names(TSK_IMG_INFO *a_img_info, int *a_num_imgs)
{
if (a_img_info == NULL) {
tsk_error_reset();
tsk_error_set_errno(TSK_ERR_IMG_ARG);
tsk_error_set_errstr("tsk_img_get_names: IMG_INFO is NULL");
return NULL;
}
if (a_num_imgs == NULL) {
tsk_error_reset();
tsk_error_set_errno(TSK_ERR_IMG_ARG);
tsk_error_set_errstr("tsk_img_get_names: a_num_imgs is NULL");
return NULL;
}
*a_num_imgs = 0;
switch (a_img_info->itype) {
case TSK_IMG_TYPE_RAW:
{
IMG_RAW_INFO *raw_info = (IMG_RAW_INFO *)a_img_info;
*a_num_imgs = raw_info->num_img;
return raw_info->images;
}
#if HAVE_LIBEWF
case TSK_IMG_TYPE_EWF_EWF:
{
IMG_EWF_INFO *ewf_info = (IMG_EWF_INFO *)a_img_info;
*a_num_imgs = ewf_info->num_imgs;
return ewf_info->images;
}
break;
#endif
default:
return NULL;
}
}
...@@ -40,6 +40,9 @@ extern void tsk_img_free(void *); ...@@ -40,6 +40,9 @@ extern void tsk_img_free(void *);
extern TSK_TCHAR **tsk_img_findFiles(const TSK_TCHAR * a_startingName, extern TSK_TCHAR **tsk_img_findFiles(const TSK_TCHAR * a_startingName,
int *a_numFound); int *a_numFound);
extern const TSK_TCHAR **
tsk_img_get_names(TSK_IMG_INFO *a_img_info, int *a_num_imgs);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment