rcutils
master
C API providing common utilities and data structures.
include
rcutils
snprintf.h
Go to the documentation of this file.
1
// Copyright 2017 Open Source Robotics Foundation, Inc.
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
16
17
#ifndef RCUTILS__SNPRINTF_H_
18
#define RCUTILS__SNPRINTF_H_
19
20
#ifdef __cplusplus
21
extern
"C"
22
{
23
#endif
24
25
#include <stdarg.h>
26
#include <stddef.h>
27
28
#include "
rcutils/macros.h
"
29
#include "
rcutils/visibility_control.h
"
30
32
56
RCUTILS_PUBLIC
57
RCUTILS_WARN_UNUSED
58
int
59
rcutils_snprintf
(
char
* buffer,
size_t
buffer_size,
const
char
* format, ...)
61
RCUTILS_ATTRIBUTE_PRINTF_FORMAT
(3, 4)
63
;
64
66
RCUTILS_PUBLIC
67
RCUTILS_WARN_UNUSED
68
int
69
rcutils_vsnprintf
(
char
* buffer,
size_t
buffer_size, const
char
* format,
va_list
args);
70
71
#ifdef __cplusplus
72
}
73
#endif
74
75
#endif // RCUTILS__SNPRINTF_H_
RCUTILS_ATTRIBUTE_PRINTF_FORMAT
#define RCUTILS_ATTRIBUTE_PRINTF_FORMAT(format_string_index, first_to_check_index)
Definition:
macros.h:102
macros.h
rcutils_vsnprintf
int rcutils_vsnprintf(char *buffer, size_t buffer_size, const char *format, va_list args)
Format a string with va_list for arguments, see rcutils_snprintf().
RCUTILS_WARN_UNUSED
#define RCUTILS_WARN_UNUSED
A macro to make the compiler warn when the return value of a function is not used.
Definition:
macros.h:27
visibility_control.h
RCUTILS_PUBLIC
#define RCUTILS_PUBLIC
Definition:
visibility_control.h:23
va_list
rcutils_snprintf
int rcutils_snprintf(char *buffer, size_t buffer_size, const char *format,...)
Format a string.
Generated by
1.8.17