Jan Nieuwenhuizen <janneke@gnu.org>
*/
-#include <math.h>
-#include <time.h>
+#include "paper-outputter.hh"
+
+#include <cmath>
+#include <ctime>
-#include "array.hh"
#include "dimensions.hh"
#include "file-name.hh"
#include "font-metric.hh"
#include "input-smob.hh"
-#include "lily-guile.hh"
#include "lily-version.hh"
#include "ly-module.hh"
#include "main.hh"
#include "output-def.hh"
#include "paper-book.hh"
-#include "paper-outputter.hh"
#include "paper-system.hh"
#include "scm-hash.hh"
-#include "stencil.hh"
#include "string-convert.hh"
#include "warn.hh"
#include "ly-smobs.icc"
-
-Paper_outputter::Paper_outputter (String filename, String format)
+Paper_outputter::Paper_outputter (String file_name, String format)
{
file_ = SCM_EOL;
output_module_ = SCM_EOL;
smobify_self ();
- filename_ = filename;
+ file_name_ = file_name;
String module_name = "scm output-" + format;
output_module_ = scm_c_resolve_module (module_name.to_str0 ());
}
Paper_outputter::file ()
{
if (file_ == SCM_EOL)
- if (filename_ == "-")
+ if (file_name_ == "-")
file_ = scm_current_output_port();
else
- file_ = scm_open_file (scm_makfrom0str (filename_.to_str0 ()),
+ file_ = scm_open_file (scm_makfrom0str (file_name_.to_str0 ()),
scm_makfrom0str ("w"));
return file_;
}
void
Paper_outputter::close ()
{
- scm_close_port (file_);
+ if (scm_port_p (file_) == SCM_BOOL_T)
+ scm_close_port (file_);
}