"SfR Fresh" - the SfR Freeware/Shareware Archive

Member "dosfstools-2.11/dosfsck/common.h" of archive dosfstools-2.11.src.tar.gz:


As a special service "SfR Fresh" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. That can be also achieved for any archive member file by clicking within an archive contents listing on the first character of the file(path) respectively on the according byte size field.
    1 /* common.h  -  Common functions */
    2 
    3 /* Written 1993 by Werner Almesberger */
    4 
    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 
   13 #ifndef _COMMON_H
   14 #define _COMMON_H
   15 
   16 void die(char *msg,...) __attribute((noreturn));
   17 
   18 /* Displays a prinf-style message and terminates the program. */
   19 
   20 void pdie(char *msg,...) __attribute((noreturn));
   21 
   22 /* Like die, but appends an error message according to the state of errno. */
   23 
   24 void *alloc(int size);
   25 
   26 /* mallocs SIZE bytes and returns a pointer to the data. Terminates the program
   27    if malloc fails. */
   28 
   29 void *qalloc(void **root,int size);
   30 
   31 /* Like alloc, but registers the data area in a list described by ROOT. */
   32 
   33 void qfree(void **root);
   34 
   35 /* Deallocates all qalloc'ed data areas described by ROOT. */
   36 
   37 int min(int a,int b);
   38 
   39 /* Returns the smaller integer value of a and b. */
   40 
   41 char get_key(char *valid,char *prompt);
   42 
   43 /* Displays PROMPT and waits for user input. Only characters in VALID are
   44    accepted. Terminates the program on EOF. Returns the character. */
   45 
   46 #endif