1 /*
2  * The Sleuth Kit
3  *
4  * Brian Carrier [carrier <at> sleuthkit [dot] org]
5  * Copyright (c) 2005-2011 Brian Carrier.  All rights reserved
6  *
7  * This software is distributed under the Common Public License 1.0
8  */
9 
10 /*
11  * Contains the single raw data file-specific functions and structures.
12  */
13 
14 #ifndef _RAW_H
15 #define _RAW_H
16 
17 #include "img_writer.h"
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23     extern TSK_IMG_INFO *raw_open(int a_num_img,
24         const TSK_TCHAR * const a_images[], unsigned int a_ssize);
25 
26 #define SPLIT_CACHE	15
27 
28     typedef struct {
29 #ifdef TSK_WIN32
30         HANDLE fd;
31 #else
32         int fd;
33 #endif
34         int image;
35         TSK_OFF_T seek_pos;
36     } IMG_SPLIT_CACHE;
37 
38     typedef struct {
39         TSK_IMG_INFO img_info;
40         uint8_t is_winobj;
41         TSK_IMG_WRITER *img_writer;
42 
43         // the following are protected by cache_lock in IMG_INFO
44         TSK_OFF_T *max_off;
45         int *cptr;              /* exists for each image - points to entry in cache */
46         IMG_SPLIT_CACHE cache[SPLIT_CACHE];     /* small number of fds for open images */
47         int next_slot;
48     } IMG_RAW_INFO;
49 
50 #ifdef __cplusplus
51 }
52 #endif
53 #endif
54