added port of dosfsck. Does not work yet as I cannot figure how to open the device...
[reactos.git] / rosapps / sysutils / dosfsck / common.h
1 /* common.h - Common functions */
2
3 /* Written 1993 by Werner Almesberger */
4 #if 0
5 #include <linux/version.h>
6 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
7 # define __KERNEL__
8 # include <asm/types.h>
9 # undef __KERNEL__
10 # define MSDOS_FAT12 4084 /* maximum number of clusters in a 12 bit FAT */
11 #endif
12 #endif
13
14 # define MSDOS_FAT12 4084 /* maximum number of clusters in a 12 bit FAT */
15
16 #include "version.h"
17
18 #ifndef _COMMON_H
19 #define _COMMON_H
20
21 void die(char *msg,...) __attribute((noreturn));
22
23 /* Displays a prinf-style message and terminates the program. */
24
25 void pdie(char *msg,...) __attribute((noreturn));
26
27 /* Like die, but appends an error message according to the state of errno. */
28
29 void *alloc(int size);
30
31 /* mallocs SIZE bytes and returns a pointer to the data. Terminates the program
32 if malloc fails. */
33
34 void *qalloc(void **root,int size);
35
36 /* Like alloc, but registers the data area in a list described by ROOT. */
37
38 void qfree(void **root);
39
40 /* Deallocates all qalloc'ed data areas described by ROOT. */
41
42 //int min(int a,int b);
43
44 /* Returns the smaller integer value of a and b. */
45
46 char get_key(char *valid,char *prompt);
47
48 /* Displays PROMPT and waits for user input. Only characters in VALID are
49 accepted. Terminates the program on EOF. Returns the character. */
50
51 #endif