mirror of
https://github.com/zoriya/Twac.git
synced 2026-06-06 20:02:14 +00:00
Adding layer
This commit is contained in:
+1
-1
Submodule lib/gamacon updated: 94dbd5eb0e...a15371fed1
@@ -6,6 +6,8 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
int my_str_islower_or_num(const char *str);
|
||||
|
||||
int my_printf(const char *str, ...);
|
||||
|
||||
void print_ptr(void *ptr);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
int my_strlen(const char *str);
|
||||
|
||||
int my_compute_power_it(int i, int p);
|
||||
int my_pow(int i, int p);
|
||||
|
||||
static int indexof(char c, const char *str)
|
||||
{
|
||||
@@ -29,7 +29,7 @@ static int parse(char *str, const char *base, long n, int i)
|
||||
neg = -1;
|
||||
i *= -1;
|
||||
}
|
||||
power = my_compute_power_it(base_length, i - 1);
|
||||
power = my_pow(base_length, i - 1);
|
||||
n += indexof(str[str_length - i], base) * power * neg;
|
||||
if ((n > 0 && neg < 0) || (n < 0 && neg > 0))
|
||||
return (0);
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
** Duplicate of the string.h (I think)
|
||||
*/
|
||||
|
||||
int is_digit(char c);
|
||||
|
||||
int is_lowercase(char c)
|
||||
{
|
||||
if (c >= 'a' && c <= 'z')
|
||||
@@ -20,3 +22,12 @@ int my_str_islower(const char *str)
|
||||
}
|
||||
return (1);
|
||||
}
|
||||
|
||||
int my_str_islower_or_num(const char *str)
|
||||
{
|
||||
for (int i = 0; str[i] != '\0'; i++) {
|
||||
if (!is_lowercase(str[i]) && !is_digit(str[i]))
|
||||
return (0);
|
||||
}
|
||||
return (1);
|
||||
}
|
||||
|
||||
+1
-1
Submodule lib/quadtree updated: b23039ac96...a7a504fd26
+1
-1
Submodule lib/xmlparser updated: b9cd425416...9262589054
Reference in New Issue
Block a user