Sygaldry
Loading...
Searching...
No Matches
sygup-cstdio_logger.hpp
1/*
2Copyright 2023 Travis J. West, https://traviswest.ca, Input Devices and Music
3Interaction Laboratory (IDMIL), Centre for Interdisciplinary Research in Music
4Media and Technology (CIRMMT), McGill University, Montréal, Canada, and Univ.
5Lille, Inria, CNRS, Centrale Lille, UMR 9189 CRIStAL, F-59000 Lille, France
6
7SPDX-License-Identifier: MIT
8*/
9
10#pragma once
11#include <cstdio>
12#include <cstdlib>
13#include "sygup-basic_logger.hpp"
14
15namespace sygaldry { namespace sygup {
20
22{
23 void operator()(char c)
24 {
25 auto retcode = std::putchar(c);
26 if (retcode == EOF)
27 {
28 // I guess we're unexpectedly done now?
29 std::exit(EXIT_FAILURE);
30 }
31 }
32};
33
34using CstdioLogger = BasicLogger<CstdioPutter>;
35
38} }
Definition sygup-basic_logger.hpp:26
Definition sygup-cstdio_logger.hpp:22