00001 /* 00002 * Drizzle Client & Protocol Library 00003 * 00004 * Copyright (C) 2008 Eric Day (eday@oddments.org) 00005 * All rights reserved. 00006 * 00007 * Use and distribution licensed under the BSD license. See 00008 * the COPYING file in this directory for full text. 00009 */ 00010 00016 #ifndef __DRIZZLE_CONN_LOCAL_H 00017 #define __DRIZZLE_CONN_LOCAL_H 00018 00019 #ifdef __cplusplus 00020 extern "C" { 00021 #endif 00022 00035 DRIZZLE_LOCAL 00036 void drizzle_con_reset_addrinfo(drizzle_con_st *con); 00037 00045 static inline bool drizzle_state_none(drizzle_con_st *con) 00046 { 00047 return con->state_current == 0; 00048 } 00049 00057 static inline void drizzle_state_push(drizzle_con_st *con, 00058 drizzle_state_fn *function) 00059 { 00060 /* The maximum stack depth can be determined at compile time, so bump this 00061 constant if needed to avoid the dynamic memory management. */ 00062 assert(con->state_current < DRIZZLE_STATE_STACK_SIZE); 00063 con->state_stack[con->state_current]= function; 00064 con->state_current++; 00065 } 00066 00073 static inline void drizzle_state_pop(drizzle_con_st *con) 00074 { 00075 con->state_current--; 00076 } 00077 00084 static inline void drizzle_state_reset(drizzle_con_st *con) 00085 { 00086 con->state_current= 0; 00087 } 00088 00091 #ifdef __cplusplus 00092 } 00093 #endif 00094 00095 #endif /* __DRIZZLE_CONN_LOCAL_H */