#include <errno.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/param.h>#include <utime.h>#include <atalk/adouble.h>#include <atalk/afp.h>#include <atalk/cnid.h>#include <atalk/dsi.h>#include <atalk/fce_api.h>#include <atalk/globals.h>#include <atalk/logger.h>#include <atalk/netatalk_conf.h>#include <atalk/spotlight.h>#include <atalk/unix.h>#include <atalk/util.h>#include <atalk/vfs.h>#include "desktop.h"#include "dircache.h"#include "directory.h"#include "file.h"#include "filedir.h"#include "fork.h"#include "unix.h"#include "volume.h"Data Structures | |
| struct | reenum |
Macros | |
| #define | PARAM_NEED_ADP(b) |
| #define | APPLETEMP ".AppleTempXXXXXX" |
Functions | |
| static int | default_type (void *finder) |
| void * | get_finderinfo (const struct vol *vol, const char *upath, struct adouble *adp, void *data, int islink) |
| char * | set_name (const struct vol *vol, char *data, cnid_t pid, char *name, cnid_t id, uint32_t utf8) |
| uint32_t | get_id (struct vol *vol, struct adouble *adp, const struct stat *st, const cnid_t did, const char *upath, const int len) |
| Get CNID for did/upath args both from database and adouble file. | |
| int | getmetadata (const AFPObj *obj, struct vol *vol, uint16_t bitmap, struct path *path, struct dir *dir, char *buf, size_t *buflen, struct adouble *adp) |
| int | getfilparams (const AFPObj *obj, struct vol *vol, uint16_t bitmap, struct path *path, struct dir *dir, char *buf, size_t *buflen, int in_enumerate) |
| int | afp_createfile (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) |
| int | afp_setfilparams (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) |
| int | setfilparams (const AFPObj *obj, struct vol *vol, struct path *path, uint16_t f_bitmap, char *buf) |
| int | renamefile (struct vol *vol, struct dir *ddir, int sdir_fd, char *src, char *dst, char *newname, struct adouble *adp) |
| Rename a file, including its resource fork and mac name. | |
| size_t | mtoUTF8 (const struct vol *vol, const char *src, size_t srclen, char *dest, size_t destlen) |
| int | copy_path_name (const struct vol *vol, char *newname, char *ibuf) |
| int | afp_copyfile (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) |
| int | copyfile (struct vol *s_vol, struct vol *d_vol, struct dir *d_dir, int sfd, char *src, char *dst, char *newname, struct adouble *adp) |
| static int | check_attrib (const struct vol *vol, struct adouble *adp) |
| int | deletefile (const struct vol *vol, int dirfd, char *file, int checkAttrib) |
| int | afp_createid (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) |
| static int | reenumerate_loop (struct dirent *de, char *mname, void *data) |
| static int | reenumerate_id (struct vol *vol, char *name, struct dir *dir) |
| int | afp_resolveid (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) |
| int | afp_deleteid (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) |
| static struct adouble * | find_adouble (const AFPObj *obj, struct vol *vol, struct path *path, struct ofork **of, struct adouble *adp) |
| int | afp_exchangefiles (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) |
Variables | |
| const uint8_t | ufinderi [ADEDLEN_FINDERI] |
| static const uint8_t | old_ufinderi [] |
| struct path | Cur_Path |
| #define APPLETEMP ".AppleTempXXXXXX" |
| #define PARAM_NEED_ADP | ( | b | ) |
| int afp_copyfile | ( | AFPObj * | obj, |
| char * | ibuf, | ||
| size_t | ibuflen, | ||
| char * | rbuf, | ||
| size_t * | rbuflen ) |
| int afp_createfile | ( | AFPObj * | obj, |
| char * | ibuf, | ||
| size_t | ibuflen, | ||
| char * | rbuf, | ||
| size_t * | rbuflen ) |
| int afp_createid | ( | AFPObj * | obj, |
| char * | ibuf, | ||
| size_t | ibuflen, | ||
| char * | rbuf, | ||
| size_t * | rbuflen ) |
| int afp_deleteid | ( | AFPObj * | obj, |
| char * | ibuf, | ||
| size_t | ibuflen, | ||
| char * | rbuf, | ||
| size_t * | rbuflen ) |
| int afp_exchangefiles | ( | AFPObj * | obj, |
| char * | ibuf, | ||
| size_t | ibuflen, | ||
| char * | rbuf, | ||
| size_t * | rbuflen ) |
| int afp_resolveid | ( | AFPObj * | obj, |
| char * | ibuf, | ||
| size_t | ibuflen, | ||
| char * | rbuf, | ||
| size_t * | rbuflen ) |
resolve a file id
| int afp_setfilparams | ( | AFPObj * | obj, |
| char * | ibuf, | ||
| size_t | ibuflen, | ||
| char * | rbuf, | ||
| size_t * | rbuflen ) |
| int copy_path_name | ( | const struct vol * | vol, |
| char * | newname, | ||
| char * | ibuf ) |
| int copyfile | ( | struct vol * | s_vol, |
| struct vol * | d_vol, | ||
| struct dir * | d_dir, | ||
| int | sfd, | ||
| char * | src, | ||
| char * | dst, | ||
| char * | newname, | ||
| struct adouble * | adp ) |
|
static |
| int deletefile | ( | const struct vol * | vol, |
| int | dirfd, | ||
| char * | file, | ||
| int | checkAttrib ) |
|
static |
| void * get_finderinfo | ( | const struct vol * | vol, |
| const char * | upath, | ||
| struct adouble * | adp, | ||
| void * | data, | ||
| int | islink ) |
| uint32_t get_id | ( | struct vol * | vol, |
| struct adouble * | adp, | ||
| const struct stat * | st, | ||
| const cnid_t | did, | ||
| const char * | upath, | ||
| const int | len ) |
Get CNID for did/upath args both from database and adouble file.
| [in,out] | vol | volume |
| [in,out] | adp | adouble struct of object upath, might be NULL |
| [in] | st | stat of upath, must NOT be NULL |
| [in] | did | parent CNID of upath |
| [in] | upath | name of object |
| [in] | len | strlen of upath |
| int getfilparams | ( | const AFPObj * | obj, |
| struct vol * | vol, | ||
| uint16_t | bitmap, | ||
| struct path * | path, | ||
| struct dir * | dir, | ||
| char * | buf, | ||
| size_t * | buflen, | ||
| int | in_enumerate ) |
| int getmetadata | ( | const AFPObj * | obj, |
| struct vol * | vol, | ||
| uint16_t | bitmap, | ||
| struct path * | path, | ||
| struct dir * | dir, | ||
| char * | buf, | ||
| size_t * | buflen, | ||
| struct adouble * | adp ) |
| size_t mtoUTF8 | ( | const struct vol * | vol, |
| const char * | src, | ||
| size_t | srclen, | ||
| char * | dest, | ||
| size_t | destlen ) |
convert a Mac long name to an utf8 name
|
static |
| int renamefile | ( | struct vol * | vol, |
| struct dir * | ddir, | ||
| int | sdir_fd, | ||
| char * | src, | ||
| char * | dst, | ||
| char * | newname, | ||
| struct adouble * | adp ) |
Rename a file, including its resource fork and mac name.
renamefile and copyfile take the old and new unix pathnames and the new mac name.
| vol | volume structure |
| ddir | dest dir structure |
| sdir_fd | source dir fd to which src path is relative (for openat et al semantics) passing -1 means this is not used, src path is a full path |
| src | the source path |
| dst | the dest filename in current dir |
| newname | the dest mac name |
| adp | adouble struct of src file, if open, or & zeroed one |
| char * set_name | ( | const struct vol * | vol, |
| char * | data, | ||
| cnid_t | pid, | ||
| char * | name, | ||
| cnid_t | id, | ||
| uint32_t | utf8 ) |
| int setfilparams | ( | const AFPObj * | obj, |
| struct vol * | vol, | ||
| struct path * | path, | ||
| uint16_t | f_bitmap, | ||
| char * | buf ) |
|
extern |
|
static |
| const uint8_t ufinderi[ADEDLEN_FINDERI] |