1
/*********************************************************
2
* Copyright (C) 1998 VMware, Inc. All rights reserved.
4
* The contents of this file are subject to the terms of the Common
5
* Development and Distribution License (the "License") version 1.0
6
* and no later version. You may not use this file except in
7
* compliance with the License.
9
* You can obtain a copy of the License at
10
* http://www.opensource.org/licenses/cddl1.php
12
* See the License for the specific language governing permissions
13
* and limitations under the License.
15
*********************************************************/
20
* Cross-platform name format used by hgfs.
29
# include "driver-config.h"
30
# include <linux/string.h>
31
#elif defined(__FreeBSD__)
33
# include <sys/libkern.h>
34
# define strchr(s,c) index(s,c)
38
#elif defined(__APPLE__) && defined(KERNEL)
45
#include "vm_basic_types.h"
48
/* Status codes for processing share names */
50
HGFS_NAME_STATUS_COMPLETE, /* Name is complete */
51
HGFS_NAME_STATUS_FAILURE, /* Name processing failed */
52
HGFS_NAME_STATUS_INCOMPLETE_BASE, /* Name is base of namespace */
53
HGFS_NAME_STATUS_INCOMPLETE_ROOT, /* Name is "root" only */
54
HGFS_NAME_STATUS_INCOMPLETE_DRIVE, /* Name is "root drive" only */
55
HGFS_NAME_STATUS_INCOMPLETE_UNC, /* Name is "root unc" only */
56
HGFS_NAME_STATUS_INCOMPLETE_UNC_MACH, /* Name is "root unc <x>" only */
57
HGFS_NAME_STATUS_DOES_NOT_EXIST, /* Name does not exist */
58
HGFS_NAME_STATUS_ACCESS_DENIED, /* Desired access to share denied */
59
HGFS_NAME_STATUS_SYMBOLIC_LINK, /* Name contains a symbolic link */
60
HGFS_NAME_STATUS_OUT_OF_MEMORY, /* Out of memory while processing */
61
HGFS_NAME_STATUS_TOO_LONG, /* Name has overly long component */
66
CPName_ConvertTo(char const *nameIn, // IN: The buf to convert
67
size_t bufOutSize, // IN: The size of the output buffer
68
char *bufOut); // OUT: The output buffer
71
CPName_LinuxConvertTo(char const *nameIn, // IN: buf to convert
72
size_t bufOutSize, // IN: size of the output buffer
73
char *bufOut); // OUT: output buffer
76
CPName_WindowsConvertTo(char const *nameIn, // IN: buf to convert
77
size_t bufOutSize, // IN: size of the output buffer
78
char *bufOut); // OUT: output buffer
81
CPName_ConvertFrom(char const **bufIn, // IN/OUT: Input to convert
82
size_t *inSize, // IN/OUT: Size of input buffer
83
size_t *outSize, // IN/OUT: Size of output buffer
84
char **bufOut); // IN/OUT: Output buffer
87
CPName_ConvertFromRoot(char const **bufIn, // IN/OUT: Input to convert
88
size_t *inSize, // IN/OUT: Size of input
89
size_t *outSize, // IN/OUT: Size of output buf
90
char **bufOut); // IN/OUT: Output buffer
93
CPName_GetComponent(char const *begin, // IN: Beginning of buffer
94
char const *end, // IN: End of buffer
95
char const **next); // OUT: Next component
98
CPName_Print(char const *in, // IN: Name to print
99
size_t size); // IN: Size of name
102
#endif /* __CP_NAME_H__ */