3 |
* PUPA -- Preliminary Universal Programming Architecture for GRUB |
* PUPA -- Preliminary Universal Programming Architecture for GRUB |
4 |
* Copyright (C) 1999,2000,2001,2002 Free Software Foundation, Inc. |
* Copyright (C) 1999,2000,2001,2002 Free Software Foundation, Inc. |
5 |
* Copyright (C) 2002 Yoshinori K. Okuji <okuji@enbug.org> |
* Copyright (C) 2002 Yoshinori K. Okuji <okuji@enbug.org> |
6 |
|
* Copyright (C) 2003 Marco Gerards <metgerards@student.han.nl> |
7 |
* |
* |
8 |
* PUPA is free software; you can redistribute it and/or modify |
* PUPA is free software; you can redistribute it and/or modify |
9 |
* it under the terms of the GNU General Public License as published by |
* it under the terms of the GNU General Public License as published by |
58 |
return dest; |
return dest; |
59 |
} |
} |
60 |
|
|
61 |
#if 0 |
char * |
62 |
|
pupa_strncpy (char *dest, const char *src, int c) |
63 |
|
{ |
64 |
|
char *p = dest; |
65 |
|
int pos = 0; |
66 |
|
|
67 |
|
while ((*p++ = *src++) != '\0' && c > pos) |
68 |
|
pos++; |
69 |
|
|
70 |
|
return dest; |
71 |
|
} |
72 |
|
|
73 |
char * |
char * |
74 |
pupa_strcat (char *dest, const char *src) |
pupa_strcat (char *dest, const char *src) |
75 |
{ |
{ |
83 |
|
|
84 |
return dest; |
return dest; |
85 |
} |
} |
|
#endif |
|
86 |
|
|
87 |
int |
int |
88 |
pupa_printf (const char *fmt, ...) |
pupa_printf (const char *fmt, ...) |
134 |
} |
} |
135 |
|
|
136 |
return (int) *s1 - (int) *s2; |
return (int) *s1 - (int) *s2; |
137 |
|
} |
138 |
|
|
139 |
|
int |
140 |
|
pupa_strncmp (const char *s1, const char *s2, int c) |
141 |
|
{ |
142 |
|
int p = 1; |
143 |
|
|
144 |
|
while (*s1 && *s2 && p < c) |
145 |
|
{ |
146 |
|
if (*s1 != *s2) |
147 |
|
return (int) *s1 - (int) *s2; |
148 |
|
|
149 |
|
s1++; |
150 |
|
s2++; |
151 |
|
p++; |
152 |
|
} |
153 |
|
|
154 |
|
return (int) *s1 - (int) *s2; |
155 |
} |
} |
156 |
|
|
157 |
char * |
char * |