/* Copyright 2005 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file lcn_types.h * @brief Random stuff that doesn't fit anywhere else */ #ifndef _LCN_TYPES_H #define _LCN_TYPES_H #include #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** Since we use C89 we need a boolean type... */ typedef int lcn_boolean_t; #ifndef FALSE /** You figure it out. */ #define FALSE 0 #endif #ifndef TRUE /** You figure it out. */ #define TRUE 1 #endif /** A handy wrapper for functions that return an @c lcn_error_t, just returns * the error to our caller if it's not @c LCN_NO_ERROR. */ #define LCN_ERR(expr) \ do { \ lcn_error_t *lcn_err__temp = (expr); \ if (lcn_err__temp) \ return lcn_err__temp; \ } while (0) /** Index into an apr_array_header_t */ #define APR_ARRAY_IDX(ary,i,type) (((type *)(ary)->elts)[i]) /** Easier array-pushing syntax */ #define APR_ARRAY_PUSH(ary,type) (*((type *)apr_array_push (ary))) #ifdef __cplusplus } #endif /* __cplusplus */ #endif