netatalk  4.5.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
appl.c File Reference
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/param.h>
#include <bstrlib.h>
#include <atalk/adouble.h>
#include <atalk/afp.h>
#include <atalk/globals.h>
#include <atalk/logger.h>
#include <atalk/netatalk_conf.h>
#include <atalk/util.h>
#include "desktop.h"
#include "directory.h"
#include "file.h"
#include "volume.h"

Functions

static int pathcmp (char *p, int plen, char *q, int qlen)
 
static int applopen (struct vol *vol, uint8_t creator[4], int flags, int mode)
 
static int copyapplfile (int sfd, int dfd, char *mpath, u_short mplen)
 
static char * makemacpath (const struct vol *vol, char *mpath, int mpathlen, struct dir *dir, char *path)
 build mac. path (backwards) by traversing the directory tree
 
int afp_addappl (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
 
int afp_rmvappl (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
 
int afp_getappl (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
 

Variables

static struct savedt sa = { { 0, 0, 0, 0 }, -1, 0, 0}
 

Function Documentation

◆ afp_addappl()

int afp_addappl ( AFPObj obj,
char *  ibuf,
size_t  ibuflen,
char *  rbuf,
size_t *  rbuflen 
)

◆ afp_getappl()

int afp_getappl ( AFPObj obj,
char *  ibuf,
size_t  ibuflen,
char *  rbuf,
size_t *  rbuflen 
)

◆ afp_rmvappl()

int afp_rmvappl ( AFPObj obj,
char *  ibuf,
size_t  ibuflen,
char *  rbuf,
size_t *  rbuflen 
)

◆ applopen()

static int applopen ( struct vol vol,
uint8_t  creator[4],
int  flags,
int  mode 
)
static

◆ copyapplfile()

static int copyapplfile ( int  sfd,
int  dfd,
char *  mpath,
u_short  mplen 
)
static

copy appls to new file, deleting any matching (old) appl entries

◆ makemacpath()

static char * makemacpath ( const struct vol vol,
char *  mpath,
int  mpathlen,
struct dir dir,
char *  path 
)
static

build mac. path (backwards) by traversing the directory tree

The old way: dir and path refer to an app, path is a mac format pathname. makemacpath() builds something that looks like a cname, but uses upaths instead of mac format paths.

The new way: dir and path refer to an app, path is a mac format pathname. makemacpath() builds a cname. (zero is a path separator and it's not \0 terminated).

See also
afp_getappl() for the backward compatiblity code.

◆ pathcmp()

static int pathcmp ( char *  p,
int  plen,
char *  q,
int  qlen 
)
static

Variable Documentation

◆ sa

struct savedt sa = { { 0, 0, 0, 0 }, -1, 0, 0}
static