libsqsh v1.5.1
Loading...
Searching...
No Matches
sqsh_easy.h
Go to the documentation of this file.
1/******************************************************************************
2 * *
3 * Copyright (c) 2023-2024, Enno Boland <g@s01.de> *
4 * *
5 * Redistribution and use in source and binary forms, with or without *
6 * modification, are permitted provided that the following conditions are *
7 * met: *
8 * *
9 * * Redistributions of source code must retain the above copyright notice, *
10 * this list of conditions and the following disclaimer. *
11 * * Redistributions in binary form must reproduce the above copyright *
12 * notice, this list of conditions and the following disclaimer in the *
13 * documentation and/or other materials provided with the distribution. *
14 * *
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS *
16 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, *
17 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR *
18 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR *
19 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
22 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
23 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
24 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
26 * *
27 ******************************************************************************/
28
34#ifndef SQSH_CHROME_H
35#define SQSH_CHROME_H
36
37#include "sqsh_common.h"
38
39#include <fcntl.h>
40#include <stdio.h>
41#include <time.h>
42
43#ifdef __cplusplus
44extern "C" {
45#endif
46
47struct SqshArchive;
48struct SqshFile;
49
50/***************************************
51 * easy/file.c
52 */
53
63bool
64sqsh_easy_file_exists(struct SqshArchive *archive, const char *path, int *err);
65
78uint8_t *
79sqsh_easy_file_content(struct SqshArchive *archive, const char *path, int *err);
80
90uint64_t
91sqsh_easy_file_size2(struct SqshArchive *archive, const char *path, int *err);
92
103__attribute__((deprecated("Since 1.5.0. Use sqsh_easy_file_size2() instead.")))
104size_t
105sqsh_easy_file_size(struct SqshArchive *archive, const char *path, int *err);
106
117 struct SqshArchive *archive, const char *path, int *err);
118
128uint32_t
129sqsh_easy_file_mtime2(struct SqshArchive *archive, const char *path, int *err);
130
141__attribute__((deprecated("Since 1.5.0. Use sqsh_easy_file_mtime2() instead.")))
142time_t
143sqsh_easy_file_mtime(struct SqshArchive *archive, const char *path, int *err);
144
145/***************************************
146 * easy/directory.c
147 */
148
161 struct SqshArchive *archive, const char *path, int *err);
162
175 struct SqshArchive *archive, const char *path, int *err);
176
177/***************************************
178 * easy/traversal.c
179 */
180
182 struct SqshArchive *archive, const char *path, int *err);
183
184/***************************************
185 * easy/xattr.c
186 */
187
199char **
200sqsh_easy_xattr_keys(struct SqshArchive *archive, const char *path, int *err);
201
215 struct SqshArchive *archive, const char *path, const char *key,
216 int *err);
217
218#ifdef __cplusplus
219}
220#endif
221#endif /* SQSH_CHROME_H */
size_t sqsh_easy_file_size(struct SqshArchive *archive, const char *path, int *err)
retrieves the size of a file.
char ** sqsh_easy_directory_list_path(struct SqshArchive *archive, const char *path, int *err)
retrieves the contents of a directory as a list of file paths
mode_t sqsh_easy_file_permission(struct SqshArchive *archive, const char *path, int *err)
retrieves unix permissions of a file.
char ** sqsh_easy_tree_traversal(struct SqshArchive *archive, const char *path, int *err)
uint32_t sqsh_easy_file_mtime2(struct SqshArchive *archive, const char *path, int *err)
retrieves the modification time of a file.
uint64_t sqsh_easy_file_size2(struct SqshArchive *archive, const char *path, int *err)
retrieves the size of a file.
char * sqsh_easy_xattr_get(struct SqshArchive *archive, const char *path, const char *key, int *err)
retrieves the value of a xattr key of a file or directory.
bool sqsh_easy_file_exists(struct SqshArchive *archive, const char *path, int *err)
checks if a file exists.
time_t sqsh_easy_file_mtime(struct SqshArchive *archive, const char *path, int *err)
retrieves the modification time of a file.
char ** sqsh_easy_xattr_keys(struct SqshArchive *archive, const char *path, int *err)
retrieves all xattr keys of a file or directory.
char ** sqsh_easy_directory_list(struct SqshArchive *archive, const char *path, int *err)
retrieves the contents of a directory as a list of file names
uint8_t * sqsh_easy_file_content(struct SqshArchive *archive, const char *path, int *err)
retrieves the content of a file.
The Inode context.