2 * $Id: file.h,v 1.20 2006-09-29 09:39:16 didg Exp $
4 * Copyright (c) 1990,1991 Regents of The University of Michigan.
7 * Permission to use, copy, modify, and distribute this software and
8 * its documentation for any purpose and without fee is hereby granted,
9 * provided that the above copyright notice appears in all copies and
10 * that both that copyright notice and this permission notice appear
11 * in supporting documentation, and that the name of The University
12 * of Michigan not be used in advertising or publicity pertaining to
13 * distribution of the software without specific, written prior
14 * permission. This software is supplied as is without expressed or
15 * implied warranties of any kind.
17 * Research Systems Unix Group
18 * The University of Michigan
20 * 535 W. William Street
23 * netatalk@itd.umich.edu
29 /*#include <sys/stat.h>*/ /* including it here causes some confusion */
30 #include <sys/param.h>
31 #include <sys/cdefs.h>
32 #include <netatalk/endian.h>
33 #include <atalk/adouble.h>
37 #include "directory.h"
39 extern const u_char ufinderi[];
41 #define FILPBIT_ATTR 0
42 #define FILPBIT_PDID 1
43 #define FILPBIT_CDATE 2
44 #define FILPBIT_MDATE 3
45 #define FILPBIT_BDATE 4
46 #define FILPBIT_FINFO 5
47 #define FILPBIT_LNAME 6
48 #define FILPBIT_SNAME 7
49 #define FILPBIT_FNUM 8
50 #define FILPBIT_DFLEN 9
51 #define FILPBIT_RFLEN 10
52 #define FILPBIT_EXTDFLEN 11
53 #define FILPBIT_PDINFO 13 /* ProDOS Info/ UTF8 name */
54 #define FILPBIT_EXTRFLEN 14
55 #define FILPBIT_UNIXPR 15
57 /* attribute bits. (d) = directory attribute bit as well. */
58 #define ATTRBIT_INVISIBLE (1<<0) /* invisible (d) */
59 #define ATTRBIT_MULTIUSER (1<<1) /* multiuser */
60 #define ATTRBIT_SYSTEM (1<<2) /* system (d) */
63 /* define in adouble.h */
64 #define ATTRBIT_DOPEN (1<<3) /* data fork already open */
65 #define ATTRBIT_ROPEN (1<<4) /* resource fork already open */
68 #define ATTRBIT_SHARED (1<<4) /* shared area (d) */
69 #define ATTRBIT_NOWRITE (1<<5) /* write inhibit(v2)/read-only(v1) bit */
70 #define ATTRBIT_BACKUP (1<<6) /* backup needed (d) */
71 #define ATTRBIT_NORENAME (1<<7) /* rename inhibit (d) */
72 #define ATTRBIT_NODELETE (1<<8) /* delete inhibit (d) */
73 #define ATTRBIT_NOCOPY (1<<10) /* copy protect */
74 #define ATTRBIT_SETCLR (1<<15) /* set/clear bits (d) */
82 #define kTextEncodingUTF8 0x08000103
86 kTextEncodingMacRoman = 0L,
87 kTextEncodingMacJapanese = 1,
88 kTextEncodingMacChineseTrad = 2,
89 kTextEncodingMacKorean = 3,
90 kTextEncodingMacArabic = 4,
91 kTextEncodingMacHebrew = 5,
92 kTextEncodingMacGreek = 6,
93 kTextEncodingMacCyrillic = 7,
94 kTextEncodingMacDevanagari = 9,
95 kTextEncodingMacGurmukhi = 10,
96 kTextEncodingMacGujarati = 11,
97 kTextEncodingMacOriya = 12,
98 kTextEncodingMacBengali = 13,
99 kTextEncodingMacTamil = 14,
100 kTextEncodingMacTelugu = 15,
101 kTextEncodingMacKannada = 16,
102 kTextEncodingMacMalayalam = 17,
103 kTextEncodingMacSinhalese = 18,
104 kTextEncodingMacBurmese = 19,
105 kTextEncodingMacKhmer = 20,
106 kTextEncodingMacThai = 21,
107 kTextEncodingMacLaotian = 22,
108 kTextEncodingMacGeorgian = 23,
109 kTextEncodingMacArmenian = 24,
110 kTextEncodingMacChineseSimp = 25,
111 kTextEncodingMacTibetan = 26,
112 kTextEncodingMacMongolian = 27,
113 kTextEncodingMacEthiopic = 28,
114 kTextEncodingMacCentralEurRoman = 29,
115 kTextEncodingMacVietnamese = 30,
116 kTextEncodingMacExtArabic = 31, /* The following use script code 0, smRoman*/
117 kTextEncodingMacSymbol = 33,
118 kTextEncodingMacDingbats = 34,
119 kTextEncodingMacTurkish = 35,
120 kTextEncodingMacCroatian = 36,
121 kTextEncodingMacIcelandic = 37,
122 kTextEncodingMacRomanian = 38,
123 kTextEncodingMacCeltic = 39,
124 kTextEncodingMacGaelic = 40,
125 kTextEncodingMacKeyboardGlyphs = 41,
128 extern char *set_name __P((const struct vol *, char *, cnid_t, char *, cnid_t, u_int32_t ) );
130 extern struct extmap *getextmap __P((const char *));
131 extern struct extmap *getdefextmap __P((void));
133 extern int getfilparams __P((struct vol *, u_int16_t, struct path *,
134 struct dir *, char *buf, int *));
136 extern int setfilparams __P((struct vol *, struct path *, u_int16_t, char *));
137 extern int renamefile __P((const struct vol *, char *, char *, char *, struct adouble *));
138 extern int copyfile __P((const struct vol *, const struct vol *, char *, char *, char *, struct adouble *));
139 extern int deletefile __P((const struct vol *, char *, int));
141 extern void *get_finderinfo __P((const struct vol *, const char *, struct adouble *, void *));
143 extern size_t mtoUTF8 __P((const struct vol *, const char *, size_t , char *, size_t ));
144 extern int copy_path_name __P((const struct vol *, char *, char *i));
146 extern u_int32_t get_id __P((struct vol *, struct adouble *, const struct stat *,
147 const cnid_t , char *, const int ));
150 extern int afp_exchangefiles __P((AFPObj *, char *, int, char *, int *));
151 extern int afp_setfilparams __P((AFPObj *, char *, int, char *, int *));
152 extern int afp_copyfile __P((AFPObj *, char *, int, char *, int *));
153 extern int afp_createfile __P((AFPObj *, char *, int, char *, int *));
154 extern int afp_createid __P((AFPObj *, char *, int, char *, int *));
155 extern int afp_resolveid __P((AFPObj *, char *, int, char *, int *));
156 extern int afp_deleteid __P((AFPObj *, char *, int, char *, int *));