-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit_strglob.c
56 lines (47 loc) · 1.22 KB
/
init_strglob.c
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
#include"strglob.h"
/*! @fn STR_GLOB *init_strglob(STR_GLOB *restrict ugpnt)
*
* @brief initialize the glob list prior to utilizing its output
*
* @param [in] ugpnt a pointer to the head element of the glob list
*
* @return the only argument that was passed as its original type
*
* @note this function invokes `imply_range` if an element's `out` member is `NULL`
*
* @see imply_float_range
*
* @see imply_range
*/
/* 1 = integer range
* 2 = character range
* 3 = set
* 4 = character class
* 5 = string
* 6 = float
*/
STR_GLOB *init_strglob(STR_GLOB *restrict ugpnt) {
while(ugpnt) {
if(!ugpnt->type) {
} else if(ugpnt->type == 4) { /* character class */
} else if(ugpnt->type == 3) { /* set */
} else { /* integer, character or floating-point range */
if(!ugpnt->out) {
if(ugpnt->type == 6) {
if(ugpnt->runi.frng.inc == 0.0)
ugpnt->runi.frng.inc = 1.0;
ugpnt->out = imply_float_range(ugpnt);
}
else
ugpnt->out = imply_range(ugpnt);
}
}
if(ugpnt->out) {
register char **opp = ugpnt->out;
while(*opp++);
ugpnt->tot = opp - ugpnt->out;
}
ugpnt = ugpnt->next;
}
return ugpnt;
}