home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / system / filesyst / dosfs / dosfsck_.z / dosfsck_ / dosfsck / common.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-08  |  914 b   |  40 lines

  1. /* common.h  -  Common functions */
  2.  
  3. /* Written 1993 by Werner Almesberger */
  4.  
  5.  
  6. #ifndef _COMMON_H
  7. #define _COMMON_H
  8.  
  9. void die(char *msg,...);
  10.  
  11. /* Displays a prinf-style message and terminates the program. */
  12.  
  13. void pdie(char *msg,...);
  14.  
  15. /* Like die, but appends an error message according to the state of errno. */
  16.  
  17. void *alloc(int size);
  18.  
  19. /* mallocs SIZE bytes and returns a pointer to the data. Terminates the program
  20.    if malloc fails. */
  21.  
  22. void *qalloc(void **root,int size);
  23.  
  24. /* Like alloc, but registers the data area in a list described by ROOT. */
  25.  
  26. void qfree(void **root);
  27.  
  28. /* Deallocates all qalloc'ed data areas described by ROOT. */
  29.  
  30. int min(int a,int b);
  31.  
  32. /* Returns the smaller integer value of a and b. */
  33.  
  34. char get_key(char *valid,char *prompt);
  35.  
  36. /* Displays PROMPT and waits for user input. Only characters in VALID are
  37.    accepted. Terminates the program on EOF. Returns the character. */
  38.  
  39. #endif
  40.