amend bash.h; add example_builtin.c

This commit is contained in:
2025-06-01 07:51:03 -07:00
parent 424c8b0fee
commit e1202ab4fe
2 changed files with 23 additions and 26 deletions

3
bash.h
View File

@ -34,7 +34,6 @@ extern char **make_builtin_argv(WORD_LIST*, int*);
PyImport_AppendInittab(#modname, PyInit_##modname); \
Py_Initialize(); \
} \
int _##bash_name(int argc, char **argv) { \
int ret = 1; \
PyObject *mod = NULL, *func = NULL, *result; \
\
@ -59,7 +58,5 @@ extern char **make_builtin_argv(WORD_LIST*, int*);
Py_XDECREF(mod); \
return ret; \
} \
return _##bash_name(argc, argv); \
} \
WRAP_FUNC_WITH_BUILTIN(bash_name); \
DEFINE_BUILTIN(bash_name);

View File

@ -3,4 +3,4 @@
PY_FUNC(foo, foo, _foo);
PY_FUNC(bar, foo, _bar);
PY_FUNC(graph, foo, _complicated_function);
PY_FUNC(graph, bar, _complicated_function);