~ilya-yanok/ubuntu/precise/grub2/fix-for-948716

« back to all changes in this revision

Viewing changes to script/lua/grub_lua.h

  • Committer: Bazaar Package Importer
  • Author(s): Robert Millan
  • Date: 2009-07-25 19:00:53 UTC
  • mfrom: (1.6.3 upstream)
  • mto: (17.4.13 sid)
  • mto: This revision was merged to the branch mainline in revision 53.
  • Revision ID: james.westby@ubuntu.com-20090725190053-uv3lm6ya3zxs77ep
ImportĀ upstreamĀ versionĀ 1.96+20090725

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  GRUB  --  GRand Unified Bootloader
 
3
 *  Copyright (C) 2009  Free Software Foundation, Inc.
 
4
 *
 
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.
 
9
 *
 
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.
 
14
 *
 
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/>.
 
17
 */
 
18
 
 
19
#ifndef GRUB_LUA_HEADER
 
20
#define GRUB_LUA_HEADER 1
 
21
 
 
22
#include <grub/types.h>
 
23
#include <grub/mm.h>
 
24
#include <grub/err.h>
 
25
#include <grub/misc.h>
 
26
#include <grub/setjmp.h>
 
27
 
 
28
#define INT_MAX         GRUB_LONG_MAX
 
29
#define UCHAR_MAX       255
 
30
#define SHRT_MAX        32767
 
31
 
 
32
#undef UNUSED
 
33
#define UNUSED          (void)
 
34
 
 
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
 
51
 
 
52
#define malloc          grub_malloc
 
53
#define realloc         grub_realloc
 
54
#define free            grub_free
 
55
 
 
56
#define exit(a)         grub_exit()
 
57
#define jmp_buf         grub_jmp_buf
 
58
#define setjmp          grub_setjmp
 
59
#define longjmp         grub_longjmp
 
60
 
 
61
#define fputs(s,f)      grub_printf(s)
 
62
 
 
63
#define isdigit         grub_isdigit
 
64
#define isalpha         grub_isalpha
 
65
#define isspace         grub_isspace
 
66
 
 
67
static inline int
 
68
isalnum (int c)
 
69
{
 
70
  return (isalpha (c) || isdigit (c));
 
71
}
 
72
 
 
73
static inline int
 
74
iscntrl (int c)
 
75
{
 
76
  return ((c <= 0x1f) || (c == 0x7f));
 
77
}
 
78
 
 
79
static inline int
 
80
isupper (int c)
 
81
{
 
82
  return ((c >= 'A') && (c <= 'Z'));
 
83
}
 
84
 
 
85
static inline int
 
86
islower (int c)
 
87
{
 
88
  return ((c >= 'a') && (c <= 'z'));
 
89
}
 
90
 
 
91
static inline int
 
92
ispunct (int c)
 
93
{
 
94
  return ((! isspace (c)) && (! isalnum (c)));
 
95
}
 
96
 
 
97
static inline int
 
98
isxdigit (int c)
 
99
{
 
100
  return (isdigit (c) || ((c >= 'a') && (c <= 'f')) ||
 
101
          ((c >= 'A') && (c <= 'F')));
 
102
}
 
103
 
 
104
static inline int
 
105
abs (int c)
 
106
{
 
107
  return (c >= 0) ? : -c;
 
108
}
 
109
 
 
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);
 
113
 
 
114
#endif