- Overview
- Files
- Related Pages
- Modules

- File List
- Globals

Functions
tanvastouch_diagnostics.h File Reference
`#include "tanvastouch.h"`
`#include <stdbool.h>`

Go to the source code of this file.

## Functions
TANVASTOUCH_API int | tanvastouch_diag_set_server_enabled (tanvastouch_ctx *ctx, bool enabled, const char *path)
TANVASTOUCH_API int | tanvastouch_diag_get_server_path (tanvastouch_ctx *ctx, bool *running, char *path_buffer, size_t path_buffer_len, size_t *actual_path_len)

## Function Documentation

## ◆ tanvastouch_diag_get_server_path()

TANVASTOUCH_API int tanvastouch_diag_get_server_path | ( | tanvastouch_ctx * | ctx,
|  | bool * | running,
|  | char * | path_buffer,
|  | size_t | path_buffer_len,
|  | size_t * | actual_path_len
| ) |  |

Returns the current path of the diagnostics server and whether or not the diagnostics server is running.

Parameters

  ctx | The API context to use.
  running | Whether the diagnostics server is running.
  path_buffer | On success, the function writes up to (path_buffer_len - 1) characters into this buffer. The final character in the buffer is always a NULL. On failure, the contents of this buffer are in an unspecified state.
  path_buffer_len | The length of path_buffer.
  actual_path_len | On success, the function writes the actual length of the server path to this location. This can be used to determine if the path_buffer needs to be enlarged. On failure, the pointed-to storage is in an unspecified state.

Returns
  TANVASTOUCH_OK if the server status was succesfully checked, an error otherwise.

## ◆ tanvastouch_diag_set_server_enabled()

TANVASTOUCH_API int tanvastouch_diag_set_server_enabled | ( | tanvastouch_ctx * | ctx,
|  | bool | enabled,
|  | const char * | path
| ) |  |

Start or stop the diagnostics server.

Parameters

  ctx | The API context to use.
  enable | True to start the server, false to stop it.
  path | The path where the server will be started, or NULL to use the default of "/tmp/tte-diagnostics". Ignored if enabled is false.

Returns
  TANVASTOUCH_OK if the server successfully starts or stops. If the server is already running, returns TANVASTOUCH_ERROR_ENGINE_ALREADY_RUNNING.