Lines Matching refs:p
7 static int parse_parts_value_whole(const char *p, const char *symbol) { in parse_parts_value_whole() argument
11 pc = endswith(p, symbol); in parse_parts_value_whole()
15 n = strndupa_safe(p, pc - p); in parse_parts_value_whole()
25 static int parse_parts_value_with_tenths_place(const char *p, const char *symbol) { in parse_parts_value_with_tenths_place() argument
29 pc = endswith(p, symbol); in parse_parts_value_with_tenths_place()
33 dot = memchr(p, '.', pc - p); in parse_parts_value_with_tenths_place()
40 n = strndupa_safe(p, dot - p); in parse_parts_value_with_tenths_place()
43 n = strndupa_safe(p, pc - p); in parse_parts_value_with_tenths_place()
57 static int parse_parts_value_with_hundredths_place(const char *p, const char *symbol) { in parse_parts_value_with_hundredths_place() argument
61 pc = endswith(p, symbol); in parse_parts_value_with_hundredths_place()
65 dot = memchr(p, '.', pc - p); in parse_parts_value_with_hundredths_place()
84 n = strndupa_safe(p, dot - p); in parse_parts_value_with_hundredths_place()
87 n = strndupa_safe(p, pc - p); in parse_parts_value_with_hundredths_place()
101 int parse_percent_unbounded(const char *p) { in parse_percent_unbounded() argument
102 return parse_parts_value_whole(p, "%"); in parse_percent_unbounded()
105 int parse_percent(const char *p) { in parse_percent() argument
108 v = parse_percent_unbounded(p); in parse_percent()
115 int parse_permille_unbounded(const char *p) { in parse_permille_unbounded() argument
118 pm = endswith(p, "‰"); in parse_permille_unbounded()
120 return parse_parts_value_whole(p, "‰"); in parse_permille_unbounded()
122 return parse_parts_value_with_tenths_place(p, "%"); in parse_permille_unbounded()
125 int parse_permille(const char *p) { in parse_permille() argument
128 v = parse_permille_unbounded(p); in parse_permille()
135 int parse_permyriad_unbounded(const char *p) { in parse_permyriad_unbounded() argument
138 pm = endswith(p, "‱"); in parse_permyriad_unbounded()
140 return parse_parts_value_whole(p, "‱"); in parse_permyriad_unbounded()
142 pm = endswith(p, "‰"); in parse_permyriad_unbounded()
144 return parse_parts_value_with_tenths_place(p, "‰"); in parse_permyriad_unbounded()
146 return parse_parts_value_with_hundredths_place(p, "%"); in parse_permyriad_unbounded()
149 int parse_permyriad(const char *p) { in parse_permyriad() argument
152 v = parse_permyriad_unbounded(p); in parse_permyriad()