Make lib/num2str.c a stand-alone library by adding lib/num2str.h
authorTomohiro Kusumi <tkusumi@tuxera.com>
Tue, 4 Apr 2017 20:22:16 +0000 (23:22 +0300)
committerJens Axboe <axboe@fb.com>
Sat, 8 Apr 2017 17:04:21 +0000 (11:04 -0600)
commit5e7468209ad6956c3d7393110c379dd7d316dd7e
tree4b395742ec10f4cde57ff7754df36bdff77695d0
parent087c0cba36b6d2bf9c5f9b9ce96f308e0be1bd9e
Make lib/num2str.c a stand-alone library by adding lib/num2str.h

lib/num2str.c not having dependency on fio.h by adding a new header
lib/num2str.h enables it to be a stand-alone library function, which
is useful for debugging purpose. In fact, most of the files under
lib/ directory do things this way.

--
 # cat ./test1.c
 #include <stdio.h>
 #include "lib/num2str.h"
 int main(void) {
         printf("%s\n", num2str(1024, 4, 1, 1, N2S_BYTE));
         return 0;
 }
 # gcc -Wall -g -DCONFIG_STATIC_ASSERT ./test1.c ./lib/num2str.c
 # ./a.out
 1024B

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
fio.h
lib/num2str.c
lib/num2str.h [new file with mode: 0644]