stumpless
2.2.0
Loading...
Searching...
No Matches
function.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: Apache-2.0 */
2
3
/*
4
* Copyright 2021-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
44
#ifndef __STUMPLESS_TARGET_FUNCTION_H
45
# define __STUMPLESS_TARGET_FUNCTION_H
46
47
# include <stumpless/config.h>
48
# include <
stumpless/entry.h
>
49
# include <
stumpless/target.h
>
50
# include <
stumpless/target/function.h
>
51
52
# ifdef __cplusplus
53
extern
"C"
{
54
# endif
55
57
typedef
int ( *
stumpless_log_func_t
)(
const
struct
stumpless_target
*,
58
const
struct
stumpless_entry
* );
59
60
80
STUMPLESS_PUBLIC_FUNCTION
81
void
82
stumpless_close_function_target
(
const
struct
stumpless_target
*target );
83
121
STUMPLESS_PUBLIC_FUNCTION
122
struct
stumpless_target
*
123
stumpless_open_function_target
(
const
char
*
name
,
124
stumpless_log_func_t
log_function );
125
126
# ifdef __cplusplus
127
}
/* extern "C" */
128
# endif
129
#endif
/* __STUMPLESS_TARGET_FUNCTION_H */
STUMPLESS_PUBLIC_FUNCTION
#define STUMPLESS_PUBLIC_FUNCTION
Marks functions that are provided for use by the library.
Definition
config.h:31
entry.h
Types and functions for creating and modifying entries.
function.h
Function targets allow log entries to be sent to a custom function, making it possible to implement a...
stumpless_log_func_t
int(* stumpless_log_func_t)(const struct stumpless_target *, const struct stumpless_entry *)
A handler for entries sent to a function target.
Definition
function.h:57
stumpless_close_function_target
STUMPLESS_PUBLIC_FUNCTION void stumpless_close_function_target(const struct stumpless_target *target)
Closes a function target.
stumpless_open_function_target
STUMPLESS_PUBLIC_FUNCTION struct stumpless_target * stumpless_open_function_target(const char *name, stumpless_log_func_t log_function)
Opens a function target.
stumpless_entry
A log entry.
Definition
entry.h:60
stumpless_target
A target that log entries can be sent to.
Definition
target.h:140
stumpless_target::name
char * name
The name of this target.
Definition
target.h:157
target.h
General types and functions for working with all targets.
stumpless
target
function.h
Generated by
1.11.0