\hypertarget{fnmatch_8c_source}{}\doxysection{fnmatch.\+c}
\label{fnmatch_8c_source}\index{libkern/fnmatch.c@{libkern/fnmatch.c}}
\mbox{\hyperlink{fnmatch_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/3-\/Clause}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 1989, 1993, 1994}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00005}00005 \textcolor{comment}{ *      The Regents of the University of California.  All rights reserved.}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00007}00007 \textcolor{comment}{ * This code is derived from software contributed to Berkeley by}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00008}00008 \textcolor{comment}{ * Guido van Rossum.}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00009}00009 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00010}00010 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00011}00011 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00012}00012 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00013}00013 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00014}00014 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00015}00015 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00016}00016 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00017}00017 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00018}00018 \textcolor{comment}{ * 3. Neither the name of the University nor the names of its contributors}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00019}00019 \textcolor{comment}{ *    may be used to endorse or promote products derived from this software}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00020}00020 \textcolor{comment}{ *    without specific prior written permission.}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00021}00021 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00022}00022 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00023}00023 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00024}00024 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00025}00025 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00026}00026 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00027}00027 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00028}00028 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00029}00029 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00030}00030 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00031}00031 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00032}00032 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00033}00033 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00034}00034 }
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00036}\mbox{\hyperlink{fnmatch_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00036}} \mbox{\hyperlink{fnmatch_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00037}00037 }
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00038}00038 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00039}00039 \textcolor{comment}{ * Function fnmatch() as specified in POSIX 1003.2-\/1992, section B.6.}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00040}00040 \textcolor{comment}{ * Compares a filename or pathname to a pattern.}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00041}00041 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00042}00042 }
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00043}00043 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00044}00044 \textcolor{preprocessor}{\#include <sys/ctype.h>}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00045}00045 \textcolor{preprocessor}{\#include <sys/libkern.h>}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00046}00046 }
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00047}\mbox{\hyperlink{fnmatch_8c_aadbbc7b02d94a4c18646813ac8d7dec1}{00047}} \textcolor{preprocessor}{\#define EOS     '\(\backslash\)0'}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00048}00048 }
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00049}\mbox{\hyperlink{fnmatch_8c_abba32c16b1ac3be5cb803a179a43e96e}{00049}} \textcolor{preprocessor}{\#define RANGE\_MATCH     1}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00050}\mbox{\hyperlink{fnmatch_8c_a678fa83d3346393910c687dbc3787e86}{00050}} \textcolor{preprocessor}{\#define RANGE\_NOMATCH   0}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00051}\mbox{\hyperlink{fnmatch_8c_aa6d704750721f15505d2dab71c199a74}{00051}} \textcolor{preprocessor}{\#define RANGE\_ERROR     (-\/1)}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00052}00052 }
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00053}00053 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{fnmatch_8c_add2b662fdec47be5bfb897d4295331b4}{rangematch}}(\textcolor{keyword}{const} \textcolor{keywordtype}{char} *, \textcolor{keywordtype}{char}, \textcolor{keywordtype}{int}, \textcolor{keywordtype}{char} **);}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00054}00054 }
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00055}00055 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00056}\mbox{\hyperlink{fnmatch_8c_a088b414f40eb0ce3dad9e5243816f68f}{00056}} \mbox{\hyperlink{fnmatch_8c_a088b414f40eb0ce3dad9e5243816f68f}{fnmatch}}(\textcolor{keyword}{const} \textcolor{keywordtype}{char} *pattern, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *\textcolor{keywordtype}{string}, \textcolor{keywordtype}{int} flags)}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00057}00057 \{}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00058}00058         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *stringstart;}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00059}00059         \textcolor{keywordtype}{char} *newp;}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00060}00060         \textcolor{keywordtype}{char} \mbox{\hyperlink{iconv__converter__if_8m_a4e1e0e72dd773439e333c84dd762a9c3}{c}}, test;}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00061}00061 }
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00062}00062         \textcolor{keywordflow}{for} (stringstart = \textcolor{keywordtype}{string};;)}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00063}00063                 \textcolor{keywordflow}{switch} (\mbox{\hyperlink{iconv__converter__if_8m_a4e1e0e72dd773439e333c84dd762a9c3}{c}} = *pattern++) \{}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00064}00064                 \textcolor{keywordflow}{case} \mbox{\hyperlink{fnmatch_8c_aadbbc7b02d94a4c18646813ac8d7dec1}{EOS}}:}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00065}00065                         \textcolor{keywordflow}{if} ((flags \& FNM\_LEADING\_DIR) \&\& *\textcolor{keywordtype}{string} == \textcolor{charliteral}{'/'})}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00066}00066                                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00067}00067                         \textcolor{keywordflow}{return} (*\textcolor{keywordtype}{string} == \mbox{\hyperlink{fnmatch_8c_aadbbc7b02d94a4c18646813ac8d7dec1}{EOS}} ? 0 : FNM\_NOMATCH);}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00068}00068                 \textcolor{keywordflow}{case} \textcolor{charliteral}{'?'}:}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00069}00069                         \textcolor{keywordflow}{if} (*\textcolor{keywordtype}{string} == \mbox{\hyperlink{fnmatch_8c_aadbbc7b02d94a4c18646813ac8d7dec1}{EOS}})}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00070}00070                                 \textcolor{keywordflow}{return} (FNM\_NOMATCH);}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00071}00071                         \textcolor{keywordflow}{if} (*\textcolor{keywordtype}{string} == \textcolor{charliteral}{'/'} \&\& (flags \& FNM\_PATHNAME))}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00072}00072                                 \textcolor{keywordflow}{return} (FNM\_NOMATCH);}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00073}00073                         \textcolor{keywordflow}{if} (*\textcolor{keywordtype}{string} == \textcolor{charliteral}{'.'} \&\& (flags \& FNM\_PERIOD) \&\&}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00074}00074                             (\textcolor{keywordtype}{string} == stringstart ||}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00075}00075                             ((flags \& FNM\_PATHNAME) \&\& *(\textcolor{keywordtype}{string} -\/ 1) == \textcolor{charliteral}{'/'})))}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00076}00076                                 \textcolor{keywordflow}{return} (FNM\_NOMATCH);}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00077}00077                         ++string;}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00078}00078                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00079}00079                 \textcolor{keywordflow}{case} \textcolor{charliteral}{'*'}:}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00080}00080                         \mbox{\hyperlink{iconv__converter__if_8m_a4e1e0e72dd773439e333c84dd762a9c3}{c}} = *pattern;}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00081}00081                         \textcolor{comment}{/* Collapse multiple stars. */}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00082}00082                         \textcolor{keywordflow}{while} (\mbox{\hyperlink{iconv__converter__if_8m_a4e1e0e72dd773439e333c84dd762a9c3}{c}} == \textcolor{charliteral}{'*'})}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00083}00083                                 \mbox{\hyperlink{iconv__converter__if_8m_a4e1e0e72dd773439e333c84dd762a9c3}{c}} = *++pattern;}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00084}00084 }
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00085}00085                         \textcolor{keywordflow}{if} (*\textcolor{keywordtype}{string} == \textcolor{charliteral}{'.'} \&\& (flags \& FNM\_PERIOD) \&\&}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00086}00086                             (\textcolor{keywordtype}{string} == stringstart ||}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00087}00087                             ((flags \& FNM\_PATHNAME) \&\& *(\textcolor{keywordtype}{string} -\/ 1) == \textcolor{charliteral}{'/'})))}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00088}00088                                 \textcolor{keywordflow}{return} (FNM\_NOMATCH);}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00089}00089 }
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00090}00090                         \textcolor{comment}{/* Optimize for pattern with * at end or before /. */}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00091}00091                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{iconv__converter__if_8m_a4e1e0e72dd773439e333c84dd762a9c3}{c}} == \mbox{\hyperlink{fnmatch_8c_aadbbc7b02d94a4c18646813ac8d7dec1}{EOS}})}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00092}00092                                 \textcolor{keywordflow}{if} (flags \& FNM\_PATHNAME)}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00093}00093                                         \textcolor{keywordflow}{return} ((flags \& FNM\_LEADING\_DIR) ||}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00094}00094                                             \mbox{\hyperlink{strchr_8c_a77fb43c12b09505b9adcce78aebaad3d}{strchr}}(\textcolor{keywordtype}{string}, \textcolor{charliteral}{'/'}) == NULL ?}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00095}00095                                             0 : FNM\_NOMATCH);}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00096}00096                                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00097}00097                                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00098}00098                         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (\mbox{\hyperlink{iconv__converter__if_8m_a4e1e0e72dd773439e333c84dd762a9c3}{c}} == \textcolor{charliteral}{'/'} \&\& flags \& FNM\_PATHNAME) \{}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00099}00099                                 \textcolor{keywordflow}{if} ((\textcolor{keywordtype}{string} = \mbox{\hyperlink{strchr_8c_a77fb43c12b09505b9adcce78aebaad3d}{strchr}}(\textcolor{keywordtype}{string}, \textcolor{charliteral}{'/'})) == NULL)}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00100}00100                                         \textcolor{keywordflow}{return} (FNM\_NOMATCH);}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00101}00101                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00102}00102                         \}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00103}00103 }
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00104}00104                         \textcolor{comment}{/* General case, use recursion. */}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00105}00105                         \textcolor{keywordflow}{while} ((test = *\textcolor{keywordtype}{string}) != \mbox{\hyperlink{fnmatch_8c_aadbbc7b02d94a4c18646813ac8d7dec1}{EOS}}) \{}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00106}00106                                 \textcolor{keywordflow}{if} (!\mbox{\hyperlink{fnmatch_8c_a088b414f40eb0ce3dad9e5243816f68f}{fnmatch}}(pattern, \textcolor{keywordtype}{string}, flags \& \string~FNM\_PERIOD))}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00107}00107                                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00108}00108                                 \textcolor{keywordflow}{if} (test == \textcolor{charliteral}{'/'} \&\& flags \& FNM\_PATHNAME)}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00109}00109                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00110}00110                                 ++string;}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00111}00111                         \}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00112}00112                         \textcolor{keywordflow}{return} (FNM\_NOMATCH);}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00113}00113                 \textcolor{keywordflow}{case} \textcolor{charliteral}{'['}:}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00114}00114                         \textcolor{keywordflow}{if} (*\textcolor{keywordtype}{string} == \mbox{\hyperlink{fnmatch_8c_aadbbc7b02d94a4c18646813ac8d7dec1}{EOS}})}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00115}00115                                 \textcolor{keywordflow}{return} (FNM\_NOMATCH);}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00116}00116                         \textcolor{keywordflow}{if} (*\textcolor{keywordtype}{string} == \textcolor{charliteral}{'/'} \&\& (flags \& FNM\_PATHNAME))}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00117}00117                                 \textcolor{keywordflow}{return} (FNM\_NOMATCH);}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00118}00118                         \textcolor{keywordflow}{if} (*\textcolor{keywordtype}{string} == \textcolor{charliteral}{'.'} \&\& (flags \& FNM\_PERIOD) \&\&}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00119}00119                             (\textcolor{keywordtype}{string} == stringstart ||}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00120}00120                             ((flags \& FNM\_PATHNAME) \&\& *(\textcolor{keywordtype}{string} -\/ 1) == \textcolor{charliteral}{'/'})))}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00121}00121                                 \textcolor{keywordflow}{return} (FNM\_NOMATCH);}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00122}00122 }
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00123}00123                         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{fnmatch_8c_add2b662fdec47be5bfb897d4295331b4}{rangematch}}(pattern, *\textcolor{keywordtype}{string}, flags, \&newp)) \{}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00124}00124                         \textcolor{keywordflow}{case} \mbox{\hyperlink{fnmatch_8c_aa6d704750721f15505d2dab71c199a74}{RANGE\_ERROR}}:}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00125}00125                                 \textcolor{keywordflow}{goto} norm;}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00126}00126                         \textcolor{keywordflow}{case} \mbox{\hyperlink{fnmatch_8c_abba32c16b1ac3be5cb803a179a43e96e}{RANGE\_MATCH}}:}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00127}00127                                 pattern = newp;}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00128}00128                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00129}00129                         \textcolor{keywordflow}{case} \mbox{\hyperlink{fnmatch_8c_a678fa83d3346393910c687dbc3787e86}{RANGE\_NOMATCH}}:}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00130}00130                                 \textcolor{keywordflow}{return} (FNM\_NOMATCH);}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00131}00131                         \}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00132}00132                         ++string;}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00133}00133                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00134}00134                 \textcolor{keywordflow}{case} \textcolor{charliteral}{'\(\backslash\)\(\backslash\)'}:}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00135}00135                         \textcolor{keywordflow}{if} (!(flags \& FNM\_NOESCAPE)) \{}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00136}00136                                 \textcolor{keywordflow}{if} ((\mbox{\hyperlink{iconv__converter__if_8m_a4e1e0e72dd773439e333c84dd762a9c3}{c}} = *pattern++) == \mbox{\hyperlink{fnmatch_8c_aadbbc7b02d94a4c18646813ac8d7dec1}{EOS}}) \{}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00137}00137                                         \mbox{\hyperlink{iconv__converter__if_8m_a4e1e0e72dd773439e333c84dd762a9c3}{c}} = \textcolor{charliteral}{'\(\backslash\)\(\backslash\)'};}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00138}00138                                         -\/-\/pattern;}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00139}00139                                 \}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00140}00140                         \}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00141}00141                         \textcolor{comment}{/* FALLTHROUGH */}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00142}00142                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00143}00143                 norm:}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00144}00144                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{iconv__converter__if_8m_a4e1e0e72dd773439e333c84dd762a9c3}{c}} == *\textcolor{keywordtype}{string})}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00145}00145                                 ;}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00146}00146                         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} ((flags \& FNM\_CASEFOLD) \&\&}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00147}00147                                  (\mbox{\hyperlink{iconv__converter__if_8m_a64463165d2d28472db9eb5f055ffa586}{tolower}}((\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char})\mbox{\hyperlink{iconv__converter__if_8m_a4e1e0e72dd773439e333c84dd762a9c3}{c}}) ==}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00148}00148                                   \mbox{\hyperlink{iconv__converter__if_8m_a64463165d2d28472db9eb5f055ffa586}{tolower}}((\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char})*\textcolor{keywordtype}{string})))}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00149}00149                                 ;}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00150}00150                         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00151}00151                                 \textcolor{keywordflow}{return} (FNM\_NOMATCH);}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00152}00152                         \textcolor{keywordtype}{string}++;}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00153}00153                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00154}00154                 \}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00155}00155         \textcolor{comment}{/* NOTREACHED */}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00156}00156 \}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00157}00157 }
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00158}00158 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00159}\mbox{\hyperlink{fnmatch_8c_add2b662fdec47be5bfb897d4295331b4}{00159}} \mbox{\hyperlink{fnmatch_8c_add2b662fdec47be5bfb897d4295331b4}{rangematch}}(\textcolor{keyword}{const} \textcolor{keywordtype}{char} *pattern, \textcolor{keywordtype}{char} test, \textcolor{keywordtype}{int} flags, \textcolor{keywordtype}{char} **newp)}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00160}00160 \{}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00161}00161         \textcolor{keywordtype}{int} negate, ok;}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00162}00162         \textcolor{keywordtype}{char} \mbox{\hyperlink{iconv__converter__if_8m_a4e1e0e72dd773439e333c84dd762a9c3}{c}}, c2;}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00163}00163 }
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00164}00164         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00165}00165 \textcolor{comment}{         * A bracket expression starting with an unquoted circumflex}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00166}00166 \textcolor{comment}{         * character produces unspecified results (IEEE 1003.2-\/1992,}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00167}00167 \textcolor{comment}{         * 3.13.2).  This implementation treats it like '!', for}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00168}00168 \textcolor{comment}{         * consistency with the regular expression syntax.}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00169}00169 \textcolor{comment}{         * J.T. Conklin (conklin@ngai.kaleida.com)}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00170}00170 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00171}00171         \textcolor{keywordflow}{if} ( (negate = (*pattern == \textcolor{charliteral}{'!'} || *pattern == \textcolor{charliteral}{'\string^'})) )}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00172}00172                 ++pattern;}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00173}00173 }
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00174}00174         \textcolor{keywordflow}{if} (flags \& FNM\_CASEFOLD)}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00175}00175                 test = \mbox{\hyperlink{iconv__converter__if_8m_a64463165d2d28472db9eb5f055ffa586}{tolower}}((\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char})test);}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00176}00176 }
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00177}00177         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00178}00178 \textcolor{comment}{         * A right bracket shall lose its special meaning and represent}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00179}00179 \textcolor{comment}{         * itself in a bracket expression if it occurs first in the list.}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00180}00180 \textcolor{comment}{         * -\/-\/ POSIX.2 2.8.3.2}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00181}00181 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00182}00182         ok = 0;}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00183}00183         \mbox{\hyperlink{iconv__converter__if_8m_a4e1e0e72dd773439e333c84dd762a9c3}{c}} = *pattern++;}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00184}00184         \textcolor{keywordflow}{do} \{}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00185}00185                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{iconv__converter__if_8m_a4e1e0e72dd773439e333c84dd762a9c3}{c}} == \textcolor{charliteral}{'\(\backslash\)\(\backslash\)'} \&\& !(flags \& FNM\_NOESCAPE))}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00186}00186                         \mbox{\hyperlink{iconv__converter__if_8m_a4e1e0e72dd773439e333c84dd762a9c3}{c}} = *pattern++;}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00187}00187                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{iconv__converter__if_8m_a4e1e0e72dd773439e333c84dd762a9c3}{c}} == \mbox{\hyperlink{fnmatch_8c_aadbbc7b02d94a4c18646813ac8d7dec1}{EOS}})}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00188}00188                         \textcolor{keywordflow}{return} (\mbox{\hyperlink{fnmatch_8c_aa6d704750721f15505d2dab71c199a74}{RANGE\_ERROR}});}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00189}00189 }
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00190}00190                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{iconv__converter__if_8m_a4e1e0e72dd773439e333c84dd762a9c3}{c}} == \textcolor{charliteral}{'/'} \&\& (flags \& FNM\_PATHNAME))}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00191}00191                         \textcolor{keywordflow}{return} (\mbox{\hyperlink{fnmatch_8c_a678fa83d3346393910c687dbc3787e86}{RANGE\_NOMATCH}});}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00192}00192 }
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00193}00193                 \textcolor{keywordflow}{if} (flags \& FNM\_CASEFOLD)}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00194}00194                         \mbox{\hyperlink{iconv__converter__if_8m_a4e1e0e72dd773439e333c84dd762a9c3}{c}} = \mbox{\hyperlink{iconv__converter__if_8m_a64463165d2d28472db9eb5f055ffa586}{tolower}}((\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char})\mbox{\hyperlink{iconv__converter__if_8m_a4e1e0e72dd773439e333c84dd762a9c3}{c}});}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00195}00195 }
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00196}00196                 \textcolor{keywordflow}{if} (*pattern == \textcolor{charliteral}{'-\/'}}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00197}00197                     \&\& (c2 = *(pattern+1)) != \mbox{\hyperlink{fnmatch_8c_aadbbc7b02d94a4c18646813ac8d7dec1}{EOS}} \&\& c2 != \textcolor{charliteral}{']'}) \{}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00198}00198                         pattern += 2;}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00199}00199                         \textcolor{keywordflow}{if} (c2 == \textcolor{charliteral}{'\(\backslash\)\(\backslash\)'} \&\& !(flags \& FNM\_NOESCAPE))}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00200}00200                                 c2 = *pattern++;}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00201}00201                         \textcolor{keywordflow}{if} (c2 == \mbox{\hyperlink{fnmatch_8c_aadbbc7b02d94a4c18646813ac8d7dec1}{EOS}})}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00202}00202                                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{fnmatch_8c_aa6d704750721f15505d2dab71c199a74}{RANGE\_ERROR}});}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00203}00203 }
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00204}00204                         \textcolor{keywordflow}{if} (flags \& FNM\_CASEFOLD)}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00205}00205                                 c2 = \mbox{\hyperlink{iconv__converter__if_8m_a64463165d2d28472db9eb5f055ffa586}{tolower}}((\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char})c2);}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00206}00206 }
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00207}00207                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{iconv__converter__if_8m_a4e1e0e72dd773439e333c84dd762a9c3}{c}} <= test \&\& test <= c2)}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00208}00208                                 ok = 1;}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00209}00209                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (\mbox{\hyperlink{iconv__converter__if_8m_a4e1e0e72dd773439e333c84dd762a9c3}{c}} == test)}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00210}00210                         ok = 1;}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00211}00211         \} \textcolor{keywordflow}{while} ((\mbox{\hyperlink{iconv__converter__if_8m_a4e1e0e72dd773439e333c84dd762a9c3}{c}} = *pattern++) != \textcolor{charliteral}{']'});}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00212}00212 }
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00213}00213         *newp = (\textcolor{keywordtype}{char} *)(uintptr\_t)pattern;}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00214}00214         \textcolor{keywordflow}{return} (ok == negate ? \mbox{\hyperlink{fnmatch_8c_a678fa83d3346393910c687dbc3787e86}{RANGE\_NOMATCH}} : \mbox{\hyperlink{fnmatch_8c_abba32c16b1ac3be5cb803a179a43e96e}{RANGE\_MATCH}});}
\DoxyCodeLine{\Hypertarget{fnmatch_8c_source_l00215}00215 \}}

\end{DoxyCode}
