netatalk  4.4.0dev
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
nad_cp.c File Reference
#include <errno.h>
#include <libgen.h>
#include <limits.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <bstrlib.h>
#include <atalk/adouble.h>
#include <atalk/queue.h>
#include <atalk/unix.h>
#include <atalk/util.h>
#include <atalk/vfs.h>
#include <atalk/volume.h>
#include "nad.h"
#include "ftw.h"

Macros

#define STRIP_TRAILING_SLASH(p)
#define PHYSPAGES_THRESHOLD   (32*1024)
#define BUFSIZE_MAX   (2*1024*1024)
#define MAXPHYS   (64 * 1024)
#define BUFSIZE_SMALL   (MAXPHYS)
#define YESNO   "(y/n [n]) "

Enumerations

enum  op { FILE_TO_FILE , FILE_TO_DIR , DIR_TO_DNE }

Functions

static int copy (const char *fpath, const struct stat *sb, int tflag, struct FTW *ftwbuf)
static int ftw_copy_file (const struct FTW *, const char *, const struct stat *, int)
static int ftw_copy_link (const struct FTW *, const char *, const struct stat *, int)
static int setfile (const struct stat *, int)
static void upfunc (void)
static void sig_handler (int signo _U_)
static void set_signal (void)
static void usage_cp (void)
int ad_cp (int argc, char *argv[], AFPObj *obj)
static int ftw_copy_file (const struct FTW *entp _U_, const char *spath, const struct stat *sp, int dne)
static int ftw_copy_link (const struct FTW *p _U_, const char *spath, const struct stat *sstp, int exists)

Variables

static char emptystring [] = ""
PATH_T to = { to.p_path, emptystring, "" }
int fflag
int iflag
int nflag
int pflag
int vflag
mode_t mask
cnid_t ppdid
cnid_t pdid
cnid_t did
static afpvol_t svolume
static afpvol_t dvolume
static enum op type
static int Rflag
static volatile sig_atomic_t alarmed
static int badcp
static int rval
static int ftw_options = FTW_MOUNT | FTW_PHYS | FTW_ACTIONRETVAL

Macro Definition Documentation

◆ BUFSIZE_MAX

#define BUFSIZE_MAX   (2*1024*1024)

◆ BUFSIZE_SMALL

#define BUFSIZE_SMALL   (MAXPHYS)

◆ MAXPHYS

#define MAXPHYS   (64 * 1024)

◆ PHYSPAGES_THRESHOLD

#define PHYSPAGES_THRESHOLD   (32*1024)

◆ STRIP_TRAILING_SLASH

#define STRIP_TRAILING_SLASH ( p)
Value:
{ \
while ((p).p_end > (p).p_path + 1 && (p).p_end[-1] == '/') \
*--(p).p_end = 0; \
}
static gcry_mpi_t p
Definition uams_dhx2_pam.c:39

◆ YESNO

#define YESNO   "(y/n [n]) "

Enumeration Type Documentation

◆ op

enum op
Enumerator
FILE_TO_FILE 
FILE_TO_DIR 
DIR_TO_DNE 

Function Documentation

◆ ad_cp()

int ad_cp ( int argc,
char * argv[],
AFPObj * obj )

◆ copy()

int copy ( const char * fpath,
const struct stat * sb,
int tflag _U_,
struct FTW * ftwbuf )
static

◆ ftw_copy_file() [1/2]

int ftw_copy_file ( const struct FTW * ,
const char * ,
const struct stat * ,
int  )
static

◆ ftw_copy_file() [2/2]

int ftw_copy_file ( const struct FTW *entp _U_,
const char * spath,
const struct stat * sp,
int dne )
static

◆ ftw_copy_link() [1/2]

int ftw_copy_link ( const struct FTW * ,
const char * ,
const struct stat * ,
int  )
static

◆ ftw_copy_link() [2/2]

int ftw_copy_link ( const struct FTW *p _U_,
const char * spath,
const struct stat * sstp,
int exists )
static

◆ set_signal()

void set_signal ( void )
static

◆ setfile()

int setfile ( const struct stat * fs,
int fd )
static

◆ sig_handler()

void sig_handler ( int signo _U_)
static

◆ upfunc()

void upfunc ( void )
static

◆ usage_cp()

void usage_cp ( void )
static

Variable Documentation

◆ alarmed

volatile sig_atomic_t alarmed
static

◆ badcp

int badcp
static

◆ did

cnid_t did

◆ dvolume

afpvol_t dvolume
static

◆ emptystring

char emptystring[] = ""
static

◆ fflag

int fflag

◆ ftw_options

int ftw_options = FTW_MOUNT | FTW_PHYS | FTW_ACTIONRETVAL
static

◆ iflag

int iflag

◆ mask

mode_t mask

◆ nflag

int nflag

◆ pdid

cnid_t pdid

◆ pflag

int pflag

◆ ppdid

cnid_t ppdid

◆ Rflag

int Rflag
static

◆ rval

int rval
static

◆ svolume

afpvol_t svolume
static

◆ to

PATH_T to = { to.p_path, emptystring, "" }

◆ type

enum op type
static

◆ vflag

int vflag