lib.c revision 677833bc953b6cb418c701facbdcf4aa18d6c44e
#include <etherboot.h>
#include <lib.h>
char *strdup(const char *s)
{
return d;
}
int isspace(int c)
{
switch (c) {
case ' ': case '\f': case '\n':
case '\r': case '\t': case '\v':
return 1;
default:
return 0;
}
}
unsigned int get_le32(const unsigned char *p)
{
return ((unsigned int) p[0] << 0)
| ((unsigned int) p[1] << 8)
| ((unsigned int) p[2] << 16)
| ((unsigned int) p[3] << 24);
}
unsigned int get_le16(const unsigned char *p)
{
return ((unsigned int) p[0] << 0)
| ((unsigned int) p[1] << 8);
}
// It is needed by debug for filo
{
int i;
const unsigned char *q = p;
for (i = 0; i < len; i++) {
if (i%16==0)
printf("%04x: ", i);
}
if (i%16 != 0)
putchar('\n');
}
#endif