xref: /PHP-7.0/ext/fileinfo/create_data_file.php (revision 14ce4a1d)
1/* This is a generated file, do not modify */
2/* Usage: php create_data_file.php /path/to/magic.mgc > data_file.c */
3<?php
4	$dta = file_get_contents( $argv[1] );
5	$dta_l = strlen($dta);
6	$j = 0;
7
8	echo "const unsigned char php_magic_database[$dta_l] = {\n";
9	for ($i = 0; $i < $dta_l; $i++) {
10		printf("0x%02X, ", ord($dta[$i]));
11		if ($j % 16 == 15) {
12			echo "\n";
13		}
14		$j++;
15	}
16	echo "};\n";
17?>
18