@@ -6,44 +6,44 @@ PyObject* PyInit_xyzzy(void); /* Forward */
66
77main (int argc , char * * argv )
88{
9- /* Ignore passed-in argc/argv. If desired, conversion
10- should use mbstowcs to convert them. */
11- wchar_t * args [] = {L"embed" , L"hello" , 0 };
9+ /* Ignore passed-in argc/argv. If desired, conversion
10+ should use mbstowcs to convert them. */
11+ wchar_t * args [] = {L"embed" , L"hello" , 0 };
1212
13- /* Pass argv[0] to the Python interpreter */
14- Py_SetProgramName (args [0 ]);
13+ /* Pass argv[0] to the Python interpreter */
14+ Py_SetProgramName (args [0 ]);
1515
16- /* Add a static module */
17- PyImport_AppendInittab ("xyzzy" , PyInit_xyzzy );
16+ /* Add a static module */
17+ PyImport_AppendInittab ("xyzzy" , PyInit_xyzzy );
1818
19- /* Initialize the Python interpreter. Required. */
20- Py_Initialize ();
19+ /* Initialize the Python interpreter. Required. */
20+ Py_Initialize ();
2121
22- /* Define sys.argv. It is up to the application if you
23- want this; you can also let it undefined (since the Python
24- code is generally not a main program it has no business
25- touching sys.argv...) */
26- PySys_SetArgv (2 , args );
22+ /* Define sys.argv. It is up to the application if you
23+ want this; you can also let it undefined (since the Python
24+ code is generally not a main program it has no business
25+ touching sys.argv...) */
26+ PySys_SetArgv (2 , args );
2727
28- /* Do some application specific code */
29- printf ("Hello, brave new world\n\n" );
28+ /* Do some application specific code */
29+ printf ("Hello, brave new world\n\n" );
3030
31- /* Execute some Python statements (in module __main__) */
32- PyRun_SimpleString ("import sys\n" );
33- PyRun_SimpleString ("print(sys.builtin_module_names)\n" );
34- PyRun_SimpleString ("print(sys.modules.keys())\n" );
35- PyRun_SimpleString ("print(sys.executable)\n" );
36- PyRun_SimpleString ("print(sys.argv)\n" );
31+ /* Execute some Python statements (in module __main__) */
32+ PyRun_SimpleString ("import sys\n" );
33+ PyRun_SimpleString ("print(sys.builtin_module_names)\n" );
34+ PyRun_SimpleString ("print(sys.modules.keys())\n" );
35+ PyRun_SimpleString ("print(sys.executable)\n" );
36+ PyRun_SimpleString ("print(sys.argv)\n" );
3737
38- /* Note that you can call any public function of the Python
39- interpreter here, e.g. call_object(). */
38+ /* Note that you can call any public function of the Python
39+ interpreter here, e.g. call_object(). */
4040
41- /* Some more application specific code */
42- printf ("\nGoodbye, cruel world\n" );
41+ /* Some more application specific code */
42+ printf ("\nGoodbye, cruel world\n" );
4343
44- /* Exit, cleaning up the interpreter */
45- Py_Exit (0 );
46- /*NOTREACHED*/
44+ /* Exit, cleaning up the interpreter */
45+ Py_Exit (0 );
46+ /*NOTREACHED*/
4747}
4848
4949/* A static module */
@@ -52,29 +52,29 @@ main(int argc, char **argv)
5252static PyObject *
5353xyzzy_foo (PyObject * self , PyObject * args )
5454{
55- return PyLong_FromLong (42L );
55+ return PyLong_FromLong (42L );
5656}
5757
5858static PyMethodDef xyzzy_methods [] = {
59- {"foo" , xyzzy_foo , METH_NOARGS ,
60- "Return the meaning of everything." },
61- {NULL , NULL } /* sentinel */
59+ {"foo" , xyzzy_foo , METH_NOARGS ,
60+ "Return the meaning of everything." },
61+ {NULL , NULL } /* sentinel */
6262};
6363
6464static struct PyModuleDef xyzzymodule = {
65- {}, /* m_base */
66- "xyzzy" , /* m_name */
67- 0 , /* m_doc */
68- 0 , /* m_size */
69- xyzzy_methods , /* m_methods */
70- 0 , /* m_reload */
71- 0 , /* m_traverse */
72- 0 , /* m_clear */
73- 0 , /* m_free */
65+ {}, /* m_base */
66+ "xyzzy" , /* m_name */
67+ 0 , /* m_doc */
68+ 0 , /* m_size */
69+ xyzzy_methods , /* m_methods */
70+ 0 , /* m_reload */
71+ 0 , /* m_traverse */
72+ 0 , /* m_clear */
73+ 0 , /* m_free */
7474};
7575
7676PyObject *
7777PyInit_xyzzy (void )
7878{
79- return PyModule_Create (& xyzzymodule );
79+ return PyModule_Create (& xyzzymodule );
8080}
0 commit comments