/* $Id: cpl_error_impl.h,v 1.7 2007/06/18 15:09:37 llundin Exp $ * * This file is part of the ESO Common Pipeline Library * Copyright (C) 2001-2005 European Southern Observatory * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * $Author: llundin $ * $Date: 2007/06/18 15:09:37 $ * $Revision: 1.7 $ * $Name: $ */ #ifndef CPL_ERROR_IMPL_H #define CPL_ERROR_IMPL_H #include "cpl_error.h" #include "cpl_type.h" CPL_BEGIN_DECLS /*----------------------------------------------------------------------------- Define -----------------------------------------------------------------------------*/ /* * As the error handler itself should never fail, it cannot rely on * allocating memory dynamically. Therefore, define max limits for * string lengths, size of error queue. */ #ifdef PATH_MAX #define MAX_FILE_LENGTH PATH_MAX #else #define MAX_FILE_LENGTH 4096 #endif #define MAX_NAME_LENGTH 50 struct _cpl_error_ { cpl_error_code code; unsigned line; char function[MAX_NAME_LENGTH+1]; char file[MAX_FILE_LENGTH+1]; char msg[CPL_ERROR_MAX_MESSAGE_LENGTH]; }; /*----------------------------------------------------------------------------- Prototypes of private functions -----------------------------------------------------------------------------*/ cpl_error * cpl_errorstate_append(void); const cpl_error * cpl_errorstate_find(void); cpl_boolean cpl_error_is_set(void); cpl_boolean cpl_error_is_readonly(void); void cpl_error_set_readonly(void); void cpl_error_reset_readonly(void); CPL_END_DECLS #endif /* end of cpl_error_impl.h */