2001-12-17 17:04:10 +03:00
/*
2004-03-30 23:35:44 +04:00
* Copyright ( C ) 2001 - 2004 Sistina Software , Inc . All rights reserved .
* Copyright ( C ) 2004 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
* of the GNU General Public License v .2 .
*
* You should have received a copy of the GNU General Public License
* along with this program ; if not , write to the Free Software Foundation ,
* Inc . , 59 Temple Place , Suite 330 , Boston , MA 02111 - 1307 USA
2001-12-17 17:04:10 +03:00
*/
# ifndef _LVM_STRING_H
# define _LVM_STRING_H
2002-01-21 14:06:32 +03:00
# include <stdio.h>
2001-12-17 17:04:10 +03:00
# include <stdarg.h>
2004-09-15 19:02:36 +04:00
struct pool ;
2001-12-17 17:04:10 +03:00
/*
2001-12-31 18:17:34 +03:00
* On error , up to glibc 2.0 .6 , snprintf returned - 1 if buffer was too small ;
* From glibc 2.1 it returns number of chars ( excl . trailing null ) that would
* have been written had there been room .
*
* lvm_snprintf reverts to the old behaviour .
2001-12-17 17:04:10 +03:00
*/
2002-12-20 02:25:55 +03:00
int lvm_snprintf ( char * buf , size_t bufsize , const char * format , . . . ) ;
2001-12-17 17:04:10 +03:00
2003-09-18 00:35:57 +04:00
int emit_to_buffer ( char * * buffer , size_t * size , const char * fmt , . . . ) ;
2004-02-13 17:43:35 +03:00
int split_words ( char * buffer , unsigned max , char * * argv ) ;
2005-10-17 03:03:59 +04:00
char * build_dm_name ( struct dm_pool * mem , const char * vg ,
2004-09-15 19:02:36 +04:00
const char * lv , const char * layer ) ;
2005-10-17 03:03:59 +04:00
int split_dm_name ( struct dm_pool * mem , const char * dmname ,
2004-09-15 19:02:36 +04:00
char * * vgname , char * * lvname , char * * layer ) ;
2001-12-17 17:04:10 +03:00
# endif