]>
git.saurik.com Git - apt.git/blob - apt-pkg/contrib/hashes.cc
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: hashes.cc,v 1.1 2001/03/06 07:15:29 jgg Exp $
4 /* ######################################################################
6 Hashes - Simple wrapper around the hash functions
8 This is just used to make building the methods simpler, this is the
9 only interface required..
11 ##################################################################### */
13 // Include Files /*{{{*/
14 #include <apt-pkg/hashes.h>
20 // Hashes::AddFD - Add the contents of the FD /*{{{*/
21 // ---------------------------------------------------------------------
23 bool Hashes::AddFD(int Fd
,unsigned long Size
)
25 unsigned char Buf
[64*64];
29 Res
= read(Fd
,Buf
,min(Size
,(unsigned long)sizeof(Buf
)));
30 if (Res
< 0 || (unsigned)Res
!= min(Size
,(unsigned long)sizeof(Buf
)))