Commit | Line | Data |
---|---|---|
71a559f8 | 1 | /* |
ab5be9fa | 2 | * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com> |
71a559f8 | 3 | * |
ab5be9fa | 4 | * SPDX-License-Identifier: GPL-2.0-only |
71a559f8 | 5 | * |
71a559f8 JG |
6 | */ |
7 | ||
8 | #ifndef LTTNG_COMMON_CONTEXT_H | |
9 | #define LTTNG_COMMON_CONTEXT_H | |
10 | ||
b12ed34b JG |
11 | #include <common/macros.h> |
12 | ||
7966af57 SM |
13 | #ifdef __cplusplus |
14 | extern "C" { | |
15 | #endif | |
16 | ||
71a559f8 JG |
17 | /* |
18 | * Parse string as an application context of the form | |
19 | * "$app.provider_name:context_name" and return the provider name and context | |
20 | * name separately. | |
21 | * | |
22 | * provider_name and ctx_name are returned only if an application context name | |
23 | * was successfully parsed and must be freed by the caller. | |
24 | * | |
25 | * Returns 0 if the string is a valid application context, else a negative | |
26 | * value on error. | |
27 | */ | |
28 | int parse_application_context(const char *str, char **provider_name, | |
29 | char **ctx_name); | |
30 | ||
7966af57 SM |
31 | #ifdef __cplusplus |
32 | } | |
33 | #endif | |
34 | ||
71a559f8 | 35 | #endif /* LTTNG_COMMON_CONTEXT_H */ |