Rename pmconflict_t to alpm_conflict_t
[pacman-ng.git] / lib / libalpm / md5.h
blobddcea8c7e690f73d9f69e9e0ab9d3e7eb098bef1
1 /*
2 * RFC 1321 compliant MD5 implementation
4 * Copyright (C) 2006-2007 Christophe Devine
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef _MD5_H
21 #define _MD5_H
23 /**
24 * \brief MD5 context structure
26 typedef struct
28 unsigned long total[2]; /*!< number of bytes processed */
29 unsigned long state[4]; /*!< intermediate digest state */
30 unsigned char buffer[64]; /*!< data block being processed */
32 md5_context;
34 /**
35 * \brief Output = MD5( input buffer )
37 * \param input buffer holding the data
38 * \param ilen length of the input data
39 * \param output MD5 checksum result
41 void md5( unsigned char *input, int ilen, unsigned char output[16] );
43 /**
44 * \brief Output = MD5( file contents )
46 * \param path input file name
47 * \param output MD5 checksum result
49 * \return 0 if successful, 1 if fopen failed,
50 * or 2 if fread failed
52 int md5_file( const char *path, unsigned char output[16] );
54 #endif /* md5.h */