Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
statusMessageReporting.h
Go to the documentation of this file.
1/*
2# <<BEGIN-copyright>>
3# Copyright (c) 2010, Lawrence Livermore National Security, LLC.
4# Produced at the Lawrence Livermore National Laboratory
5# Written by Bret R. Beck, beck6@llnl.gov.
6# CODE-461393
7# All rights reserved.
8#
9# This file is part of GIDI. For details, see nuclear.llnl.gov.
10# Please also read the "Additional BSD Notice" at nuclear.llnl.gov.
11#
12# Redistribution and use in source and binary forms, with or without modification,
13# are permitted provided that the following conditions are met:
14#
15# 1) Redistributions of source code must retain the above copyright notice,
16# this list of conditions and the disclaimer below.
17# 2) Redistributions in binary form must reproduce the above copyright notice,
18# this list of conditions and the disclaimer (as noted below) in the
19# documentation and/or other materials provided with the distribution.
20# 3) Neither the name of the LLNS/LLNL nor the names of its contributors may be
21# used to endorse or promote products derived from this software without
22# specific prior written permission.
23#
24# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
25# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
26# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
27# SHALL LAWRENCE LIVERMORE NATIONAL SECURITY, LLC, THE U.S. DEPARTMENT OF ENERGY OR
28# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
31# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
33# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34# <<END-copyright>>
35*/
36#ifndef statusMessageReporting_h_included
37#define statusMessageReporting_h_included
38
39#include <stdio.h>
40#include <stdarg.h>
41
42#if defined __cplusplus
43 namespace GIDI {
44 extern "C" {
45#endif
46
47#define smr_maximumPackageNameSize 256
49typedef int (*smr_userInterface)( void *userData, char **smr );
50
51typedef struct statusMessageReporting {
53 char packageName[smr_maximumPackageNameSize]; /* Do not free this. */
54 int line;
55 int code;
56 char *message; /* User must free this when done. Should use smr_release. */
58
61int smr_setMessageInfo( statusMessageReporting *smr, void *userInterface, const char *file, int line, int code, const char *fmt, ... );
62int smr_vsetMessageInfo( statusMessageReporting *smr, void *userInterface, const char *file, int line, int code, const char *fmt, va_list *args );
63int smr_setMessageError( statusMessageReporting *smr, void *userInterface, const char *file, int line, int code, const char *fmt, ... );
64int smr_vsetMessageError( statusMessageReporting *smr, void *userInterface, const char *file, int line, int code, const char *fmt, va_list *args );
65char *smr_allocateFormatMessage( const char *fmt, ... );
66char *smr_vallocateFormatMessage( const char *fmt, va_list *args );
71const char *smr_getMessage( statusMessageReporting *smr );
73void smr_print( statusMessageReporting *smr, FILE *f, int clear );
74
75#if defined __cplusplus
76 }
77 }
78#endif
79
80#endif /* End of statusMessageReporting_h_included. */
int smr_vsetMessageError(statusMessageReporting *smr, void *userInterface, const char *file, int line, int code, const char *fmt, va_list *args)
int smr_isInfo(statusMessageReporting *smr)
int smr_isError(statusMessageReporting *smr)
int smr_vsetMessageInfo(statusMessageReporting *smr, void *userInterface, const char *file, int line, int code, const char *fmt, va_list *args)
char * smr_vallocateFormatMessage(const char *fmt, va_list *args)
int smr_isFatal(statusMessageReporting *smr)
int smr_initialize(statusMessageReporting *smr)
char * smr_getFullMessage(statusMessageReporting *smr)
#define smr_maximumPackageNameSize
void smr_print(statusMessageReporting *smr, FILE *f, int clear)
int smr_release(statusMessageReporting *smr)
int smr_setMessageError(statusMessageReporting *smr, void *userInterface, const char *file, int line, int code, const char *fmt,...)
char * smr_allocateFormatMessage(const char *fmt,...)
const char * smr_getMessage(statusMessageReporting *smr)
int smr_setMessageInfo(statusMessageReporting *smr, void *userInterface, const char *file, int line, int code, const char *fmt,...)
int smr_isOk(statusMessageReporting *smr)
@ smr_status_Error
@ smr_status_Fatal
@ smr_status_Info
@ smr_status_Ok
int(* smr_userInterface)(void *userData, char **smr)
#define userData
Definition: xmlparse.cc:555