\doxysection{hash.\+c}
\label{hash_8c_source}\index{src/hash.c@{src/hash.c}}
\textbf{ Go to the documentation of this file.}
\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{preprocessor}{\#include\ "{}hash.h"{}}}
\DoxyCodeLine{00002\ }
\DoxyCodeLine{00003\ \textcolor{keywordtype}{unsigned}\ hash(\textcolor{keywordtype}{int}\ keyc,\ HKEY\ *keyv[],\ \textcolor{keywordtype}{int}\ tabsize)}
\DoxyCodeLine{00004\ \{}
\DoxyCodeLine{00005\ \ \ \ \ \textcolor{keywordtype}{unsigned}\ hashval\ =\ 0;}
\DoxyCodeLine{00006\ \ \ \ \ \textcolor{keyword}{enum}\ \{}
\DoxyCodeLine{00007\ \ \ \ \ \ \ \ \ HASHNUM\ =\ 31}
\DoxyCodeLine{00008\ \ \ \ \ \};}
\DoxyCodeLine{00009\ }
\DoxyCodeLine{00010\ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{int}\ i\ =\ 0;\ i\ <\ keyc;\ i++)\ \{}
\DoxyCodeLine{00011\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{switch}(keyv[i]-\/>type)\ \{}
\DoxyCodeLine{00012\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{case}\ CHARS:}
\DoxyCodeLine{00013\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{int}\ j\ =\ 0;\ keyv[i]-\/>val.s[j];\ j++)\ \{}
\DoxyCodeLine{00014\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ hashval\ =\ keyv[i]-\/>val.s[j]\ +\ HASHNUM\ *\ hashval;}
\DoxyCodeLine{00015\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00016\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{00017\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{case}\ INT:}
\DoxyCodeLine{00018\ \ \ \ \ \ \ \ \ \ \ \ \ hashval\ =\ keyv[i]-\/>val.i\ +\ HASHNUM\ *\ hashval;}
\DoxyCodeLine{00019\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{00020\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{default}:}
\DoxyCodeLine{00021\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{00022\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00023\ \ \ \ \ \}}
\DoxyCodeLine{00024\ \ \ \ \ \textcolor{keywordflow}{return}\ (hashval\ \%\ tabsize);}
\DoxyCodeLine{00025\ \}}
\end{DoxyCode}