1/* -*- c-basic-offset: 2 -*- */
2/*
3 Copyright(C) 2015-2016 Brazil
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License version 2.1 as published by the Free Software Foundation.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this library; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17*/
18
19#pragma once
20
21#include "../grn.h"
22#include "../grn_ctx.h"
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28/* GRN_TS_DEBUG() logs a message that is useful for debug. */
29#define GRN_TS_DEBUG(...) GRN_LOG(ctx, GRN_LOG_DEBUG, __VA_ARGS__)
30
31/* GRN_TS_WARN() logs a warning. */
32#define GRN_TS_WARN(rc, ...) WARN(rc, __VA_ARGS__)
33
34/* GRN_TS_ERR() reports an error. */
35#define GRN_TS_ERR(rc, ...) ERR(rc, __VA_ARGS__)
36
37/* GRN_TS_ERR_RETURN() reports an error and returns its error code. */
38#define GRN_TS_ERR_RETURN(rc, ...) do {\
39 GRN_TS_ERR(rc, __VA_ARGS__);\
40 return rc;\
41} while (GRN_FALSE)
42
43#ifdef __cplusplus
44}
45#endif
46
47