~ubuntu-branches/debian/sid/grub2/sid-200907171834

« back to all changes in this revision

Viewing changes to script/lua/grub_lua.h

  • Committer: Bazaar Package Importer
  • Author(s): Robert Millan, Updated translations, Robert Millan
  • Date: 2008-11-10 16:18:14 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20081110161814-1ltb13avouqapmlh
Tags: 1.96+20080724-12
[ Updated translations ]
* Italian (it.po) by Luca Monducci. (Closes: #504076)
* Swedish (sv.po) by Martin Ågren. (Closes: #504207)
* Arabic (ar.po) by Ossama Khayat. (Closes: #504254)
* Portuguese (pt.po) by Miguel Figueiredo. (Closes: #504280)
* Russian (ru.po) by Yuri Kozlov. (Closes: #504324)
* Finnish (fi.po) by Esko Arajärvi. (Closes: #504310)
* Basque (eu.po) by Piarres Beobide. (Closes: #504466)
* Dutch (nl.po) by Paul Gevers. (Closes: #504683)

[ Robert Millan ]
* Update to new debian theme.
  - grub-pc.postinst: Switch to moreblue-orbit-grub.png.
  - grub.d/05_debian_theme: Likewise.

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
 
strcspn(const char *s1, const char *s2)
81
 
{
82
 
  int size = 0;
83
 
 
84
 
  while (*s1)
85
 
    {
86
 
      const char *p = s2;
87
 
 
88
 
      while (*p)
89
 
        {
90
 
          if (*s1 == *p)
91
 
            return size;
92
 
          p++;
93
 
        }
94
 
 
95
 
      s1++;
96
 
      size++;
97
 
    }
98
 
 
99
 
  return size;
100
 
}
101
 
 
102
 
static inline int
103
 
abs (int c)
104
 
{
105
 
  return (c >= 0) ? : -c;
106
 
}
107
 
 
108
 
#endif