E-MailRelay
gcleanup_win32.cpp
Go to the documentation of this file.
1//
2// Copyright (C) 2001-2024 Graeme Walker <graeme_walker@users.sourceforge.net>
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
16// ===
17///
18/// \file gcleanup_win32.cpp
19///
20
21#include "gdef.h"
22#include "gcleanup.h"
23#include <cstring> // _strdup()
24
26{
27 // no-op
28}
29
30void G::Cleanup::add( bool (*)(const Arg &) noexcept , Arg )
31{
32 // not implemented
33}
34
35void G::Cleanup::atexit( bool )
36{
37 // not implemented
38}
39
40void G::Cleanup::block() noexcept
41{
42 // not implemented
43}
44
45void G::Cleanup::release() noexcept
46{
47 // not implemented
48}
49
50G::Cleanup::Arg G::Cleanup::arg( const char * )
51{
52 return {} ;
53}
54
55G::Cleanup::Arg G::Cleanup::arg( const std::string & )
56{
57 return {} ;
58}
59
60G::Cleanup::Arg G::Cleanup::arg( const Path & )
61{
62 Arg arg ;
63 //arg.m_is_path = true ; // fwiw
64 return arg ;
65}
66
67G::Cleanup::Arg G::Cleanup::arg( std::nullptr_t )
68{
69 return {} ;
70}
71
72const char * G::Cleanup::Arg::str() const noexcept
73{
74 return m_ptr ;
75}
76
77bool G::Cleanup::Arg::isPath() const noexcept
78{
79 return m_is_path ;
80}
81
static Arg arg(const char *)
Duplicates a c-string for add().
static void atexit(bool active=true)
Ensures that the cleanup functions are also called via atexit(), in addition to abnormal-termination ...
static void release() noexcept
Releases block()ed signals.
static void block() noexcept
Temporarily blocks signals until release()d.
static void init()
An optional early-initialisation function. May be called more than once.
static void add(Fn, Arg arg)
Adds the given handler to the list of handlers that are to be called when the process terminates abno...
Opaque leaky string pointer wrapper created by G::Cleanup::arg().
Definition: gcleanup.h:55