summaryrefslogtreecommitdiffstats
path: root/lib/libalpm
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2007-08-20 18:55:38 +0200
committerDan McGee <dan@archlinux.org>2007-08-20 18:58:17 +0200
commit942175feaa866c4e536a7da0f77ab54de98b6c07 (patch)
treedb190135ad82672a1b0dc3328500ce49c5dd0023 /lib/libalpm
parent3acbf56bbab128d8ef037a7dcc87d91fe7354d14 (diff)
downloadpacman-942175feaa866c4e536a7da0f77ab54de98b6c07.tar.gz
pacman-942175feaa866c4e536a7da0f77ab54de98b6c07.tar.xz
Add const qualifier to md5_file and alpm_get_md5sum
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm')
-rw-r--r--lib/libalpm/alpm.h2
-rw-r--r--lib/libalpm/md5.c6
-rw-r--r--lib/libalpm/md5.h2
-rw-r--r--lib/libalpm/util.c4
4 files changed, 8 insertions, 6 deletions
diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h
index 09538506..beb06c01 100644
--- a/lib/libalpm/alpm.h
+++ b/lib/libalpm/alpm.h
@@ -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
diff --git a/lib/libalpm/md5.c b/lib/libalpm/md5.c
index 7cb003f0..8d6fe049 100644
--- a/lib/libalpm/md5.c
+++ b/lib/libalpm/md5.c
@@ -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;
diff --git a/lib/libalpm/md5.h b/lib/libalpm/md5.h
index d652c2e4..7af70749 100644
--- a/lib/libalpm/md5.h
+++ b/lib/libalpm/md5.h
@@ -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
}
diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c
index 5f431171..64371348 100644
--- a/lib/libalpm/util.c
+++ b/lib/libalpm/util.c
@@ -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: */