File: display.cpp

package info (click to toggle)
afflib 3.6.6-1.1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 5,320 kB
  • sloc: cpp: 21,493; ansic: 14,745; sh: 11,235; makefile: 538; python: 95
file content (34 lines) | stat: -rw-r--r-- 661 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
 * A list of the segments that should be displayed as a quadword.
 */

#include "affconfig.h"
#include "afflib.h"
#include "afflib_i.h"

static const char *quads[] = {
    AF_IMAGESIZE,
    AF_BADSECTORS,
    AF_BLANKSECTORS,
    AF_DEVICE_SECTORS,
    0
};


int af_display_as_quad(const char *segname)
{
    for(int i=0;quads[i];i++){
	if(strcmp(segname,quads[i])==0) return true;
    }
    return false;
}

int af_display_as_hex(const char *segname)
{
    if(strcmp(segname,AF_MD5)==0) return 1;
    if(strcmp(segname,AF_SHA1)==0) return 1;
    if(strcmp(segname,AF_SHA256)==0) return 1;
    if(strcmp(segname,AF_IMAGE_GID)==0) return 1;
    return 0;
}