#include <pybind11/pybind11.h>

int add(int i, int j) {
    return i + j;
}

int fourty_two() {
    return 42;
}

int two_variable(int i, int j){
    return i - j;
}

namespace py = pybind11;

PYBIND11_MODULE(yyggtest, m) {
    m.doc() = R"pbdoc(
        Pybind11 example plugin
        -----------------------

        .. currentmodule:: python_example

        .. autosummary::
           :toctree: _generate

           add
           subtract
           fourty_two
    )pbdoc";

    m.def("add", &add, R"pbdoc(
        Add two numbers

        Some other explanation about the add function.
    )pbdoc");

    m.def("subtract", [](int i, int j) { return i - j; }, R"pbdoc(
        Subtract two numbers

        Some other explanation about the subtract function.
    )pbdoc");

    m.def("fourty_two", &fourty_two, R"pbdoc(
        return fourty two

        just some explaination
    )pbdoc");

    m.def("two_integer", &fourty_two, R"pbdoc(
        return i

        just some explaination
    )pbdoc");

#ifdef VERSION_INFO
    m.attr("__version__") = VERSION_INFO;
#else
    m.attr("__version__") = "dev";
#endif
}
