linux/scripts/mod/sumversion.c
<<
lue=v2./spa.6. v2./form6. v2.a lue=v2 href="../linux+v327 1/scripts/mod/sumvers.1..c">lue=v2.img src="../.static/gfx/right.png" alt=">>">lu./spa.6.lu.spa. class="lxr_search">lue=lue=v2.input typ.42hidden" nam.42navtarget" v3.0.42">lue=v2.input typ.42text" nam.42search" id42search">lue=v2.butt.72typ.42submit">Searchlue=v2Prefs. v2./a>lu./spa.6.e=v2 2./div6.e=v2 2.form ac2.1.="ajax+*" method="post" onsubmit="return false;">lu.input typ.42hidden" nam.42ajax_lookup" id42ajax_lookup" v3.0.42">le=v2 2./form6.le=v2 2.div class="headingbott.m">. .div id42file_contents"6
2 21./a>#include <netinet/in.h./a>>
2 22./a>#ifdef2.a href="+code=__sun__" class="sref">__sun__./a>l2 23./a>#include <inttyp.s.h./a>>
2 24./a>#else
2 25./a>#include <stdint.h./a>>
2 26./a>#endif
2 27./a>#include <ctyp..h./a>>
2 28./a>#include <errno.h./a>>
2 29./a>#include <string.h./a>>
2   #include <limits.h./a>>
2 11./a>#include "modpost.h./a>"
2 12./a>l2 13./a>.spa. class="comment">/*./spa.6.2 14./a>.spa. class="comment"> * Stolen form Cryptographic API../spa.6.2 15./a>.spa. class="comment"> *./spa.6.2 16./a>.spa. class="comment"> * MD4 Message Digest Algorithm (RFC1320)../spa.6.2 17./a>.spa. class="comment"> *./spa.6.2 18./a>.spa. class="comment"> * Implementa38.72derived from Andrew Tridgell and Steve French's./spa.6.2 19./a>.spa. class="comment"> * CIFS MD4 implementa38.7, and the cryptoapi implementa38.7./spa.6.2 20./a>.spa. class="comment"> * originally based .72the public domain implementa38.7 written./spa.6.2 21./a>.spa. class="comment"> * by Colin Plumb in 1993../spa.6.2 22./a>.spa. class="comment"> *./spa.6.2 23./a>.spa. class="comment"> * Copyright (c) Andrew Tridgell 1997-1998../spa.6.2 24./a>.spa. class="comment"> * Modified by Steve French (sfrench@us.ibm.com) 2002./spa.6.2 25./a>.spa. class="comment"> * Copyright (c) Cryptoapi developers../spa.6.2 26./a>.spa. class="comment"> * Copyright (c) 2002 David S. Miller (davem@redhat.com)./spa.6.2 27./a>.spa. class="comment"> * Copyright (c) 2002 Jam.s Morris <jmorris@intercode.com.au>./spa.6.2 28./a>.spa. class="comment"> *./spa.6.2 29./a>.spa. class="comment"> * This program is free software; you ca. redistribute it and/or modify./spa.6.2 30./a>.spa. class="comment"> * it under2the terms of2the GNU General Public License as published by./spa.6.2 31./a>.spa. class="comment"> * the Free Software Founda38.7; either2vers.1. 2 of2the License, or./spa.6.2 32./a>.spa. class="comment"> * (at your  v2.1.) any later2vers.1.../spa.6.2 33./a>.spa. class="comment"> *./spa.6.2 34./a>.spa. class="comment"> */./spa.6.2 35./a>#define2.a href="+code=MD4_DIGEST_SIZE" class="sref">MD4_DIGEST_SIZE./a>         16.2 36./a>#define2.a href="+code=MD4_HMAC_BLOCK_SIZE" class="sref">MD4_HMAC_BLOCK_SIZE./a>     64.2 37./a>#define2.a href="+code=MD4_BLOCK_WORDS" class="sref">MD4_BLOCK_WORDS./a>         16.2 38./a>#define2.a href="+code=MD4_HASH_WORDS" class="sref">MD4_HASH_WORDS./a>          4.2 39./a>l2 40./a>struct2.a href="+code=md4_ctx" class="sref">md4_ctx./a> {l2 41./a>        .a href="+code=uint32_t" class="sref">uint32_t./a> .a href="+code=hash" class="sref">hash./a>[.a href="+code=MD4_HASH_WORDS" class="sref">MD4_HASH_WORDS./a>];
2 42./a>        .a href="+code=uint32_t" class="sref">uint32_t./a> .a href="+code=block" class="sref">block./a>[.a href="+code=MD4_BLOCK_WORDS" class="sref">MD4_BLOCK_WORDS./a>];
2 43./a>        .a href="+code=uint64_t" class="sref">uint64_t./a> .a href="+code=byte_count" class="sref">byte_count./a>;
2 44./a>};
2 45./a>l2 46./a>static .a href="+code=inline" class="sref">inline./a> .a href="+code=uint32_t" class="sref">uint32_t./a> .a href="+code=lshift" class="sref">lshift./a>(.a href="+code=uint32_t" class="sref">uint32_t./a> .a href="+code=x" class="sref">x./a>, unsigned int .a href="+code=s" class="sref">s./a>)l2 47./a>{l2 48./a>        .a href="+code=x" class="sref">x./a> &= 0xFFFFFFFF;
2 49./a>        return ((.a href="+code=x" class="sref">x./a> << .a href="+code=s" class="sref">s./a>) & 0xFFFFFFFF) | (.a href="+code=x" class="sref">x./a> >> (32 - .a href="+code=s" class="sref">s./a>));
2 50./a>}
2 51./a>l2 52./a>static .a href="+code=inline" class="sref">inline./a> .a href="+code=uint32_t" class="sref">uint32_t./a> .a href="+code=F" class="sref">F./a>(.a href="+code=uint32_t" class="sref">uint32_t./a> .a href="+code=x" class="sref">x./a>, .a href="+code=uint32_t" class="sref">uint32_t./a> .a href="+code=y" class="sref">y./a>, .a href="+code=uint32_t" class="sref">uint32_t./a> .a href="+code=z" class="sref">z./a>)l2 53./a>{l2 54./a>        return (.a href="+code=x" class="sref">x./a> & .a href="+code=y" class="sref">y./a>) | ((~.a href="+code=x" class="sref">x./a>) & .a href="+code=z" class="sref">z./a>);
2 55./a>}
2 56./a>l2 57./a>static .a href="+code=inline" class="sref">inline./a> .a href="+code=uint32_t" class="sref">uint32_t./a> .a href="+code=G" class="sref">G./a>(.a href="+code=uint32_t" class="sref">uint32_t./a> .a href="+code=x" class="sref">x./a>, .a href="+code=uint32_t" class="sref">uint32_t./a> .a href="+code=y" class="sref">y./a>, .a href="+code=uint32_t" class="sref">uint32_t./a> .a href="+code=z" class="sref">z./a>)l2 58./a>{l2 59./a>        return (.a href="+code=x" class="sref">x./a> & .a href="+code=y" class="sref">y./a>) | (.a href="+code=x" class="sref">x./a> & .a href="+code=z" class="sref">z./a>) | (.a href="+code=y" class="sref">y./a> & .a href="+code=z" class="sref">z./a>);
2 60./a>}
2 61./a>l2 62./a>static .a href="+code=inline" class="sref">inline./a> .a href="+code=uint32_t" class="sref">uint32_t./a> .a href="+code=H" class="sref">H./a>(.a href="+code=uint32_t" class="sref">uint32_t./a> .a href="+code=x" class="sref">x./a>, .a href="+code=uint32_t" class="sref">uint32_t./a> .a href="+code=y" class="sref">y./a>, .a href="+code=uint32_t" class="sref">uint32_t./a> .a href="+code=z" class="sref">z./a>)l2 63./a>{l2 64./a>        return .a href="+code=x" class="sref">x./a> ^ .a href="+code=y" class="sref">y./a> ^ .a href="+code=z" class="sref">z./a>;
2 65./a>}
2 66./a>l2 67./a>#define2.a href="+code=ROUND1" class="sref">ROUND1./a>(.a href="+code=a" class="sref">a./a>,.a href="+code=b" class="sref">b./a>,.a href="+code=c" class="sref">c./a>,.a href="+code=d" class="sref">d./a>,.a href="+code=k" class="sref">k./a>,.a href="+code=s" class="sref">s./a>) (.a href="+code=a" class="sref">a./a> = .a href="+code=lshift" class="sref">lshift./a>(.a href="+code=a" class="sref">a./a> + .a href="+code=F" class="sref">F./a>(.a href="+code=b" class="sref">b./a>,.a href="+code=c" class="sref">c./a>,.a href="+code=d" class="sref">d./a>) + .a href="+code=k" class="sref">k./a>, .a href="+code=s" class="sref">s./a>))l2 68./a>#define2.a href="+code=ROUND2" class="sref">ROUND2./a>(.a href="+code=a" class="sref">a./a>,.a href="+code=b" class="sref">b./a>,.a href="+code=c" class="sref">c./a>,.a href="+code=d" class="sref">d./a>,.a href="+code=k" class="sref">k./a>,.a href="+code=s" class="sref">s./a>) (.a href="+code=a" class="sref">a./a> = .a href="+code=lshift" class="sref">lshift./a>(.a href="+code=a" class="sref">a./a> + .a href="+code=G" class="sref">G./a>(.a href="+code=b" class="sref">b./a>,.a href="+code=c" class="sref">c./a>,.a href="+code=d" class="sref">d./a>) + .a href="+code=k" class="sref">k./a> + (.a href="+code=uint32_t" class="sref">uint32_t./a>)0x5A827999,.a href="+code=s" class="sref">s./a>))l2 69./a>#define2.a href="+code=ROUND3" class="sref">ROUND3./a>(.a href="+code=a" class="sref">a./a>,.a href="+code=b" class="sref">b./a>,.a href="+code=c" class="sref">c./a>,.a href="+code=d" class="sref">d./a>,.a href="+code=k" class="sref">k./a>,.a href="+code=s" class="sref">s./a>) (.a href="+code=a" class="sref">a./a> = .a href="+code=lshift" class="sref">lshift./a>(.a href="+code=a" class="sref">a./a> + .a href="+code=H" class="sref">H./a>(.a href="+code=b" class="sref">b./a>,.a href="+code=c" class="sref">c./a>,.a href="+code=d" class="sref">d./a>) + .a href="+code=k" class="sref">k./a> + (.a href="+code=uint32_t" class="sref">uint32_t./a>)0x6ED9EBA1,.a href="+code=s" class="sref">s./a>))l2 70./a>l2 71./a>.spa. class="comment">/* XXX: this stuff ca. be  v2.mized */./spa.6.2 72./a>static .a href="+code=inline" class="sref">inline./a> void .a href="+code=le32_to_cpu_array" class="sref">le32_to_cpu_array./a>(.a href="+code=uint32_t" class="sref">uint32_t./a> *.a href="+code=buf" class="sref">buf./a>, unsigned int .a href="+code=words" class="sref">words./a>)l2 73./a>{l2 74./a>        while (.a href="+code=words" class="sref">words./a>--) {l2 75./a>                *.a href="+code=buf" class="sref">buf./a> = .a href="+code=ntohl" class="sref">ntohl./a>(*.a href="+code=buf" class="sref">buf./a>);
2 76./a>                .a href="+code=buf" class="sref">buf./a>++;
2 77./a>        }
2 78./a>}
2 79./a>l2 80./a>static .a href="+code=inline" class="sref">inline./a> void .a href="+code=cpu_to_le32_array" class="sref">cpu_to_le32_array./a>(.a href="+code=uint32_t" class="sref">uint32_t./a> *.a href="+code=buf" class="sref">buf./a>, unsigned int .a href="+code=words" class="sref">words./a>)l2 81./a>{l2 82./a>        while (.a href="+code=words" class="sref">words./a>--) {l2 83./a>                *.a href="+code=buf" class="sref">buf./a> = .a href="+code=htonl" class="sref">htonl./a>(*.a href="+code=buf" class="sref">buf./a>);
2 84./a>                .a href="+code=buf" class="sref">buf./a>++;
2 85./a>        }
2 86./a>}
2 87./a>l2 88./a>static void .a href="+code=md4_transform" class="sref">md4_transform./a>(.a href="+code=uint32_t" class="sref">uint32_t./a> *.a href="+code=hash" class="sref">hash./a>, .a href="+code=uint32_t" class="sref">uint32_t./a> const *.a href="+code=in" class="sref">in./a>)l2 89./a>{l2 90./a>        .a href="+code=uint32_t" class="sref">uint32_t./a> .a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>;
2 91./a>l2 92./a>        .a href="+code=a" class="sref">a./a> = .a href="+code=hash" class="sref">hash./a>[0];
2 93./a>        .a href="+code=b" class="sref">b./a> = .a href="+code=hash" class="sref">hash./a>[1];
2 94./a>        .a href="+code=c" class="sref">c./a> = .a href="+code=hash" class="sref">hash./a>[2];
2 95./a>        .a href="+code=d" class="sref">d./a> = .a href="+code=hash" class="sref">hash./a>[3];
2 96./a>l2 97./a>        .a href="+code=ROUND1" class="sref">ROUND1./a>(.a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>, .a href="+code=in" class="sref">in./a>[0], 3);
2 98./a>        .a href="+code=ROUND1" class="sref">ROUND1./a>(.a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=in" class="sref">in./a>[1], 7);
2 99./a>        .a href="+code=ROUND1" class="sref">ROUND1./a>(.a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=in" class="sref">in./a>[2], 11);
2100./a>        .a href="+code=ROUND1" class="sref">ROUND1./a>(.a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=in" class="sref">in./a>[3], 19);
2101./a>        .a href="+code=ROUND1" class="sref">ROUND1./a>(.a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>, .a href="+code=in" class="sref">in./a>[4], 3);
2102./a>        .a href="+code=ROUND1" class="sref">ROUND1./a>(.a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=in" class="sref">in./a>[5], 7);
2103./a>        .a href="+code=ROUND1" class="sref">ROUND1./a>(.a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=in" class="sref">in./a>[6], 11);
2104./a>        .a href="+code=ROUND1" class="sref">ROUND1./a>(.a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=in" class="sref">in./a>[7], 19);
2105./a>        .a href="+code=ROUND1" class="sref">ROUND1./a>(.a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>, .a href="+code=in" class="sref">in./a>[8], 3);
2106./a>        .a href="+code=ROUND1" class="sref">ROUND1./a>(.a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=in" class="sref">in./a>[9], 7);
2107./a>        .a href="+code=ROUND1" class="sref">ROUND1./a>(.a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=in" class="sref">in./a>[10], 11);
2108./a>        .a href="+code=ROUND1" class="sref">ROUND1./a>(.a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=in" class="sref">in./a>[11], 19);
2109./a>        .a href="+code=ROUND1" class="sref">ROUND1./a>(.a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>, .a href="+code=in" class="sref">in./a>[12], 3);
2110./a>        .a href="+code=ROUND1" class="sref">ROUND1./a>(.a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=in" class="sref">in./a>[13], 7);
2111./a>        .a href="+code=ROUND1" class="sref">ROUND1./a>(.a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=in" class="sref">in./a>[14], 11);
2112./a>        .a href="+code=ROUND1" class="sref">ROUND1./a>(.a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=in" class="sref">in./a>[15], 19);
2113./a>
2114./a>        .a href="+code=ROUND2" class="sref">ROUND2./a>(.a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>,.a href="+code=in" class="sref">in./a>[ 0], 3);
2115./a>        .a href="+code=ROUND2" class="sref">ROUND2./a>(.a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=in" class="sref">in./a>[4], 5);
2116./a>        .a href="+code=ROUND2" class="sref">ROUND2./a>(.a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=in" class="sref">in./a>[8], 9);
2117./a>        .a href="+code=ROUND2" class="sref">ROUND2./a>(.a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=in" class="sref">in./a>[12], 13);
2118./a>        .a href="+code=ROUND2" class="sref">ROUND2./a>(.a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>, .a href="+code=in" class="sref">in./a>[1], 3);
2119./a>        .a href="+code=ROUND2" class="sref">ROUND2./a>(.a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=in" class="sref">in./a>[5], 5);
2120./a>        .a href="+code=ROUND2" class="sref">ROUND2./a>(.a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=in" class="sref">in./a>[9], 9);
2121./a>        .a href="+code=ROUND2" class="sref">ROUND2./a>(.a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=in" class="sref">in./a>[13], 13);
2122./a>        .a href="+code=ROUND2" class="sref">ROUND2./a>(.a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>, .a href="+code=in" class="sref">in./a>[2], 3);
2123./a>        .a href="+code=ROUND2" class="sref">ROUND2./a>(.a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=in" class="sref">in./a>[6], 5);
2124./a>        .a href="+code=ROUND2" class="sref">ROUND2./a>(.a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=in" class="sref">in./a>[10], 9);
2125./a>        .a href="+code=ROUND2" class="sref">ROUND2./a>(.a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=in" class="sref">in./a>[14], 13);
2126./a>        .a href="+code=ROUND2" class="sref">ROUND2./a>(.a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>, .a href="+code=in" class="sref">in./a>[3], 3);
2127./a>        .a href="+code=ROUND2" class="sref">ROUND2./a>(.a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=in" class="sref">in./a>[7], 5);
2128./a>        .a href="+code=ROUND2" class="sref">ROUND2./a>(.a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=in" class="sref">in./a>[11], 9);
2129./a>        .a href="+code=ROUND2" class="sref">ROUND2./a>(.a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=in" class="sref">in./a>[15], 13);
2130./a>l2131./a>        .a href="+code=ROUND3" class="sref">ROUND3./a>(.a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>,.a href="+code=in" class="sref">in./a>[ 0], 3);
2132./a>        .a href="+code=ROUND3" class="sref">ROUND3./a>(.a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=in" class="sref">in./a>[8], 9);
2133./a>        .a href="+code=ROUND3" class="sref">ROUND3./a>(.a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=in" class="sref">in./a>[4], 11);
2134./a>        .a href="+code=ROUND3" class="sref">ROUND3./a>(.a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=in" class="sref">in./a>[12], 15);
2135./a>        .a href="+code=ROUND3" class="sref">ROUND3./a>(.a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>, .a href="+code=in" class="sref">in./a>[2], 3);
2136./a>        .a href="+code=ROUND3" class="sref">ROUND3./a>(.a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=in" class="sref">in./a>[10], 9);
2137./a>        .a href="+code=ROUND3" class="sref">ROUND3./a>(.a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=in" class="sref">in./a>[6], 11);
2138./a>        .a href="+code=ROUND3" class="sref">ROUND3./a>(.a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=in" class="sref">in./a>[14], 15);
2139./a>        .a href="+code=ROUND3" class="sref">ROUND3./a>(.a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>, .a href="+code=in" class="sref">in./a>[1], 3);
2140./a>        .a href="+code=ROUND3" class="sref">ROUND3./a>(.a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=in" class="sref">in./a>[9], 9);
2141./a>        .a href="+code=ROUND3" class="sref">ROUND3./a>(.a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=in" class="sref">in./a>[5], 11);
2142./a>        .a href="+code=ROUND3" class="sref">ROUND3./a>(.a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=in" class="sref">in./a>[13], 15);
2143./a>        .a href="+code=ROUND3" class="sref">ROUND3./a>(.a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>, .a href="+code=in" class="sref">in./a>[3], 3);
2144./a>        .a href="+code=ROUND3" class="sref">ROUND3./a>(.a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=in" class="sref">in./a>[11], 9);
2145./a>        .a href="+code=ROUND3" class="sref">ROUND3./a>(.a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=b" class="sref">b./a>, .a href="+code=in" class="sref">in./a>[7], 11);
2146./a>        .a href="+code=ROUND3" class="sref">ROUND3./a>(.a href="+code=b" class="sref">b./a>, .a href="+code=c" class="sref">c./a>, .a href="+code=d" class="sref">d./a>, .a href="+code=a" class="sref">a./a>, .a href="+code=in" class="sref">in./a>[15], 15);
2147./a>l2148./a>        .a href="+code=hash" class="sref">hash./a>[0] += .a href="+code=a" class="sref">a./a>;
2149./a>        .a href="+code=hash" class="sref">hash./a>[1] += .a href="+code=b" class="sref">b./a>;
2150./a>        .a href="+code=hash" class="sref">hash./a>[2] += .a href="+code=c" class="sref">c./a>;
2151./a>        .a href="+code=hash" class="sref">hash./a>[3] += .a href="+code=d" class="sref">d./a>;
2152./a>}
2153./a>
2154./a>static .a href="+code=inline" class="sref">inline./a> void .a href="+code=md4_transform_helper" class="sref">md4_transform_helper./a>(struct2.a href="+code=md4_ctx" class="sref">md4_ctx./a> *.a href="+code=ctx" class="sref">ctx./a>)l2155./a>{l2156./a>        .a href="+code=le32_to_cpu_array" class="sref">le32_to_cpu_array./a>(.a href="+code=ctx" class="sref">ctx./a>->.a href="+code=block" class="sref">block./a>, sizeof(.a href="+code=ctx" class="sref">ctx./a>->.a href="+code=block" class="sref">block./a>) / sizeof(.a href="+code=uint32_t" class="sref">uint32_t./a>));
2157./a>        .a href="+code=md4_transform" class="sref">md4_transform./a>(.a href="+code=ctx" class="sref">ctx./a>->.a href="+code=hash" class="sref">hash./a>, .a href="+code=ctx" class="sref">ctx./a>->.a href="+code=block" class="sref">block./a>);
2158./a>}
2159./a>l2160./a>static void .a href="+code=md4_init" class="sref">md4_init./a>(struct2.a href="+code=md4_ctx" class="sref">md4_ctx./a> *.a href="+code=mctx" class="sref">mctx./a>)l2161./a>{l2162./a>        .a href="+code=mctx" class="sref">mctx./a>->.a href="+code=hash" class="sref">hash./a>[0] = 0x67452301;
2163./a>        .a href="+code=mctx" class="sref">mctx./a>->.a href="+code=hash" class="sref">hash./a>[1] = 0xefcdab89;
2164./a>        .a href="+code=mctx" class="sref">mctx./a>->.a href="+code=hash" class="sref">hash./a>[2] = 0x98badcfe;
2165./a>        .a href="+code=mctx" class="sref">mctx./a>->.a href="+code=hash" class="sref">hash./a>[3] = 0x10325476;
2166./a>        .a href="+code=mctx" class="sref">mctx./a>->.a href="+code=byte_count" class="sref">byte_count./a> = 0;
2167./a>}
2168./a>
2169./a>static void .a href="+code=md4_update" class="sref">md4_update./a>(struct2.a href="+code=md4_ctx" class="sref">md4_ctx./a> *.a href="+code=mctx" class="sref">mctx./a>,
2170./a>                       const unsigned char *.a href="+code=data" class="sref">data./a>, unsigned int .a href="+code=len" class="sref">len./a>)l2171./a>{l2172./a>        const .a href="+code=uint32_t" class="sref">uint32_t./a> .a href="+code=avail" class="sref">avail./a> = sizeof(.a href="+code=mctx" class="sref">mctx./a>->.a href="+code=block" class="sref">block./a>) - (.a href="+code=mctx" class="sref">mctx./a>->.a href="+code=byte_count" class="sref">byte_count./a> & 0x3f);
2173./a>
2174./a>        .a href="+code=mctx" class="sref">mctx./a>->.a href="+code=byte_count" class="sref">byte_count./a> += .a href="+code=len" class="sref">len./a>;
2175./a>l2176./a>        if (.a href="+code=avail" class="sref">avail./a> > .a href="+code=len" class="sref">len./a>) {l2177./a>                .a href="+code=memcpy" class="sref">memcpy./a>((char *).a href="+code=mctx" class="sref">mctx./a>->.a href="+code=block" class="sref">block./a> + (sizeof(.a href="+code=mctx" class="sref">mctx./a>->.a href="+code=block" class="sref">block./a>) - .a href="+code=avail" class="sref">avail./a>),
2178./a>                       .a href="+code=data" class="sref">data./a>, .a href="+code=len" class="sref">len./a>);
2179./a>                return;
2180./a>        }
2181./a>l2182./a>        .a href="+code=memcpy" class="sref">memcpy./a>((char *).a href="+code=mctx" class="sref">mctx./a>->.a href="+code=block" class="sref">block./a> + (sizeof(.a href="+code=mctx" class="sref">mctx./a>->.a href="+code=block" class="sref">block./a>) - .a href="+code=avail" class="sref">avail./a>),
2183./a>               .a href="+code=data" class="sref">data./a>, .a href="+code=avail" class="sref">avail./a>);
2184./a>
2185./a>        .a href="+code=md4_transform_helper" class="sref">md4_transform_helper./a>(.a href="+code=mctx" class="sref">mctx./a>);
2186./a>        .a href="+code=data" class="sref">data./a> += .a href="+code=avail" class="sref">avail./a>;
2187./a>        .a href="+code=len" class="sref">len./a> -= .a href="+code=avail" class="sref">avail./a>;
2188./a>
2189./a>        while (.a href="+code=len" class="sref">len./a> >= sizeof(.a href="+code=mctx" class="sref">mctx./a>->.a href="+code=block" class="sref">block./a>)) {l2190./a>                .a href="+code=memcpy" class="sref">memcpy./a>(.a href="+code=mctx" class="sref">mctx./a>->.a href="+code=block" class="sref">block./a>, .a href="+code=data" class="sref">data./a>, sizeof(.a href="+code=mctx" class="sref">mctx./a>->.a href="+code=block" class="sref">block./a>));
2191./a>                .a href="+code=md4_transform_helper" class="sref">md4_transform_helper./a>(.a href="+code=mctx" class="sref">mctx./a>);
2192./a>                .a href="+code=data" class="sref">data./a> += sizeof(.a href="+code=mctx" class="sref">mctx./a>->.a href="+code=block" class="sref">block./a>);
2193./a>                .a href="+code=len" class="sref">len./a> -= sizeof(.a href="+code=mctx" class="sref">mctx./a>->.a href="+code=block" class="sref">block./a>);
2194./a>        }
2195./a>l2196./a>        .a href="+code=memcpy" class="sref">memcpy./a>(.a href="+code=mctx" class="sref">mctx./a>->.a href="+code=block" class="sref">block./a>, .a href="+code=data" class="sref">data./a>, .a href="+code=len" class="sref">len./a>);
2197./a>}
2198./a>
2199./a>static void .a href="+code=md4_final_ascii" class="sref">md4_final_ascii./a>(struct2.a href="+code=md4_ctx" class="sref">md4_ctx./a> *.a href="+code=mctx" class="sref">mctx./a>, char *.a href="+code=out" class="sref">out./a>, unsigned int .a href="+code=len" class="sref">len./a>)l2200./a>{l2201./a>        const unsigned int .a href="+code=offset" class="sref">offset./a> = .a href="+code=mctx" class="sref">mctx./a>->.a href="+code=byte_count" class="sref">byte_count./a> & 0x3f;
2202./a>        char *.a href="+code=p" class="sref">p./a> = (char *).a href="+code=mctx" class="sref">mctx./a>->.a href="+code=block" class="sref">block./a> + .a href="+code=offset" class="sref">offset./a>;
2203./a>        int .a href="+code=padding" class="sref">padding./a> = 56 - (.a href="+code=offset" class="sref">offset./a> + 1);
2204./a>
2205./a>        *.a href="+code=p" class="sref">p./a>++ = 0x80;
2206./a>        if (.a href="+code=padding" class="sref">padding./a> < 0) {l2207./a>                .a href="+code=memset" class="sref">memset./a>(.a href="+code=p" class="sref">p./a>, 0x00, .a href="+code=padding" class="sref">padding./a> + sizeof (.a href="+code=uint64_t" class="sref">uint64_t./a>));
2208./a>                .a href="+code=md4_transform_helper" class="sref">md4_transform_helper./a>(.a href="+code=mctx" class="sref">mctx./a>);
2209./a>                .a href="+code=p" class="sref">p./a> = (char *).a href="+code=mctx" class="sref">mctx./a>->.a href="+code=block" class="sref">block./a>;
2210./a>                .a href="+code=padding" class="sref">padding./a> = 56;
2211./a>        }
2212./a>
2213./a>        .a href="+code=memset" class="sref">memset./a>(.a href="+code=p" class="sref">p./a>, 0, .a href="+code=padding" class="sref">padding./a>);
2214./a>        .a href="+code=mctx" class="sref">mctx./a>->.a href="+code=block" class="sref">block./a>[14] = .a href="+code=mctx" class="sref">mctx./a>->.a href="+code=byte_count" class="sref">byte_count./a> << 3;
2215./a>        .a href="+code=mctx" class="sref">mctx./a>->.a href="+code=block" class="sref">block./a>[15] = .a href="+code=mctx" class="sref">mctx./a>->.a href="+code=byte_count" class="sref">byte_count./a> >> 29;
2216./a>        .a href="+code=le32_to_cpu_array" class="sref">le32_to_cpu_array./a>(.a href="+code=mctx" class="sref">mctx./a>->.a href="+code=block" class="sref">block./a>, (sizeof(.a href="+code=mctx" class="sref">mctx./a>->.a href="+code=block" class="sref">block./a>) -
2217./a>                          sizeof(.a href="+code=uint64_t" class="sref">uint64_t./a>)) / sizeof(.a href="+code=uint32_t" class="sref">uint32_t./a>));
2218./a>        .a href="+code=md4_transform" class="sref">md4_transform./a>(.a href="+code=mctx" class="sref">mctx./a>->.a href="+code=hash" class="sref">hash./a>, .a href="+code=mctx" class="sref">mctx./a>->.a href="+code=block" class="sref">block./a>);
2219./a>        .a href="+code=cpu_to_le32_array" class="sref">cpu_to_le32_array./a>(.a href="+code=mctx" class="sref">mctx./a>->.a href="+code=hash" class="sref">hash./a>, sizeof(.a href="+code=mctx" class="sref">mctx./a>->.a href="+code=hash" class="sref">hash./a>) / sizeof(.a href="+code=uint32_t" class="sref">uint32_t./a>));
2220./a>l2221./a>        .a href="+code=snprintf" class="sref">snprintf./a>(.a href="+code=out" class="sref">out./a>, .a href="+code=len" class="sref">len./a>, .span class="string">"%08X%08X%08X%08X",
2222./a>                 .a href="+code=mctx" class="sref">mctx./a>->.a href="+code=hash" class="sref">hash./a>[0], .a href="+code=mctx" class="sref">mctx./a>->.a href="+code=hash" class="sref">hash./a>[1], .a href="+code=mctx" class="sref">mctx./a>->.a href="+code=hash" class="sref">hash./a>[2], .a href="+code=mctx" class="sref">mctx./a>->.a href="+code=hash" class="sref">hash./a>[3]);
2223./a>}
2224./a>
2225./a>static .a href="+code=inline" class="sref">inline./a> void .a href="+code=add_char" class="sref">add_char./a>(unsigned char .a href="+code=c" class="sref">c./a>, struct2.a href="+code=md4_ctx" class="sref">md4_ctx./a> *.a href="+code=md" class="sref">md./a>)l2226./a>{l2227./a>        .a href="+code=md4_update" class="sref">md4_update./a>(.a href="+code=md" class="sref">md./a>, &.a href="+code=c" class="sref">c./a>, 1);
2228./a>}
2229./a>l2230./a>static int .a href="+code=parse_string" class="sref">parse_string./a>(const char *.a href="+code=file" class="sref">file./a>, unsigned long .a href="+code=len" class="sref">len./a>,l2231./a>                        struct2.a href="+code=md4_ctx" class="sref">md4_ctx./a> *.a href="+code=md" class="sref">md./a>)l2232./a>{l2233./a>        unsigned long .a href="+code=i" class="sref">i./a>;
2234./a>
2235./a>        .a href="+code=add_char" class="sref">add_char./a>(.a href="+code=file" class="sref">file./a>[0], .a href="+code=md" class="sref">md./a>);
2236./a>        for (.a href="+code=i" class="sref">i./a> = 1; .a href="+code=i" class="sref">i./a> < .a href="+code=len" class="sref">len./a>; .a href="+code=i" class="sref">i./a>++) {l2237./a>                .a href="+code=add_char" class="sref">add_char./a>(.a href="+code=file" class="sref">file./a>[.a href="+code=i" class="sref">i./a>], .a href="+code=md" class="sref">md./a>);
2238./a>                if (.a href="+code=file" class="sref">file./a>[.a href="+code=i" class="sref">i./a>] == .span class="string">'"' && .a href="+code=file" class="sref">file./a>[.a href="+code=i" class="sref">i./a>-1] != .span class="string">'\\')l2239./a>                        break;
2240./a>        }
2241./a>        return .a href="+code=i" class="sref">i./a>;
2242./a>}
2243./a>
2244./a>static int .a href="+code=parse_comment" class="sref">parse_comment./a>(const char *.a href="+code=file" class="sref">file./a>, unsigned long .a href="+code=len" class="sref">len./a>)l2245./a>{l2246./a>        unsigned long .a href="+code=i" class="sref">i./a>;
2247./a>l2248./a>        for (.a href="+code=i" class="sref">i./a> = 2; .a href="+code=i" class="sref">i./a> < .a href="+code=len" class="sref">len./a>; .a href="+code=i" class="sref">i./a>++) {l2249./a>                if (.a href="+code=file" class="sref">file./a>[.a href="+code=i" class="sref">i./a>-1] == .span class="string">'*' && .a href="+code=file" class="sref">file./a>[.a href="+code=i" class="sref">i./a>] == .span class="string">'/')l2250./a>                        break;
2251./a>        }
2252./a>        return .a href="+code=i" class="sref">i./a>;
2253./a>}
2254./a>
2255./a>.span class="comment">/* FIXME: Handle .s files differently (eg. # starts comments) --RR */
2256./a>static int .a href="+code=parse_file" class="sref">parse_file./a>(const char *.a href="+code=fnam." class="sref">fnam../a>, struct2.a href="+code=md4_ctx" class="sref">md4_ctx./a> *.a href="+code=md" class="sref">md./a>)l2257./a>{l2258./a>        char *.a href="+code=file" class="sref">file./a>;
2259./a>        unsigned long .a href="+code=i" class="sref">i./a>, .a href="+code=len" class="sref">len./a>;
2260./a>l2261./a>        .a href="+code=file" class="sref">file./a> = .a href="+code=grab_file" class="sref">grab_file./a>(.a href="+code=fnam." class="sref">fnam../a>, &.a href="+code=len" class="sref">len./a>);
2262./a>        if (!.a href="+code=file" class="sref">file./a>)l2263./a>                return 0;
2264./a>
2265./a>        for (.a href="+code=i" class="sref">i./a> = 0; .a href="+code=i" class="sref">i./a> < .a href="+code=len" class="sref">len./a>; .a href="+code=i" class="sref">i./a>++) {l2266./a>                .span class="comment">/* Collapse and ignore \ and CR. */
2267./a>                if (.a href="+code=file" class="sref">file./a>[.a href="+code=i" class="sref">i./a>] == .span class="string">'\\' && (.a href="+code=i" class="sref">i./a>+1 < .a href="+code=len" class="sref">len./a>) && .a href="+code=file" class="sref">file./a>[.a href="+code=i" class="sref">i./a>+1] == .span class="string">'\n') {l2268./a>                        .a href="+code=i" class="sref">i./a>++;
2269./a>                        continue;
2270./a>                }
2271./a>l2272./a>                .span class="comment">/* Ignore whitespace */
2273./a>                if (.a href="+code=isspace" class="sref">isspace./a>(.a href="+code=file" class="sref">file./a>[.a href="+code=i" class="sref">i./a>]))l2274./a>                        continue;
2275./a>l2276./a>                .span class="comment">/* Handle strings as whole units */
2277./a>                if (.a href="+code=file" class="sref">file./a>[.a href="+code=i" class="sref">i./a>] == .span class="string">'"') {l2278./a>                        .a href="+code=i" class="sref">i./a> += .a href="+code=parse_string" class="sref">parse_string./a>(.a href="+code=file" class="sref">file./a>+.a href="+code=i" class="sref">i./a>, .a href="+code=len" class="sref">len./a> - .a href="+code=i" class="sref">i./a>, .a href="+code=md" class="sref">md./a>);
2279./a>                        continue;
2280./a>                }
2281./a>l2282./a>                .span class="comment">/* Comments: ignore */
2283./a>                if (.a href="+code=file" class="sref">file./a>[.a href="+code=i" class="sref">i./a>] == .span class="string">'/' && .a href="+code=file" class="sref">file./a>[.a href="+code=i" class="sref">i./a>+1] == .span class="string">'*') {l2284./a>                        .a href="+code=i" class="sref">i./a> += .a href="+code=parse_comment" class="sref">parse_comment./a>(.a href="+code=file" class="sref">file./a>+.a href="+code=i" class="sref">i./a>, .a href="+code=len" class="sref">len./a> - .a href="+code=i" class="sref">i./a>);
2285./a>                        continue;
2286./a>                }
2287./a>l2288./a>                .a href="+code=add_char" class="sref">add_char./a>(.a href="+code=file" class="sref">file./a>[.a href="+code=i" class="sref">i./a>], .a href="+code=md" class="sref">md./a>);
2289./a>        }
2290./a>        .a href="+code=release_file" class="sref">release_file./a>(.a href="+code=file" class="sref">file./a>, .a href="+code=len" class="sref">len./a>);
2291./a>        return 1;
2292./a>}
2293./a>.span class="comment">/* Check whether the file is a static library or not */
2294./a>static int .a href="+code=is_static_library" class="sref">is_static_library./a>(const char *.a href="+code=objfile" class="sref">objfile./a>)l2295./a>{l2296./a>        int .a href="+code=len" class="sref">len./a> = .a href="+code=strlen" class="sref">strlen./a>(.a href="+code=objfile" class="sref">objfile./a>);
2297./a>        if (.a href="+code=objfile" class="sref">objfile./a>[.a href="+code=len" class="sref">len./a> - 2] == .span class="string">'.' && .a href="+code=objfile" class="sref">objfile./a>[.a href="+code=len" class="sref">len./a> - 1] == .span class="string">'a')l2298./a>                return 1;
2299./a>        else
2300./a>                return 0;
2301./a>}
2302./a>
2303./a>.span class="comment">/* We have dir/file.o.  Open dir/.file.o.cmd, look for source_ and deps_ line./span>
2304./a>.span class="comment"> * to figure out source files. */
2305./a>static int .a href="+code=parse_source_files" class="sref">parse_source_files./a>(const char *.a href="+code=objfile" class="sref">objfile./a>, struct2.a href="+code=md4_ctx" class="sref">md4_ctx./a> *.a href="+code=md" class="sref">md./a>)l2306./a>{l2307./a>        char *.a href="+code=cmd" class="sref">cmd./a>, *.a href="+code=file" class="sref">file./a>, *.a href="+code=line" class="sref">line./a>, *.a href="+code=dir" class="sref">dir./a>;
2308./a>        const char *.a href="+code=base" class="sref">base./a>;
2309./a>        unsigned long .a href="+code=flen" class="sref">flen./a>, .a href="+code=pos" class="sref">pos./a> = 0;
2310./a>        int .a href="+code=dirlen" class="sref">dirlen./a>, .a href="+code=ret" class="sref">ret./a> = 0, .a href="+code=check_files" class="sref">check_files./a> = 0;
2311./a>l2312./a>        .a href="+code=cmd" class="sref">cmd./a> = .a href="+code=NOFAIL" class="sref">NOFAIL./a>(.a href="+code=malloc" class="sref">malloc./a>(.a href="+code=strlen" class="sref">strlen./a>(.a href="+code=objfile" class="sref">objfile./a>) + sizeof(.span class="string">"..cmd")));
2313./a>
2314./a>        .a href="+code=base" class="sref">base./a> = .a href="+code=strrchr" class="sref">strrchr./a>(.a href="+code=objfile" class="sref">objfile./a>, .span class="string">'/');
2315./a>        if (.a href="+code=base" class="sref">base./a>) {l2316./a>                .a href="+code=base" class="sref">base./a>++;
2317./a>                .a href="+code=dirlen" class="sref">dirlen./a> = .a href="+code=base" class="sref">base./a> - .a href="+code=objfile" class="sref">objfile./a>;
2318./a>                .a href="+code=sprintf" class="sref">sprintf./a>(.a href="+code=cmd" class="sref">cmd./a>, .span class="string">"%.*s.%s.cmd", .a href="+code=dirlen" class="sref">dirlen./a>, .a href="+code=objfile" class="sref">objfile./a>, .a href="+code=base" class="sref">base./a>);
2319./a>        } else {l2320./a>                .a href="+code=dirlen" class="sref">dirlen./a> = 0;
2321./a>                .a href="+code=sprintf" class="sref">sprintf./a>(.a href="+code=cmd" class="sref">cmd./a>, .span class="string">".%s.cmd", .a href="+code=objfile" class="sref">objfile./a>);
2322./a>        }
2323./a>        .a href="+code=dir" class="sref">dir./a> = .a href="+code=NOFAIL" class="sref">NOFAIL./a>(.a href="+code=malloc" class="sref">malloc./a>(.a href="+code=dirlen" class="sref">dirlen./a> + 1));
2324./a>        .a href="+code=strncpy" class="sref">strncpy./a>(.a href="+code=dir" class="sref">dir./a>, .a href="+code=objfile" class="sref">objfile./a>, .a href="+code=dirlen" class="sref">dirlen./a>);
2325./a>        .a href="+code=dir" class="sref">dir./a>[.a href="+code=dirlen" class="sref">dirlen./a>] = .span class="string">'\0';
2326./a>
2327./a>        .a href="+code=file" class="sref">file./a> = .a href="+code=grab_file" class="sref">grab_file./a>(.a href="+code=cmd" class="sref">cmd./a>, &.a href="+code=flen" class="sref">flen./a>);
2328./a>        if (!.a href="+code=file" class="sref">file./a>) {l2329./a>                .a href="+code=warn" class="sref">warn./a>(.span class="string">"could not find %s for %s\n", .a href="+code=cmd" class="sref">cmd./a>, .a href="+code=objfile" class="sref">objfile./a>);
2330./a>                goto .a href="+code=out" class="sref">out./a>;
2331./a>        }
2332./a>
2333./a>        .span class="comment">/* There will be a line like so:
2334./a>.span class="comment">                deps_drivers/net/dummy.o := \
2335./a>.span class="comment">                  drivers/net/dummy.c \
2336./a>.span class="comment">                    $(wildcard include/config/net/fastroute.h) \
2337./a>.span class="comment">                  include/linux/module.h \
2338./a>
2339./a>.span class="comment">           Sum all files in the sam. dir or subdirs.
2340./a>.span class="comment">        */
2341./a>        while ((.a href="+code=line" class="sref">line./a> = .a href="+code=get_next_line" class="sref">get_next_line./a>(&.a href="+code=pos" class="sref">pos./a>, .a href="+code=file" class="sref">file./a>, .a href="+code=flen" class="sref">flen./a>)) != .a href="+code=NULL" class="sref">NULL./a>) {l2342./a>                char* .a href="+code=p" class="sref">p./a> = .a href="+code=line" class="sref">line./a>;
2343./a>
2344./a>                if (.a href="+code=strncmp" class="sref">strncmp./a>(.a href="+code=line" class="sref">line./a>, .span class="string">"source_", sizeof(.span class="string">"source_")-1) == 0) {l2345./a>                        .a href="+code=p" class="sref">p./a> = .a href="+code=strrchr" class="sref">strrchr./a>(.a href="+code=line" class="sref">line./a>, .span class="string">' ');
2346./a>                        if (!.a href="+code=p" class="sref">p./a>) {l2347./a>                                .a href="+code=warn" class="sref">warn./a>(.span class="string">"malformed line: %s\n", .a href="+code=line" class="sref">line./a>);
2348./a>                                goto .a href="+code=out_file" class="sref">out_file./a>;
2349./a>                        }
2350./a>                        .a href="+code=p" class="sref">p./a>++;
2351./a>                        if (!.a href="+code=parse_file" class="sref">parse_file./a>(.a href="+code=p" class="sref">p./a>, .a href="+code=md" class="sref">md./a>)) {l2352./a>                                .a href="+code=warn" class="sref">warn./a>(.span class="string">"could not open %s: %s\n",l2353./a>                                     .a href="+code=p" class="sref">p./a>, .a href="+code=strerror" class="sref">strerror./a>(.a href="+code=errno" class="sref">errno./a>));
2354./a>                                goto .a href="+code=out_file" class="sref">out_file./a>;
2355./a>                        }
2356./a>                        continue;
2357./a>                }
2358./a>                if (.a href="+code=strncmp" class="sref">strncmp./a>(.a href="+code=line" class="sref">line./a>, .span class="string">"deps_", sizeof(.span class="string">"deps_")-1) == 0) {l2359./a>                        .a href="+code=check_files" class="sref">check_files./a> = 1;
2360./a>                        continue;
2361./a>                }
2362./a>                if (!.a href="+code=check_files" class="sref">check_files./a>)l2363./a>                        continue;
2364./a>
2365./a>                .span class="comment">/* Continue until line does not end with '\' */
2366./a>                if ( *(.a href="+code=p" class="sref">p./a> + .a href="+code=strlen" class="sref">strlen./a>(.a href="+code=p" class="sref">p./a>)-1) != .span class="string">'\\')l2367./a>                        break;
2368./a>                .span class="comment">/* Terminate line at first space, to get rid of final ' \' */
2369./a>                while (*.a href="+code=p" class="sref">p./a>) {l2370./a>                       if (.a href="+code=isspace" class="sref">isspace./a>(*.a href="+code=p" class="sref">p./a>)) {l2371./a>                                *.a href="+code=p" class="sref">p./a> = .span class="string">'\0';
2372./a>                                break;
2373./a>                        }
2374./a>                        .a href="+code=p" class="sref">p./a>++;
2375./a>                }
2376./a>
2377./a>                .span class="comment">/* Check if this file is in sam. dir as objfile */
2378./a>                if ((.a href="+code=strstr" class="sref">strstr./a>(.a href="+code=line" class="sref">line./a>, .a href="+code=dir" class="sref">dir./a>)+.a href="+code=strlen" class="sref">strlen./a>(.a href="+code=dir" class="sref">dir./a>)-1) == .a href="+code=strrchr" class="sref">strrchr./a>(.a href="+code=line" class="sref">line./a>, .span class="string">'/')) {l2379./a>                        if (!.a href="+code=parse_file" class="sref">parse_file./a>(.a href="+code=line" class="sref">line./a>, .a href="+code=md" class="sref">md./a>)) {l2380./a>                                .a href="+code=warn" class="sref">warn./a>(.span class="string">"could not open %s: %s\n",l2381./a>                                     .a href="+code=line" class="sref">line./a>, .a href="+code=strerror" class="sref">strerror./a>(.a href="+code=errno" class="sref">errno./a>));
2382./a>                                goto .a href="+code=out_file" class="sref">out_file./a>;
2383./a>                        }
2384./a>
2385./a>                }
2386./a>
2387./a>        }
2388./a>
2389./a>        .span class="comment">/* Everyone parsed OK */
2390./a>        .a href="+code=ret" class="sref">ret./a> = 1;
2391./a>.a href="+code=out_file" class="sref">out_file./a>:
2392./a>        .a href="+code=release_file" class="sref">release_file./a>(.a href="+code=file" class="sref">file./a>, .a href="+code=flen" class="sref">flen./a>);
2393./a>.a href="+code=out" class="sref">out./a>:
2394./a>        .a href="+code=free" class="sref">free./a>(.a href="+code=dir" class="sref">dir./a>);
2395./a>        .a href="+code=free" class="sref">free./a>(.a href="+code=cmd" class="sref">cmd./a>);
2396./a>        return .a href="+code=ret" class="sref">ret./a>;
2397./a>}
2398./a>
2399./a>.span class="comment">/* Calc and record src checksum. */
2400./a>void .a href="+code=get_src_vers.1." class="sref">get_src_vers.1../a>(const char *.a href="+code=modnam." class="sref">modnam../a>, char .a href="+code=sum" class="sref">sum./a>[], unsigned .a href="+code=sumlen" class="sref">sumlen./a>)l2401./a>{l2402./a>        void *.a href="+code=file" class="sref">file./a>;
2403./a>        unsigned long .a href="+code=len" class="sref">len./a>;
2404./a>        struct2.a href="+code=md4_ctx" class="sref">md4_ctx./a> .a href="+code=md" class="sref">md./a>;
2405./a>        char *.a href="+code=sources" class="sref">sources./a>, *.a href="+code=end" class="sref">end./a>, *.a href="+code=fnam." class="sref">fnam../a>;
2406./a>        const char *.a href="+code=basenam." class="sref">basenam../a>;
2407./a>        char .a href="+code=filelist" class="sref">filelist./a>[.a href="+code=PATH_MAX" class="sref">PATH_MAX./a> + 1];
2408./a>        char *.a href="+code=modverdir" class="sref">modverdir./a> = .a href="+code=getenv" class="sref">getenv./a>(.span class="string">"MODVERDIR");
2409./a>l2410./a>        if (!.a href="+code=modverdir" class="sref">modverdir./a>)l2411./a>                .a href="+code=modverdir" class="sref">modverdir./a> = .span class="string">".";
2412./a>
2413./a>        .span class="comment">/* Source files for module are in .tmp_vers.1.s/modnam..mod,
2414./a>.span class="comment">           after the first line. */
2415./a>        if (.a href="+code=strrchr" class="sref">strrchr./a>(.a href="+code=modnam." class="sref">modnam../a>, .span class="string">'/'))
2416./a>                .a href="+code=basenam." class="sref">basenam../a> = .a href="+code=strrchr" class="sref">strrchr./a>(.a href="+code=modnam." class="sref">modnam../a>, .span class="string">'/') + 1;
2417./a>        else
2418./a>                .a href="+code=basenam." class="sref">basenam../a> = .a href="+code=modnam." class="sref">modnam../a>;
2419./a>        .a href="+code=sprintf" class="sref">sprintf./a>(.a href="+code=filelist" class="sref">filelist./a>, .span class="string">"%s/%.*s.mod", .a href="+code=modverdir" class="sref">modverdir./a>,l2420./a>                (int) .a href="+code=strlen" class="sref">strlen./a>(.a href="+code=basenam." class="sref">basenam../a>) - 2, .a href="+code=basenam." class="sref">basenam../a>);
2421./a>l2422./a>        .a href="+code=file" class="sref">file./a> = .a href="+code=grab_file" class="sref">grab_file./a>(.a href="+code=filelist" class="sref">filelist./a>, &.a href="+code=len" class="sref">len./a>);
2423./a>        if (!.a href="+code=file" class="sref">file./a>)l2424./a>                .span class="comment">/* not a module or .mod file missing - ignore */
2425./a>                return;
2426./a>
2427./a>        .a href="+code=sources" class="sref">sources./a> = .a href="+code=strchr" class="sref">strchr./a>(.a href="+code=file" class="sref">file./a>, .span class="string">'\n');
2428./a>        if (!.a href="+code=sources" class="sref">sources./a>) {l2429./a>                .a href="+code=warn" class="sref">warn./a>(.span class="string">"malformed vers.1.s file for %s\n", .a href="+code=modnam." class="sref">modnam../a>);
2430./a>                goto .a href="+code=release" class="sref">release./a>;
2431./a>        }
2432./a>
2433./a>        .a href="+code=sources" class="sref">sources./a>++;
2434./a>        .a href="+code=end" class="sref">end./a> = .a href="+code=strchr" class="sref">strchr./a>(.a href="+code=sources" class="sref">sources./a>, .span class="string">'\n');
2435./a>        if (!.a href="+code=end" class="sref">end./a>) {l2436./a>                .a href="+code=warn" class="sref">warn./a>(.span class="string">"bad ending vers.1.s file for %s\n", .a href="+code=modnam." class="sref">modnam../a>);
2437./a>                goto .a href="+code=release" class="sref">release./a>;
2438./a>        }
2439./a>        *.a href="+code=end" class="sref">end./a> = .span class="string">'\0';
2440./a>l2441./a>        .a href="+code=md4_init" class="sref">md4_init./a>(&.a href="+code=md" class="sref">md./a>);
2442./a>        while ((.a href="+code=fnam." class="sref">fnam../a> = .a href="+code=strsep" class="sref">strsep./a>(&.a href="+code=sources" class="sref">sources./a>, .span class="string">" ")) != .a href="+code=NULL" class="sref">NULL./a>) {l2443./a>                if (!*.a href="+code=fnam." class="sref">fnam../a>)l2444./a>                        continue;
2445./a>                if (!(.a href="+code=is_static_library" class="sref">is_static_library./a>(.a href="+code=fnam." class="sref">fnam../a>)) &&
2446./a>                                !.a href="+code=parse_source_files" class="sref">parse_source_files./a>(.a href="+code=fnam." class="sref">fnam../a>, &.a href="+code=md" class="sref">md./a>))
2447./a>                        goto .a href="+code=release" class="sref">release./a>;
2448./a>        }
2449./a>l2450./a>        .a href="+code=md4_final_ascii" class="sref">md4_final_ascii./a>(&.a href="+code=md" class="sref">md./a>, .a href="+code=sum" class="sref">sum./a>, .a href="+code=sumlen" class="sref">sumlen./a>);
2451./a>.a href="+code=release" class="sref">release./a>:
2452./a>        .a href="+code=release_file" class="sref">release_file./a>(.a href="+code=file" class="sref">file./a>, .a href="+code=len" class="sref">len./a>);
2453./a>}
2454./a>
2455./a>static void .a href="+code=write_vers.1." class="sref">write_vers.1../a>(const char *.a href="+code=filenam." class="sref">filenam../a>, const char *.a href="+code=sum" class="sref">sum./a>,
2456./a>                          unsigned long .a href="+code=offset" class="sref">offset./a>)l2457./a>{l2458./a>        int .a href="+code=fd" class="sref">fd./a>;
2459./a>l2460./a>        .a href="+code=fd" class="sref">fd./a> = .a href="+code=open" class="sref">open./a>(.a href="+code=filenam." class="sref">filenam../a>, .a href="+code=O_RDWR" class="sref">O_RDWR./a>);
2461./a>        if (.a href="+code=fd" class="sref">fd./a> < 0) {l2462./a>                .a href="+code=warn" class="sref">warn./a>(.span class="string">"changing sum in %s failed: %s\n",l2463./a>                        .a href="+code=filenam." class="sref">filenam../a>, .a href="+code=strerror" class="sref">strerror./a>(.a href="+code=errno" class="sref">errno./a>));
2464./a>                return;
2465./a>        }
2466./a>
2467./a>        if (.a href="+code=lseek" class="sref">lseek./a>(.a href="+code=fd" class="sref">fd./a>, .a href="+code=offset" class="sref">offset./a>, .a href="+code=SEEK_SET" class="sref">SEEK_SET./a>) == (.a href="+code=off_t" class="sref">off_t./a>)-1) {l2468./a>                .a href="+code=warn" class="sref">warn./a>(.span class="string">"changing sum in %s:%lu failed: %s\n",l2469./a>                        .a href="+code=filenam." class="sref">filenam../a>, .a href="+code=offset" class="sref">offset./a>, .a href="+code=strerror" class="sref">strerror./a>(.a href="+code=errno" class="sref">errno./a>));
2470./a>                goto .a href="+code=out" class="sref">out./a>;
2471./a>        }
2472./a>
2473./a>        if (.a href="+code=write" class="sref">write./a>(.a href="+code=fd" class="sref">fd./a>, .a href="+code=sum" class="sref">sum./a>, .a href="+code=strlen" class="sref">strlen./a>(.a href="+code=sum" class="sref">sum./a>)+1) != .a href="+code=strlen" class="sref">strlen./a>(.a href="+code=sum" class="sref">sum./a>)+1) {l2474./a>                .a href="+code=warn" class="sref">warn./a>(.span class="string">"writing sum in %s failed: %s\n",l2475./a>                        .a href="+code=filenam." class="sref">filenam../a>, .a href="+code=strerror" class="sref">strerror./a>(.a href="+code=errno" class="sref">errno./a>));
2476./a>                goto .a href="+code=out" class="sref">out./a>;
2477./a>        }
2478./a>.a href="+code=out" class="sref">out./a>:
2479./a>        .a href="+code=close" class="sref">close./a>(.a href="+code=fd" class="sref">fd./a>);
2480./a>}
2481./a>l2482./a>static int .a href="+code=strip_rcs_crap" class="sref">strip_rcs_crap./a>(char *.a href="+code=vers.1." class="sref">vers.1../a>)l2483./a>{l2484./a>        unsigned int .a href="+code=len" class="sref">len./a>, .a href="+code=full_len" class="sref">full_len./a>;
2485./a>
2486./a>        if (.a href="+code=strncmp" class="sref">strncmp./a>(.a href="+code=vers.1." class="sref">vers.1../a>, .span class="string">"$Revis.1.", .a href="+code=strlen" class="sref">strlen./a>(.span class="string">"$Revis.1.")) != 0)l2487./a>                return 0;
2488./a>
2489./a>        .span class="comment">/* Space for vers.1. string follows. */
2490./a>        .a href="+code=full_len" class="sref">full_len./a> = .a href="+code=strlen" class="sref">strlen./a>(.a href="+code=vers.1." class="sref">vers.1../a>) + .a href="+code=strlen" class="sref">strlen./a>(.a href="+code=vers.1." class="sref">vers.1../a> + .a href="+code=strlen" class="sref">strlen./a>(.a href="+code=vers.1." class="sref">vers.1../a>) + 1) + 2;
2491./a>l2492./a>        .span class="comment">/* Move string to start with vers.1. number: prefix will be
2493./a>.span class="comment">         * $Revis.1.$ or $Revis.1.: */
2494./a>        .a href="+code=len" class="sref">len./a> = .a href="+code=strlen" class="sref">strlen./a>(.span class="string">"$Revis.1.");
2495./a>        if (.a href="+code=vers.1." class="sref">vers.1../a>[.a href="+code=len" class="sref">len./a>] == .span class="string">':' || .a href="+code=vers.1." class="sref">vers.1../a>[.a href="+code=len" class="sref">len./a>] == .span class="string">'$')l2496./a>                .a href="+code=len" class="sref">len./a>++;
2497./a>        while (.a href="+code=isspace" class="sref">isspace./a>(.a href="+code=vers.1." class="sref">vers.1../a>[.a href="+code=len" class="sref">len./a>]))
2498./a>                .a href="+code=len" class="sref">len./a>++;
2499./a>        .a href="+code=memmove" class="sref">memmove./a>(.a href="+code=vers.1." class="sref">vers.1../a>, .a href="+code=vers.1." class="sref">vers.1../a>+.a href="+code=len" class="sref">len./a>, .a href="+code=full_len" class="sref">full_len./a>-.a href="+code=len" class="sref">len./a>);
2500./a>        .a href="+code=full_len" class="sref">full_len./a> -= .a href="+code=len" class="sref">len./a>;
2501./a>l2502./a>        .span class="comment">/* Preserve up to next whitespace. */
2503./a>        .a href="+code=len" class="sref">len./a> = 0;
2504./a>        while (.a href="+code=vers.1." class="sref">vers.1../a>[.a href="+code=len" class="sref">len./a>] && !.a href="+code=isspace" class="sref">isspace./a>(.a href="+code=vers.1." class="sref">vers.1../a>[.a href="+code=len" class="sref">len./a>]))
2505./a>                .a href="+code=len" class="sref">len./a>++;
2506./a>        .a href="+code=memmove" class="sref">memmove./a>(.a href="+code=vers.1." class="sref">vers.1../a> + .a href="+code=len" class="sref">len./a>, .a href="+code=vers.1." class="sref">vers.1../a> + .a href="+code=strlen" class="sref">strlen./a>(.a href="+code=vers.1." class="sref">vers.1../a>),l2507./a>                .a href="+code=full_len" class="sref">full_len./a> - .a href="+code=strlen" class="sref">strlen./a>(.a href="+code=vers.1." class="sref">vers.1../a>));
2508./a>        return 1;
2509./a>}
2510./a>l2511./a>.span class="comment">/* Clean up RCS-style vers.1. numbers. */
2512./a>void .a href="+code=maybe_frob_rcs_vers.1." class="sref">maybe_frob_rcs_vers.1../a>(const char *.a href="+code=modfilenam." class="sref">modfilenam../a>,
2513./a>                            char *.a href="+code=vers.1." class="sref">vers.1../a>,
2514./a>                            void *.a href="+code=modinfo" class="sref">modinfo./a>,
2515./a>                            unsigned long .a href="+code=vers.1._offset" class="sref">vers.1._offset./a>)l2516./a>{l2517./a>        if (.a href="+code=strip_rcs_crap" class="sref">strip_rcs_crap./a>(.a href="+code=vers.1." class="sref">vers.1../a>))l2518./a>                .a href="+code=write_vers.1." class="sref">write_vers.1../a>(.a href="+code=modfilenam." class="sref">modfilenam../a>, .a href="+code=vers.1." class="sref">vers.1../a>, .a href="+code=vers.1._offset" class="sref">vers.1._offset./a>);
2519./a>}
2520./a>
lxr.linux.no kindly hosted by Redpill Linpro AS./a>, provider of Linux consulting and operati1.s services since 1995.