X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fsymlink.c;h=5c8417c70fda6f3720dfba23af50ad10fe67a0d7;hp=b0f03f060f35c692b47585609f8e28cc9498b0af;hb=14baa6ae892debbaa18dba8119931580efd0e517;hpb=1530b6dab02a9e1e5faf81529ab502aee68d8cd2 diff --git a/src/symlink.c b/src/symlink.c index b0f03f06..5c8417c7 100644 --- a/src/symlink.c +++ b/src/symlink.c @@ -5,7 +5,7 @@ */ /* - * Copyright (C) 2012 Eric Biggers + * Copyright (C) 2012, 2013 Eric Biggers * * This file is part of wimlib, a library for working with WIM files. * @@ -40,9 +40,10 @@ * dentry, and we already know the reparse tag length from the lookup table * entry resource length. */ -static ssize_t get_symlink_name(const u8 *resource, size_t resource_len, - char *buf, size_t buf_len, - u32 reparse_tag) +static ssize_t +get_symlink_name(const void *resource, size_t resource_len, + void *buf, size_t buf_len, + u32 reparse_tag) { const u8 *p = resource; u16 substitute_name_offset; @@ -128,8 +129,9 @@ out: return ret; } -static int make_symlink_reparse_data_buf(const char *symlink_target, - size_t *len_ret, void **buf_ret) +static int +make_symlink_reparse_data_buf(const mbchar *symlink_target, + size_t *len_ret, void **buf_ret) { size_t utf8_len = strlen(symlink_target); char *name_utf16; @@ -167,10 +169,13 @@ static int make_symlink_reparse_data_buf(const char *symlink_target, /* Get the symlink target from a WIM inode. * - * The inode may be either "real" symlink or a junction point. + * The inode may be either a "real" symlink (reparse tag + * WIM_IO_REPARSE_TAG_SYMLINK), or it may be a junction point (reparse tag + * WIM_IO_REPARSE_TAG_MOUNT_POINT). */ -ssize_t inode_readlink(const struct wim_inode *inode, char *buf, size_t buf_len, - const WIMStruct *w, int read_resource_flags) +ssize_t +inode_readlink(const struct wim_inode *inode, mbchar *buf, size_t buf_len, + const WIMStruct *w, int read_resource_flags) { const struct wim_lookup_table_entry *lte; int ret; @@ -203,9 +208,11 @@ ssize_t inode_readlink(const struct wim_inode *inode, char *buf, size_t buf_len, * * On failure @dentry and @lookup_table are not modified. */ -int inode_set_symlink(struct wim_inode *inode, const char *target, - struct wim_lookup_table *lookup_table, - struct wim_lookup_table_entry **lte_ret) +int +inode_set_symlink(struct wim_inode *inode, + const mbchar *target, + struct wim_lookup_table *lookup_table, + struct wim_lookup_table_entry **lte_ret) { int ret;