netatalk  4.4.0dev
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
file.h File Reference
#include <arpa/inet.h>
#include <sys/param.h>
#include <atalk/adouble.h>
#include <atalk/globals.h>
#include "directory.h"
#include "volume.h"

Go to the source code of this file.

Macros

#define FILPBIT_ATTR   0
#define FILPBIT_PDID   1
#define FILPBIT_CDATE   2
#define FILPBIT_MDATE   3
#define FILPBIT_BDATE   4
#define FILPBIT_FINFO   5
#define FILPBIT_LNAME   6
#define FILPBIT_SNAME   7
#define FILPBIT_FNUM   8
#define FILPBIT_DFLEN   9
#define FILPBIT_RFLEN   10
#define FILPBIT_EXTDFLEN   11
#define FILPBIT_PDINFO   13 /* ProDOS Info/ UTF8 name */
#define FILPBIT_EXTRFLEN   14
#define FILPBIT_UNIXPR   15
#define kTextEncodingUTF8   0x08000103

Enumerations

enum  kTextEncoding_t {
  kTextEncodingMacRoman = 0L , kTextEncodingMacJapanese = 1 , kTextEncodingMacChineseTrad = 2 , kTextEncodingMacKorean = 3 ,
  kTextEncodingMacArabic = 4 , kTextEncodingMacHebrew = 5 , kTextEncodingMacGreek = 6 , kTextEncodingMacCyrillic = 7 ,
  kTextEncodingMacDevanagari = 9 , kTextEncodingMacGurmukhi = 10 , kTextEncodingMacGujarati = 11 , kTextEncodingMacOriya = 12 ,
  kTextEncodingMacBengali = 13 , kTextEncodingMacTamil = 14 , kTextEncodingMacTelugu = 15 , kTextEncodingMacKannada = 16 ,
  kTextEncodingMacMalayalam = 17 , kTextEncodingMacSinhalese = 18 , kTextEncodingMacBurmese = 19 , kTextEncodingMacKhmer = 20 ,
  kTextEncodingMacThai = 21 , kTextEncodingMacLaotian = 22 , kTextEncodingMacGeorgian = 23 , kTextEncodingMacArmenian = 24 ,
  kTextEncodingMacChineseSimp = 25 , kTextEncodingMacTibetan = 26 , kTextEncodingMacMongolian = 27 , kTextEncodingMacEthiopic = 28 ,
  kTextEncodingMacCentralEurRoman = 29 , kTextEncodingMacVietnamese = 30 , kTextEncodingMacExtArabic = 31 , kTextEncodingMacSymbol = 33 ,
  kTextEncodingMacDingbats = 34 , kTextEncodingMacTurkish = 35 , kTextEncodingMacCroatian = 36 , kTextEncodingMacIcelandic = 37 ,
  kTextEncodingMacRomanian = 38 , kTextEncodingMacCeltic = 39 , kTextEncodingMacGaelic = 40 , kTextEncodingMacKeyboardGlyphs = 41
}

Functions

char * set_name (const struct vol *, char *, cnid_t, char *, cnid_t, uint32_t)
struct extmapgetextmap (const char *)
struct extmapgetdefextmap (void)
int getfilparams (const AFPObj *obj, struct vol *, uint16_t, struct path *, struct dir *, char *buf, size_t *, int)
int setfilparams (const AFPObj *obj, struct vol *, struct path *, uint16_t, char *)
int renamefile (struct vol *, struct dir *, int, char *, char *, char *, struct adouble *)
int copyfile (struct vol *, struct vol *, struct dir *, int, char *, char *, char *, struct adouble *)
int deletefile (const struct vol *, int, char *, int)
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)
void * get_finderinfo (const struct vol *, const char *, struct adouble *, void *, int)
size_t mtoUTF8 (const struct vol *, const char *, size_t, char *, size_t)
int copy_path_name (const struct vol *, char *, char *i)
uint32_t get_id (struct vol *, struct adouble *, const struct stat *, cnid_t, const char *, int)
 Get CNID for did/upath args both from database and adouble file.
int afp_exchangefiles (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 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_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)

Variables

const uint8_t ufinderi []

Macro Definition Documentation

◆ FILPBIT_ATTR

#define FILPBIT_ATTR   0

◆ FILPBIT_BDATE

#define FILPBIT_BDATE   4

◆ FILPBIT_CDATE

#define FILPBIT_CDATE   2

◆ FILPBIT_DFLEN

#define FILPBIT_DFLEN   9

◆ FILPBIT_EXTDFLEN

#define FILPBIT_EXTDFLEN   11

◆ FILPBIT_EXTRFLEN

#define FILPBIT_EXTRFLEN   14

◆ FILPBIT_FINFO

#define FILPBIT_FINFO   5

◆ FILPBIT_FNUM

#define FILPBIT_FNUM   8

◆ FILPBIT_LNAME

#define FILPBIT_LNAME   6

◆ FILPBIT_MDATE

#define FILPBIT_MDATE   3

◆ FILPBIT_PDID

#define FILPBIT_PDID   1

◆ FILPBIT_PDINFO

#define FILPBIT_PDINFO   13 /* ProDOS Info/ UTF8 name */

◆ FILPBIT_RFLEN

#define FILPBIT_RFLEN   10

◆ FILPBIT_SNAME

#define FILPBIT_SNAME   7

◆ FILPBIT_UNIXPR

#define FILPBIT_UNIXPR   15

◆ kTextEncodingUTF8

#define kTextEncodingUTF8   0x08000103

Enumeration Type Documentation

◆ kTextEncoding_t

Enumerator
kTextEncodingMacRoman 
kTextEncodingMacJapanese 
kTextEncodingMacChineseTrad 
kTextEncodingMacKorean 
kTextEncodingMacArabic 
kTextEncodingMacHebrew 
kTextEncodingMacGreek 
kTextEncodingMacCyrillic 
kTextEncodingMacDevanagari 
kTextEncodingMacGurmukhi 
kTextEncodingMacGujarati 
kTextEncodingMacOriya 
kTextEncodingMacBengali 
kTextEncodingMacTamil 
kTextEncodingMacTelugu 
kTextEncodingMacKannada 
kTextEncodingMacMalayalam 
kTextEncodingMacSinhalese 
kTextEncodingMacBurmese 
kTextEncodingMacKhmer 
kTextEncodingMacThai 
kTextEncodingMacLaotian 
kTextEncodingMacGeorgian 
kTextEncodingMacArmenian 
kTextEncodingMacChineseSimp 
kTextEncodingMacTibetan 
kTextEncodingMacMongolian 
kTextEncodingMacEthiopic 
kTextEncodingMacCentralEurRoman 
kTextEncodingMacVietnamese 
kTextEncodingMacExtArabic 
kTextEncodingMacSymbol 
kTextEncodingMacDingbats 
kTextEncodingMacTurkish 
kTextEncodingMacCroatian 
kTextEncodingMacIcelandic 
kTextEncodingMacRomanian 
kTextEncodingMacCeltic 
kTextEncodingMacGaelic 
kTextEncodingMacKeyboardGlyphs 

Function Documentation

◆ afp_copyfile()

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

◆ afp_createfile()

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

◆ afp_createid()

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

◆ afp_deleteid()

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

◆ afp_exchangefiles()

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

◆ afp_resolveid()

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

◆ afp_setfilparams()

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

◆ copy_path_name()

int copy_path_name ( const struct vol * vol,
char * newname,
char * i )
extern

◆ copyfile()

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 )
extern

◆ deletefile()

int deletefile ( const struct vol * vol,
int dirfd,
char * file,
int checkAttrib )
extern

◆ get_finderinfo()

void * get_finderinfo ( const struct vol * vol,
const char * upath,
struct adouble * adp,
void * data,
int islink )
extern

Only enter if no appledouble information and no finder information found.

◆ get_id()

uint32_t get_id ( struct vol * vol,
struct adouble * adp,
const struct stat * st,
const cnid_t did,
const char * upath,
const int len )
extern

Get CNID for did/upath args both from database and adouble file.

  1. Get the objects CNID as stored in its adouble file
  2. Get the objects CNID from the database
  3. Store resource fork data
Parameters
vol(rw) volume
adp(rw) adouble struct of object upath, might be NULL
st(r) stat of upath, must NOT be NULL
did(r) parent CNID of upath
upath(r) name of object
len(r) strlen of upath

◆ getdefextmap()

struct extmap * getdefextmap ( void )
extern

◆ getextmap()

struct extmap * getextmap ( const char * path)
extern

◆ getfilparams()

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 )
extern

◆ getmetadata()

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 )
extern

◆ mtoUTF8()

size_t mtoUTF8 ( const struct vol * vol,
const char * src,
size_t srclen,
char * dest,
size_t destlen )
extern

◆ renamefile()

int renamefile ( struct vol * vol,
struct dir * ddir,
int sdir_fd,
char * src,
char * dst,
char * newname,
struct adouble * adp )
extern

◆ set_name()

char * set_name ( const struct vol * vol,
char * data,
cnid_t pid,
char * name,
cnid_t id,
uint32_t utf8 )
extern

◆ setfilparams()

int setfilparams ( const AFPObj * obj,
struct vol * vol,
struct path * path,
uint16_t f_bitmap,
char * buf )
extern

Variable Documentation

◆ ufinderi

const uint8_t ufinderi[]
extern