|
|
|
@ -172,7 +172,8 @@ ex:;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** Convert a text into a number of type double and multiply it by unit code
|
|
|
|
|
[kmgtpe] (2^10 to 2^60) or [s] (2048). (Also accepts capital letters.) |
|
|
|
|
[kmgtpe] (2^10 to 2^60) or [s] (2048) or [d] (512). |
|
|
|
|
(Also accepts capital letters.) |
|
|
|
|
@param text Input like "42", "2k", "3.14m" or "-1g" |
|
|
|
|
@param flag Bitfield for control purposes: |
|
|
|
|
bit0= return -1 rathern than 0 on failure |
|
|
|
@ -199,6 +200,7 @@ double Scanf_io_size(char *text, int flag)
|
|
|
|
|
if(c=='p' || c=='P') ret*= 1024.0*1024.0*1024.0*1024.0*1024.0; |
|
|
|
|
if(c=='e' || c=='E') ret*= 1024.0*1024.0*1024.0*1024.0*1024.0*1024.0; |
|
|
|
|
if(c=='s' || c=='S') ret*= 2048.0; |
|
|
|
|
if(c=='d' || c=='D') ret*= 512.0; |
|
|
|
|
return(ret); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|