netatalk  4.4.0dev
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
ad_conv.c File Reference
#include <arpa/inet.h>
#include <errno.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <sys/param.h>
#include <bstrlib.h>
#include <atalk/adouble.h>
#include <atalk/compat.h>
#include <atalk/dsi.h>
#include <atalk/ea.h>
#include <atalk/errchk.h>
#include <atalk/logger.h>
#include <atalk/unix.h>
#include <atalk/util.h>
#include <atalk/volume.h>
#include "ad_lock.h"

Functions

static int ad_conv_v22ea_hf (const char *path, const struct stat *sp, const struct vol *vol)
static int ad_conv_v22ea_rf (const char *path, const struct stat *sp, const struct vol *vol)
static int ad_conv_v22ea (const char *path, const struct stat *sp, const struct vol *vol)
static int ad_conv_dehex (const char *path, const struct stat *sp, const struct vol *vol, const char **newpathp)
int ad_convert (const char *path, const struct stat *sp, const struct vol *vol, const char **newpath)

Variables

static char emptyfilad [32]
static char emptydirad [32]

Detailed Description

Part of Netatalk's AppleDouble implementatation

See also
include/atalk/adouble.h

Function Documentation

◆ ad_conv_dehex()

int ad_conv_dehex ( const char * path,
const struct stat * sp,
const struct vol * vol,
const char ** newpathp )
static

Remove hexencoded dots and slashes (":2e" and ":2f")

◆ ad_conv_v22ea()

int ad_conv_v22ea ( const char * path,
const struct stat * sp,
const struct vol * vol )
static

◆ ad_conv_v22ea_hf()

int ad_conv_v22ea_hf ( const char * path,
const struct stat * sp,
const struct vol * vol )
static

◆ ad_conv_v22ea_rf()

int ad_conv_v22ea_rf ( const char * path,
const struct stat * sp,
const struct vol * vol )
static

◆ ad_convert()

int ad_convert ( const char * path,
const struct stat * sp,
const struct vol * vol,
const char ** newpath )

AppleDouble and encoding conversion on the fly

Parameters
path(r) path to file or directory
sp(r) stat(path)
vol(r) volume handle
newpath(w) if encoding changed, new name. Can be NULL.
Returns
-1 on internal error, otherwise 0. newpath is NULL if no character conversion was done, otherwise newpath points to a static string with the converted name

Variable Documentation

◆ emptydirad

char emptydirad[32]
static
Initial value:
= {0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0
}

◆ emptyfilad

char emptyfilad[32]
static
Initial value:
= {0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0
}