Author: aschnell Date: Tue Feb 10 15:25:56 2009 New Revision: 55394 URL: http://svn.opensuse.org/viewcvs/yast?rev=55394&view=rev Log: - removed kmgt_str_to_byte Modified: trunk/storage/storage/src/include/lvm_lib.ycp trunk/storage/storage/src/include/partition_defines.ycp Modified: trunk/storage/storage/src/include/lvm_lib.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/lvm_lib.ycp?rev=55394&r1=55393&r2=55394&view=diff ============================================================================== --- trunk/storage/storage/src/include/lvm_lib.ycp (original) +++ trunk/storage/storage/src/include/lvm_lib.ycp Tue Feb 10 15:25:56 2009 @@ -50,25 +50,6 @@ return( lvm_vg ); }; -////////////////////////////////////////////////////////////////////// -// pesize to byte -// in: <number>[kKmM][bB] -// -// return "0" if input is invalid -// -// pesize is valid 8kB to 512MB in power of 2 -// used by autoyast -define integer pesize_str_to_byte(string input) -{ - integer ret = kmgt_str_to_byte(input); - - if (!Integer::IsPowerOfTwo(ret)) - ret = 0; - else if (ret < 8*1024 || ret > 512*1024*1024) - ret = 0; - return ret; -}; - ////////////////////////////////////////////////////////////////////// // Let the User create a new Volume group: open dialog ... Modified: trunk/storage/storage/src/include/partition_defines.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/partition_defines.ycp?rev=55394&r1=55393&r2=55394&view=diff ============================================================================== --- trunk/storage/storage/src/include/partition_defines.ycp (original) +++ trunk/storage/storage/src/include/partition_defines.ycp Tue Feb 10 15:25:56 2009 @@ -33,89 +33,6 @@ textdomain "storage"; -////////////////////////////////////////////////////////////////////// -// size str to byte -// in: <number>[kKmM][bB] -// -// return "0" if input is invalid -// -// 8 is 8k -// 16K == 16k == 16KB == 16kb -// TODO: remove -define integer kmgt_str_to_byte( string input ) -{ - integer number = 0; - integer pos = findfirstnotof( input, " +" ); - - if( pos != nil && pos>0 ) - { - input = substring( input, pos ); - } - - if( size(filterchars(input, "0123456789kKmMgGtTbBoO .")) != size(input)) - { - return(0); - } - - input = filterchars(input, "0123456789kKmMgGtTbBoO."); - - if( size(input)>0 && findfirstnotof( input, "0123456789.") != nil ) - { - // check whether the last char is in "kKmM" or "bB" - string last_char = substring( input, size(input)-1, 1); - - if( last_char == "b" || last_char == "B" || - last_char == "o" || last_char == "O" ) - { - input = substring( input, 0, size(input)-1); - // check whether the last char is in "kKmM" - last_char = substring( input, size(input)-1, 1); - } - - string number_str = substring(input, 0, size(input)-1); - - if( findfirstnotof( number_str, "0123456789.") == nil ) - { - if( last_char == "k" || last_char == "K" ) - { - number = tointeger(tofloat( number_str ) * 1024.0) ; - } - else if ( last_char == "m" || last_char == "M" ) - { - number = tointeger(tofloat( number_str ) * 1024.0 * 1024.0); - } - else if ( last_char == "g" || last_char == "G" ) - { - number = tointeger(tofloat( number_str ) * - 1024.0 * 1024.0 * 1024.0); - } - else if ( last_char == "t" || last_char == "T" ) - { - number = tointeger(tofloat( number_str ) * - 1024.0 * 1024.0 * 1024.0 * 1024.0); - } - else - { - number = 0; - } - } - else - { - number = 0; - } - } - else if( size(input)==0 ) - { - number = 0; - } - else - { - number = tointeger( input ); - } - return( number ); - }; - - /*--------------------------------------------------------------------- * get a list of not used mountpoints *------------------------------------ -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org