File: fdutils.h

package info (click to toggle)
fdutils 5.3-3
  • links: PTS
  • area: main
  • in suites: potato
  • size: 1,004 kB
  • ctags: 621
  • sloc: ansic: 6,098; sh: 2,236; makefile: 279; sed: 4
file content (24 lines) | stat: -rw-r--r-- 732 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <assert.h>
/* This file contains common structures understood by several of the
 * fdutils
 */

/* format map */
typedef	struct format_map {
	unsigned char cylinder;
	unsigned char head;
	unsigned char sector;
	unsigned char size;
} format_map_t;

void readid(int fd, int dn, int rate, int cylinder);
int measure_raw_capacity(int fd, int dn, int rate,
			int cylinder, int warmup, int verbosity);

#define NewArray(n,type) ((type *)(calloc((n), sizeof(type))))
#define New(type) ((type *)(malloc(sizeof(type))))

#define SafeNewArray(n,type) ((type *)(safe_calloc((n), sizeof(type))))
#define SafeNew(type) ((type *)(safe_malloc(sizeof(type))))
void *safe_malloc(size_t size);
void *safe_calloc(size_t nmemb, size_t size);