1 /* string.h: Extra string defs
3 Copyright 2001 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 strchr cygwin_strchr
22 static inline __stdcall char *
23 strchr (const char *s, int c)
26 __asm__ __volatile__ ("\
36 ":"=a" (res), "=r" (s)
41 extern const char isalpha_array[];
44 #define strcasematch cygwin_strcasematch
47 cygwin_strcasematch (const char *cs, const char *ct)
52 .global _isalpha_array \n\
58 xorb _isalpha_array(%%eax),%%al \n\
59 cmpb -1(%%edi),%%al \n\
61 2: testb %%al,%%al \n\
67 :"=a" (__res), "=&S" (d0), "=&D" (d1)
68 : "1" (cs), "2" (ct));
74 #define strncasematch cygwin_strncasematch
77 cygwin_strncasematch (const char *cs, const char *ct, size_t n)
82 .global _isalpha_array; \n\
90 xorb _isalpha_array(%%eax),%%al \n\
91 cmpb -1(%%edi),%%al \n\
93 2: testb %%al,%%al \n\
99 :"=a" (__res), "=&S" (d0), "=&D" (d1), "=&c" (d2)
100 :"1" (cs), "2" (ct), "3" (n));
108 #endif /* _CYGWIN_STRING_H */