diff options
author | Srikant Patnaik | 2015-01-11 12:28:04 +0530 |
---|---|---|
committer | Srikant Patnaik | 2015-01-11 12:28:04 +0530 |
commit | 871480933a1c28f8a9fed4c4d34d06c439a7a422 (patch) | |
tree | 8718f573808810c2a1e8cb8fb6ac469093ca2784 /sound/oss/bin2hex.c | |
parent | 9d40ac5867b9aefe0722bc1f110b965ff294d30d (diff) | |
download | FOSSEE-netbook-kernel-source-871480933a1c28f8a9fed4c4d34d06c439a7a422.tar.gz FOSSEE-netbook-kernel-source-871480933a1c28f8a9fed4c4d34d06c439a7a422.tar.bz2 FOSSEE-netbook-kernel-source-871480933a1c28f8a9fed4c4d34d06c439a7a422.zip |
Moved, renamed, and deleted files
The original directory structure was scattered and unorganized.
Changes are basically to make it look like kernel structure.
Diffstat (limited to 'sound/oss/bin2hex.c')
-rw-r--r-- | sound/oss/bin2hex.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/sound/oss/bin2hex.c b/sound/oss/bin2hex.c new file mode 100644 index 00000000..b59109eb --- /dev/null +++ b/sound/oss/bin2hex.c @@ -0,0 +1,39 @@ +#include <stdio.h> +#include <string.h> +#include <stdlib.h> + +int main( int argc, const char * argv [] ) +{ + const char * varname; + int i = 0; + int c; + int id = 0; + + if(argv[1] && strcmp(argv[1],"-i")==0) + { + argv++; + argc--; + id=1; + } + + if(argc==1) + { + fprintf(stderr, "bin2hex: [-i] firmware\n"); + exit(1); + } + + varname = argv[1]; + printf( "/* automatically generated by bin2hex */\n" ); + printf( "static unsigned char %s [] %s =\n{\n", varname , id?"__initdata":""); + + while ( ( c = getchar( ) ) != EOF ) + { + if ( i != 0 && i % 10 == 0 ) + printf( "\n" ); + printf( "0x%02lx,", c & 0xFFl ); + i++; + } + + printf( "};\nstatic int %sLen = %d;\n", varname, i ); + return 0; +} |