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