#include <arpa/inet.h>
#include <signal.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <atalk/globals.h>
#include <atalk/cnid.h>
#include <atalk/compat.h>
#include <atalk/volume.h>
Go to the source code of this file.
|
| void | _log (enum logtype lt, char *fmt,...) |
| |
| void | set_signal (void) |
| |
| int | nad_ls (int argc, char **argv, AFPObj *obj) |
| |
| int | nad_cp (int argc, char **argv, AFPObj *obj) |
| |
| int | nad_rm (int argc, char **argv, AFPObj *obj) |
| |
| int | nad_mv (int argc, char **argv, AFPObj *obj) |
| |
| int | nad_set (int argc, char **argv, AFPObj *obj) |
| |
| int | nad_find (int argc, char **argv, AFPObj *obj) |
| |
| int | nad_mkdir (int argc, char **argv, AFPObj *obj) |
| |
| int | nad_rmdir (int argc, char **argv, AFPObj *obj) |
| |
| int | openvol (AFPObj *obj, const char *path, afpvol_t *vol) |
| | Load volinfo and initialize struct vol.
|
| |
| int | openvol_optional (AFPObj *obj, const char *path, afpvol_t *vol) |
| | Open an AFP volume, or return a stub for non-AFP paths.
|
| |
| void | closevol (afpvol_t *vol) |
| |
| cnid_t | cnid_for_paths_parent (const afpvol_t *vol, const char *path, cnid_t *did) |
| | Resolves CNID of a given paths parent directory.
|
| |
| char * | utompath (const struct vol *, const char *) |
| |
| int | convert_dots_encoding (const afpvol_t *svol, const afpvol_t *dvol, char *path) |
| | Convert dot encoding of basename in place
|
| |
◆ ADVOL_V2_OR_EA
◆ DIR_DOT_OR_DOTDOT
| #define DIR_DOT_OR_DOTDOT |
( |
|
a | ) |
((strcmp(a, ".") == 0) || (strcmp(a, "..") == 0)) |
◆ ERROR
Value: do { \
_log(
STD, __VA_ARGS__); \
exit(1); \
} while (0)
◆ SLOG
| #define SLOG |
( |
|
... | ) |
_log(STD, __VA_ARGS__) |
◆ logtype
◆ _log()
| void _log |
( |
enum logtype |
lt, |
|
|
char * |
fmt, |
|
|
|
... |
|
) |
| |
|
extern |
◆ closevol()
◆ cnid_for_paths_parent()
Resolves CNID of a given paths parent directory.
path might be: (a) relative: "dir/subdir" with cwd: "/afp_volume/topdir" (b) absolute: "/afp_volume/dir/subdir"
path MUST be pointing inside vol, this is usually the case as vol has been build from path using loadvolinfo and friends.
- Parameters
-
| [in] | vol | pointer to afpvol_t |
| [in] | path | path, see above |
| [in,out] | did | parent CNID of returned CNID |
- Returns
- CNID of path
◆ convert_dots_encoding()
| int convert_dots_encoding |
( |
const afpvol_t * |
svol, |
|
|
const afpvol_t * |
dvol, |
|
|
char * |
path |
|
) |
| |
|
extern |
Convert dot encoding of basename in place
path arg can be "[/][dir/ | ...]filename". It will be converted in place possible encoding ".file" as ":2efile" which means the result will be longer then the original which means provide a big enough buffer.
- Parameters
-
| [in] | svol | source volume |
| [in] | dvol | destination volume |
| [in,out] | path | path to convert in place |
- Returns
- 0 on success, -1 on error
◆ nad_cp()
| int nad_cp |
( |
int |
argc, |
|
|
char ** |
argv, |
|
|
AFPObj * |
obj |
|
) |
| |
|
extern |
◆ nad_find()
| int nad_find |
( |
int |
argc, |
|
|
char ** |
argv, |
|
|
AFPObj * |
obj |
|
) |
| |
|
extern |
◆ nad_ls()
| int nad_ls |
( |
int |
argc, |
|
|
char ** |
argv, |
|
|
AFPObj * |
obj |
|
) |
| |
|
extern |
◆ nad_mkdir()
| int nad_mkdir |
( |
int |
argc, |
|
|
char ** |
argv, |
|
|
AFPObj * |
obj |
|
) |
| |
|
extern |
◆ nad_mv()
| int nad_mv |
( |
int |
argc, |
|
|
char ** |
argv, |
|
|
AFPObj * |
obj |
|
) |
| |
|
extern |
◆ nad_rm()
| int nad_rm |
( |
int |
argc, |
|
|
char ** |
argv, |
|
|
AFPObj * |
obj |
|
) |
| |
|
extern |
◆ nad_rmdir()
| int nad_rmdir |
( |
int |
argc, |
|
|
char ** |
argv, |
|
|
AFPObj * |
obj |
|
) |
| |
|
extern |
◆ nad_set()
| int nad_set |
( |
int |
argc, |
|
|
char ** |
argv, |
|
|
AFPObj * |
obj |
|
) |
| |
|
extern |
◆ openvol()
Load volinfo and initialize struct vol.
The path must be inside an AFP volume. Returns -1 if it is not.
- Parameters
-
| [in] | obj | AFPObj of the current connection |
| [in] | path | path to evaluate |
| [in,out] | vol | structure to initialize |
- Returns
- 0 on success, -1 on error
◆ openvol_optional()
| int openvol_optional |
( |
AFPObj * |
obj, |
|
|
const char * |
path, |
|
|
afpvol_t * |
vol |
|
) |
| |
|
extern |
Open an AFP volume, or return a stub for non-AFP paths.
If the path is inside an AFP volume, the volume's CNID database is opened. If the path is outside any AFP volume, a stub volume with v_path=NULL and v_cdb=NULL is returned so that callers can use v_path as a guard for AFP-specific operations.
This is intended for commands like mv and cp that may operate across AFP and non-AFP paths.
- Parameters
-
| [in] | obj | AFPObj of the current connection |
| [in] | path | path to evaluate |
| [in,out] | vol | structure to initialize |
- Returns
- 0 on success, -1 on error
◆ set_signal()
◆ utompath()
| char * utompath |
( |
const struct vol * |
, |
|
|
const char * |
|
|
) |
| |
|
extern |
◆ alarmed
| volatile sig_atomic_t alarmed |
|
extern |
Signal flag for clean exit
flags for signals
◆ fflag
◆ iflag
◆ lflag
◆ log_verbose
◆ nflag
◆ pflag
◆ vflag