函数逻辑报告 |
Source Code:lib\string_helpers.c |
Create Date:2022-07-27 07:23:04 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:string_get_size - get the size in the specified units*@size: The size to be converted in blocks*@blk_size: Size of the block (use 1 for size in bytes)*@units: units to use (powers of 1000 or 1024)*@buf: buffer to format to*@len: length of buffer* This
函数原型:void string_get_size(u64 size, u64 blk_size, const enum string_size_units units, char *buf, int len)
返回类型:void
参数:
类型 | 参数 | 名称 |
---|---|---|
u64 | size | |
u64 | blk_size | |
const enum string_size_units | units | |
char * | buf | |
int | len |
37 | static const char * const units_10[] = {"B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"} |
40 | static const char * const units_2[] = {"B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"} |
43 | static const char * const * const units_str[] = {[use powers of 10^3 (standard SI) ] = units_10, [use binary powers of 2^10 ] = units_2, } |
47 | static const unsigned int divisor[] = {[use powers of 10^3 (standard SI) ] = 1000, [use binary powers of 2^10 ] = 1024, } |
51 | static const unsigned int rounding[] = {500, 50, 5} |
52 | i等于0 |
53 | remainder等于0 |
57 | tmp[0]等于'\0' |
77 | i自加 |
82 | i自加 |
101 | 如果units恒等于use binary powers of 2^10 则 |
112 | 如果remainder大于等于1000则 |
117 | 如果j则 |
122 | out : |
123 | 如果i大于等于ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(units_2)则unit等于"UNK" |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |