--- /dev/null
+HeaderFilterRegex: '.*((include/.*-internal)|(src/common.*)|(src/bin.*)|(src/lib.*)|(tests.*))\.(h|hpp)$'
+Checks: '-*,modernize-use-using'
+FormatStyle: 'file'
struct mi_lttng_error_query_callbacks;
struct lttng_trigger;
-typedef bool (*action_validate_cb)(struct lttng_action *action);
-typedef void (*action_destroy_cb)(struct lttng_action *action);
-typedef int (*action_serialize_cb)(struct lttng_action *action,
- struct lttng_payload *payload);
-typedef bool (*action_equal_cb)(const struct lttng_action *a,
- const struct lttng_action *b);
-typedef ssize_t (*action_create_from_payload_cb)(
- struct lttng_payload_view *view,
- struct lttng_action **action);
-typedef const struct lttng_rate_policy *(*action_get_rate_policy_cb)(
- const struct lttng_action *action);
-typedef enum lttng_action_status (*action_add_error_query_results_cb)(
- const struct lttng_action *action,
- struct lttng_error_query_results *results);
-typedef enum lttng_error_code (*action_mi_serialize_cb)(
- const struct lttng_action *condition, struct mi_writer *writer);
+using action_validate_cb = bool (*)(struct lttng_action *);
+using action_destroy_cb = void (*)(struct lttng_action *);
+using action_serialize_cb = int (*)(struct lttng_action *, struct lttng_payload *);
+using action_equal_cb = bool (*)(const struct lttng_action *, const struct lttng_action *);
+using action_create_from_payload_cb = ssize_t (*)(struct lttng_payload_view *,
+ struct lttng_action **);
+using action_get_rate_policy_cb = const struct lttng_rate_policy *(*) (const struct lttng_action *);
+using action_add_error_query_results_cb = enum lttng_action_status (*)(
+ const struct lttng_action *, struct lttng_error_query_results *);
+using action_mi_serialize_cb = enum lttng_error_code (*)(const struct lttng_action *,
+ struct mi_writer *);
struct lttng_action {
struct urcu_ref ref;
struct mi_lttng_error_query_callbacks;
struct lttng_trigger;
-typedef void (*condition_destroy_cb)(struct lttng_condition *condition);
-typedef bool (*condition_validate_cb)(const struct lttng_condition *condition);
-typedef int (*condition_serialize_cb)(
- const struct lttng_condition *condition,
- struct lttng_payload *payload);
-typedef bool (*condition_equal_cb)(const struct lttng_condition *a,
- const struct lttng_condition *b);
-typedef ssize_t (*condition_create_from_payload_cb)(
- struct lttng_payload_view *view,
- struct lttng_condition **condition);
-typedef enum lttng_error_code (*condition_mi_serialize_cb)(
- const struct lttng_condition *condition,
- struct mi_writer *writer);
+using condition_destroy_cb = void (*)(struct lttng_condition *);
+using condition_validate_cb = bool (*)(const struct lttng_condition *);
+using condition_serialize_cb = int (*)(const struct lttng_condition *, struct lttng_payload *);
+using condition_equal_cb = bool (*)(const struct lttng_condition *, const struct lttng_condition *);
+using condition_create_from_payload_cb = ssize_t (*)(struct lttng_payload_view *,
+ struct lttng_condition **);
+using condition_mi_serialize_cb = enum lttng_error_code (*)(const struct lttng_condition *,
+ struct mi_writer *);
struct lttng_condition {
/* Reference counting is only exposed to internal users. */
struct lttng_payload;
struct lttng_payload_view;
-typedef void (*evaluation_destroy_cb)(struct lttng_evaluation *evaluation);
-typedef int (*evaluation_serialize_cb)(
- const struct lttng_evaluation *evaluation,
- struct lttng_payload *payload);
+using evaluation_destroy_cb = void (*)(struct lttng_evaluation *);
+using evaluation_serialize_cb = int (*)(const struct lttng_evaluation *, struct lttng_payload *);
struct lttng_evaluation_comm {
/* enum lttng_condition_type type */
LTTNG_EVENT_RULE_GENERATE_EXCLUSIONS_STATUS_OUT_OF_MEMORY,
};
-typedef void (*event_rule_destroy_cb)(struct lttng_event_rule *event_rule);
-typedef bool (*event_rule_validate_cb)(
- const struct lttng_event_rule *event_rule);
-typedef int (*event_rule_serialize_cb)(
- const struct lttng_event_rule *event_rule,
- struct lttng_payload *payload);
-typedef bool (*event_rule_equal_cb)(const struct lttng_event_rule *a,
- const struct lttng_event_rule *b);
-typedef ssize_t (*event_rule_create_from_payload_cb)(
- struct lttng_payload_view *view,
- struct lttng_event_rule **event_rule);
-typedef enum lttng_error_code (*event_rule_generate_filter_bytecode_cb)(
- struct lttng_event_rule *event_rule,
- const struct lttng_credentials *creds);
-typedef const char *(*event_rule_get_filter_cb)(
- const struct lttng_event_rule *event_rule);
-typedef const struct lttng_bytecode *(
- *event_rule_get_filter_bytecode_cb)(
- const struct lttng_event_rule *event_rule);
-typedef enum lttng_event_rule_generate_exclusions_status (
- *event_rule_generate_exclusions_cb)(
- const struct lttng_event_rule *event_rule,
- struct lttng_event_exclusion **exclusions);
-typedef unsigned long (*event_rule_hash_cb)(
- const struct lttng_event_rule *event_rule);
-typedef struct lttng_event *(*event_rule_generate_lttng_event_cb)(
- const struct lttng_event_rule *event_rule);
-typedef enum lttng_error_code (*event_rule_mi_serialize_cb)(
- const struct lttng_event_rule *event_rule,
- struct mi_writer *writer);
+using event_rule_destroy_cb = void (*)(struct lttng_event_rule *);
+using event_rule_validate_cb = bool (*)(const struct lttng_event_rule *);
+using event_rule_serialize_cb = int (*)(const struct lttng_event_rule *, struct lttng_payload *);
+using event_rule_equal_cb = bool (*)(const struct lttng_event_rule *,
+ const struct lttng_event_rule *);
+using event_rule_create_from_payload_cb = ssize_t (*)(struct lttng_payload_view *,
+ struct lttng_event_rule **);
+using event_rule_generate_filter_bytecode_cb =
+ enum lttng_error_code (*)(struct lttng_event_rule *, const struct lttng_credentials *);
+using event_rule_get_filter_cb = const char *(*) (const struct lttng_event_rule *);
+using event_rule_get_filter_bytecode_cb =
+ const struct lttng_bytecode *(*) (const struct lttng_event_rule *);
+using event_rule_generate_exclusions_cb = enum lttng_event_rule_generate_exclusions_status (*)(
+ const struct lttng_event_rule *, struct lttng_event_exclusion **);
+using event_rule_hash_cb = unsigned long (*)(const struct lttng_event_rule *);
+using event_rule_generate_lttng_event_cb = struct lttng_event *(*) (const struct lttng_event_rule *);
+using event_rule_mi_serialize_cb = enum lttng_error_code (*)(const struct lttng_event_rule *,
+ struct mi_writer *);
struct lttng_event_rule {
struct urcu_ref ref;
struct lttng_dynamic_buffer;
struct mi_writer;
-typedef bool (*kernel_probe_location_equal_cb)(
- const struct lttng_kernel_probe_location *a,
- const struct lttng_kernel_probe_location *b);
-typedef int (*kernel_probe_location_serialize_cb)(
- const struct lttng_kernel_probe_location *kernel_probe_location,
- struct lttng_payload *payload);
-typedef bool (*kernel_probe_location_equal_cb)(
- const struct lttng_kernel_probe_location *a,
- const struct lttng_kernel_probe_location *b);
-typedef ssize_t (*kernel_probe_location_create_from_payload_cb)(
- struct lttng_payload_view *view,
- struct lttng_kernel_probe_location **kernel_probe_location);
-typedef unsigned long (*kernel_probe_location_hash_cb)(
- const struct lttng_kernel_probe_location *location);
-typedef enum lttng_error_code (*kernel_probe_location_mi_serialize_cb)(
- const struct lttng_kernel_probe_location *location,
- struct mi_writer *writer);
+using kernel_probe_location_equal_cb = bool (*)(const struct lttng_kernel_probe_location *,
+ const struct lttng_kernel_probe_location *);
+using kernel_probe_location_serialize_cb = int (*)(const struct lttng_kernel_probe_location *,
+ struct lttng_payload *);
+using kernel_probe_location_equal_cb = bool (*)(const struct lttng_kernel_probe_location *,
+ const struct lttng_kernel_probe_location *);
+using kernel_probe_location_create_from_payload_cb =
+ ssize_t (*)(struct lttng_payload_view *, struct lttng_kernel_probe_location **);
+using kernel_probe_location_hash_cb = unsigned long (*)(const struct lttng_kernel_probe_location *);
+using kernel_probe_location_mi_serialize_cb =
+ enum lttng_error_code (*)(const struct lttng_kernel_probe_location *, struct mi_writer *);
struct lttng_kernel_probe_location_comm {
/* enum lttng_kernel_probe_location_type */
*
*/
-
-typedef void (*lttng_release_func)(void *);
+using lttng_release_func = void (*)(void *);
struct lttng_ref {
unsigned long count;
#ifndef LTTNG_USERSPACE_PROBE_INTERNAL_H
#define LTTNG_USERSPACE_PROBE_INTERNAL_H
-#include <lttng/userspace-probe.h>
-#include <common/macros.hpp>
#include <common/fd-handle.hpp>
+#include <common/macros.hpp>
+
+#include <lttng/lttng-error.h>
+#include <lttng/userspace-probe.h>
+
#include <stdbool.h>
struct lttng_payload;
struct lttng_dynamic_buffer;
struct mi_writer;
-typedef bool (*userspace_probe_location_equal_cb)(
- const struct lttng_userspace_probe_location *a,
- const struct lttng_userspace_probe_location *b);
-typedef unsigned long (*userspace_probe_location_hash_cb)(
- const struct lttng_userspace_probe_location *location);
-typedef enum lttng_error_code (*userspace_probe_location_mi)(
- const struct lttng_userspace_probe_location *location,
- struct mi_writer);
+using userspace_probe_location_equal_cb = bool (*)(const struct lttng_userspace_probe_location *,
+ const struct lttng_userspace_probe_location *);
+using userspace_probe_location_hash_cb =
+ unsigned long (*)(const struct lttng_userspace_probe_location *);
+using userspace_probe_location_mi =
+ enum lttng_error_code (*)(const struct lttng_userspace_probe_location *, struct mi_writer);
/*
* No elf-specific comm structure is defined since no elf-specific payload is
* Only return non-zero on a fatal error that should shut down the action
* executor.
*/
-typedef int (*action_executor_handler)(struct action_executor *executor,
- const struct action_work_item *,
- struct action_work_subitem *item);
+using action_executor_handler = int (*)(struct action_executor *,
+ const struct action_work_item *,
+ struct action_work_subitem *);
static int action_executor_notify_handler(struct action_executor *executor,
const struct action_work_item *,
#include <urcu/rculist.h>
#include <urcu/uatomic.h>
-typedef enum lttng_event_rule_status (*event_rule_logging_get_name_pattern)(
- const struct lttng_event_rule *rule, const char **pattern);
-typedef enum lttng_event_rule_status (*event_rule_logging_get_log_level_rule)(
- const struct lttng_event_rule *rule, const struct lttng_log_level_rule **log_level_rule);
+using event_rule_logging_get_name_pattern =
+ enum lttng_event_rule_status (*)(const struct lttng_event_rule *, const char **);
+using event_rule_logging_get_log_level_rule = enum lttng_event_rule_status (*)(
+ const struct lttng_event_rule *, const struct lttng_log_level_rule **);
/*
* Agent application context representation.
* completed successfully. On failure, the handler's return code should
* be the only reply sent to the client.
*/
-typedef enum lttng_error_code (*completion_handler_function)(void *);
+using completion_handler_function = enum lttng_error_code (*)(void *);
struct cmd_completion_handler {
completion_handler_function run;
void *data;
void notification_client_list_put(struct notification_client_list *list);
/* Only returns a non-zero value if a fatal error occurred. */
-typedef int (*report_client_transmission_result_cb)(
- struct notification_client *client,
- enum client_transmission_status status,
- void *user_data);
+using report_client_transmission_result_cb = int (*)(struct notification_client *,
+ enum client_transmission_status,
+ void *);
int notification_client_list_send_evaluation(
struct notification_client_list *list,
#include <urcu/list.h>
#include <urcu/rculfhash.h>
-typedef uint64_t notification_client_id;
+using notification_client_id = uint64_t;
/*
* The notification thread holds no ownership of the tracer event source pipe
struct ltt_ust_session;
-typedef void (*ltt_session_destroy_notifier)(const struct ltt_session *session,
- void *user_data);
-typedef void (*ltt_session_clear_notifier)(const struct ltt_session *session,
- void *user_data);
+using ltt_session_destroy_notifier = void (*)(const struct ltt_session *, void *);
+using ltt_session_clear_notifier = void (*)(const struct ltt_session *, void *);
namespace lttng {
namespace sessiond {
struct lttng_thread;
/* Main function of the new thread. */
-typedef void *(*lttng_thread_entry_point)(void *);
+using lttng_thread_entry_point = void *(*) (void *);
/* Callback invoked to initiate the shutdown a thread. */
-typedef bool (*lttng_thread_shutdown_cb)(void *);
+using lttng_thread_shutdown_cb = bool (*)(void *);
/*
* Callback invoked to clean-up the thread data.
* race between a use by the "thread shutdown callback" and
* a use by the thread itself.
*/
-typedef void (*lttng_thread_cleanup_cb)(void *);
+using lttng_thread_cleanup_cb = void (*)(void *);
/*
* Returns a reference to the newly-created thread.
#define INDENTATION_LEVEL_STR " "
-typedef enum lttng_event_rule_status (*event_rule_logging_get_name_pattern)(
- const struct lttng_event_rule *rule, const char **pattern);
-typedef enum lttng_event_rule_status (*event_rule_logging_get_filter)(
- const struct lttng_event_rule *rule, const char **expression);
-typedef enum lttng_event_rule_status (*event_rule_logging_get_log_level_rule)(
- const struct lttng_event_rule *rule, const struct lttng_log_level_rule **log_level_rule);
+using event_rule_logging_get_name_pattern =
+ enum lttng_event_rule_status (*)(const struct lttng_event_rule *, const char **);
+using event_rule_logging_get_filter =
+ enum lttng_event_rule_status (*)(const struct lttng_event_rule *, const char **);
+using event_rule_logging_get_log_level_rule = enum lttng_event_rule_status (*)(
+ const struct lttng_event_rule *, const struct lttng_log_level_rule **);
enum {
OPT_HELP,
#define IS_ONCE_AFTER_N_RATE_POLICY(policy) \
(lttng_rate_policy_get_type(policy) == LTTNG_RATE_POLICY_TYPE_ONCE_AFTER_N)
-typedef void (*rate_policy_destroy_cb)(struct lttng_rate_policy *rate_policy);
-typedef int (*rate_policy_serialize_cb)(struct lttng_rate_policy *rate_policy,
- struct lttng_payload *payload);
-typedef bool (*rate_policy_equal_cb)(const struct lttng_rate_policy *a,
- const struct lttng_rate_policy *b);
-typedef ssize_t (*rate_policy_create_from_payload_cb)(struct lttng_payload_view *view,
- struct lttng_rate_policy **rate_policy);
-typedef struct lttng_rate_policy *(*rate_policy_copy_cb)(const struct lttng_rate_policy *source);
-typedef enum lttng_error_code (*rate_policy_mi_serialize_cb)(
- const struct lttng_rate_policy *rate_policy, struct mi_writer *writer);
+using rate_policy_destroy_cb = void (*)(struct lttng_rate_policy *);
+using rate_policy_serialize_cb = int (*)(struct lttng_rate_policy *, struct lttng_payload *);
+using rate_policy_equal_cb = bool (*)(const struct lttng_rate_policy *,
+ const struct lttng_rate_policy *);
+using rate_policy_create_from_payload_cb = ssize_t (*)(struct lttng_payload_view *,
+ struct lttng_rate_policy **);
+using rate_policy_copy_cb = struct lttng_rate_policy *(*) (const struct lttng_rate_policy *);
+using rate_policy_mi_serialize_cb = enum lttng_error_code (*)(const struct lttng_rate_policy *,
+ struct mi_writer *);
struct lttng_rate_policy {
enum lttng_rate_policy_type type;
NR_BYTECODE_OPS,
};
-typedef uint8_t bytecode_opcode_t;
+using bytecode_opcode_t = uint8_t;
struct load_op {
bytecode_opcode_t op;
struct lttng_directory_handle;
-typedef void (*lttng_directory_handle_destroy_cb)(
- struct lttng_directory_handle *handle, void *data);
+using lttng_directory_handle_destroy_cb = void (*)(struct lttng_directory_handle *, void *);
struct lttng_directory_handle {
struct urcu_ref ref;
#define LTTNG_SOCK_CREDS SCM_CREDENTIALS
-typedef struct ucred lttng_sock_cred;
+using lttng_sock_cred = struct ucred;
#define LTTNG_SOCK_SET_UID_CRED(c, u) LTTNG_REF(c)->uid = u
#define LTTNG_SOCK_SET_GID_CRED(c, g) LTTNG_REF(c)->gid = g
#include <inttypes.h>
#include <signal.h>
-typedef int (*sample_positions_cb)(struct lttng_consumer_stream *stream);
-typedef int (*get_consumed_cb)(struct lttng_consumer_stream *stream, unsigned long *consumed);
-typedef int (*get_produced_cb)(struct lttng_consumer_stream *stream, unsigned long *produced);
-typedef int (*flush_index_cb)(struct lttng_consumer_stream *stream);
+using sample_positions_cb = int (*)(struct lttng_consumer_stream *);
+using get_consumed_cb = int (*)(struct lttng_consumer_stream *, unsigned long *);
+using get_produced_cb = int (*)(struct lttng_consumer_stream *, unsigned long *);
+using flush_index_cb = int (*)(struct lttng_consumer_stream *);
static struct timer_signal_data timer_signal = {
.tid = 0,
*
* Stream and channel locks are acquired during this call.
*/
-typedef int (*on_wake_up_cb)(struct lttng_consumer_stream *);
+using on_wake_up_cb = int (*)(struct lttng_consumer_stream *);
/*
* Perform any operation required before a consumer stream is put
*
* Stream and channel locks are acquired during this call.
*/
-typedef int (*on_sleep_cb)(struct lttng_consumer_stream *,
- struct lttng_consumer_local_data *);
+using on_sleep_cb = int (*)(struct lttng_consumer_stream *, struct lttng_consumer_local_data *);
/*
* Acquire the subbuffer at the current 'consumed' position.
*
* Stream and channel locks are acquired during this call.
*/
-typedef enum get_next_subbuffer_status (*get_next_subbuffer_cb)(
- struct lttng_consumer_stream *, struct stream_subbuffer *);
+using get_next_subbuffer_cb = enum get_next_subbuffer_status (*)(struct lttng_consumer_stream *,
+ struct stream_subbuffer *);
/*
* Populate the stream_subbuffer's info member. The info to populate
*
* Stream and channel locks are acquired during this call.
*/
-typedef int (*extract_subbuffer_info_cb)(
- struct lttng_consumer_stream *, struct stream_subbuffer *);
+using extract_subbuffer_info_cb = int (*)(struct lttng_consumer_stream *,
+ struct stream_subbuffer *);
/*
* Invoked after a subbuffer's info has been filled.
*
* Stream and channel locks are acquired during this call.
*/
-typedef int (*pre_consume_subbuffer_cb)(struct lttng_consumer_stream *,
- const struct stream_subbuffer *);
+using pre_consume_subbuffer_cb = int (*)(struct lttng_consumer_stream *,
+ const struct stream_subbuffer *);
/*
* Consume subbuffer contents.
*
* Stream and channel locks are acquired during this call.
*/
-typedef ssize_t (*consume_subbuffer_cb)(struct lttng_consumer_local_data *,
- struct lttng_consumer_stream *,
- const struct stream_subbuffer *);
+using consume_subbuffer_cb = ssize_t (*)(struct lttng_consumer_local_data *,
+ struct lttng_consumer_stream *,
+ const struct stream_subbuffer *);
/*
* Release the current subbuffer and advance the 'consumed' position by
*
* Stream and channel locks are acquired during this call.
*/
-typedef int (*put_next_subbuffer_cb)(struct lttng_consumer_stream *,
- struct stream_subbuffer *);
+using put_next_subbuffer_cb = int (*)(struct lttng_consumer_stream *, struct stream_subbuffer *);
/*
* Invoked after consuming a subbuffer.
*
* Stream and channel locks are acquired during this call.
*/
-typedef int (*post_consume_cb)(struct lttng_consumer_stream *,
- const struct stream_subbuffer *,
- struct lttng_consumer_local_data *);
+using post_consume_cb = int (*)(struct lttng_consumer_stream *,
+ const struct stream_subbuffer *,
+ struct lttng_consumer_local_data *);
/*
* Send a live beacon if no data is available.
*
* Stream and channel locks are acquired during this call.
*/
-typedef int (*send_live_beacon_cb)(struct lttng_consumer_stream *);
+using send_live_beacon_cb = int (*)(struct lttng_consumer_stream *);
/*
* Lock the stream and channel locks and any other stream-type specific
* lock that need to be acquired during the processing of an
* availability notification.
*/
-typedef void (*lock_cb)(struct lttng_consumer_stream *);
+using lock_cb = void (*)(struct lttng_consumer_stream *);
/*
* Unlock the stream and channel locks and any other stream-type specific
*
* Stream and channel locks are acquired during this call.
*/
-typedef void (*unlock_cb)(struct lttng_consumer_stream *);
+using unlock_cb = void (*)(struct lttng_consumer_stream *);
/*
* Assert that the stream and channel lock and any other stream type specific
* lock that need to be acquired during the processing of a read_subbuffer
* operation is acquired.
*/
-typedef void (*assert_locked_cb)(struct lttng_consumer_stream *);
+using assert_locked_cb = void (*)(struct lttng_consumer_stream *);
/*
* Invoked when a subbuffer's metadata version does not match the last
*
* Stream and channel locks are acquired during this call.
*/
-typedef void (*reset_metadata_cb)(struct lttng_consumer_stream *);
+using reset_metadata_cb = void (*)(struct lttng_consumer_stream *);
/*
* Internal representation of the streams, sessiond_key is used to identify
struct metadata_bucket;
-typedef ssize_t (*metadata_bucket_flush_cb)(
- const struct stream_subbuffer *buffer, void *data);
+using metadata_bucket_flush_cb = ssize_t (*)(const struct stream_subbuffer *, void *);
enum metadata_bucket_status {
METADATA_BUCKET_STATUS_OK,
#include <common/dynamic-buffer.hpp>
-typedef void (*lttng_dynamic_array_element_destructor)(void *element);
-typedef void (*lttng_dynamic_pointer_array_destructor)(void *ptr);
+using lttng_dynamic_array_element_destructor = void (*)(void *);
+using lttng_dynamic_pointer_array_destructor = void (*)(void *);
struct lttng_dynamic_array {
struct lttng_dynamic_buffer buffer;
*
* Must return zero on success. Negative values should map to a UNIX error code.
*/
-typedef int (*fd_open_cb)(void *, int *out_fds);
+using fd_open_cb = int (*)(void *, int *);
/*
* Callback to allow the user to close a now-untracked file descriptor. This
*
* Must return zero on success. Negative values should map to a UNIX error code.
*/
-typedef int (*fd_close_cb)(void *, int *in_fds);
+using fd_close_cb = int (*)(void *, int *);
/*
* Set the maximal number of fds that the process should be allowed to open at
--- /dev/null
+Checks: '-*,llvm-twine-local'
#ifndef YY_TYPEDEF_YY_SCANNER_T
#define YY_TYPEDEF_YY_SCANNER_T
-typedef void* yyscan_t;
+using yyscan_t = void *;
#endif
extern int filter_parser_debug;
* to use an fd-tracker.
*/
-typedef int (*fs_handle_get_fd_cb)(struct fs_handle *);
-typedef void (*fs_handle_put_fd_cb)(struct fs_handle *);
-typedef int (*fs_handle_unlink_cb)(struct fs_handle *);
-typedef int (*fs_handle_close_cb)(struct fs_handle *);
+using fs_handle_get_fd_cb = int (*)(struct fs_handle *);
+using fs_handle_put_fd_cb = void (*)(struct fs_handle *);
+using fs_handle_unlink_cb = int (*)(struct fs_handle *);
+using fs_handle_close_cb = int (*)(struct fs_handle *);
struct fs_handle {
fs_handle_get_fd_cb get_fd;
LTTNG_EXPORT extern unsigned long lttng_ht_seed;
-typedef unsigned long (*hash_fct_type)(const void *_key, unsigned long seed);
-typedef cds_lfht_match_fct hash_match_fct;
+using hash_fct_type = unsigned long (*)(const void *, unsigned long);
+using hash_match_fct = cds_lfht_match_fct;
enum lttng_ht_type {
LTTNG_HT_TYPE_STRING,
* config_entry_handler_cb may return negative value to indicate an error in
* the configuration file.
*/
-typedef int (*config_entry_handler_cb)(const struct config_entry *, void *);
+using config_entry_handler_cb = int (*)(const struct config_entry *, void *);
/*
* Read a section's entries in an INI configuration file.
/* Make this header file easier to include in C++ code */
#include <stdio.h>
-typedef int (*ini_entry_handler)(void *, const char *, const char *,
- const char *);
+using ini_entry_handler = int (*)(void *, const char *, const char *, const char *);
/*
* Parse given INI-style file. May have [section]s, name=value pairs
};
/* Error query callbacks. */
-typedef enum lttng_error_code (*mi_lttng_error_query_trigger_cb)(
- const struct lttng_trigger *trigger,
- struct lttng_error_query_results **results);
-typedef enum lttng_error_code (*mi_lttng_error_query_condition_cb)(
- const struct lttng_trigger *trigger,
- struct lttng_error_query_results **results);
-typedef enum lttng_error_code (*mi_lttng_error_query_action_cb)(
- const struct lttng_trigger *trigger,
- const struct lttng_action_path *action_path,
- struct lttng_error_query_results **results);
+using mi_lttng_error_query_trigger_cb = enum lttng_error_code (*)(
+ const struct lttng_trigger *, struct lttng_error_query_results **);
+using mi_lttng_error_query_condition_cb = enum lttng_error_code (*)(
+ const struct lttng_trigger *, struct lttng_error_query_results **);
+using mi_lttng_error_query_action_cb =
+ enum lttng_error_code (*)(const struct lttng_trigger *,
+ const struct lttng_action_path *,
+ struct lttng_error_query_results **);
struct mi_lttng_error_query_callbacks {
mi_lttng_error_query_trigger_cb trigger_cb;
namespace {
struct run_as_data;
struct run_as_ret;
-typedef int (*run_as_fct)(struct run_as_data *data, struct run_as_ret *ret_value);
+using run_as_fct = int (*)(struct run_as_data *, struct run_as_ret *);
struct run_as_mkdir_data {
int dirfd;
* A negative return value will cause the run-as process to exit with a non-zero
* value.
*/
-typedef int (*post_fork_cleanup_cb)(void *user_data);
+using post_fork_cleanup_cb = int (*)(void *);
int run_as_mkdir_recursive(const char *path, mode_t mode, uid_t uid, gid_t gid);
int run_as_mkdirat_recursive(int dirfd, const char *path, mode_t mode,
* since only one thread may access a chunk during its destruction (the last
* to release its reference to the chunk).
*/
-typedef int (*chunk_command)(struct lttng_trace_chunk *trace_chunk);
+using chunk_command = int (*)(struct lttng_trace_chunk *);
/* Move a completed trace chunk to the 'completed' trace archive folder. */
static int lttng_trace_chunk_move_to_completed_post_release(struct lttng_trace_chunk *trace_chunk);
lttng_userspace_probe_location_mi_serialize(const struct lttng_userspace_probe_location *location,
struct mi_writer *writer)
{
- typedef enum lttng_error_code (*mi_fp)(const struct lttng_userspace_probe_location *,
- struct mi_writer *);
+ using mi_fp = enum lttng_error_code (*)(const struct lttng_userspace_probe_location *,
+ struct mi_writer *);
int ret;
enum lttng_error_code ret_code;
static void ppoll_concurrent_write(FILE *validation_output_file);
static void epoll_pwait_concurrent_munmap(FILE *validation_output_file);
-typedef void (*test_case_cb)(FILE *output_file);
+using test_case_cb = void (*)(FILE *);
namespace {
const struct test_case {
#define FIELD_NAME_MAX_LEN 256
/* A callback to populate the condition capture descriptor. */
-typedef int (*condition_capture_desc_cb)(struct lttng_condition *condition);
+using condition_capture_desc_cb = int (*)(struct lttng_condition *);
/* A callback for captured field validation. */
-typedef int (*validate_cb)(const struct lttng_event_field_value *event_field, unsigned iteration);
+using validate_cb = int (*)(const struct lttng_event_field_value *, unsigned int);
int nb_args = 0;
int named_pipe_args_start = 0;
struct lttng_condition **condition,
struct lttng_trigger **trigger)
{
- typedef struct lttng_event_rule *(*event_rule_create)(void);
- typedef enum lttng_event_rule_status (
- *event_rule_set_name_pattern)(struct lttng_event_rule * rule, const char *pattern);
- typedef enum lttng_event_rule_status (
- *event_rule_set_filter)(struct lttng_event_rule * rule, const char *expression);
- typedef enum lttng_event_rule_status (*event_rule_add_name_pattern_exclusion)(
- struct lttng_event_rule * rule, const char *exclusion);
+ using event_rule_create = struct lttng_event_rule *(*) ();
+ using event_rule_set_name_pattern =
+ enum lttng_event_rule_status (*)(struct lttng_event_rule *, const char *);
+ using event_rule_set_filter =
+ enum lttng_event_rule_status (*)(struct lttng_event_rule *, const char *);
+ using event_rule_add_name_pattern_exclusion =
+ enum lttng_event_rule_status (*)(struct lttng_event_rule *, const char *);
enum lttng_event_rule_status event_rule_status;
struct lttng_action *tmp_action = NULL;
UNREGISTRATION_TRIGGER_INSTANCE_FROM_LISTING,
};
-typedef void (*test_function)(enum unregistration_trigger_instance);
+using test_function = void (*)(enum unregistration_trigger_instance);
static const char *get_trigger_name(const struct lttng_trigger *trigger)
{
* Returns the number of tests that ran (irrespective of the result) or a
* negative value on error (will abort all tests).
*/
-typedef int(test_func)(const char *test_base_path);
+using test_func = int(const char *);
static test_func test_rmdir_fail_non_empty;
static test_func test_rmdir_skip_non_empty;
};
} /* namespace */
-typedef const char *(*log_level_name_getter)(int log_level);
+using log_level_name_getter = const char *(*) (int);
-typedef struct lttng_event_rule *(*event_rule_create)(void);
-typedef enum lttng_event_rule_status (*event_rule_set_log_level)(
- struct lttng_event_rule *rule, const struct lttng_log_level_rule *log_level_rule);
+using event_rule_create = struct lttng_event_rule *(*) ();
+using event_rule_set_log_level = enum lttng_event_rule_status (*)(
+ struct lttng_event_rule *, const struct lttng_log_level_rule *);
static void test_event_rule_kernel_tracepoint(void)
{