/*============================================================================
*
*                    Code_Saturne version 1.3
*                    ------------------------
*
*
*     This file is part of the Code_Saturne Kernel, element of the
*     Code_Saturne CFD tool.
*
*     Copyright (C) 1998-2007 EDF S.A., France
*
*     contact: saturne-support@edf.fr
*
*     The Code_Saturne Kernel 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.
*
*     The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
*     Free Software Foundation, Inc.,
*     51 Franklin St, Fifth Floor,
*     Boston, MA  02110-1301  USA
*
*============================================================================*/

#ifndef __CS_MSG_H__
#define __CS_MSG_H__

/*============================================================================
 * Utilitaires pour le listing et les messages d'erreur
 *============================================================================*/

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */


/*============================================================================
 * Définitions de types
 *============================================================================*/


/* Types de messages qui peuvent être envoyés à l'utilisateur */

typedef enum {

  CS_MSG_TYPE_ERR,                      /* Message d'erreur "générique"       */
  CS_MSG_TYPE_ERR_SYS,                  /* Message d'erreur système           */
  CS_MSG_TYPE_WARN                      /* Message d'avertissement            */

} cs_msg_type_t;


/*=============================================================================
 * Définitions de macros
 *============================================================================*/

/* Nom du programme (pour messages d'erreur) */

#define CS_MSG_NOM_PROGRAMME    "Code_Saturne"


/*=============================================================================
 * Définitions de variables globales
 *============================================================================*/


/*=============================================================================
 * Prototypes de fonctions
 *============================================================================*/


/*----------------------------------------------------------------------------
 * Fonction d'impression d'un message d'erreur ou d'avertissement
 *----------------------------------------------------------------------------*/

void cs_msg_err
(
  const char          *file_name,
  const int            line_num,
  const cs_msg_type_t  msg_typ,
  const cs_int_t       error,           /* --> Numéro d'erreur système (pas
                                               une erreur système si 0)       */
  const char          *format,
  ...
);


/*----------------------------------------------------------------------------
 * Fonction de vidage du tampon de fichier d'impression
 *----------------------------------------------------------------------------*/

void cs_msg_flush
(
 void
);


#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* __CS_MSG_H__ */


syntax highlighted by Code2HTML, v. 0.9.1