stumpless  2.1.0
buffer.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: Apache-2.0 */
2 
3 /*
4  * Copyright 2018-2022 Joel E. Anderson
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
43 #ifndef __STUMPLESS_TARGET_BUFFER_H
44 # define __STUMPLESS_TARGET_BUFFER_H
45 
46 # include <stddef.h>
47 # include <stumpless/config.h>
48 # include <stumpless/target.h>
49 
50 # ifdef __cplusplus
51 extern "C" {
52 # endif
53 
78 void
80 
117 struct stumpless_target *
119  char *buffer,
120  size_t size );
121 
161 size_t
163  char *buffer,
164  size_t max_length );
165 
166 # ifdef __cplusplus
167 } /* extern "C" */
168 # endif
169 #endif /* __STUMPLESS_TARGET_BUFFER_H */
stumpless_target::name
char * name
The name of this target.
Definition: target.h:153
stumpless_target
A target that log entries can be sent to.
Definition: target.h:136
stumpless_read_buffer
size_t stumpless_read_buffer(struct stumpless_target *target, char *buffer, size_t max_length)
Reads the next message from the provided buffer target and writes it into the given buffer.
stumpless_close_buffer_target
void stumpless_close_buffer_target(const struct stumpless_target *target)
Closes a buffer target.
target.h
STUMPLESS_PUBLIC_FUNCTION
#define STUMPLESS_PUBLIC_FUNCTION
Marks functions that are provided for use by the library.
Definition: config.h:31
config.h
stumpless_open_buffer_target
struct stumpless_target * stumpless_open_buffer_target(const char *name, char *buffer, size_t size)
Creates a buffer target for the given buffer.