Loading...
Searching...
No Matches
anonymous_namespace{operations_test.cpp} Namespace Reference

## Functions

static int | hook_add (lutok::state &state)
| Addition function for injection into Lua.
static int | hook_multiply (lutok::state &state)
| Multiplication function for injection into Lua.

## Function Documentation

## hook_add()

int anonymous_namespace{operations_test.cpp}::hook_add | ( | lutok::state & | state | ) |

static

Addition function for injection into Lua.

Precondition
  stack(-2) The first summand.
  stack(-1) The second summand.

Postcondition
  stack(-1) The result of the sum.

Parameters

  state | The Lua state.

Returns
  The number of results (1).

## hook_multiply()

int anonymous_namespace{operations_test.cpp}::hook_multiply | ( | lutok::state & | state | ) |

static

Multiplication function for injection into Lua.

Precondition
  stack(-2) The first factor.
  stack(-1) The second factor.

Postcondition
  stack(-1) The product.

Parameters

  state | The Lua state.

Returns
  The number of results (1).