archive_entry_locale.h revision 358088
1/*-
2 * Copyright (c) 2011 Michihiro NAKAJIMA
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 *    notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 *    notice, this list of conditions and the following disclaimer in the
12 *    documentation and/or other materials provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
15 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17 * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 *
25 * $FreeBSD$
26 */
27
28#ifndef ARCHIVE_ENTRY_LOCALE_H_INCLUDED
29#define ARCHIVE_ENTRY_LOCALE_H_INCLUDED
30
31#ifndef __LIBARCHIVE_BUILD
32#error This header is only to be used internally to libarchive.
33#endif
34
35struct archive_entry;
36struct archive_string_conv;
37
38/*
39 * Utility functions to set and get entry attributes by translating
40 * character-set. These are designed for use in format readers and writers.
41 *
42 * The return code and interface of these are quite different from other
43 * functions for archive_entry defined in archive_entry.h.
44 * Common return code are:
45 *   Return 0 if the string conversion succeeded.
46 *   Return -1 if the string conversion failed.
47 */
48
49#define archive_entry_gname_l	_archive_entry_gname_l
50int _archive_entry_gname_l(struct archive_entry *,
51    const char **, size_t *, struct archive_string_conv *);
52#define archive_entry_hardlink_l	_archive_entry_hardlink_l
53int _archive_entry_hardlink_l(struct archive_entry *,
54    const char **, size_t *, struct archive_string_conv *);
55#define archive_entry_pathname_l	_archive_entry_pathname_l
56int _archive_entry_pathname_l(struct archive_entry *,
57    const char **, size_t *, struct archive_string_conv *);
58#define archive_entry_symlink_l	_archive_entry_symlink_l
59int _archive_entry_symlink_l(struct archive_entry *,
60    const char **, size_t *, struct archive_string_conv *);
61#define archive_entry_uname_l	_archive_entry_uname_l
62int _archive_entry_uname_l(struct archive_entry *,
63    const char **, size_t *, struct archive_string_conv *);
64#define archive_entry_acl_text_l _archive_entry_acl_text_l
65int _archive_entry_acl_text_l(struct archive_entry *, int,
66const char **, size_t *, struct archive_string_conv *) __LA_DEPRECATED;
67#define archive_entry_acl_to_text_l _archive_entry_acl_to_text_l
68char *_archive_entry_acl_to_text_l(struct archive_entry *, ssize_t *, int,
69    struct archive_string_conv *);
70#define archive_entry_acl_from_text_l _archive_entry_acl_from_text_l
71int _archive_entry_acl_from_text_l(struct archive_entry *, const char* text,
72    int type, struct archive_string_conv *);
73#define archive_entry_copy_gname_l	_archive_entry_copy_gname_l
74int _archive_entry_copy_gname_l(struct archive_entry *,
75    const char *, size_t, struct archive_string_conv *);
76#define archive_entry_copy_hardlink_l	_archive_entry_copy_hardlink_l
77int _archive_entry_copy_hardlink_l(struct archive_entry *,
78    const char *, size_t, struct archive_string_conv *);
79#define archive_entry_copy_link_l	_archive_entry_copy_link_l
80int _archive_entry_copy_link_l(struct archive_entry *,
81    const char *, size_t, struct archive_string_conv *);
82#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
83int _archive_entry_copy_pathname_l(struct archive_entry *,
84    const char *, size_t, struct archive_string_conv *);
85#define archive_entry_copy_symlink_l	_archive_entry_copy_symlink_l
86int _archive_entry_copy_symlink_l(struct archive_entry *,
87    const char *, size_t, struct archive_string_conv *);
88#define archive_entry_copy_uname_l	_archive_entry_copy_uname_l
89int _archive_entry_copy_uname_l(struct archive_entry *,
90    const char *, size_t, struct archive_string_conv *);
91
92#endif /* ARCHIVE_ENTRY_LOCALE_H_INCLUDED */
93