File: test.c

package info (click to toggle)
html5-parser 0.4.9-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 1,764 kB
  • sloc: ansic: 32,441; python: 2,055; makefile: 13
file content (23 lines) | stat: -rw-r--r-- 486 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
 * test.c
 * Copyright (C) 2017 Kovid Goyal <kovid at kovidgoyal.net>
 *
 * Distributed under terms of the Apache 2.0 license.
 */

#include <Python.h>

int 
main(int argc, char **argv) {
#if PY_MAJOR_VERSION >= 3
    wchar_t *argw[1024] = {0};
    int i;
    for (i = 0; i < argc; i++) {
        argw[i] = (wchar_t*)calloc(sizeof(wchar_t), 1024);
        swprintf(argw[i], 1024, L"%hs", argv[i]);
    }
    return Py_Main(argc, argw);
#else
    return Py_Main(argc, argv);
#endif
}