/*
* Copyright (C) 2012, 2013, 2014 Eric Biggers
*
- * This file is part of wimlib, a library for working with WIM files.
+ * This file is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 3 of the License, or (at your option) any
+ * later version.
*
- * wimlib is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 3 of the License, or (at your option)
- * any later version.
- *
- * wimlib is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- * A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * This file is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
- * You should have received a copy of the GNU General Public License
- * along with wimlib; if not, see http://www.gnu.org/licenses/.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this file; if not, see http://www.gnu.org/licenses/.
*/
#ifdef HAVE_CONFIG_H
}
struct sd_node {
- int security_id;
+ s32 security_id;
u8 hash[SHA1_HASH_SIZE];
struct avl_tree_node index_node;
};
return hashes_cmp(SD_NODE(n1)->hash, SD_NODE(n2)->hash);
}
-/* Inserts a a new node into the security descriptor index tree. Returns true
+/* Inserts a new node into the security descriptor index tree. Returns true
* if successful (not a duplicate). */
static bool
insert_sd_node(struct wim_sd_set *set, struct sd_node *new)
/* Returns the index of the security descriptor having a SHA1 message digest of
* @hash. If not found, return -1. */
-static int
+static s32
lookup_sd(struct wim_sd_set *set, const u8 hash[SHA1_HASH_SIZE])
{
struct avl_tree_node *res;
* the security ID for it. If a new security descriptor cannot be allocated,
* return -1.
*/
-int
+s32
sd_set_add_sd(struct wim_sd_set *sd_set, const char *descriptor, size_t size)
{
u8 hash[SHA1_HASH_SIZE];
- int security_id;
+ s32 security_id;
struct sd_node *new;
u8 **descriptors;
u64 *sizes;