X-Git-Url: https://git.efficios.com/?a=blobdiff_plain;f=src%2Fcli%2Fbabeltrace2-cfg-cli-args.h;h=92f499950a7b72d4919275b6cd92bab2af4ad340;hb=353c2524c2d4606a79ac5f4c0354a683a14e63e5;hp=e709263fbff86e9bd896ea37d54b901c3487ca62;hpb=3dae1685cf1f1a368cd83928433eb778c8815dab;p=babeltrace.git diff --git a/src/cli/babeltrace2-cfg-cli-args.h b/src/cli/babeltrace2-cfg-cli-args.h index e709263f..92f49995 100644 --- a/src/cli/babeltrace2-cfg-cli-args.h +++ b/src/cli/babeltrace2-cfg-cli-args.h @@ -1,40 +1,52 @@ -#ifndef CLI_BABELTRACE_CFG_CLI_ARGS_H -#define CLI_BABELTRACE_CFG_CLI_ARGS_H - /* - * Copyright 2016-2017 Philippe Proulx + * SPDX-License-Identifier: MIT * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright 2016-2017 Philippe Proulx */ +#ifndef CLI_BABELTRACE_CFG_CLI_ARGS_H +#define CLI_BABELTRACE_CFG_CLI_ARGS_H + +#include #include #include #include #include "lib/object.h" #include "compat/compiler.h" -#include +#include #include #include "babeltrace2-cfg.h" -struct bt_config *bt_config_cli_args_create(int argc, const char *argv[], - int *retcode, bool force_omit_system_plugin_path, +/* + * Return value of functions that create a bt_config from CLI args and return + * it through an out parameter. + */ +enum bt_config_cli_args_status +{ + /* + * Config was successfully created and returned through the out + * parameter. + */ + BT_CONFIG_CLI_ARGS_STATUS_OK = 0, + + /* + * Config could not be created due to an error. The out parameter is + * left unchanged. + */ + BT_CONFIG_CLI_ARGS_STATUS_ERROR = -1, + + /* + * The arguments caused the function to print some information (help, + * version, etc), not config was created. The out parameter is left + * unchanged. + */ + BT_CONFIG_CLI_ARGS_STATUS_INFO_ONLY = 1, +}; + +enum bt_config_cli_args_status bt_config_cli_args_create(int argc, + const char *argv[], + struct bt_config **cfg, bool force_omit_system_plugin_path, bool force_omit_home_plugin_path, const bt_value *initial_plugin_paths, const bt_interrupter *interrupter);