cbmimage
Loading...
Searching...
No Matches
Loop detector specific functions

Classes

struct  cbmimage_loop_s
 cbmimage loop detector struct More...
 

Typedefs

typedef struct cbmimage_loop_s cbmimage_loop
 cbmimage loop detector struct
 

Functions

cbmimage_loopcbmimage_loop_create (cbmimage_fileimage *image)
 create a loop detector data structure
 
void cbmimage_loop_close (cbmimage_loop *loop)
 free a loop detector data structure
 
int cbmimage_loop_mark (cbmimage_loop *loop, cbmimage_blockaddress block)
 mark a block as used/visited
 
int cbmimage_loop_check (cbmimage_loop *loop, cbmimage_blockaddress block)
 check if a block is marked as used/visited
 

Detailed Description

Typedef Documentation

◆ cbmimage_loop

cbmimage loop detector struct

In order to recognize loops in the T/S links, the cbmimage_loop_*() functions use this structure to mark blocks already visited.

Function Documentation

◆ cbmimage_loop_check()

int cbmimage_loop_check ( cbmimage_loop * loop,
cbmimage_blockaddress block )

check if a block is marked as used/visited

Parameters
[in]looppointer to the loop detector data
[in]blockthe block to mark as used/visited
Returns
  • 1 if this block has already been used/visited/marked
  • 0 otherwise
  • -1 if an error occurred

◆ cbmimage_loop_close()

void cbmimage_loop_close ( cbmimage_loop * loop)

free a loop detector data structure

Parameters
[in]looppointer to the loop detector data
Remarks
  • don't access the structure at *loop after this function has been called.

◆ cbmimage_loop_create()

cbmimage_loop * cbmimage_loop_create ( cbmimage_fileimage * image)

create a loop detector data structure

Parameters
[in]imagepointer to the image data
Returns
  • pointer to an initialized cbmimage_loop structure in case of success
  • NULL on failure
Remarks

◆ cbmimage_loop_mark()

int cbmimage_loop_mark ( cbmimage_loop * loop,
cbmimage_blockaddress block )

mark a block as used/visited

Parameters
[in]looppointer to the loop detector data
[in]blockthe block to mark as used/visited
Returns
  • 1 if this block has already been used/visited/marked
  • 0 otherwise
  • -1 if an error occurred