\doxysection{include/sphinxbase/case.h File Reference}
\label{case_8h}\index{include/sphinxbase/case.h@{include/sphinxbase/case.h}}


Locale-\/independent implementation of case swapping operation.  


{\ttfamily \#include $<$string.\+h$>$}\newline
{\ttfamily \#include $<$sphinxbase/prim\+\_\+type.\+h$>$}\newline
{\ttfamily \#include $<$sphinxbase/sphinxbase\+\_\+export.\+h$>$}\newline
\doxysubsubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \textbf{ UPPER\+\_\+\+CASE}(c)~((((c) $>$= \textquotesingle{}a\textquotesingle{}) \&\& ((c) $<$= \textquotesingle{}z\textquotesingle{})) ? (c-\/32) \+: c)
\begin{DoxyCompactList}\small\item\em Return upper case form for c. \end{DoxyCompactList}\item 
\#define \textbf{ LOWER\+\_\+\+CASE}(c)~((((c) $>$= \textquotesingle{}A\textquotesingle{}) \&\& ((c) $<$= \textquotesingle{}Z\textquotesingle{})) ? (c+32) \+: c)
\begin{DoxyCompactList}\small\item\em Return lower case form for c. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
SPHINXBASE\+\_\+\+EXPORT void \textbf{ ucase} (char $\ast$str)
\begin{DoxyCompactList}\small\item\em Convert str to all upper case. \end{DoxyCompactList}\item 
SPHINXBASE\+\_\+\+EXPORT void \textbf{ lcase} (char $\ast$str)
\begin{DoxyCompactList}\small\item\em Convert str to all lower case. \end{DoxyCompactList}\item 
SPHINXBASE\+\_\+\+EXPORT int32 \textbf{ strcmp\+\_\+nocase} (const char $\ast$str1, const char $\ast$str2)
\begin{DoxyCompactList}\small\item\em (FIXME! The implementation is incorrect!) Case insensitive string compare. \end{DoxyCompactList}\item 
SPHINXBASE\+\_\+\+EXPORT int32 \textbf{ strncmp\+\_\+nocase} (const char $\ast$str1, const char $\ast$str2, size\+\_\+t len)
\begin{DoxyCompactList}\small\item\em Like \doxyref{strcmp\+\_\+nocase()}{p.}{case_8h_ad276a997bd6709d986aa6e1e4e06c210} but with a maximum length. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Locale-\/independent implementation of case swapping operation. 

This function implements ASCII-\/only case switching and comparison related operations, which do not depend on the locale and are guaranteed to exist on all versions of Windows. 

Definition in file \textbf{ case.\+h}.



\doxysubsection{Macro Definition Documentation}
\label{case_8h_a44403ce2c3f4378aca12ffb732f24cef} 
\index{case.h@{case.h}!LOWER\_CASE@{LOWER\_CASE}}
\index{LOWER\_CASE@{LOWER\_CASE}!case.h@{case.h}}
\doxysubsubsection{LOWER\_CASE}
{\footnotesize\ttfamily \#define LOWER\+\_\+\+CASE(\begin{DoxyParamCaption}\item[{}]{c }\end{DoxyParamCaption})~((((c) $>$= \textquotesingle{}A\textquotesingle{}) \&\& ((c) $<$= \textquotesingle{}Z\textquotesingle{})) ? (c+32) \+: c)}



Return lower case form for c. 



Definition at line \textbf{ 97} of file \textbf{ case.\+h}.

\label{case_8h_a3299c549655d5af1fcbc384ee7fd68e3} 
\index{case.h@{case.h}!UPPER\_CASE@{UPPER\_CASE}}
\index{UPPER\_CASE@{UPPER\_CASE}!case.h@{case.h}}
\doxysubsubsection{UPPER\_CASE}
{\footnotesize\ttfamily \#define UPPER\+\_\+\+CASE(\begin{DoxyParamCaption}\item[{}]{c }\end{DoxyParamCaption})~((((c) $>$= \textquotesingle{}a\textquotesingle{}) \&\& ((c) $<$= \textquotesingle{}z\textquotesingle{})) ? (c-\/32) \+: c)}



Return upper case form for c. 



Definition at line \textbf{ 92} of file \textbf{ case.\+h}.



\doxysubsection{Function Documentation}
\label{case_8h_ac0e30dac40f15762f39270f65bd8cdba} 
\index{case.h@{case.h}!lcase@{lcase}}
\index{lcase@{lcase}!case.h@{case.h}}
\doxysubsubsection{lcase()}
{\footnotesize\ttfamily SPHINXBASE\+\_\+\+EXPORT void lcase (\begin{DoxyParamCaption}\item[{char $\ast$}]{str }\end{DoxyParamCaption})}



Convert str to all lower case. 


\begin{DoxyParams}{Parameters}
{\em str} & is a string. \\
\hline
\end{DoxyParams}


Referenced by \textbf{ ngram\+\_\+model\+\_\+casefold()}.

\label{case_8h_ad276a997bd6709d986aa6e1e4e06c210} 
\index{case.h@{case.h}!strcmp\_nocase@{strcmp\_nocase}}
\index{strcmp\_nocase@{strcmp\_nocase}!case.h@{case.h}}
\doxysubsubsection{strcmp\_nocase()}
{\footnotesize\ttfamily SPHINXBASE\+\_\+\+EXPORT int32 strcmp\+\_\+nocase (\begin{DoxyParamCaption}\item[{const char $\ast$}]{str1,  }\item[{const char $\ast$}]{str2 }\end{DoxyParamCaption})}



(FIXME! The implementation is incorrect!) Case insensitive string compare. 

Return the usual -\/1, 0, +1, depending on str1 $<$, =, $>$ str2 (case insensitive, of course). 
\begin{DoxyParams}{Parameters}
{\em str1} & is the first string. \\
\hline
{\em str2} & is the second string. \\
\hline
\end{DoxyParams}


Definition at line \textbf{ 94} of file \textbf{ case.\+c}.



References \textbf{ strcmp\+\_\+nocase()}, and \textbf{ UPPER\+\_\+\+CASE}.



Referenced by \textbf{ ngram\+\_\+file\+\_\+name\+\_\+to\+\_\+type()}, \textbf{ ngram\+\_\+str\+\_\+to\+\_\+type()}, and \textbf{ strcmp\+\_\+nocase()}.

\label{case_8h_ae7c2a7f29d72b9516a947f5c69a043db} 
\index{case.h@{case.h}!strncmp\_nocase@{strncmp\_nocase}}
\index{strncmp\_nocase@{strncmp\_nocase}!case.h@{case.h}}
\doxysubsubsection{strncmp\_nocase()}
{\footnotesize\ttfamily SPHINXBASE\+\_\+\+EXPORT int32 strncmp\+\_\+nocase (\begin{DoxyParamCaption}\item[{const char $\ast$}]{str1,  }\item[{const char $\ast$}]{str2,  }\item[{size\+\_\+t}]{len }\end{DoxyParamCaption})}



Like \doxyref{strcmp\+\_\+nocase()}{p.}{case_8h_ad276a997bd6709d986aa6e1e4e06c210} but with a maximum length. 



Definition at line \textbf{ 119} of file \textbf{ case.\+c}.



References \textbf{ strncmp\+\_\+nocase()}, and \textbf{ UPPER\+\_\+\+CASE}.



Referenced by \textbf{ ngram\+\_\+file\+\_\+name\+\_\+to\+\_\+type()}, and \textbf{ strncmp\+\_\+nocase()}.

\label{case_8h_a79d99e36b7c2c36dcc6f7f0df746384e} 
\index{case.h@{case.h}!ucase@{ucase}}
\index{ucase@{ucase}!case.h@{case.h}}
\doxysubsubsection{ucase()}
{\footnotesize\ttfamily SPHINXBASE\+\_\+\+EXPORT void ucase (\begin{DoxyParamCaption}\item[{char $\ast$}]{str }\end{DoxyParamCaption})}



Convert str to all upper case. 


\begin{DoxyParams}{Parameters}
{\em str} & is a string. \\
\hline
\end{DoxyParams}


Referenced by \textbf{ ngram\+\_\+model\+\_\+casefold()}.

