Flow123d  release_2.2.0-33-g759111d
Classes | Functions | Variables
system.cc File Reference

Various system-wide functions. More...

#include <cstring>
#include <cstdarg>
#include <ctime>
#include <cstdlib>
#include <sys/stat.h>
#include <cerrno>
#include <sstream>
#include <fstream>
#include <string>
#include "mpi.h"
#include "system/system.hh"
#include "system/file_path.hh"
#include "system/sys_profiler.hh"
#include <boost/algorithm/string/predicate.hpp>
#include <boost/algorithm/string/trim.hpp>
#include <boost/format.hpp>

Go to the source code of this file.

Classes

struct  MsgFmt
 INTERNAL DEFINITIONS FOR XPRINTF. More...
 

Functions

int _xprintf (const char *const xprintf_file, const char *const xprintf_func, const int xprintf_line, MessageType type, const char *const fmt,...)
 Multi-purpose printing routine: messages, warnings, errors. More...
 

Variables

SystemInfo sys_info
 
#define SCR_NONE   0
 
#define SCR_STDOUT   1
 
#define SCR_STDERR   2
 
#define NUM_OF_FMTS   8
 
static struct MsgFmt msg_fmt []
 

Detailed Description

Various system-wide functions.

 * Copyright (C) 2015 Technical University of Liberec. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation. (http://www.gnu.org/licenses/gpl-3.0.en.html)

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.

Definition in file system.cc.

Macro Definition Documentation

#define NUM_OF_FMTS   8

configuration table for individual message types defined in system.h Msg type Log mpi screen Stop message header

Definition at line 62 of file system.cc.

#define SCR_NONE   0

Definition at line 56 of file system.cc.

#define SCR_STDERR   2

Definition at line 58 of file system.cc.

#define SCR_STDOUT   1

Definition at line 57 of file system.cc.

Function Documentation

int _xprintf ( const char *const  xprintf_file,
const char *const  xprintf_func,
const int  xprintf_line,
MessageType  type,
const char *const  fmt,
  ... 
)

Multi-purpose printing routine: messages, warnings, errors.

Parameters
[in]xprintf_filecurrent file
[in]xprintf_funccurrent function
[in]xprintf_linecurrent line number
[in]typemessage type
[in]fmtmessage format
Returns
Same as printf, what internal printing routine returns.

Definition at line 85 of file system.cc.

Variable Documentation

struct MsgFmt msg_fmt[]
static
Initial value:
= {
{Msg, true, false, SCR_STDOUT, false, NULL},
{MsgDbg, true, false, SCR_STDOUT, false, " DBG (%s, %s(), %d):"},
{MsgLog, true, false, SCR_NONE, false, NULL},
{MsgVerb, false, false, SCR_STDOUT, false, NULL},
{Warn, true, false, SCR_STDERR, false, "\nWarning (%s, %s(), %d):\n"},
{UsrErr, true, false, SCR_NONE, true, "\nUser Error (%s, %s(), %d):\n"},
{Err, true, false, SCR_NONE, true, "\nError (%s, %s(), %d):\n"},
{PrgErr, true, false, SCR_NONE, true, "\nInternal Error (%s, %s(), %d):\n"}
}
Definition: system.hh:64
Definition: system.hh:64
Definition: system.hh:64
#define SCR_STDOUT
Definition: system.cc:57
#define SCR_NONE
Definition: system.cc:56
Definition: system.hh:64
Definition: system.hh:64
Definition: system.hh:64
Definition: system.hh:64
#define SCR_STDERR
Definition: system.cc:58

Definition at line 63 of file system.cc.

SystemInfo sys_info

Definition at line 41 of file system.cc.