blob: 57f880a6ec13a04c0d3d0943cc1ce2dc67692958 [file] [log] [blame]
John Koleszar0ea50ce2010-05-18 11:58:33 -04001/*
John Koleszarc2140b82010-09-09 08:16:39 -04002 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
John Koleszar0ea50ce2010-05-18 11:58:33 -04003 *
John Koleszar94c52e42010-06-18 12:39:21 -04004 * Use of this source code is governed by a BSD-style license
John Koleszar09202d82010-06-04 16:19:40 -04005 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
John Koleszar94c52e42010-06-18 12:39:21 -04007 * in the file PATENTS. All contributing project authors may
John Koleszar09202d82010-06-04 16:19:40 -04008 * be found in the AUTHORS file in the root of the source tree.
John Koleszar0ea50ce2010-05-18 11:58:33 -04009 */
10
11
12/* This program is created to take command arguments and pass
13 * them to main() in example.c or example_xma.c, because the
14 * correspending part in example.c or example_xma.c does not
15 * work on Pocket PC platform.
16 * To modify the command arguments, go to "Property" page and
17 * fill in "Command arguments." For example:
18 * --codec vp6 --flipuv --progress _bnd.vp6
19 */
20#include <stdio.h>
21#include <stdlib.h>
22#include <string.h>
23
24#define MAX_NUM_ARG 64
25#define MAX_SIZ_ARG 512
26
27extern "C"
28{
29 int main(int argc, char **argv);
30}
31
32int wmain(int argc, wchar_t **argv) {
33 char *cargv[MAX_NUM_ARG];
34 char chargv[MAX_SIZ_ARG];
35 int ret;
36
37 /* transform command line arguments from (wchar_t *) to (char *) */
38 for(int i=0; i<argc; i++) {
39 wcstombs( chargv, argv[i], sizeof(chargv));
40 cargv[i] = _strdup(chargv);
41 }
42
43 ret = main(argc, (char **)cargv);
44
45 //free the memory located by _strdup()
46 for(int i=0; i<argc; i++)
47 free(cargv[i]);
48
49 return ret;
50}