<commit_before>// Copyright 2014 Open Source Robotics Foundation, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef RMW__ERROR_HANDLING_H_
#define RMW__ERROR_HANDLING_H_

#if __cplusplus
extern "C"
{
#endif

#include <stddef.h>

#include "rmw/macros.h"
#include "rmw/visibility_control.h"

/// Struct which encapsulates the error state set by RMW_SET_ERROR_MSG().
typedef struct rmw_error_state_t
{
  const char * message;
  const char * file;
  size_t line_number;
} rmw_error_state_t;

/// Set the error message, the file it occurred in, and the line on which it occurred.
/**
 * This is not meant to be used directly, but instead via the RMW_SET_ERROR_MSG(msg) macro.
 *
 * The error_msg parameter is copied into the interal error storage and must be null terminated.
 * The file parameter is not copied, but instead is assumed to be a global as it should be set to
 * the __FILE__ preprocessor literal when used with the RMW_SET_ERROR_MSG macro.
 * It should also be null terminated.
 *
 * \param error_msg The error message to set.
 * \param file The path to the file in which the error occurred.
 * \param line_number The line number on which the error occurred.
 */
RMW_PUBLIC
void<commit_msg>add missing include<commit_after>// Copyright 2014 Open Source Robotics Foundation, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef RMW__ERROR_HANDLING_H_
#define RMW__ERROR_HANDLING_H_

#if __cplusplus
extern "C"
{
#endif

#include <stdbool.h>
#include <stddef.h>

#include "rmw/macros.h"
#include "rmw/visibility_control.h"

/// Struct which encapsulates the error state set by RMW_SET_ERROR_MSG().
typedef struct rmw_error_state_t
{
  const char * message;
  const char * file;
  size_t line_number;
} rmw_error_state_t;

/// Set the error message, the file it occurred in, and the line on which it occurred.
/**
 * This is not meant to be used directly, but instead via the RMW_SET_ERROR_MSG(msg) macro.
 *
 * The error_msg parameter is copied into the interal error storage and must be null terminated.
 * The file parameter is not copied, but instead is assumed to be a global as it should be set to
 * the __FILE__ preprocessor literal when used with the RMW_SET_ERROR_MSG macro.
 * It should also be null terminated.
 *
 * \param error_msg The error message to set.
 * \param file The path to the file in which the error occurred.
 * \param line_number The line number on which the error occurred.
 */
RMW_PUBLIC
void
{'fraction_non_alphanumeric': 0.073177758571017, 'fraction_numerical': 0.004609622587150677, 'mean_word_length': 3.8491620111731844, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4490720', 'n_tokens_mistral': 1027, 'n_tokens_neox': 988, 'n_words': 471}