2003-10-27 Marco Gerards <metgerards@student.han.nl>
* README: In the pupa-mkimage example use _chain instead of chain and ext2 instead of fat. * TODO: Replace ext2fs with jfs as an example. Add an item for adding journal playback for ext2fs. * conf/i386-pc.rmk (pupa_setup_SOURCES): Added fs/ext2.c. (pkgdata_MODULES): Added ext2.mod. (ext2_mod_SOURCES): New variable. (ext2_mod_CFLAGS): Likewise. * include/pupa/err.h (pupa_err_t): Added PUPA_ERR_SYMLINK_LOOP. * include/pupa/misc.h (pupa_strncpy): New prototype. (pupa_strcat): Likewise. (pupa_strncmp): Likewise. * kern/misc.c (pupa_strcat): Enable function. (pupa_strncpy): New function. (pupa_strncmp): Likewise. * kern/disk.c (pupa_disk_read): Set pupa_errno to PUPA_ERR_NONE when the read failed before retrying. * util/i386/pc/biosdisk.c (_LARGEFILE_SOURCE): Removed. (_FILE_OFFSET_BITS): Likewise. * configure.ac: Added AC_SYS_LARGEFILE.
This commit is contained in:
parent
98d150633e
commit
a35eed7c3e
13 changed files with 1149 additions and 18 deletions
33
kern/misc.c
33
kern/misc.c
|
@ -3,6 +3,7 @@
|
|||
* PUPA -- Preliminary Universal Programming Architecture for GRUB
|
||||
* Copyright (C) 1999,2000,2001,2002 Free Software Foundation, Inc.
|
||||
* Copyright (C) 2002 Yoshinori K. Okuji <okuji@enbug.org>
|
||||
* Copyright (C) 2003 Marco Gerards <metgerards@student.han.nl>
|
||||
*
|
||||
* PUPA is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -57,7 +58,18 @@ pupa_strcpy (char *dest, const char *src)
|
|||
return dest;
|
||||
}
|
||||
|
||||
#if 0
|
||||
char *
|
||||
pupa_strncpy (char *dest, const char *src, int c)
|
||||
{
|
||||
char *p = dest;
|
||||
int pos = 0;
|
||||
|
||||
while ((*p++ = *src++) != '\0' && c > pos)
|
||||
pos++;
|
||||
|
||||
return dest;
|
||||
}
|
||||
|
||||
char *
|
||||
pupa_strcat (char *dest, const char *src)
|
||||
{
|
||||
|
@ -71,7 +83,6 @@ pupa_strcat (char *dest, const char *src)
|
|||
|
||||
return dest;
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
pupa_printf (const char *fmt, ...)
|
||||
|
@ -125,6 +136,24 @@ pupa_strcmp (const char *s1, const char *s2)
|
|||
return (int) *s1 - (int) *s2;
|
||||
}
|
||||
|
||||
int
|
||||
pupa_strncmp (const char *s1, const char *s2, int c)
|
||||
{
|
||||
int p = 1;
|
||||
|
||||
while (*s1 && *s2 && p < c)
|
||||
{
|
||||
if (*s1 != *s2)
|
||||
return (int) *s1 - (int) *s2;
|
||||
|
||||
s1++;
|
||||
s2++;
|
||||
p++;
|
||||
}
|
||||
|
||||
return (int) *s1 - (int) *s2;
|
||||
}
|
||||
|
||||
char *
|
||||
pupa_strchr (const char *s, int c)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue