<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'> <html xmlns='http://www.w3.org/1999/xhtml'> <head> <title>src/hash.c</title> <meta name='robots' content='noindex,nofollow' /> <meta name='generator' content='GLOBAL-6.6.5' /> <meta http-equiv='Content-Style-Type' content='text/css' /> <link rel='stylesheet' type='text/css' href='../style.css' /> </head> <body> <a id='TOP' name='TOP'></a><h2 class='header'><a href='../mains.html'>root</a>/<a href='../files/2932.html'>src</a>/hash.c</h2> <em class='comment'>/* [<][>]<a href='#L3'>[^]</a>[v][top]<a href='#BOTTOM'>[bottom]</a><a href='../mains.html'>[index]</a><a href='../help.html'>[help]</a> */</em> <hr /> <h2 class='header'>DEFINITIONS</h2> This source file includes following definitions. <ol> <li><a href='#L3' title='Defined at 3.'>hash</a></li> </ol> <hr /> <pre> <a id='L1' name='L1'></a> 1 <em class='sharp'>#include</em> "<a href='2426.html'>hash.h</a>" <a id='L2' name='L2'></a> 2 <a id='L3' name='L3'></a> 3 <strong class='reserved'>unsigned</strong> <a href='../R/161.html' title='Multiple referred from 18 places.'>hash</a>(<strong class='reserved'>int</strong> <a href='../Y/123.html' title='Multiple used in 3 places.'>keyc</a>, <a href='../S/2426.html#L21' title='Defined at 21 in include/hash.h.'>HKEY</a> *<a href='../Y/125.html' title='Multiple used in 6 places.'>keyv</a>[], <strong class='reserved'>int</strong> <a href='../Y/219.html' title='Multiple used in 3 places.'>tabsize</a>) <a id='L4' name='L4'></a> 4 <em class='brace'>{</em> <a id='L5' name='L5'></a> 5 <strong class='reserved'>unsigned</strong> <a href='../Y/115.html' title='Multiple used in 12 places.'>hashval</a> = 0; <a id='L6' name='L6'></a> 6 <strong class='reserved'>enum</strong> <em class='brace'>{</em> <a id='L7' name='L7'></a> 7 <a href='../R/27.html' title='Multiple referred from 2 places.'>HASHNUM</a> = 31 <a id='L8' name='L8'></a> 8 <em class='brace'>}</em>; <a id='L9' name='L9'></a> 9 <a id='L10' name='L10'></a> 10 <strong class='reserved'>for</strong>(<strong class='reserved'>int</strong> <a href='../Y/117.html' title='Multiple used in 233 places.'>i</a> = 0; <a href='../Y/117.html' title='Multiple used in 233 places.'>i</a> < <a href='../Y/123.html' title='Multiple used in 3 places.'>keyc</a>; <a href='../Y/117.html' title='Multiple used in 233 places.'>i</a>++) <em class='brace'>{</em> <a id='L11' name='L11'></a> 11 <strong class='reserved'>switch</strong>(<a href='../Y/125.html' title='Multiple used in 6 places.'>keyv</a>[<a href='../Y/117.html' title='Multiple used in 233 places.'>i</a>]-><a href='../Y/230.html' title='Multiple used in 26 places.'>type</a>) <em class='brace'>{</em> <a id='L12' name='L12'></a> 12 <strong class='reserved'>case</strong> <a href='../S/2426.html#L8' title='Defined at 8 in include/hash.h.'>CHARS</a>: <a id='L13' name='L13'></a> 13 <strong class='reserved'>for</strong>(<strong class='reserved'>int</strong> <a href='../Y/121.html' title='Multiple used in 20 places.'>j</a> = 0; <a href='../Y/125.html' title='Multiple used in 6 places.'>keyv</a>[<a href='../Y/117.html' title='Multiple used in 233 places.'>i</a>]-><a href='../Y/232.html' title='Multiple used in 27 places.'>val</a>.<a href='../Y/188.html' title='Multiple used in 74 places.'>s</a>[<a href='../Y/121.html' title='Multiple used in 20 places.'>j</a>]; <a href='../Y/121.html' title='Multiple used in 20 places.'>j</a>++) <em class='brace'>{</em> <a id='L14' name='L14'></a> 14 <a href='../Y/115.html' title='Multiple used in 12 places.'>hashval</a> = <a href='../Y/125.html' title='Multiple used in 6 places.'>keyv</a>[<a href='../Y/117.html' title='Multiple used in 233 places.'>i</a>]-><a href='../Y/232.html' title='Multiple used in 27 places.'>val</a>.<a href='../Y/188.html' title='Multiple used in 74 places.'>s</a>[<a href='../Y/121.html' title='Multiple used in 20 places.'>j</a>] + <a href='../S/2830.html#L7' title='Defined at 7 in src/hash.c.'>HASHNUM</a> * <a href='../Y/115.html' title='Multiple used in 12 places.'>hashval</a>; <a id='L15' name='L15'></a> 15 <em class='brace'>}</em> <a id='L16' name='L16'></a> 16 <strong class='reserved'>break</strong>; <a id='L17' name='L17'></a> 17 <strong class='reserved'>case</strong> <a href='../S/2426.html#L9' title='Defined at 9 in include/hash.h.'>INT</a>: <a id='L18' name='L18'></a> 18 <a href='../Y/115.html' title='Multiple used in 12 places.'>hashval</a> = <a href='../Y/125.html' title='Multiple used in 6 places.'>keyv</a>[<a href='../Y/117.html' title='Multiple used in 233 places.'>i</a>]-><a href='../Y/232.html' title='Multiple used in 27 places.'>val</a>.<a href='../Y/117.html' title='Multiple used in 233 places.'>i</a> + <a href='../S/2830.html#L7' title='Defined at 7 in src/hash.c.'>HASHNUM</a> * <a href='../Y/115.html' title='Multiple used in 12 places.'>hashval</a>; <a id='L19' name='L19'></a> 19 <strong class='reserved'>break</strong>; <a id='L20' name='L20'></a> 20 <strong class='reserved'>default</strong>: <a id='L21' name='L21'></a> 21 <strong class='reserved'>break</strong>; <a id='L22' name='L22'></a> 22 <em class='brace'>}</em> <a id='L23' name='L23'></a> 23 <em class='brace'>}</em> <a id='L24' name='L24'></a> 24 <strong class='reserved'>return</strong> (<a href='../Y/115.html' title='Multiple used in 12 places.'>hashval</a> % <a href='../Y/219.html' title='Multiple used in 3 places.'>tabsize</a>); <a id='L25' name='L25'></a> 25 <em class='brace'>}</em> </pre> <hr /> <a id='BOTTOM' name='BOTTOM'></a> <em class='comment'>/* [<][>][^]<a href='#L3'>[v]</a><a href='#TOP'>[top]</a>[bottom]<a href='../mains.html'>[index]</a><a href='../help.html'>[help]</a> */</em> </body> </html>