root / Whitix / branches / network / include / string.h

Revision 229, 1.9 kB (checked in by mwhitworth, 9 months ago)

Update pci.h to remove out-of-date header.

Line 
1/*  This file is part of Whitix.
2 *
3 *  Whitix is free software; you can redistribute it and/or modify
4 *  it under the terms of the GNU General Public License as published by
5 *  the Free Software Foundation; either version 2 of the License, or
6 *  (at your option) any later version.
7 *
8 *  Whitix is distributed in the hope that it will be useful,
9 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 *  GNU General Public License for more details.
12 *
13 *  You should have received a copy of the GNU General Public License
14 *  along with Whitix; if not, write to the Free Software
15 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
16 *
17 */
18
19#ifndef STRING_H
20#define STRING_H
21
22#include <stdarg.h>
23#include <typedefs.h>
24
25int strncpy(char* dest,char* src,int len);
26int strcpy(char* dest,char* src);
27int strncmp(const char* s1,const char* s2,int num);
28int strlen(char* str);
29static inline int strcmp(const char* s1,const char* s2) {return strncmp(s1,s2,0xFFFFFFFF);}
30int strnicmp(const char* s1,const char* s2,int num);
31char* strcat(char* s1,const char* s2);
32char* strchr(char* string,int c);
33void* memcpy(void* dest,void* src,long size);
34
35#if 0
36static inline void* memcpy(void* dest,void* src,long size)
37{
38        return ((__builtin_constant_p(size) ? __builtin_memcpy(dest,src,size) : var_memcpy(dest,src,size)));
39}
40#endif
41
42
43void* memset(void* pointer,int size,char value);
44void* memsetw(void* pointer,int size /* in words */,WORD value);
45int memcmp(const void* s1, const void* s2, int n);
46#define ZeroMemory(p,sz) memset((char*)(p),(sz),0)
47
48int sprintf(char* buf,const char* fmt,...);
49int vsprintf(char* buf,const char* fmt,va_list args);
50int toupper(char c);
51
52static inline int isupper(char c)
53{
54        return (c >= 'A' && c <= 'Z');
55}
56
57static inline int tolower(char c)
58{
59        if (isupper(c))
60                c|=0x20;
61
62        return c;
63}
64
65
66#endif
Note: See TracBrowser for help on using the browser.