2001-12-17 17:04:10 +03:00
/*
2013-09-26 20:37:40 +04:00
* Copyright ( C ) 2001 - 2004 Sistina Software , Inc . All rights reserved .
2007-08-21 00:55:30 +04:00
* Copyright ( C ) 2004 - 2007 Red Hat , Inc . All rights reserved .
2001-12-17 17:04:10 +03:00
*
2004-03-30 23:35:44 +04:00
* This file is part of LVM2 .
*
* This copyrighted material is made available to anyone wishing to use ,
* modify , copy , or redistribute it subject to the terms and conditions
2007-08-21 00:55:30 +04:00
* of the GNU Lesser General Public License v .2 .1 .
2004-03-30 23:35:44 +04:00
*
2007-08-21 00:55:30 +04:00
* You should have received a copy of the GNU Lesser General Public License
2004-03-30 23:35:44 +04:00
* along with this program ; if not , write to the Free Software Foundation ,
2016-01-21 13:49:46 +03:00
* Inc . , 51 Franklin Street , Fifth Floor , Boston , MA 02110 - 1301 USA
2001-12-17 17:04:10 +03:00
*/
# ifndef _LVM_STRING_H
# define _LVM_STRING_H
2006-04-19 19:33:07 +04:00
# define NAME_LEN 128
2010-04-14 17:01:38 +04:00
# define UUID_PREFIX "LVM-"
2006-04-19 19:33:07 +04:00
2014-04-17 12:48:55 +04:00
# include <sys/types.h>
struct dm_pool ;
2004-09-15 19:02:36 +04:00
struct pool ;
2014-03-11 20:13:47 +04:00
struct logical_volume ;
2004-09-15 19:02:36 +04:00
2014-05-07 15:52:01 +04:00
typedef enum name_error {
NAME_VALID = 0 ,
NAME_INVALID_EMPTY = - 1 ,
2015-02-23 20:09:35 +03:00
NAME_INVALID_HYPHEN = - 2 ,
2014-05-07 15:52:01 +04:00
NAME_INVALID_DOTS = - 3 ,
NAME_INVALID_CHARSET = - 4 ,
NAME_INVALID_LENGTH = - 5
} name_error_t ;
2013-09-26 20:37:40 +04:00
2007-07-20 19:38:19 +04:00
int emit_to_buffer ( char * * buffer , size_t * size , const char * fmt , . . . )
__attribute__ ( ( format ( printf , 3 , 4 ) ) ) ;
2003-09-18 00:35:57 +04:00
2014-03-11 20:13:47 +04:00
char * build_dm_uuid ( struct dm_pool * mem , const struct logical_volume * lvid ,
2010-04-14 17:01:38 +04:00
const char * layer ) ;
2004-09-15 19:02:36 +04:00
2006-04-19 19:33:07 +04:00
int validate_name ( const char * n ) ;
2013-09-26 20:37:40 +04:00
name_error_t validate_name_detailed ( const char * n ) ;
2010-11-17 13:19:29 +03:00
int validate_tag ( const char * n ) ;
2006-04-19 19:33:07 +04:00
2015-02-23 22:47:03 +03:00
void copy_systemid_chars ( const char * src , char * dst ) ;
2014-10-24 21:29:04 +04:00
2010-04-23 18:16:32 +04:00
int apply_lvname_restrictions ( const char * name ) ;
int is_reserved_lvname ( const char * name ) ;
2016-07-14 16:46:38 +03:00
/*
* Provided with a NULL - terminated argument list of const char *
* substrings that might be contained within the string str , use
* strstr ( ) to search str for each in turn and return a pointer to the
* first match or else NULL .
*/
char * first_substring ( const char * str , . . . ) ;
2001-12-17 17:04:10 +03:00
# endif