smb-symlink-to-vnovnode-attribute-20081017
[openafs.git] / src / WINNT / afsd / cm_utils.h
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  * 
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 #ifndef __CM_UTILS_H_ENV__
11 #define __CM_UTILS_H_ENV__ 1
12
13 #define CM_UTILS_SPACESIZE              8192    /* space to allocate */
14 typedef struct cm_space {
15     union {
16         clientchar_t wdata[CM_UTILS_SPACESIZE];
17         char data[CM_UTILS_SPACESIZE];
18     };
19     struct cm_space *nextp;
20 } cm_space_t;
21
22 /* error code hack */
23 #define VL_IDEXIST                               (363520L)
24 #define VL_IO                                    (363521L)
25 #define VL_NAMEEXIST                             (363522L)
26 #define VL_CREATEFAIL                            (363523L)
27 #define VL_NOENT                                 (363524L)
28 #define VL_EMPTY                                 (363525L)
29 #define VL_ENTDELETED                            (363526L)
30 #define VL_BADNAME                               (363527L)
31 #define VL_BADINDEX                              (363528L)
32 #define VL_BADVOLTYPE                            (363529L)
33 #define VL_BADSERVER                             (363530L)
34 #define VL_BADPARTITION                          (363531L)
35 #define VL_REPSFULL                              (363532L)
36 #define VL_NOREPSERVER                           (363533L)
37 #define VL_DUPREPSERVER                          (363534L)
38 #define VL_RWNOTFOUND                            (363535L)
39 #define VL_BADREFCOUNT                           (363536L)
40 #define VL_SIZEEXCEEDED                          (363537L)
41 #define VL_BADENTRY                              (363538L)
42 #define VL_BADVOLIDBUMP                          (363539L)
43 #define VL_IDALREADYHASHED                       (363540L)
44 #define VL_ENTRYLOCKED                           (363541L)
45 #define VL_BADVOLOPER                            (363542L)
46 #define VL_BADRELLOCKTYPE                        (363543L)
47 #define VL_RERELEASE                             (363544L)
48 #define VL_BADSERVERFLAG                         (363545L)
49 #define VL_PERM                                  (363546L)
50 #define VL_NOMEM                                 (363547L)
51 #define VL_BADVERSION                            (363548L)
52 #define VL_INDEXERANGE                           (363549L)
53 #define VL_MULTIPADDR                            (363550L)
54 #define VL_BADMASK                               (363551L)
55
56 extern cm_space_t *cm_GetSpace(void);
57
58 extern void cm_FreeSpace(cm_space_t *);
59
60 extern long cm_MapRPCError(long error, cm_req_t *reqp);
61
62 extern long cm_MapRPCErrorRmdir(long error, cm_req_t *reqp);
63
64 extern long cm_MapVLRPCError(long error, cm_req_t *reqp);
65
66 extern void init_et_to_sys_error(void);
67
68 extern int cm_Is8Dot3(clientchar_t *namep);
69
70 extern void cm_Gen8Dot3Name(struct cm_dirEntry *dep, clientchar_t *shortName,
71                             clientchar_t **shortNameEndp);
72
73 #define cm_Gen8Dot3Name(dep,shortName,shortNameEndp)                  \
74 cm_Gen8Dot3NameInt((dep)->name, &(dep)->fid, shortName, shortNameEndp)
75
76 extern void cm_Gen8Dot3NameInt(const fschar_t * longname, cm_dirFid_t * pfid,
77                                clientchar_t *shortName, clientchar_t **shortNameEndp);
78
79 extern void cm_Gen8Dot3NameIntW(const clientchar_t* longname, cm_dirFid_t * pfid,
80                                 clientchar_t *shortName, clientchar_t **shortNameEndp);
81
82 extern int cm_MatchMask(clientchar_t *namep, clientchar_t *maskp, int flags);
83
84 extern BOOL cm_TargetPerceivedAsDirectory(const fschar_t *target);
85
86 #endif /*  __CM_UTILS_H_ENV__ */