aboutsummaryrefslogtreecommitdiff
path: root/include/libcasio/log.h
blob: 0ccce1dbaf3ba8994cbffaabc4ae210f4e4f2d87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/* ****************************************************************************
 * libcasio/log.h -- libcasio logging.
 * Copyright (C) 2017 Thomas "Cakeisalie5" Touhey <thomas@touhey.fr>
 *
 * This file is part of libcasio.
 * libcasio is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 3.0 of the License,
 * or (at your option) any later version.
 *
 * libcasio is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with libcasio; if not, see <http://www.gnu.org/licenses/>.
 * ************************************************************************* */
#ifndef  LIBCASIO_LOG_H
# define LIBCASIO_LOG_H
# include "cdefs.h"
# include "iter.h"
CASIO_BEGIN_NAMESPACE
CASIO_BEGIN_DECLS

/* Get and set the log level at runtime. */

CASIO_EXTERN void        CASIO_EXPORT casio_setlog
	OF((const char *casio__level));
CASIO_EXTERN const char* CASIO_EXPORT casio_getlog
	OF((void));

/* List log levels (deprecated interface) */

typedef void casio_log_list_t OF((void *casio__cookie,
	const char *casio__str));

CASIO_EXTERN CASIO_DEPRECATED void CASIO_EXPORT casio_listlog
	OF((casio_log_list_t *casio__callback, void *casio__cookie));

/* List log levels (new interface).
 * This iterator yields strings (`const char *`). */

CASIO_EXTERN int CASIO_EXPORT casio_iter_log
	OF((casio_iter_t **casio__iter));
# define casio_next_log(ITER, PTRP) (casio_next((ITER), (void **)(PTRP)))

CASIO_END_DECLS
CASIO_END_NAMESPACE
#endif /* LIBCASIO_LOG_H */