/* 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. */ #ifndef _LCN_ERROR_H #define _LCN_ERROR_H #include #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** Error codes for various types of exceptions. */ typedef enum { LCN_ERR_RUNTIME_EXCEPTION, LCN_ERR_IO_EXCEPTION, LCN_ERR_ILLEGAL_ARGUMENT_EXCEPTION, LCN_ERR_NOT_FOUND } lcn_error_code_t; /** The best kind of @c lcn_error_t. */ #define LCN_NO_ERROR NULL /** An error object. */ typedef struct { /** The error code that describes the cause of this error. */ lcn_error_code_t code; /** A textual description of the error. */ const char *message; /** The pool this error was allocated from. */ apr_pool_t *pool; } lcn_error_t; /** Create a new @c lcn_error_t with @a code and @a reason. */ lcn_error_t * lcn_error_create (lcn_error_code_t code, const char *reason); /** Deallocate any memory used by @a err. */ void lcn_error_clear (lcn_error_t *err); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* _LCN_ERROR_H */