/[osn-commons]/trunk/uar/uar.h
ViewVC logotype

Contents of /trunk/uar/uar.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 30 - (show annotations)
Tue Aug 6 14:24:41 2024 UTC (7 months, 3 weeks ago) by rakinar2
File MIME type: text/x-c
File size: 1522 byte(s)
fix(uar): io logging
1 #ifndef UAR_UAR_H
2 #define UAR_UAR_H
3
4 #include <stdbool.h>
5 #include <sys/types.h>
6
7 struct uar_archive;
8 struct uar_file;
9
10 enum uar_error
11 {
12 UAR_SUCCESS,
13 UAR_INVALID_MAGIC,
14 UAR_INVALID_FILE,
15 UAR_IO_ERROR,
16 UAR_OUT_OF_MEMORY,
17 UAR_INVALID_ARGUMENT,
18 UAR_INVALID_OPERATION,
19 UAR_INVALID_PATH,
20 UAR_SYSTEM_ERROR
21 };
22
23 enum uar_file_type
24 {
25 UF_FILE,
26 UF_DIR,
27 UF_LINK
28 };
29
30 struct uar_archive *uar_open (const char *filename);
31 bool uar_has_error (const struct uar_archive *restrict uar);
32 void uar_close (struct uar_archive *uar);
33 const char *uar_strerror (const struct uar_archive *restrict uar);
34 struct uar_archive *uar_create (void);
35 struct uar_file *uar_add_file (struct uar_archive *restrict uar,
36 const char *name, const char *path);
37 void uar_file_set_mode (struct uar_file *file, mode_t mode);
38 bool uar_write (struct uar_archive *uar, const char *filename);
39 struct uar_file *
40 uar_add_dir (struct uar_archive *uar, const char *name, const char *path,
41 bool (*callback) (struct uar_file *file, const char *fullname,
42 const char *fullpath));
43 bool uar_extract (struct uar_archive *uar, const char *cwd,
44 bool (*callback) (struct uar_file *file));
45 const char *uar_get_file_name (const struct uar_file *file);
46 enum uar_file_type uar_get_entry_type (const struct uar_file *file);
47
48 #ifndef NDEBUG
49 void uar_debug_print (const struct uar_archive *uar, bool print_file_contents);
50 #endif
51
52 #endif /* UAR_UAR_H */

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26