mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 10:26:02 +00:00 
			
		
		
		
	 7889010731
			
		
	
	
		7889010731
		
	
	
	
	
		
			
			char**) and return an int even on PC platforms. If not, please fix PC/utils/makesrc.c ;-P
		
			
				
	
	
		
			20 lines
		
	
	
	
		
			319 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
	
		
			319 B
		
	
	
	
		
			C
		
	
	
	
	
	
| #include "Python.h"
 | |
| 
 | |
| static PyObject *
 | |
| ex_foo(PyObject *self, PyObject *args)
 | |
| {
 | |
| 	printf("Hello, world\n");
 | |
| 	Py_INCREF(Py_None);
 | |
| 	return Py_None;
 | |
| }
 | |
| 
 | |
| static PyMethodDef example_methods[] = {
 | |
| 	{"foo", ex_foo, 1, "foo() doc string"},
 | |
| 	{NULL, NULL}
 | |
| };
 | |
| 
 | |
| void
 | |
| initexample(void)
 | |
| {
 | |
| 	Py_InitModule("example", example_methods);
 | |
| }
 |