|
ginnOS
The reference: libc, the libraries and the kernel
|
librat: the database files. More...
#include "internal.h"#include <dirent.h>#include <errno.h>#include <stdlib.h>#include <string.h>Macros | |
| #define | RECORD_MAX (64u * 1024 * 1024) |
| the largest files record and base.files | |
Functions | |
| int | rat_read_files_record (const char *path, rat_entry_t **entries_out, int *count_out, rat_error_t *err) |
| read the record of the files of a package (installed/<name>/files). | |
| char * | rat_files_record_text (const rat_entry_t *entries, int count) |
| the text of a files record. | |
| int | rat_owners_load (rat_t *rat, rat_owners_t *owners, rat_error_t *err) |
| read base.files and the files records of every installed package. | |
| void | rat_owners_free (rat_owners_t *owners) |
| release the owners | |
| const rat_owned_t * | rat_owners_find (const rat_owners_t *owners, const char *path, int *count_out) |
| the owners of a path. | |
| bool | rat_owned_by_other (const rat_owners_t *owners, const char *path, const char *name) |
| true if the base image, or a package other than name, owns path | |
librat: the database files.
the record of the files of a package, and the owners of all paths.
a files record has one line for each folder, file and link, sorted by path, with four fields that a tab separates:
d 0755 - usr/bin f 0755 <SHA-256 in hex> usr/bin/lua l 0777 lua usr/bin/lua5.4
a path and a link target cannot have a tab or a line break (the reader of package files refuses control characters), so the format needs no escapes.
| #define RECORD_MAX (64u * 1024 * 1024) |
the largest files record and base.files
| int rat_read_files_record | ( | const char * | path, |
| rat_entry_t ** | entries_out, | ||
| int * | count_out, | ||
| rat_error_t * | err ) |
read the record of the files of a package (installed/<name>/files).
| char * rat_files_record_text | ( | const rat_entry_t * | entries, |
| int | count ) |
the text of a files record.
| int rat_owners_load | ( | rat_t * | rat, |
| rat_owners_t * | owners, | ||
| rat_error_t * | err ) |
read base.files and the files records of every installed package.
| void rat_owners_free | ( | rat_owners_t * | owners | ) |
release the owners
| const rat_owned_t * rat_owners_find | ( | const rat_owners_t * | owners, |
| const char * | path, | ||
| int * | count_out ) |
the owners of a path.
| count_out | gets how many there are (0 when none). |
| bool rat_owned_by_other | ( | const rat_owners_t * | owners, |
| const char * | path, | ||
| const char * | name ) |
true if the base image, or a package other than name, owns path