1 /* string.h: Extra string defs
3 Copyright 2001, 2007, 2008, 2011 Red Hat, Inc.
5 This file is part of Cygwin.
7 This software is a copyrighted work licensed under the terms of the
8 Cygwin license. Please consult the file "CYGWIN_LICENSE" for
11 #ifndef _CYGWIN_STRING_H
12 #define _CYGWIN_STRING_H
14 #include_next <string.h>
21 #define strechr cygwin_strechr
22 static inline __stdcall char *
23 strechr (const char *s, int c)
26 __asm__ __volatile__ ("\
36 ":"=a" (res), "=r" (s)
41 #ifdef __INSIDE_CYGWIN__
43 extern const char isalpha_array[];
46 ascii_strcasematch (const char *cs, const char *ct)
51 .global _isalpha_array \n\
57 xorb _isalpha_array(%%eax),%%al \n\
58 cmpb -1(%%edi),%%al \n\
60 2: testb %%al,%%al \n\
66 :"=a" (__res), "=&S" (d0), "=&D" (d1)
67 : "1" (cs), "2" (ct));
73 ascii_strncasematch (const char *cs, const char *ct, size_t n)
78 .global _isalpha_array; \n\
86 xorb _isalpha_array(%%eax),%%al \n\
87 cmpb -1(%%edi),%%al \n\
89 2: testb %%al,%%al \n\
95 :"=a" (__res), "=&S" (d0), "=&D" (d1), "=&c" (d2)
96 :"1" (cs), "2" (ct), "3" (n));
102 #define strcasecmp cygwin_strcasecmp
103 int __stdcall cygwin_strcasecmp (const char *, const char *);
106 #define strncasecmp cygwin_strncasecmp
107 int __stdcall cygwin_strncasecmp (const char *, const char *, size_t);
109 #define strcasematch(s1,s2) (!cygwin_strcasecmp ((s1),(s2)))
110 #define strncasematch(s1,s2,n) (!cygwin_strncasecmp ((s1),(s2),(n)))
113 #define strlwr cygwin_strlwr
114 char * __stdcall cygwin_strlwr (char *);
117 #define strupr cygwin_strupr
118 char * __stdcall cygwin_strupr (char *);
120 #endif /* __INSIDE_CYGWIN__ */
122 char *__stdcall strccpy (char *s1, const char **s2, char c);
128 #endif /* _CYGWIN_STRING_H */