1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-22 15:58:50 -05:00

Add const qualifier to md5_file and alpm_get_md5sum

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dan McGee 2007-08-20 12:55:38 -04:00
parent 3acbf56bba
commit 942175feaa
4 changed files with 8 additions and 6 deletions

View File

@ -379,7 +379,7 @@ const char *alpm_conflict_get_ctarget(pmconflict_t *conflict);
*/
/* checksums */
char *alpm_get_md5sum(char *name);
char *alpm_get_md5sum(const char *name);
/*
* Errors

View File

@ -32,6 +32,10 @@
* * removal of HMAC code
* * removal of SELF_TEST code
* * removal of ipad and opad from the md5_context struct in md5.h
* * change of md5_file prototype from
* int md5_file( char *path, unsigned char *output )
* to
* int md5_file( const char *path, unsigned char *output )
*/
#ifndef _CRT_SECURE_NO_DEPRECATE
@ -301,7 +305,7 @@ void md5( unsigned char *input, int ilen,
/*
* Output = MD5( file contents )
*/
int md5_file( char *path, unsigned char *output )
int md5_file( const char *path, unsigned char *output )
{
FILE *f;
size_t n;

View File

@ -82,7 +82,7 @@ void md5( unsigned char *input, int ilen,
* \return 0 if successful, 1 if fopen failed,
* or 2 if fread failed
*/
int md5_file( char *path, unsigned char *output );
int md5_file( const char *path, unsigned char *output );
#ifdef __cplusplus
}

View File

@ -547,7 +547,7 @@ int _alpm_str_cmp(const void *s1, const void *s2)
* @return the checksum on success, NULL on error
* @addtogroup alpm_misc
*/
char SYMEXPORT *alpm_get_md5sum(char *filename)
char SYMEXPORT *alpm_get_md5sum(const char *filename)
{
unsigned char output[16];
char *md5sum;
@ -582,6 +582,4 @@ char SYMEXPORT *alpm_get_md5sum(char *filename)
return(md5sum);
}
/* vim: set ts=2 sw=2 noet: */