diff --git a/src/swig/guile/gnucash-guile.c b/src/swig/guile/gnucash-guile.c new file mode 100644 index 0000000000..ba30147618 --- /dev/null +++ b/src/swig/guile/gnucash-guile.c @@ -0,0 +1,54 @@ +#include +#include +#include +#include +#include + +static void +guile_entry_point(int argc, char *argv[]) { + char *input; + gnucash_swig_init(); + + input = readline("gnucash> "); + while(input) { + SCM result = gh_eval_str(input); + gh_display(result); + gh_newline(); + add_history(input); + free(input); + input = readline("gnucash> "); + } +} + +int +main(int argc, char *argv[]) { + gh_enter(argc, argv, guile_entry_point); + return 0; +} +#include +#include +#include +#include +#include + +static void +guile_entry_point(int argc, char *argv[]) { + char *input; + xacc(); + + input = readline("xacc> "); + while(input) { + SCM result = gh_eval_str(input); + gh_display(result); + gh_newline(); + add_history(input); + free(input); + input = readline("xacc> "); + } +} + +int +main(int argc, char *argv[]) { + gh_enter(argc, argv, guile_entry_point); + return 0; +} diff --git a/src/swig/guile/gnucash-guile.h b/src/swig/guile/gnucash-guile.h new file mode 100644 index 0000000000..aa5d0f0f1f --- /dev/null +++ b/src/swig/guile/gnucash-guile.h @@ -0,0 +1,6 @@ + +/* SWIG insists that the entry function to the module be gnucash(), so + we redirect the name */ + +void +gnucash_guile_init();