zfs_namecheck.h revision 177698
1228753Smm/*
2228753Smm * CDDL HEADER START
3238856Smm *
4228753Smm * The contents of this file are subject to the terms of the
5228753Smm * Common Development and Distribution License (the "License").
6228753Smm * You may not use this file except in compliance with the License.
7228753Smm *
8228753Smm * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9228753Smm * or http://www.opensolaris.org/os/licensing.
10228753Smm * See the License for the specific language governing permissions
11228753Smm * and limitations under the License.
12228753Smm *
13228753Smm * When distributing Covered Code, include this CDDL HEADER in each
14228753Smm * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15228753Smm * If applicable, add the following below this CDDL HEADER, with the
16228753Smm * fields enclosed by brackets "[]" replaced with your own identifying
17228753Smm * information: Portions Copyright [yyyy] [name of copyright owner]
18228753Smm *
19228753Smm * CDDL HEADER END
20228753Smm */
21228753Smm/*
22228753Smm * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23228753Smm * Use is subject to license terms.
24228753Smm */
25228753Smm
26228753Smm#ifndef	_ZFS_NAMECHECK_H
27228753Smm#define	_ZFS_NAMECHECK_H
28228763Smm
29228753Smm#pragma ident	"%Z%%M%	%I%	%E% SMI"
30232153Smm
31232153Smm#ifdef	__cplusplus
32232153Smmextern "C" {
33228753Smm#endif
34228753Smm
35228753Smmtypedef enum {
36228753Smm	NAME_ERR_LEADING_SLASH,		/* name begins with leading slash */
37228753Smm	NAME_ERR_EMPTY_COMPONENT,	/* name contains an empty component */
38228753Smm	NAME_ERR_TRAILING_SLASH,	/* name ends with a slash */
39228753Smm	NAME_ERR_INVALCHAR,		/* invalid character found */
40228753Smm	NAME_ERR_MULTIPLE_AT,		/* multiple '@' characters found */
41228753Smm	NAME_ERR_NOLETTER,		/* pool doesn't begin with a letter */
42228753Smm	NAME_ERR_RESERVED,		/* entire name is reserved */
43232153Smm	NAME_ERR_DISKLIKE,		/* reserved disk name (c[0-9].*) */
44232153Smm	NAME_ERR_TOOLONG,		/* name is too long */
45232153Smm} namecheck_err_t;
46228753Smm
47228753Smmint pool_namecheck(const char *, namecheck_err_t *, char *);
48228753Smmint dataset_namecheck(const char *, namecheck_err_t *, char *);
49228753Smmint dataset_name_hidden(const char *);
50228753Smmint snapshot_namecheck(const char *, namecheck_err_t *, char *);
51228753Smm
52248616Smm#ifdef	__cplusplus
53228753Smm}
54248616Smm#endif
55248616Smm
56228753Smm#endif	/* _ZFS_NAMECHECK_H */
57232153Smm