Dynatrace OneAgent SDK for C/C++  1.7.1.1
onesdk_init.h
Go to the documentation of this file.
1 /*
2  Copyright 2017-2018 Dynatrace LLC
3 
4  Licensed under the Apache License, Version 2.0 (the "License");
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 */
16 
17 #ifndef ONESDK_INIT_H_INCLUDED
18 #define ONESDK_INIT_H_INCLUDED
19 
24 /*========================================================================================================================================*/
25 
26 #include "onesdk/onesdk_common.h" /* IWYU pragma: export */
27 
70 /*========================================================================================================================================*/
71 
80 ONESDK_DECLARE_FUNCTION(void) onesdk_stub_get_version(onesdk_stub_version_t* out_stub_version);
81 
82 /*========================================================================================================================================*/
83 
94 ONESDK_DECLARE_FUNCTION(onesdk_xchar_t const*) onesdk_stub_xstrerror(onesdk_result_t error_code, onesdk_xchar_t* buffer, onesdk_size_t buffer_length);
95 
101 ONESDK_DECLARE_FUNCTION(onesdk_bool_t) onesdk_stub_is_sdk_cmdline_arg(onesdk_xchar_t const* arg);
102 
119 ONESDK_DECLARE_FUNCTION(onesdk_result_t) onesdk_stub_process_cmdline_arg(onesdk_xchar_t const* arg, onesdk_bool_t replace_existing);
120 
141 ONESDK_DECLARE_FUNCTION(onesdk_result_t) onesdk_stub_process_cmdline_args(int argc, onesdk_xchar_t const* const* argv, onesdk_bool_t replace_existing);
142 
152 ONESDK_DECLARE_FUNCTION(onesdk_result_t) onesdk_stub_strip_sdk_cmdline_args(int* argc, onesdk_xchar_t** argv);
153 
166 ONESDK_DECLARE_FUNCTION(onesdk_result_t) onesdk_stub_set_variable(onesdk_xchar_t const* var, onesdk_bool_t replace_existing);
167 
172 ONESDK_DECLARE_FUNCTION(void) onesdk_stub_free_variables(void);
173 
174 /*========================================================================================================================================*/
175 
185 typedef void ONESDK_CALL onesdk_stub_logging_callback_t(onesdk_logging_level_t level, onesdk_xchar_t const* message);
186 
207 ONESDK_DECLARE_FUNCTION(void) onesdk_stub_default_logging_function(onesdk_logging_level_t level, onesdk_xchar_t const* message);
208 
220 ONESDK_DECLARE_FUNCTION(void) onesdk_stub_set_logging_level(onesdk_logging_level_t level);
221 
238 ONESDK_DECLARE_FUNCTION(void) onesdk_stub_set_logging_callback(onesdk_stub_logging_callback_t* stub_logging_callback);
239 
240 /*========================================================================================================================================*/
241 
259 ONESDK_DECLARE_FUNCTION(onesdk_result_t) onesdk_initialize(void);
260 
280 ONESDK_DECLARE_FUNCTION(onesdk_result_t) onesdk_initialize_2(onesdk_uint32_t init_flags);
281 
293 ONESDK_DECLARE_FUNCTION(onesdk_result_t) onesdk_shutdown(void);
294 
295 /*========================================================================================================================================*/
296 
312 ONESDK_DECLARE_FUNCTION(void) onesdk_stub_get_agent_load_info(onesdk_bool_t* agent_found, onesdk_bool_t* agent_compatible);
313 
314 /*========================================================================================================================================*/
315 
318 /*========================================================================================================================================*/
319 
320 #endif /* ONESDK_INIT_H_INCLUDED */
uint32_t onesdk_uint32_t
Unsigned 32 bit integer.
Definition: onesdk_config.h:217
Defines common types/constants/macros. Applications should not include this file directly.
onesdk_result_t onesdk_initialize(void)
Load and initialize the SDK agent.
onesdk_int32_t onesdk_logging_level_t
Integer type for logging levels.
Definition: onesdk_common.h:120
onesdk_result_t onesdk_stub_set_variable(onesdk_xchar_t const *var, onesdk_bool_t replace_existing)
Sets an SDK initialization variable.
Stores the stub version number.
Definition: onesdk_common.h:34
int32_t onesdk_result_t
Type for result codes of the SDK stub.
Definition: onesdk_config.h:181
int32_t onesdk_bool_t
Type for boolean values. Zero means false, any non-zero value means true.
Definition: onesdk_config.h:213
onesdk_result_t onesdk_initialize_2(onesdk_uint32_t init_flags)
Load and initialize the SDK agent, with additional flags.
void onesdk_stub_default_logging_function(onesdk_logging_level_t level, onesdk_xchar_t const *message)
The default SDK stub logging function - writes to stderr.
onesdk_xchar_t const * onesdk_stub_xstrerror(onesdk_result_t error_code, onesdk_xchar_t *buffer, onesdk_size_t buffer_length)
Retrieves a human readable error message corresponding to an error code that was returned by the SDK ...
void onesdk_stub_logging_callback_t(onesdk_logging_level_t level, onesdk_xchar_t const *message)
SDK stub logging function prototype.
Definition: onesdk_init.h:185
onesdk_result_t onesdk_stub_strip_sdk_cmdline_args(int *argc, onesdk_xchar_t **argv)
Removes SDK command line arguments from an argv array.
char_or_wchar_t onesdk_xchar_t
The native character type of the operating system. wchar_t for Windows and char for other systems...
Definition: onesdk_config.h:228
void onesdk_stub_set_logging_callback(onesdk_stub_logging_callback_t *stub_logging_callback)
Sets the SDK stub logging callback function.
onesdk_result_t onesdk_stub_process_cmdline_args(int argc, onesdk_xchar_t const *const *argv, onesdk_bool_t replace_existing)
Processes multiple command line arguments.
onesdk_result_t onesdk_shutdown(void)
Shut down and unload the SDK agent.
size_t onesdk_size_t
Unsigned integer type used for sizes (e.g. array sizes) and counts.
Definition: onesdk_config.h:220
onesdk_result_t onesdk_stub_process_cmdline_arg(onesdk_xchar_t const *arg, onesdk_bool_t replace_existing)
Processes one command line argument.
void onesdk_stub_set_logging_level(onesdk_logging_level_t level)
Sets the SDK stub logging level.
void onesdk_stub_free_variables(void)
Clears all SDK initialization variables.
void onesdk_stub_get_agent_load_info(onesdk_bool_t *agent_found, onesdk_bool_t *agent_compatible)
Retrieves debug information about the currently used agent.
void onesdk_stub_get_version(onesdk_stub_version_t *out_stub_version)
Retrieves the stub version number.
onesdk_bool_t onesdk_stub_is_sdk_cmdline_arg(onesdk_xchar_t const *arg)
Determines whether a command line argument is an SDK argument.