/[pupa]/pupa/kern/misc.c
ViewVC logotype

Diff of /pupa/kern/misc.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by okuji, Thu Sep 25 20:15:52 2003 UTC revision 1.4 by marco_g, Wed Oct 29 18:44:30 2003 UTC
# Line 3  Line 3 
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
# Line 57  pupa_strcpy (char *dest, const char *src Line 58  pupa_strcpy (char *dest, const char *src
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  {  {
# Line 71  pupa_strcat (char *dest, const char *src Line 83  pupa_strcat (char *dest, const char *src
83    
84    return dest;    return dest;
85  }  }
 #endif  
86    
87  int  int
88  pupa_printf (const char *fmt, ...)  pupa_printf (const char *fmt, ...)
# Line 123  pupa_strcmp (const char *s1, const char Line 134  pupa_strcmp (const char *s1, const char
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 *

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26