netatalk 4.5.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
afpd/file.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 1990,1991 Regents of The University of Michigan.
3 * All Rights Reserved.
4 *
5 * Permission to use, copy, modify, and distribute this software and
6 * its documentation for any purpose and without fee is hereby granted,
7 * provided that the above copyright notice appears in all copies and
8 * that both that copyright notice and this permission notice appear
9 * in supporting documentation, and that the name of The University
10 * of Michigan not be used in advertising or publicity pertaining to
11 * distribution of the software without specific, written prior
12 * permission. This software is supplied as is without expressed or
13 * implied warranties of any kind.
14 *
15 * Research Systems Unix Group
16 * The University of Michigan
17 * c/o Mike Clark
18 * 535 W. William Street
19 * Ann Arbor, Michigan
20 * +1-313-763-0525
21 * netatalk@itd.umich.edu
22 */
23
24#ifndef AFPD_FILE_H
25#define AFPD_FILE_H 1
26
27#include <arpa/inet.h>
28#include <sys/param.h>
29/*#include <sys/stat.h>*/ /* including it here causes some confusion */
30
31#include <atalk/adouble.h>
32#include <atalk/globals.h>
33
34#include "directory.h"
35#include "volume.h"
36
37 extern const uint8_t ufinderi[];
38
39#define FILPBIT_ATTR 0
40#define FILPBIT_PDID 1
41#define FILPBIT_CDATE 2
42#define FILPBIT_MDATE 3
43#define FILPBIT_BDATE 4
44#define FILPBIT_FINFO 5
45#define FILPBIT_LNAME 6
46#define FILPBIT_SNAME 7
47#define FILPBIT_FNUM 8
48#define FILPBIT_DFLEN 9
49#define FILPBIT_RFLEN 10
50#define FILPBIT_EXTDFLEN 11
51#define FILPBIT_PDINFO 13
52#define FILPBIT_EXTRFLEN 14
53#define FILPBIT_UNIXPR 15
54
55#define kTextEncodingUTF8 0x08000103
56
58 typedef enum {
59 kTextEncodingMacRoman = 0L,
60 kTextEncodingMacJapanese = 1,
61 kTextEncodingMacChineseTrad = 2,
62 kTextEncodingMacKorean = 3,
63 kTextEncodingMacArabic = 4,
64 kTextEncodingMacHebrew = 5,
65 kTextEncodingMacGreek = 6,
66 kTextEncodingMacCyrillic = 7,
67 kTextEncodingMacDevanagari = 9,
68 kTextEncodingMacGurmukhi = 10,
69 kTextEncodingMacGujarati = 11,
70 kTextEncodingMacOriya = 12,
71 kTextEncodingMacBengali = 13,
72 kTextEncodingMacTamil = 14,
73 kTextEncodingMacTelugu = 15,
74 kTextEncodingMacKannada = 16,
75 kTextEncodingMacMalayalam = 17,
76 kTextEncodingMacSinhalese = 18,
77 kTextEncodingMacBurmese = 19,
78 kTextEncodingMacKhmer = 20,
79 kTextEncodingMacThai = 21,
80 kTextEncodingMacLaotian = 22,
81 kTextEncodingMacGeorgian = 23,
82 kTextEncodingMacArmenian = 24,
83 kTextEncodingMacChineseSimp = 25,
84 kTextEncodingMacTibetan = 26,
85 kTextEncodingMacMongolian = 27,
86 kTextEncodingMacEthiopic = 28,
87 kTextEncodingMacCentralEurRoman = 29,
88 kTextEncodingMacVietnamese = 30,
89 kTextEncodingMacExtArabic = 31,
90 kTextEncodingMacSymbol = 33,
91 kTextEncodingMacDingbats = 34,
92 kTextEncodingMacTurkish = 35,
93 kTextEncodingMacCroatian = 36,
94 kTextEncodingMacIcelandic = 37,
95 kTextEncodingMacRomanian = 38,
96 kTextEncodingMacCeltic = 39,
97 kTextEncodingMacGaelic = 40,
98 kTextEncodingMacKeyboardGlyphs = 41,
99} kTextEncoding_t;
100
101 extern char *set_name(const struct vol *, char *, cnid_t, char *, cnid_t,
102 uint32_t);
103
104 extern struct extmap *getextmap(const char *);
105 extern struct extmap *getdefextmap(void);
106
107 extern int getfilparams(const AFPObj *obj, struct vol *, uint16_t,
108 struct path *,
109 struct dir *, char *buf, size_t *, int skip_fork_check);
110 extern int setfilparams(const AFPObj *obj, struct vol *, struct path *,
111 uint16_t, char *);
112 extern int renamefile(struct vol *, struct dir *, int, char *, char *, char *,
113 struct adouble *);
114 extern int copyfile(struct vol *, struct vol *, struct dir *, int, char *,
115 char *, char *, struct adouble *);
116 extern int deletefile(const struct vol *, int, char *, int);
117
118 extern int getmetadata(const AFPObj *obj, struct vol *vol, uint16_t bitmap,
119 struct path *path,
120 struct dir *dir, char *buf, size_t *buflen, struct adouble *adp);
121
122 extern void *get_finderinfo(const struct vol *, const char *, struct adouble *,
123 void *, int);
124
125 extern size_t mtoUTF8(const struct vol *, const char *, size_t, char *, size_t);
126 extern int copy_path_name(const struct vol *, char *, char *i);
127
128 extern uint32_t get_id(struct vol *,
129 struct adouble *,
130 const struct stat *,
131 cnid_t,
132 const char *,
133 int);
134
135/* FP functions */
136 int afp_exchangefiles(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
137 size_t *rbuflen);
138 int afp_setfilparams(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
139 size_t *rbuflen);
140 int afp_copyfile(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
141 size_t *rbuflen);
142 int afp_createfile(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
143 size_t *rbuflen);
144 int afp_createid(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
145 size_t *rbuflen);
146 int afp_resolveid(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
147 size_t *rbuflen);
148 int afp_deleteid(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
149 size_t *rbuflen);
150
151#endif
adouble.h
Part of Netatalk's AppleDouble implementatation.
cnid_t
uint32_t cnid_t
Definition adouble.h:156
ufinderi
const uint8_t ufinderi[ADEDLEN_FINDERI]
Definition afpd/file.c:67
copyfile
int copyfile(struct vol *, struct vol *, struct dir *, int, char *, char *, char *, struct adouble *)
Definition afpd/file.c:1943
set_name
char * set_name(const struct vol *, char *, cnid_t, char *, cnid_t, uint32_t)
Definition afpd/file.c:247
getdefextmap
struct extmap * getdefextmap(void)
Definition netatalk_conf.c:2146
get_id
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.
Definition afpd/file.c:331
afp_createid
int afp_createid(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition afpd/file.c:2253
kTextEncoding_t
kTextEncoding_t
Definition afpd/file.h:58
kTextEncodingMacChineseSimp
@ kTextEncodingMacChineseSimp
Definition afpd/file.h:83
kTextEncodingMacVietnamese
@ kTextEncodingMacVietnamese
Definition afpd/file.h:88
kTextEncodingMacDevanagari
@ kTextEncodingMacDevanagari
Definition afpd/file.h:67
kTextEncodingMacMongolian
@ kTextEncodingMacMongolian
Definition afpd/file.h:85
kTextEncodingMacGurmukhi
@ kTextEncodingMacGurmukhi
Definition afpd/file.h:68
kTextEncodingMacGeorgian
@ kTextEncodingMacGeorgian
Definition afpd/file.h:81
kTextEncodingMacEthiopic
@ kTextEncodingMacEthiopic
Definition afpd/file.h:86
kTextEncodingMacArabic
@ kTextEncodingMacArabic
Definition afpd/file.h:63
kTextEncodingMacKhmer
@ kTextEncodingMacKhmer
Definition afpd/file.h:78
kTextEncodingMacIcelandic
@ kTextEncodingMacIcelandic
Definition afpd/file.h:94
kTextEncodingMacBengali
@ kTextEncodingMacBengali
Definition afpd/file.h:71
kTextEncodingMacGaelic
@ kTextEncodingMacGaelic
Definition afpd/file.h:97
kTextEncodingMacMalayalam
@ kTextEncodingMacMalayalam
Definition afpd/file.h:75
kTextEncodingMacCeltic
@ kTextEncodingMacCeltic
Definition afpd/file.h:96
kTextEncodingMacBurmese
@ kTextEncodingMacBurmese
Definition afpd/file.h:77
kTextEncodingMacJapanese
@ kTextEncodingMacJapanese
Definition afpd/file.h:60
kTextEncodingMacSymbol
@ kTextEncodingMacSymbol
Definition afpd/file.h:90
kTextEncodingMacTurkish
@ kTextEncodingMacTurkish
Definition afpd/file.h:92
kTextEncodingMacArmenian
@ kTextEncodingMacArmenian
Definition afpd/file.h:82
kTextEncodingMacCyrillic
@ kTextEncodingMacCyrillic
Definition afpd/file.h:66
kTextEncodingMacLaotian
@ kTextEncodingMacLaotian
Definition afpd/file.h:80
kTextEncodingMacHebrew
@ kTextEncodingMacHebrew
Definition afpd/file.h:64
kTextEncodingMacCroatian
@ kTextEncodingMacCroatian
Definition afpd/file.h:93
kTextEncodingMacRoman
@ kTextEncodingMacRoman
Definition afpd/file.h:59
kTextEncodingMacTamil
@ kTextEncodingMacTamil
Definition afpd/file.h:72
kTextEncodingMacKorean
@ kTextEncodingMacKorean
Definition afpd/file.h:62
kTextEncodingMacExtArabic
@ kTextEncodingMacExtArabic
Definition afpd/file.h:89
kTextEncodingMacSinhalese
@ kTextEncodingMacSinhalese
Definition afpd/file.h:76
kTextEncodingMacGreek
@ kTextEncodingMacGreek
Definition afpd/file.h:65
kTextEncodingMacGujarati
@ kTextEncodingMacGujarati
Definition afpd/file.h:69
kTextEncodingMacTibetan
@ kTextEncodingMacTibetan
Definition afpd/file.h:84
kTextEncodingMacRomanian
@ kTextEncodingMacRomanian
Definition afpd/file.h:95
kTextEncodingMacThai
@ kTextEncodingMacThai
Definition afpd/file.h:79
kTextEncodingMacTelugu
@ kTextEncodingMacTelugu
Definition afpd/file.h:73
kTextEncodingMacDingbats
@ kTextEncodingMacDingbats
Definition afpd/file.h:91
kTextEncodingMacOriya
@ kTextEncodingMacOriya
Definition afpd/file.h:70
kTextEncodingMacChineseTrad
@ kTextEncodingMacChineseTrad
Definition afpd/file.h:61
kTextEncodingMacCentralEurRoman
@ kTextEncodingMacCentralEurRoman
Definition afpd/file.h:87
kTextEncodingMacKannada
@ kTextEncodingMacKannada
Definition afpd/file.h:74
kTextEncodingMacKeyboardGlyphs
@ kTextEncodingMacKeyboardGlyphs
Definition afpd/file.h:98
deletefile
int deletefile(const struct vol *, int, char *, int)
Definition afpd/file.c:2131
get_finderinfo
void * get_finderinfo(const struct vol *, const char *, struct adouble *, void *, int)
Definition afpd/file.c:180
afp_createfile
int afp_createfile(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition afpd/file.c:878
getfilparams
int getfilparams(const AFPObj *obj, struct vol *, uint16_t, struct path *, struct dir *, char *buf, size_t *, int skip_fork_check)
Definition afpd/file.c:808
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)
Definition afpd/file.c:397
afp_resolveid
int afp_resolveid(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition afpd/file.c:2399
afp_setfilparams
int afp_setfilparams(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition afpd/file.c:1058
afp_copyfile
int afp_copyfile(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition afpd/file.c:1776
copy_path_name
int copy_path_name(const struct vol *, char *, char *i)
Definition afpd/file.c:1711
afp_deleteid
int afp_deleteid(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition afpd/file.c:2523
setfilparams
int setfilparams(const AFPObj *obj, struct vol *, struct path *, uint16_t, char *)
Definition afpd/file.c:1141
afp_exchangefiles
int afp_exchangefiles(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition afpd/file.c:2675
mtoUTF8
size_t mtoUTF8(const struct vol *, const char *, size_t, char *, size_t)
Definition afpd/file.c:1697
renamefile
int renamefile(struct vol *, struct dir *, int, char *, char *, char *, struct adouble *)
Rename a file, including its resource fork and mac name.
Definition afpd/file.c:1612
getextmap
struct extmap * getextmap(const char *)
Definition netatalk_conf.c:2122
rbuflen
static size_t rbuflen
Definition afpfunc_helpers.c:45
rbuf
static char rbuf[rbufsize]
Definition afpfunc_helpers.c:44
buf
static char buf[MAXPATHLEN+1]
Definition afppasswd.c:113
directory.h
volume.h
globals.h
obj
static AFPObj obj
Definition netatalk.c:69
AFPObj
Definition globals.h:166
adouble
Definition adouble.h:191
dir
Definition include/atalk/directory.h:56
extmap
Definition include/atalk/volume.h:27
path
Definition include/atalk/directory.h:123
vol
Definition include/atalk/volume.h:33