Drizzled Public API Documentation

drizzle_local.h
Go to the documentation of this file.
1 /*
2  * Drizzle Client & Protocol Library
3  *
4  * Copyright (C) 2008 Eric Day (eday@oddments.org)
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are
9  * met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  *
14  * * Redistributions in binary form must reproduce the above
15  * copyright notice, this list of conditions and the following disclaimer
16  * in the documentation and/or other materials provided with the
17  * distribution.
18  *
19  * * The names of its contributors may not be used to endorse or
20  * promote products derived from this software without specific prior
21  * written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34  *
35  */
36 
37 #pragma once
38 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
62 DRIZZLE_LOCAL
63 void drizzle_set_error(drizzle_st *drizzle, const char *function,
64  const char *format, ...);
65 
75 DRIZZLE_LOCAL
76 void drizzle_log(drizzle_st *drizzle, drizzle_verbose_t verbose,
77  const char *format, va_list args);
78 
82 static inline void drizzle_log_fatal(drizzle_st *drizzle, const char *format,
83  ...)
84 {
85  va_list args;
86 
87  if (drizzle->verbose >= DRIZZLE_VERBOSE_FATAL)
88  {
89  va_start(args, format);
90  drizzle_log(drizzle, DRIZZLE_VERBOSE_FATAL, format, args);
91  va_end(args);
92  }
93 }
94 
98 static inline void drizzle_log_error(drizzle_st *drizzle, const char *format,
99  ...)
100 {
101  va_list args;
102 
103  if (drizzle->verbose >= DRIZZLE_VERBOSE_ERROR)
104  {
105  va_start(args, format);
106  drizzle_log(drizzle, DRIZZLE_VERBOSE_ERROR, format, args);
107  va_end(args);
108  }
109 }
110 
114 static inline void drizzle_log_info(drizzle_st *drizzle, const char *format,
115  ...)
116 {
117  va_list args;
118 
119  if (drizzle->verbose >= DRIZZLE_VERBOSE_INFO)
120  {
121  va_start(args, format);
122  drizzle_log(drizzle, DRIZZLE_VERBOSE_INFO, format, args);
123  va_end(args);
124  }
125 }
126 
130 static inline void drizzle_log_debug(drizzle_st *drizzle, const char *format,
131  ...)
132 {
133  va_list args;
134 
135  if (drizzle->verbose >= DRIZZLE_VERBOSE_DEBUG)
136  {
137  va_start(args, format);
138  drizzle_log(drizzle, DRIZZLE_VERBOSE_DEBUG, format, args);
139  va_end(args);
140  }
141 }
142 
146 static inline void drizzle_log_crazy(drizzle_st *drizzle, const char *format,
147  ...)
148 {
149  va_list args;
150 
151  if (drizzle->verbose >= DRIZZLE_VERBOSE_CRAZY)
152  {
153  va_start(args, format);
154  drizzle_log(drizzle, DRIZZLE_VERBOSE_CRAZY, format, args);
155  va_end(args);
156  }
157 }
158 
161 #ifdef __cplusplus
162 }
163 #endif
static void drizzle_log_crazy(drizzle_st *drizzle, const char *format,...)
DRIZZLE_LOCAL void drizzle_set_error(drizzle_st *drizzle, const char *function, const char *format,...)
Definition: drizzle.cc:881
static void drizzle_log_debug(drizzle_st *drizzle, const char *format,...)
DRIZZLE_LOCAL void drizzle_log(drizzle_st *drizzle, drizzle_verbose_t verbose, const char *format, va_list args)
Definition: drizzle.cc:930
static void drizzle_log_fatal(drizzle_st *drizzle, const char *format,...)
Definition: drizzle_local.h:82
static void drizzle_log_error(drizzle_st *drizzle, const char *format,...)
Definition: drizzle_local.h:98
static void drizzle_log_info(drizzle_st *drizzle, const char *format,...)