Bump version to 6.4-15
[LibreOffice.git] / include / osl / signal.h
blob4b7beadc295a2abc38092a04ad75994a893be736
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_OSL_SIGNAL_H
21 #define INCLUDED_OSL_SIGNAL_H
23 #include "sal/config.h"
25 #include "sal/saldllapi.h"
26 #include "sal/types.h"
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
32 #define OSL_SIGNAL_USER_RESERVED 0
34 #define OSL_SIGNAL_USER_RESOURCEFAILURE (OSL_SIGNAL_USER_RESERVED - 1)
35 #define OSL_SIGNAL_USER_X11SUBSYSTEMERROR (OSL_SIGNAL_USER_RESERVED - 2)
37 typedef void* oslSignalHandler;
39 typedef enum
41 osl_Signal_System,
42 osl_Signal_Terminate,
43 osl_Signal_AccessViolation,
44 osl_Signal_IntegerDivideByZero,
45 osl_Signal_FloatDivideByZero,
46 osl_Signal_DebugBreak,
47 osl_Signal_User,
48 osl_Signal_Alarm,
49 osl_Signal_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
50 } oslSignal;
52 typedef enum
54 osl_Signal_ActCallNextHdl,
55 osl_Signal_ActIgnore,
56 osl_Signal_ActAbortApp,
57 osl_Signal_ActKillApp,
58 osl_Signal_Act_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
59 } oslSignalAction;
61 #ifdef _WIN32
62 # pragma pack(push, 8)
63 #endif
65 typedef struct
67 oslSignal Signal;
68 sal_Int32 UserSignal;
69 void* UserData;
70 } oslSignalInfo;
72 #if defined( _WIN32)
73 # pragma pack(pop)
74 #endif
76 /** The function-ptr representing the signal handler-function.
78 typedef oslSignalAction (SAL_CALL *oslSignalHandlerFunction)(void* pData, oslSignalInfo* pInfo);
80 SAL_DLLPUBLIC oslSignalHandler SAL_CALL osl_addSignalHandler(
81 oslSignalHandlerFunction Handler, void* pData);
83 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_removeSignalHandler(
84 oslSignalHandler hHandler);
86 SAL_DLLPUBLIC oslSignalAction SAL_CALL osl_raiseSignal(
87 sal_Int32 UserSignal, void* UserData);
89 /** Enables or disables error reporting
91 On default error reporting is enabled after process startup.
93 @param[in] bEnable Enables or disables error reporting.
95 @retval sal_True if previous state of error reporting was enabled
96 @retval sal_False if previous state of error reporting was disabled
99 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_setErrorReporting(
100 sal_Bool bEnable );
102 #ifdef __cplusplus
104 #endif
106 #endif // INCLUDED_OSL_SIGNAL_H
109 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */