diff options
author | Eilidh McAdam <eilidh@lanedo.com> | 2012-07-10 18:07:58 +0100 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2012-07-18 11:01:33 +0200 |
commit | 99716480586148354f4e43436c9e4411e674d57e (patch) | |
tree | 9a2e93feac01736fe0b95bfc5c9d9a76b26c7580 /setup_native | |
parent | 0cab13137aac689403c7dfa8a5aed785e88ac0c4 (diff) |
Skeleton code for msitran
Change-Id: Ic48abd66a04bfaafda846e514b096431e37488a8
Signed-off-by: Fridrich Štrba <fridrich.strba@bluewin.ch>
Diffstat (limited to 'setup_native')
-rw-r--r-- | setup_native/source/win32/wintools/msitran/msitran.c | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/setup_native/source/win32/wintools/msitran/msitran.c b/setup_native/source/win32/wintools/msitran/msitran.c new file mode 100644 index 000000000000..f2669e9097e4 --- /dev/null +++ b/setup_native/source/win32/wintools/msitran/msitran.c @@ -0,0 +1,89 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <stdio.h> + +#define WIN32_LEAN_AND_MEAN +#include <windows.h> + +typedef enum ERRCOND { ERRA = 0x1, ERRB = 0x2, ERRC = 0x4, ERRD = 0x8, ERRE = 0x10, ERRF = 0x20 } ERRCOND; +static unsigned int err; + +void usage(void) +{ + printf( + "Usage: msitran.exe -g {basedb}{refdb}{transformfile}[{errorconditions}]\n" + "\nOptions:\n" + " -g Generate a transform\n" + " -? or -h Display usage\n" + "\nError conditions (specify in {errorconditions} to suppress):\n" + " a Add existing row\n" + " b Delete non-existing row\n" + " c Add existing table\n" + " d Delete non-existing table\n" + " e Modify existing row\n" + " f Change codepage\n"); +} + +void generatePatch(char * basedb, char * refdb, char * transFile) +{ +} + +int main(int argc, char *argv[]) +{ + char * genFiles[3] = {0, 0, 0}; + unsigned int i = 0; + err = 0; + + /* Get parameters */ + while (argv[1] && (argv[1][0] == '-' || argv[1][0] == '/')) + { + switch(tolower(argv[1][1])) + { + case 'g': + for (i = 0; i < 3; i++) + { + if (!argv[1]) + { + printf("Please supply all arguments for generating a transform\n"); + return 1; + } + argv++; argc--; + genFiles[i] = argv[1]; + } + break; + case '?': + case 'h': + usage(); + return 0; + } + argv++; argc++; + } + + /* Record error suppression conditions */ + if (argv[1]) + { + for (i = 0; i < strlen(argv[1]); i++) + { + switch(tolower(argv[1][i])) + { + case 'a': err |= ERRA; break; + case 'b': err |= ERRB; break; + case 'c': err |= ERRC; break; + case 'd': err |= ERRD; break; + case 'e': err |= ERRE; break; + case 'f': err |= ERRF; break; + } + } + } + + generatePatch(genFiles[0], genFiles[1], genFiles[2]); + + return 0; +} |