libdrizzle Developer Documentation

conn_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 * Use and distribution licensed under the BSD license. See
8 * the COPYING file in this directory for full text.
9 */
10
16#ifndef __DRIZZLE_CONN_LOCAL_H
17#define __DRIZZLE_CONN_LOCAL_H
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
37
45static inline bool drizzle_state_none(drizzle_con_st *con)
46{
47 return con->state_current == 0;
48}
49
57static inline void drizzle_state_push(drizzle_con_st *con,
58 drizzle_state_fn *function)
59{
60 /* The maximum stack depth can be determined at compile time, so bump this
61 constant if needed to avoid the dynamic memory management. */
63 con->state_stack[con->state_current]= function;
64 con->state_current++;
65}
66
73static inline void drizzle_state_pop(drizzle_con_st *con)
74{
75 con->state_current--;
76}
77
84static inline void drizzle_state_reset(drizzle_con_st *con)
85{
86 con->state_current= 0;
87}
88
91#ifdef __cplusplus
92}
93#endif
94
95#endif /* __DRIZZLE_CONN_LOCAL_H */
DRIZZLE_LOCAL void drizzle_con_reset_addrinfo(drizzle_con_st *con)
Definition conn.c:687
static void drizzle_state_reset(drizzle_con_st *con)
Definition conn_local.h:84
static void drizzle_state_pop(drizzle_con_st *con)
Definition conn_local.h:73
static void drizzle_state_push(drizzle_con_st *con, drizzle_state_fn *function)
Definition conn_local.h:57
static bool drizzle_state_none(drizzle_con_st *con)
Definition conn_local.h:45
#define DRIZZLE_STATE_STACK_SIZE
Definition constants.h:59
drizzle_return_t drizzle_state_fn(drizzle_con_st *con)
Definition constants.h:421
uint8_t state_current
Definition structs.h:78
drizzle_state_fn * state_stack[DRIZZLE_STATE_STACK_SIZE]
Definition structs.h:120
#define DRIZZLE_LOCAL
Definition visibility.h:46