[gnumeric] embedder: keep up with goffice
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] embedder: keep up with goffice
- Date: Mon, 5 Dec 2011 14:50:35 +0000 (UTC)
commit d070d043cbbbff3d8d819cae787abac614fec5d5
Author: Morten Welinder <terra gnome org>
Date: Mon Dec 5 09:49:56 2011 -0500
embedder: keep up with goffice
tools/embedder | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/tools/embedder b/tools/embedder
index 6902a92..905ff2d 100644
--- a/tools/embedder
+++ b/tools/embedder
@@ -9,13 +9,17 @@ $myself =~ s|^.*/||;
my $WIDTH = 70;
my $regfunc = undef;
+my $unregfunc = undef;
my $regfuncstatic = 0;
-my $regfilefunc = undef;
+my $regfilefunc = "go_rsm_register_file";
+my $unregfilefunc = "go_rsm_unregister_file";
my $id_prefix = "";
my @includes;
&GetOptions("register-function=s" => \$regfunc,
+ "unregister-function=s" => \$unregfunc,
"register-file-function=s" => \$regfilefunc,
+ "unregister-file-function=s" => \$unregfilefunc,
"static" => \$regfuncstatic,
"id-prefix=s" => \$id_prefix,
"include=s" => \ includes,
@@ -31,6 +35,7 @@ foreach my $include (@includes) {
my $fileno = 0;
my $reg = "";
+my $unreg = "";
my $docompress = 0;
print "static " if $regfuncstatic;
print "void\n";
@@ -50,6 +55,16 @@ foreach my $file (@ARGV) {
print $reg;
print "}\n";
+if (defined $unregfunc) {
+ print "\n";
+ print "static " if $regfuncstatic;
+ print "void\n";
+ print "$unregfunc (void)\n";
+ print "{\n";
+ print $unreg;
+ print "}\n";
+}
+
sub embed {
my ($file, $docompress) = @_;
@@ -76,8 +91,10 @@ sub embed {
&embed_data ($data, $id);
+ my $res = "$id_prefix$file";
my $len = length ($data);
- $reg .= " $regfilefunc (\"$id_prefix$file\", $id, $len);\n";
+ $reg .= " $regfilefunc (\"$res\", $id, $len);\n";
+ $unreg .= " $unregfilefunc (\"$res\");\n";
}
sub embed_data {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]