]> wimlib.net Git - wimlib/blobdiff - src/util.c
Use public domain SHA1 code
[wimlib] / src / util.c
index 64b8c667c27635103b7e8537ef0ea42fe7f10385..3f8a0b4873c5017c2b004c8e85edc97d14359b0c 100644 (file)
@@ -147,8 +147,10 @@ static const char *error_strings[] = {
                = "Could not read data from a file",
        [WIMLIB_ERR_RENAME] 
                = "Could not rename a file",
-       [WIMLIB_ERR_SPLIT] 
-               = "The WIM is part of a split WIM, which Wimlib does not support",
+       [WIMLIB_ERR_SPLIT_INVALID] 
+               = "The WIM is part of an invalid split WIM",
+       [WIMLIB_ERR_SPLIT_UNSUPPORTED] 
+               = "The WIM is part of a split WIM, which is not supported for this operation",
        [WIMLIB_ERR_STAT] 
                = "Could not read the metadata for a file or directory",
        [WIMLIB_ERR_TIMEOUT] 
@@ -466,21 +468,3 @@ void print_string(const void *string, size_t len)
        }
 }
 
-/* Calculates the SHA1 message digest given the name of a file.
- * @buf must point to a buffer of length 20 bytes into which the message digest
- * is written.
- */
-int sha1sum(const char *filename, void *buf)
-{
-       FILE *fp;
-       int ret;
-
-       fp = fopen(filename, "rb");
-       if (!fp) {
-               ERROR("Cannot open the file `%s' for reading: %m\n", filename);
-               return WIMLIB_ERR_OPEN;
-       }
-       ret = sha1_stream(fp, buf);
-       fclose(fp);
-       return ret;
-}