home *** CD-ROM | disk | FTP | other *** search
- /*
- * c.c
- *
- * Author: Tomi Ollila <too@cs.hut.fi>
- *
- * Copyright (c) 1993 AmiTCP/IP Group, <amitcp-group@hut.fi>
- * All rights reserved
- *
- * Created: Wed Sep 15 14:12:12 1993 too
- * Last modified: Sat Oct 16 16:53:29 1993 too
- *
- * $Id: c.c,v 1.1 1993/10/24 12:50:39 too Exp too $
- *
- * HISTORY
- * $Log: c.c,v $
- * Revision 1.1 1993/10/24 12:50:39 too
- * Initial revision
- *
- */
-
- #include "c.h"
-
- void bzero(char * mem, int len)
- {
- char *i;
-
- for(i = mem; len > 0; i++, len--)
- *i = '\0';
- }
-
- #if 0
- #define isupper(x) ((x) >= 'A' && (x) <= 'Z')
- #define tolower(x) ((x) & 0x5F) /* this is only used w/ isupper() */
-
- int strncasecmp(char * a, char * b, int n)
- {
- char la; char lb;
-
- la = *a; if (isupper(la)) la = tolower(la);
- lb = *b; if (isupper(la)) la = tolower(la);
-
- while (--n > 0) { /* don't check last one */
- if ((la == '\0') || (la != lb))
- break;
- a++;
- b++;
- la = *a; if (isupper(la)) la = tolower(la);
- lb = *b; if (isupper(la)) la = tolower(la);
- }
- return (lb - la);
- }
-
- #endif
-
- int atoi(char * a)
- {
- int i = 0;
-
- while (isdigit(*a)) {
- i *= 10;
- i += *a - '0';
- a++;
- }
- return i;
- }
-