fortune.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* =============================================================================
  2. * PROGRAM: ularn
  3. * FILENAME: fortune.h
  4. *
  5. * DESCRIPTION:
  6. * This module contains functions for displaying fortunes inside fortune
  7. * cookies.
  8. *
  9. * =============================================================================
  10. * EXPORTED VARIABLES
  11. *
  12. * None
  13. *
  14. * =============================================================================
  15. * EXPORTED FUNCTIONS
  16. *
  17. * fortune - Returns a random fortune string.
  18. * free_fortunes - Frees the fortunes data.
  19. *
  20. * =============================================================================
  21. */
  22. #ifndef __FORTUNE_H
  23. #define __FORTUNE_H
  24. /* =============================================================================
  25. * FUNCTION: fortune
  26. *
  27. * DESCRIPTION:
  28. * This function returns a random fortune from the ularn fortune file.
  29. * If the fortune file cannot be read the NULL is returned.
  30. * On the first call to this function the fortune file is read and the fortunes
  31. * are stored in memory.
  32. *
  33. * PARAMETERS:
  34. *
  35. * file : The name of the file containing the fortunes.
  36. *
  37. * RETURN VALUE:
  38. *
  39. * A pointer to the fortune textm or NULL if the file couldn't be read.
  40. */
  41. char *fortune(char *file);
  42. /* =============================================================================
  43. * FUNCTION: free_fortunes
  44. *
  45. * DESCRIPTION:
  46. * This function deallocates any memory allocated by fortune().
  47. *
  48. * PARAMETERS:
  49. *
  50. * None.
  51. *
  52. * RETURN VALUE:
  53. *
  54. * None.
  55. */
  56. void free_fortunes(void);
  57. #endif