2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 2009 Free Software Foundation, Inc.
5 * GRUB is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * GRUB is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef GRUB_LUA_HEADER
20 #define GRUB_LUA_HEADER 1
22 #include <grub/types.h>
25 #include <grub/misc.h>
26 #include <grub/setjmp.h>
28 #define INT_MAX GRUB_LONG_MAX
30 #define SHRT_MAX 32767
35 #define memcpy grub_memcpy
36 #define memcmp grub_memcmp
37 #define strcpy grub_strcpy
38 #define strstr grub_strstr
39 #define strchr grub_strchr
40 #define strlen grub_strlen
41 #define strtoul grub_strtoul
42 #define strtod(s,e) grub_strtoul(s,e,0)
43 #define sprintf grub_sprintf
44 #define strncpy grub_strncpy
45 #define strcat grub_strcat
46 #define strncat grub_strncat
47 #define strcoll grub_strcmp
48 #define strcmp grub_strcmp
49 #define tolower grub_tolower
50 #define toupper grub_toupper
52 #define malloc grub_malloc
53 #define realloc grub_realloc
54 #define free grub_free
56 #define exit(a) grub_exit()
57 #define jmp_buf grub_jmp_buf
58 #define setjmp grub_setjmp
59 #define longjmp grub_longjmp
61 #define fputs(s,f) grub_printf("%s", s)
63 #define isdigit grub_isdigit
64 #define isalpha grub_isalpha
65 #define isspace grub_isspace
70 return (isalpha (c
) || isdigit (c
));
76 return ((c
<= 0x1f) || (c
== 0x7f));
82 return ((c
>= 'A') && (c
<= 'Z'));
88 return ((c
>= 'a') && (c
<= 'z'));
94 return ((! isspace (c
)) && (! isalnum (c
)));
100 return (isdigit (c
) || ((c
>= 'a') && (c
<= 'f')) ||
101 ((c
>= 'A') && (c
<= 'F')));
107 return (c
>= 0) ? : -c
;
110 int strcspn (const char *s1
, const char *s2
);
111 char *strpbrk (const char *s1
, const char *s2
);
112 void *memchr (const void *s
, int c
, size_t n
);