|
static int | ad_mkrf (const char *path) |
static int | ad_header_read (const char *path, struct adouble *ad, const struct stat *hst) |
static int | ad_header_upgrade (struct adouble *ad, const char *name) |
static int | ad_header_read_ea (const char *path, struct adouble *ad, const struct stat *hst) |
static int | ad_header_upgrade_ea (struct adouble *ad, const char *name) |
off_t | ad_reso_size (const char *path, int adflags, struct adouble *ad) |
static int | ad_mkrf_osx (const char *path) |
const char * | adflags2logstr (int adflags) |
const char * | openflags2logstr (int oflags) |
static uint32_t | get_eid (uint32_t eid) |
int | ad_init_offsets (struct adouble *ad) |
static int | new_ad_header (struct adouble *ad, const char *path, struct stat *stp, int adflags) |
static int | parse_entries (struct adouble *ad, uint16_t nentries, size_t valid_data_len) |
int | ad_valid_header_osx (const char *path) |
static int | ad_convert_osx (const char *path, struct adouble *ad) |
static int | ad_header_read_osx (const char *path, struct adouble *ad, struct stat *hst) |
static int | ad_header_read_ea (const char *path, struct adouble *ad, const struct stat *hst _U_) |
static int | ad_mkrf_osx (const char *path _U_) |
static int | ad_chown (const char *path, struct stat *stbuf) |
static int | ad_mode_st (const char *path, mode_t *mode, struct stat *stbuf) |
static int | ad_header_upgrade (struct adouble *ad _U_, const char *name _U_) |
static int | ad_header_upgrade_ea (struct adouble *ad _U_, const char *name _U_) |
static int | ad_error (struct adouble *ad, int adflags) |
static int | ad2openflags (const struct adouble *ad, int adfile, int adflags) |
static int | ad_open_df (const char *path, int adflags, mode_t mode, struct adouble *ad) |
static int | ad_open_hf_v2 (const char *path, int adflags, mode_t mode, struct adouble *ad) |
static int | ad_open_hf_ea (const char *path, int adflags, int mode _U_, struct adouble *ad) |
static int | ad_open_hf (const char *path, int adflags, int mode, struct adouble *ad) |
off_t | ad_reso_size (const char *path, int adflags, struct adouble *ad _U_) |
static int | ad_open_rf_v2 (const char *path, int adflags, int mode _U_, struct adouble *ad) |
static int | ad_open_rf_ea (const char *path, int adflags, int mode, struct adouble *ad) |
static int | ad_open_rf (const char *path, int adflags, int mode, struct adouble *ad) |
static bool | ad_entry_check_size (uint32_t eid, size_t bufsize, uint32_t off, uint32_t got_len) |
void * | ad_entry (const struct adouble *ad, int eid) |
off_t | ad_getentryoff (const struct adouble *ad, int eid) |
const char * | ad_path_ea (const char *path, int adflags _U_) |
const char * | ad_path_osx (const char *path, int adflags _U_) |
const char * | ad_path (const char *path, int adflags) |
char * | ad_dir (const char *path) |
int | ad_setfuid (const uid_t id) |
uid_t | ad_getfuid (void) |
int | ad_stat (const char *path, struct stat *stbuf) |
int | ad_mode (const char *path, mode_t mode) |
int | ad_mkdir (const char *path, mode_t mode) |
static void | ad_init_func (struct adouble *ad) |
void | ad_init_old (struct adouble *ad, int flags, int options) |
void | ad_init (struct adouble *ad, const struct vol *restrict vol) |
int | ad_open (struct adouble *ad, const char *path, int adflags,...) |
int | ad_metadata (const char *name, int flags, struct adouble *adp) |
| open metadata, possibly as root
|
int | ad_metadataat (int dirfd, const char *name, int flags, struct adouble *adp) |
int | ad_refresh (const char *path, struct adouble *ad) |
int | ad_openat (struct adouble *ad, int dirfd, const char *path, int adflags,...) |
mode_t | ad_hf_mode (mode_t mode) |
Part of Netatalk's AppleDouble implementatation
- See also
- include/atalk/adouble.h
int ad_open |
( |
struct adouble * | ad, |
|
|
const char * | path, |
|
|
int | adflags, |
|
|
| ... ) |
Open data-, metadata(header)- or resource fork
ad_open(struct adouble *ad, const char *path, int adflags, int flags) ad_open(struct adouble *ad, const char *path, int adflags, int flags, mode_t mode)
You must call ad_init() before ad_open, usually you'll just call it like this:
struct adoube ad;
void ad_init(struct adouble *, const struct vol *restrict)
Definition include/atalk/volume.h:32
int v_ad_options
Definition include/atalk/volume.h:53
int v_adouble
Definition include/atalk/volume.h:51
Open a files data fork, metadata fork or resource fork.
- Parameters
-
ad | (rw) pointer to struct adouble |
path | (r) Path to file or directory |
adflags | (r) Flags specifying which fork to open, can be or'd: ADFLAGS_DF: open data fork ADFLAGS_RF: open resource fork ADFLAGS_HF: open header (metadata) file ADFLAGS_NOHF: it's not an error if header file couldn't be opened ADFLAGS_NORF: it's not an error if reso fork couldn't be opened ADFLAGS_DIR: if path is a directory you MUST or ADFLAGS_DIR to adflags |
Access mode for the forks: ADFLAGS_RDONLY: open read only ADFLAGS_RDWR: open read write
Creation flags: ADFLAGS_CREATE: create if not existing ADFLAGS_TRUNC: truncate
Special flags: ADFLAGS_CHECK_OF: check for open forks from us and other afpd's ADFLAGS_SETSHRMD: this adouble struct will be used to set sharemode locks. This basically results in the files being opened RW instead of RDONLY.
- Parameters
-
... | (r) mode used with O_CREATE |
The open mode flags (rw vs ro) have to take into account all the following requirements:
- we remember open fds for files because me must avoid a single close releasing fcntl locks for other fds of the same file
BUGS:
- on Solaris (HAVE_EAFD) ADFLAGS_RF doesn't work without ADFLAGS_HF, because it checks whether ad_meta_fileno() is already openend. As a workaround pass ADFLAGS_SETSHRMD.
- Returns
- 0 on success, any other value indicates an error