ALN  0.1.1
aln.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: Apache-2.0
2 
10 #ifndef __ALN_H__
11 #define __ALN_H__
12 
13 #if defined(_WIN32)
14 #define ALN_API_EXPORT __declspec(dllexport)
15 #define ALN_API_IMPORT __declspec(dllimport)
16 #else
17 #define ALN_API_EXPORT __attribute__((visibility("default")))
18 #define ALN_API_IMPORT
19 #endif
20 
21 #ifdef ALN_LIBRARY_BUILD
22 #define ALN_API ALN_API_EXPORT
23 #else
24 #define ALN_API ALN_API_IMPORT
25 #endif
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
34 typedef struct _ALN ALN;
35 
50 ALN_API ALN *aln_new(unsigned int count, unsigned int min, unsigned int max,
51  int allow_repeat);
52 
61 ALN_API void aln_free(ALN *aln);
62 
71 ALN_API void aln_reset(ALN *aln);
72 
85 ALN_API int aln_draw_number(ALN *aln, unsigned int *number);
86 
98 ALN_API int aln_draw_all(ALN *aln);
99 
113 ALN_API unsigned int aln_get_number(const ALN *aln, unsigned int index);
114 
115 #ifdef __cplusplus
116 }
117 #endif
118 
119 #endif
ALN_API int aln_draw_number(ALN *aln, unsigned int *number)
Draws a single lucky number.
Definition: aln.c:85
ALN_API int aln_draw_all(ALN *aln)
Draws all remaining lucky numbers.
Definition: aln.c:124
ALN_API void aln_reset(ALN *aln)
Resets an ALN instance.
Definition: aln.c:70
ALN_API unsigned int aln_get_number(const ALN *aln, unsigned int index)
Gets a specific lucky number by index.
Definition: aln.c:138
ALN_API ALN * aln_new(unsigned int count, unsigned int min, unsigned int max, int allow_repeat)
Creates a new ALN instance.
Definition: aln.c:18
ALN_API void aln_free(ALN *aln)
Frees an ALN instance.
Definition: aln.c:61
Definition: aln.c:7