diff --git a/src/binary_c_python.c b/src/binary_c_python.c index 94ed0a620e95651a8f4fa86b8d4c398ba2e58eef..71b549488c2104bdc513a4de5c8e7fd69060ee4e 100644 --- a/src/binary_c_python.c +++ b/src/binary_c_python.c @@ -101,48 +101,48 @@ static char test_func_docstring[] = /* Initialize pyobjects */ // Evolution function headers -static PyObject* binary_c_run_system(PyObject *self, PyObject *args, PyObject *kwargs); +static PyObject* python_run_system(PyObject *self, PyObject *args, PyObject *kwargs); // Utility function headers -static PyObject* binary_c_return_arglines(PyObject *self, PyObject *args); -static PyObject* binary_c_return_help_info(PyObject *self, PyObject *args); -static PyObject* binary_c_return_help_all_info(PyObject *self, PyObject *args); -static PyObject* binary_c_return_version_info(PyObject *self, PyObject *args); -static PyObject* binary_c_return_minimum_orbit_for_RLOF(PyObject *self, PyObject *args); +static PyObject* python_return_arglines(PyObject *self, PyObject *args); +static PyObject* python_return_help_info(PyObject *self, PyObject *args); +static PyObject* python_return_help_all_info(PyObject *self, PyObject *args); +static PyObject* python_return_version_info(PyObject *self, PyObject *args); +static PyObject* python_return_minimum_orbit_for_RLOF(PyObject *self, PyObject *args); // Other function headers -static PyObject* binary_c_return_store_memaddr(PyObject *self, PyObject *args); -static PyObject* binary_c_return_persistent_data_memaddr(PyObject *self, PyObject *args); +static PyObject* python_return_store_memaddr(PyObject *self, PyObject *args); +static PyObject* python_return_persistent_data_memaddr(PyObject *self, PyObject *args); // Free functions -static PyObject* binary_c_free_persistent_data_memaddr_and_return_json_output(PyObject *self, PyObject *args); -static PyObject* binary_c_free_store_memaddr(PyObject *self, PyObject *args); -static PyObject* binary_c_test_func(PyObject *self, PyObject *args); +static PyObject* python_free_persistent_data_memaddr_and_return_json_output(PyObject *self, PyObject *args); +static PyObject* python_free_store_memaddr(PyObject *self, PyObject *args); +static PyObject* python_test_func(PyObject *self, PyObject *args); /* Set the module functions */ static PyMethodDef module_methods[] = { // Wierdly, this casting to a PyCFunction, which usually takes only 2 args, now works when giving keywords. See https://stackoverflow.com/q/10264080 - {"run_system", (PyCFunction)binary_c_run_system, METH_VARARGS|METH_KEYWORDS, run_system_docstring}, + {"run_system", (PyCFunction)python_run_system, METH_VARARGS|METH_KEYWORDS, run_system_docstring}, // - {"return_arglines", binary_c_return_arglines, METH_VARARGS, return_arglines_docstring}, - {"return_help", binary_c_return_help_info, METH_VARARGS, return_help_info_docstring}, - {"return_help_all", binary_c_return_help_all_info, METH_VARARGS, return_help_all_info_docstring}, - {"return_version_info", binary_c_return_version_info, METH_VARARGS, return_version_info_docstring}, - {"return_minimum_orbit_for_RLOF", binary_c_return_minimum_orbit_for_RLOF, METH_VARARGS, return_minimum_orbit_for_RLOF_docstring}, + {"return_arglines", python_return_arglines, METH_VARARGS, return_arglines_docstring}, + {"return_help", python_return_help_info, METH_VARARGS, return_help_info_docstring}, + {"return_help_all", python_return_help_all_info, METH_VARARGS, return_help_all_info_docstring}, + {"return_version_info", python_return_version_info, METH_VARARGS, return_version_info_docstring}, + {"return_minimum_orbit_for_RLOF", python_return_minimum_orbit_for_RLOF, METH_VARARGS, return_minimum_orbit_for_RLOF_docstring}, // memory - {"return_store_memaddr", binary_c_return_store_memaddr, METH_VARARGS, return_store_memaddr_docstring}, - {"return_persistent_data_memaddr", binary_c_return_persistent_data_memaddr, METH_NOARGS, return_persistent_data_memaddr_docstring}, + {"return_store_memaddr", python_return_store_memaddr, METH_VARARGS, return_store_memaddr_docstring}, + {"return_persistent_data_memaddr", python_return_persistent_data_memaddr, METH_NOARGS, return_persistent_data_memaddr_docstring}, // freeing - {"free_persistent_data_memaddr_and_return_json_output", binary_c_free_persistent_data_memaddr_and_return_json_output, METH_VARARGS, free_persistent_data_memaddr_and_return_json_output_docstring}, - {"free_store_memaddr", binary_c_free_store_memaddr, METH_VARARGS, free_store_memaddr_docstring}, + {"free_persistent_data_memaddr_and_return_json_output", python_free_persistent_data_memaddr_and_return_json_output, METH_VARARGS, free_persistent_data_memaddr_and_return_json_output_docstring}, + {"free_store_memaddr", python_free_store_memaddr, METH_VARARGS, free_store_memaddr_docstring}, // dummy function - {"test_func", binary_c_test_func, METH_NOARGS, test_func_docstring}, + {"test_func", python_test_func, METH_NOARGS, test_func_docstring}, // {NULL, NULL, 0, NULL} @@ -188,7 +188,7 @@ PyMODINIT_FUNC PyInit__binary_c_bindings(void) /* Wrappers to functions that evolve binary systems. */ /* ============================================================================== */ -static PyObject* binary_c_run_system(PyObject *self, PyObject *args, PyObject *kwargs) +static PyObject* python_run_system(PyObject *self, PyObject *args, PyObject *kwargs) { static char* keywords[] = {"argstring", "custom_logging_func_memaddr", "store_memaddr", "persistent_data_memaddr", "write_logfile", "population", NULL}; @@ -271,7 +271,7 @@ static PyObject* binary_c_run_system(PyObject *self, PyObject *args, PyObject *k /* Wrappers to functions that call other API functionality like help and arglines */ /* ============================================================================== */ -static PyObject* binary_c_return_arglines(PyObject *self, PyObject *args) +static PyObject* python_return_arglines(PyObject *self, PyObject *args) { char * buffer; char * error_buffer; @@ -297,7 +297,7 @@ static PyObject* binary_c_return_arglines(PyObject *self, PyObject *args) return return_string; } -static PyObject* binary_c_return_help_info(PyObject *self, PyObject *args) +static PyObject* python_return_help_info(PyObject *self, PyObject *args) { /* Parse the input tuple */ char *argstring; @@ -332,7 +332,7 @@ static PyObject* binary_c_return_help_info(PyObject *self, PyObject *args) return return_string; } -static PyObject* binary_c_return_help_all_info(PyObject *self, PyObject *args) +static PyObject* python_return_help_all_info(PyObject *self, PyObject *args) { char * buffer; char * error_buffer; @@ -358,7 +358,7 @@ static PyObject* binary_c_return_help_all_info(PyObject *self, PyObject *args) return return_string; } -static PyObject* binary_c_return_version_info(PyObject *self, PyObject *args) +static PyObject* python_return_version_info(PyObject *self, PyObject *args) { char * buffer; char * error_buffer; @@ -384,7 +384,7 @@ static PyObject* binary_c_return_version_info(PyObject *self, PyObject *args) return return_string; } -static PyObject* binary_c_return_minimum_orbit_for_RLOF(PyObject *self, PyObject *args) +static PyObject* python_return_minimum_orbit_for_RLOF(PyObject *self, PyObject *args) { /* set vars and default values for some */ char *argstring; @@ -431,7 +431,8 @@ static PyObject* binary_c_return_minimum_orbit_for_RLOF(PyObject *self, PyObject /* Wrappers to functions that call other functionality */ /* ============================================================================== */ -static PyObject* binary_c_return_store_memaddr(PyObject *self, PyObject *args) +/* Memory setting functions */ +static PyObject* python_return_store_memaddr(PyObject *self, PyObject *args) { char * buffer; char * error_buffer; @@ -462,7 +463,7 @@ static PyObject* binary_c_return_store_memaddr(PyObject *self, PyObject *args) return store_memaddr_capsule; } -static PyObject* binary_c_return_persistent_data_memaddr(PyObject *self, PyObject *args) +static PyObject* python_return_persistent_data_memaddr(PyObject *self, PyObject *args) { /* Python binding that wraps the c function which calls the binary_c api endpoint. */ char * buffer; @@ -495,7 +496,7 @@ static PyObject* binary_c_return_persistent_data_memaddr(PyObject *self, PyObjec } /* Memory freeing functions */ -static PyObject* binary_c_free_persistent_data_memaddr_and_return_json_output(PyObject *self, PyObject *args) +static PyObject* python_free_persistent_data_memaddr_and_return_json_output(PyObject *self, PyObject *args) { /* Python binding that calls the c function that free's the persistent data memory and prints out the json */ @@ -544,7 +545,7 @@ static PyObject* binary_c_free_persistent_data_memaddr_and_return_json_output(Py return return_string; } -static PyObject* binary_c_free_store_memaddr(PyObject *self, PyObject *args) +static PyObject* python_free_store_memaddr(PyObject *self, PyObject *args) { /* Python binding that calls the c function that free's the store memory */ char * buffer; @@ -592,7 +593,7 @@ static PyObject* binary_c_free_store_memaddr(PyObject *self, PyObject *args) Py_RETURN_NONE; } -static PyObject* binary_c_test_func(PyObject *self, PyObject *args) +static PyObject* python_test_func(PyObject *self, PyObject *args) { // function to see if we can access the stability string printf("%s", RLOF_stability_string(1));