You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@corinthia.apache.org by pm...@apache.org on 2015/04/24 18:18:04 UTC
[37/55] [abbrv] incubator-corinthia git commit: Add stub and function
for odt format to dfutil -pp.
Add stub and function for odt format to dfutil -pp.
* consumers/dfutil/src/Commands.c
(prettyPrintFile): Add stub for odt command.
(prettyPrintODFFile): New function.
Project: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/commit/cd8a1804
Tree: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/tree/cd8a1804
Diff: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/diff/cd8a1804
Branch: refs/heads/stable
Commit: cd8a1804e6cc29607063af86540572ff2f5770b6
Parents: ebd3c93
Author: Gabriela Gibson <gb...@apache.org>
Authored: Tue Apr 7 17:15:57 2015 +0100
Committer: Gabriela Gibson <gb...@apache.org>
Committed: Tue Apr 7 17:15:57 2015 +0100
----------------------------------------------------------------------
consumers/dfutil/src/Commands.c | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/cd8a1804/consumers/dfutil/src/Commands.c
----------------------------------------------------------------------
diff --git a/consumers/dfutil/src/Commands.c b/consumers/dfutil/src/Commands.c
index 7f90e56..7ec5827 100644
--- a/consumers/dfutil/src/Commands.c
+++ b/consumers/dfutil/src/Commands.c
@@ -126,6 +126,34 @@ end:
return ok;
}
+static int prettyPrintODFFile(const char *filename, DFError **error)
+{
+ int ok = 0;
+ char *odf = NULL;
+ DFStorage *storage = NULL;
+
+ storage = DFStorageOpenZip(filename,error);
+
+ if (storage == NULL) {
+ DFErrorFormat(error,"%s: %s",filename,DFErrorMessage(error));
+ goto end;
+ }
+ /*
+ odf = ODF_toPlain(storage,NULL);
+ printf("%s",odt);
+ */
+ printf("ODF file support has not been implemented yet.\n");
+ ok = 1;
+
+end:
+ free(odf);
+ DFStorageRelease(storage);
+ return ok;
+
+}
+
+
+
int prettyPrintFile(const char *filename, DFError **error)
{
int ok;
@@ -136,6 +164,8 @@ int prettyPrintFile(const char *filename, DFError **error)
ok = prettyPrintXMLFile(filename,1,error);
else if (DFStringEqualsCI(extension,"docx"))
ok = prettyPrintWordFile(filename,error);
+ else if (DFStringEqualsCI(extension,"odt"))
+ ok = prettyPrintODFFile(filename,error);
else {
DFErrorFormat(error,"Unknown file type");
ok = 0;