nss: upgrade to release 3.73
[LibreOffice.git] / include / osl / signal.h
bloba467452bec10c23cef209b9cd23c676f626e8697
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_X11SUBSYSTEMERROR (OSL_SIGNAL_USER_RESERVED - 2)
36 typedef void* oslSignalHandler;
38 typedef enum
40 osl_Signal_System,
41 osl_Signal_Terminate,
42 osl_Signal_AccessViolation,
43 osl_Signal_IntegerDivideByZero,
44 osl_Signal_FloatDivideByZero,
45 osl_Signal_DebugBreak,
46 osl_Signal_User,
47 osl_Signal_Alarm,
48 osl_Signal_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
49 } oslSignal;
51 typedef enum
53 osl_Signal_ActCallNextHdl,
54 osl_Signal_ActIgnore,
55 osl_Signal_ActAbortApp,
56 osl_Signal_ActKillApp,
57 osl_Signal_Act_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
58 } oslSignalAction;
60 #ifdef _WIN32
61 # pragma pack(push, 8)
62 #endif
64 typedef struct
66 oslSignal Signal;
67 sal_Int32 UserSignal;
68 void* UserData;
69 } oslSignalInfo;
71 #if defined( _WIN32)
72 # pragma pack(pop)
73 #endif
75 /** The function-ptr representing the signal handler-function.
77 typedef oslSignalAction (SAL_CALL *oslSignalHandlerFunction)(void* pData, oslSignalInfo* pInfo);
79 SAL_DLLPUBLIC oslSignalHandler SAL_CALL osl_addSignalHandler(
80 oslSignalHandlerFunction Handler, void* pData);
82 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_removeSignalHandler(
83 oslSignalHandler hHandler);
85 SAL_DLLPUBLIC oslSignalAction SAL_CALL osl_raiseSignal(
86 sal_Int32 UserSignal, void* UserData);
88 /** Enables or disables error reporting
90 On default error reporting is enabled after process startup.
92 @param[in] bEnable Enables or disables error reporting.
94 @retval sal_True if previous state of error reporting was enabled
95 @retval sal_False if previous state of error reporting was disabled
98 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_setErrorReporting(
99 sal_Bool bEnable );
101 #ifdef __cplusplus
103 #endif
105 #endif // INCLUDED_OSL_SIGNAL_H
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */