\hypertarget{strsep_8c_source}{}\doxysection{strsep.\+c}
\label{strsep_8c_source}\index{libkern/strsep.c@{libkern/strsep.c}}
\mbox{\hyperlink{strsep_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/3-\/Clause}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 1990, 1993}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00005}00005 \textcolor{comment}{ *      The Regents of the University of California.  All rights reserved.}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00007}00007 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00008}00008 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00009}00009 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00010}00010 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00011}00011 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00012}00012 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00013}00013 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00014}00014 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00015}00015 \textcolor{comment}{ * 3. Neither the name of the University nor the names of its contributors}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00016}00016 \textcolor{comment}{ *    may be used to endorse or promote products derived from this software}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00017}00017 \textcolor{comment}{ *    without specific prior written permission.}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00018}00018 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00019}00019 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00020}00020 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00021}00021 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00022}00022 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00023}00023 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00024}00024 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00025}00025 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00026}00026 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00027}00027 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00028}00028 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00029}00029 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00030}00030 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00031}00031 }
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00032}00032 \textcolor{preprocessor}{\#if defined(LIBC\_SCCS) \&\& !defined(lint)}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00033}00033 \textcolor{keyword}{static} \textcolor{keywordtype}{char} sccsid[] = \textcolor{stringliteral}{"{}@(\#)strsep.c    8.1 (Berkeley) 6/4/93"{}};}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00034}00034 \textcolor{preprocessor}{\#endif }\textcolor{comment}{/* LIBC\_SCCS and not lint */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00036}\mbox{\hyperlink{strsep_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00036}} \mbox{\hyperlink{strsep_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00037}00037 }
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00039}00039 \textcolor{preprocessor}{\#include <sys/libkern.h>}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00040}00040 }
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00041}00041 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00042}00042 \textcolor{comment}{ * Get next token from string *stringp, where tokens are possibly-\/empty}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00043}00043 \textcolor{comment}{ * strings separated by characters from delim.}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00044}00044 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00045}00045 \textcolor{comment}{ * Writes NULs into the string at *stringp to end tokens.}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00046}00046 \textcolor{comment}{ * delim need not remain constant from call to call.}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00047}00047 \textcolor{comment}{ * On return, *stringp points past the last NUL written (if there might}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00048}00048 \textcolor{comment}{ * be further tokens), or is NULL (if there are definitely no more tokens).}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00049}00049 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00050}00050 \textcolor{comment}{ * If *stringp is NULL, strsep returns NULL.}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00051}00051 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00052}00052 \textcolor{keywordtype}{char} *}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00053}\mbox{\hyperlink{strsep_8c_a098b232e1cfa2b0ce1d94b7ad0440cbb}{00053}} \mbox{\hyperlink{strsep_8c_a098b232e1cfa2b0ce1d94b7ad0440cbb}{strsep}}(\textcolor{keywordtype}{char} **stringp, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *delim)}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00054}00054 \{}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00055}00055         \textcolor{keywordtype}{char} *s;}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00056}00056         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *spanp;}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00057}00057         \textcolor{keywordtype}{int} \mbox{\hyperlink{iconv__converter__if_8m_a4e1e0e72dd773439e333c84dd762a9c3}{c}}, sc;}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00058}00058         \textcolor{keywordtype}{char} *tok;}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00059}00059 }
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00060}00060         \textcolor{keywordflow}{if} ((s = *stringp) == NULL)}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00061}00061                 \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00062}00062         \textcolor{keywordflow}{for} (tok = s;;) \{}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00063}00063                 \mbox{\hyperlink{iconv__converter__if_8m_a4e1e0e72dd773439e333c84dd762a9c3}{c}} = *s++;}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00064}00064                 spanp = delim;}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00065}00065                 \textcolor{keywordflow}{do} \{}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00066}00066                         \textcolor{keywordflow}{if} ((sc = *spanp++) == \mbox{\hyperlink{iconv__converter__if_8m_a4e1e0e72dd773439e333c84dd762a9c3}{c}}) \{}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00067}00067                                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{iconv__converter__if_8m_a4e1e0e72dd773439e333c84dd762a9c3}{c}} == \textcolor{charliteral}{'\(\backslash\)0'})}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00068}00068                                         s = NULL;}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00069}00069                                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00070}00070                                         s[-\/1] = \textcolor{charliteral}{'\(\backslash\)0'};}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00071}00071                                 *stringp = s;}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00072}00072                                 \textcolor{keywordflow}{return} (tok);}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00073}00073                         \}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00074}00074                 \} \textcolor{keywordflow}{while} (sc != \textcolor{charliteral}{'\(\backslash\)0'});}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00075}00075         \}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00076}00076         \textcolor{comment}{/* NOTREACHED */}}
\DoxyCodeLine{\Hypertarget{strsep_8c_source_l00077}00077 \}}

\end{DoxyCode}
