boinc/test/db_def_to_php

20 lines
337 B
Perl
Executable File

#!/usr/bin/env perl
## $Id$
## parse the db #defines to php.
## syntax: ./db_def_to_php < ../db/boinc_db.h > boinc_db.inc
print "<?php\n";
print " // Generated by db_def_to_php on ";
system('date');
while (<>) {
if (/^\s*#define\s+([^\s]+)\s+([0-9]+)\s*$/) {
print qq/ define("$1", $2);\n/;
}
}
print "?>\n";