]> wimlib.net Git - wimlib/blobdiff - src/util.h
extract_wim_resource_to_fd(): Handle full_write() retval correctly
[wimlib] / src / util.h
index 73f86ed4f9ce252e16d06c7dae7069171c2461ce..911b7c5e2cc92e3897320e7d132dfd08abd8fdf8 100644 (file)
 #      define HOT
 #endif /* __GNUC__ */
 
+#ifndef _NTFS_TYPES_H
 typedef uint8_t  u8;
 typedef uint16_t u16;
 typedef uint32_t u32;
 typedef uint64_t u64;
+#endif
 typedef unsigned uint;
 
+#ifndef min
 #define min(a, b) ({ typeof(a) __a = (a); typeof(b) __b = (b); \
                                        (__a < __b) ? __a : __b; })
+#endif
+
+#ifndef max
 #define max(a, b) ({ typeof(a) __a = (a); typeof(b) __b = (b); \
                                        (__a > __b) ? __a : __b; })
+#endif
+
+#ifndef swap
 #define swap(a, b) ({typeof(a) _a = a; (a) = (b); (b) = _a;})
+#endif
 
 #define ARRAY_LEN(array) (sizeof(array) / sizeof((array)[0]))
 
@@ -124,17 +134,17 @@ extern char *utf16_to_utf8(const char *utf16_str, size_t utf16_len,
 extern char *utf8_to_utf16(const char *utf8_str, size_t utf8_len, 
                           size_t *utf16_len_ret);
 
-extern void randomize_byte_array(void *p, size_t n);
+extern void randomize_byte_array(u8 *p, size_t n);
 
 extern void randomize_char_array_with_alnum(char p[], size_t n);
 
-extern int sha1sum(const char *filename, void *buf);
-
 extern const char *path_next_part(const char *path, 
                                  size_t *first_part_len_ret);
 
 extern const char *path_basename(const char *path);
 
+extern const char *path_stream_name(const char *path);
+
 extern void to_parent_name(char buf[], size_t len);
 
 extern void print_string(const void *string, size_t len);