mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-24 21:16:50 +03:00
6807b4208a
NetSurf includes are now done with ""s and other system includes with <>s as C intended. The scandeps tool has been updated to only look for ""ed includes, and to verify that the files exist in the tree before adding them to the dependency lines. The depend rule has therefore been augmented to make sure the autogenerated files are built before it is run. This is untested under self-hosted RISC OS builds. All else tested and works. svn path=/trunk/netsurf/; revision=3307
61 lines
989 B
Perl
Executable File
61 lines
989 B
Perl
Executable File
#!/usr/bin/perl -W
|
|
|
|
print <<END;
|
|
/*
|
|
* This file is part of NetSurf, http://netsurf-browser.org/
|
|
* Licensed under the GNU General Public License,
|
|
* http://www.opensource.org/licenses/gpl-license
|
|
* Copyright 2003 James Bursa <bursa\@users.sourceforge.net>
|
|
*/
|
|
|
|
#include "utils/utils.h"
|
|
|
|
void unicode_transliterate(unsigned int c, char **r)
|
|
{
|
|
char *s = *r;
|
|
switch (c) {
|
|
|
|
END
|
|
|
|
LINE: while (<>) {
|
|
chomp;
|
|
next if m/^%/;
|
|
next if m/^ *$/;
|
|
|
|
m/^<U([0-9A-F]{4})> /g or die "invalid line '$_'";
|
|
$z = $1;
|
|
next if (hex($z) < 256);
|
|
|
|
SUBST: while (m/\G"?((<U([0-9A-F]{4})>)*)"?;?/g) {
|
|
next if $& eq '';
|
|
$m = $1;
|
|
if ($m eq '') {
|
|
print "case 0x$z: break;\n";
|
|
next;
|
|
}
|
|
chop $m;
|
|
@s = split /></, substr $m, 1;
|
|
foreach $s (@s) {
|
|
$s = substr $s, 1;
|
|
next SUBST if 255 < hex($s);
|
|
}
|
|
|
|
print "case 0x$z: ";
|
|
foreach $s (@s) {
|
|
print "*s++ = 0x$s; ";
|
|
}
|
|
print "break;\n";
|
|
next LINE;
|
|
}
|
|
}
|
|
|
|
print <<END;
|
|
|
|
default: *s++ = '?'; break;
|
|
}
|
|
|
|
*r = s;
|
|
}
|
|
END
|
|
|