]> arthur.barton.de Git - netatalk.git/blob - etc/afpd/file.h
Merge master
[netatalk.git] / etc / afpd / file.h
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 <sys/stat.h>*/ /* including it here causes some confusion */
28 #include <sys/param.h>
29 #include <arpa/inet.h>
30 #include <atalk/adouble.h>
31 #include <atalk/globals.h>
32
33 #include "volume.h"
34 #include "directory.h"
35
36 extern const u_char     ufinderi[];
37
38 #define FILPBIT_ATTR     0
39 #define FILPBIT_PDID     1
40 #define FILPBIT_CDATE    2
41 #define FILPBIT_MDATE    3
42 #define FILPBIT_BDATE    4
43 #define FILPBIT_FINFO    5
44 #define FILPBIT_LNAME    6
45 #define FILPBIT_SNAME    7
46 #define FILPBIT_FNUM     8
47 #define FILPBIT_DFLEN    9
48 #define FILPBIT_RFLEN    10
49 #define FILPBIT_EXTDFLEN 11
50 #define FILPBIT_PDINFO   13    /* ProDOS Info/ UTF8 name */
51 #define FILPBIT_EXTRFLEN 14
52 #define FILPBIT_UNIXPR   15
53
54 struct extmap {
55     char                *em_ext;
56     char                em_creator[ 4 ];
57     char                em_type[ 4 ];
58 };
59
60 #define kTextEncodingUTF8 0x08000103
61
62 typedef enum {
63                                         /* Mac OS encodings*/
64   kTextEncodingMacRoman         = 0L,
65   kTextEncodingMacJapanese      = 1,
66   kTextEncodingMacChineseTrad   = 2,
67   kTextEncodingMacKorean        = 3,
68   kTextEncodingMacArabic        = 4,
69   kTextEncodingMacHebrew        = 5,
70   kTextEncodingMacGreek         = 6,
71   kTextEncodingMacCyrillic      = 7,
72   kTextEncodingMacDevanagari    = 9,
73   kTextEncodingMacGurmukhi      = 10,
74   kTextEncodingMacGujarati      = 11,
75   kTextEncodingMacOriya         = 12,
76   kTextEncodingMacBengali       = 13,
77   kTextEncodingMacTamil         = 14,
78   kTextEncodingMacTelugu        = 15,
79   kTextEncodingMacKannada       = 16,
80   kTextEncodingMacMalayalam     = 17,
81   kTextEncodingMacSinhalese     = 18,
82   kTextEncodingMacBurmese       = 19,
83   kTextEncodingMacKhmer         = 20,
84   kTextEncodingMacThai          = 21,
85   kTextEncodingMacLaotian       = 22,
86   kTextEncodingMacGeorgian      = 23,
87   kTextEncodingMacArmenian      = 24,
88   kTextEncodingMacChineseSimp   = 25,
89   kTextEncodingMacTibetan       = 26,
90   kTextEncodingMacMongolian     = 27,
91   kTextEncodingMacEthiopic      = 28,
92   kTextEncodingMacCentralEurRoman = 29,
93   kTextEncodingMacVietnamese    = 30,
94   kTextEncodingMacExtArabic     = 31,   /* The following use script code 0, smRoman*/
95   kTextEncodingMacSymbol        = 33,
96   kTextEncodingMacDingbats      = 34,
97   kTextEncodingMacTurkish       = 35,
98   kTextEncodingMacCroatian      = 36,
99   kTextEncodingMacIcelandic     = 37,
100   kTextEncodingMacRomanian      = 38,
101   kTextEncodingMacCeltic        = 39,
102   kTextEncodingMacGaelic        = 40,
103   kTextEncodingMacKeyboardGlyphs = 41,
104 } kTextEncoding_t;
105
106 extern char *set_name   (const struct vol *, char *, cnid_t, char *, cnid_t, u_int32_t );
107
108 extern struct extmap    *getextmap (const char *);
109 extern struct extmap    *getdefextmap (void);
110
111 extern int getfilparams (struct vol *, u_int16_t, struct path *,
112                                  struct dir *, char *buf, size_t *);
113
114 extern int setfilparams (struct vol *, struct path *, u_int16_t, char *);
115 extern int renamefile   (const struct vol *, int, char *, char *, char *, struct adouble *);
116 extern int copyfile     (const struct vol *, const struct vol *, int, char *, char *, char *, struct adouble *);
117 extern int deletefile   (const struct vol *, int, char *, int);
118
119 extern int getmetadata  (struct vol *vol, u_int16_t bitmap, 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 *, void *, int);
123
124 extern size_t mtoUTF8   (const struct vol *, const char *, size_t , char *, size_t );
125 extern int  copy_path_name (const struct vol *, char *, char *i);
126
127 extern uint32_t get_id  (struct vol *,
128                          struct adouble *,
129                          const struct stat *,
130                          cnid_t ,
131                          const char *,
132                          int );
133
134 /* FP functions */
135 int afp_exchangefiles (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,  size_t *rbuflen);
136 int afp_setfilparams (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,  size_t *rbuflen);
137 int afp_copyfile (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,  size_t *rbuflen);
138 int afp_createfile (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,  size_t *rbuflen);
139 int afp_createid (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,  size_t *rbuflen);
140 int afp_resolveid (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,  size_t *rbuflen);
141 int afp_deleteid (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,  size_t *rbuflen);
142
143 #endif