Files
LBPM/IO/PIO.hpp

60 lines
1.9 KiB
C++
Raw Normal View History

2018-06-11 15:19:05 -04:00
/*
Copyright 2013--2018 James E. McClure, Virginia Polytechnic & State University
This file is part of the Open Porous Media project (OPM).
OPM 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 3 of the License, or
(at your option) any later version.
OPM 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 OPM. If not, see <http://www.gnu.org/licenses/>.
*/
/*
Copyright 2013--2018 James E. McClure, Virginia Polytechnic & State University
This file is part of the Open Porous Media project (OPM).
OPM 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 3 of the License, or
(at your option) any later version.
OPM 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 OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef included_PIO_hpp
#define included_PIO_hpp
#include "IO/PIO.h"
2021-03-17 10:24:14 -04:00
#include <cstdio>
#include <iostream>
#include <stdarg.h>
namespace IO {
inline int printp( const char *format, ... )
{
2021-03-17 10:24:14 -04:00
va_list ap;
va_start( ap, format );
char tmp[1024];
2021-03-17 10:24:14 -04:00
int n = vsprintf( tmp, format, ap );
va_end( ap );
pout << tmp;
pout.flush();
return n;
}
2021-03-17 10:24:14 -04:00
} // namespace IO
#endif