src/mess/osd/sdl/glob.c
| r1469 | r1470 | |
| 156 | 156 | |
| 157 | 157 | static int compare __P((const void *, const void *)); |
| 158 | 158 | static void g_Ctoc __P((const Char *, char *)); |
| 159 | | static int g_lstat __P((Char *, struct stat *, glob_t *)); |
| 159 | //static int g_lstat __P((Char *, struct stat *, glob_t *)); |
| 160 | 160 | static osd_directory *g_opendir __P((Char *, glob_t *)); |
| 161 | | static Char *g_strchr __P((Char *, int)); |
| 161 | static Char *g_strchr __P((const Char *, int)); |
| 162 | 162 | #ifdef notdef |
| 163 | 163 | static Char *g_strcat __P((Char *, const Char *)); |
| 164 | 164 | #endif |
| 165 | | static int g_stat __P((Char *, struct stat *, glob_t *)); |
| 165 | //static int g_stat __P((Char *, struct stat *, glob_t *)); |
| 166 | 166 | static int glob0 __P((const Char *, glob_t *)); |
| 167 | 167 | static int glob1 __P((Char *, glob_t *)); |
| 168 | 168 | static int glob2 __P((Char *, Char *, Char *, glob_t *)); |
| r1469 | r1470 | |
| 239 | 239 | if (pattern[0] == LBRACE && pattern[1] == RBRACE && pattern[2] == EOS) |
| 240 | 240 | return glob0(pattern, pglob); |
| 241 | 241 | |
| 242 | | while ((ptr = (const Char *) g_strchr((Char *) ptr, LBRACE)) != NULL) |
| 242 | while ((ptr = (const Char *) g_strchr(ptr, LBRACE)) != NULL) |
| 243 | 243 | if (!globexp2(ptr, pattern, pglob, &rv)) |
| 244 | 244 | return rv; |
| 245 | 245 | |
| r1469 | r1470 | |
| 798 | 798 | |
| 799 | 799 | return osd_opendir(buf); |
| 800 | 800 | } |
| 801 | | |
| 801 | #if 0 |
| 802 | 802 | static int |
| 803 | 803 | g_lstat(fn, sb, pglob) |
| 804 | 804 | register Char *fn; |
| r1469 | r1470 | |
| 826 | 826 | return((*pglob->gl_stat)(buf, sb)); |
| 827 | 827 | return(stat(buf, sb)); |
| 828 | 828 | } |
| 829 | | |
| 829 | #endif |
| 830 | 830 | static Char * |
| 831 | 831 | g_strchr(str, ch) |
| 832 | | Char *str; |
| 832 | const Char *str; |
| 833 | 833 | int ch; |
| 834 | 834 | { |
| 835 | 835 | do { |
| 836 | 836 | if (*str == ch) |
| 837 | | return (str); |
| 837 | return ((Char *)str); |
| 838 | 838 | } while (*str++); |
| 839 | 839 | return (NULL); |
| 840 | 840 | } |