merge the formfield patch from ooo-build
[ooovba.git] / sal / inc / osl / signal.h
blob663b9d67bf0b1a22b04e00236a8d27ec5fd1dc88
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: signal.h,v $
10 * $Revision: 1.8 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _OSL_SIGNAL_H_
32 #define _OSL_SIGNAL_H_
34 #include "sal/types.h"
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
40 #define OSL_SIGNAL_USER_RESERVED 0
42 #define OSL_SIGNAL_USER_RESOURCEFAILURE (OSL_SIGNAL_USER_RESERVED - 1)
43 #define OSL_SIGNAL_USER_X11SUBSYSTEMERROR (OSL_SIGNAL_USER_RESERVED - 2)
44 #define OSL_SIGNAL_USER_RVPCONNECTIONERROR (OSL_SIGNAL_USER_RESERVED - 3)
46 typedef void* oslSignalHandler;
48 typedef enum
50 osl_Signal_System,
51 osl_Signal_Terminate,
52 osl_Signal_AccessViolation,
53 osl_Signal_IntegerDivideByZero,
54 osl_Signal_FloatDivideByZero,
55 osl_Signal_DebugBreak,
56 osl_Signal_User,
57 osl_Signal_Alarm,
58 osl_Signal_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
59 } oslSignal;
61 typedef enum
63 osl_Signal_ActCallNextHdl,
64 osl_Signal_ActIgnore,
65 osl_Signal_ActAbortApp,
66 osl_Signal_ActKillApp,
67 osl_Signal_Act_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
68 } oslSignalAction;
70 #ifdef SAL_W32
71 # pragma pack(push, 8)
72 #elif defined(SAL_OS2)
73 # pragma pack(push, 4)
74 #endif
76 typedef struct
78 oslSignal Signal;
79 sal_Int32 UserSignal;
80 void* UserData;
81 } oslSignalInfo;
83 #if defined( SAL_W32) || defined(SAL_OS2)
84 # pragma pack(pop)
85 #endif
87 /** the function-ptr. representing the signal handler-function.
89 typedef oslSignalAction (SAL_CALL *oslSignalHandlerFunction)(void* pData, oslSignalInfo* pInfo);
91 oslSignalHandler SAL_CALL osl_addSignalHandler(oslSignalHandlerFunction Handler, void* pData);
93 sal_Bool SAL_CALL osl_removeSignalHandler(oslSignalHandler hHandler);
95 oslSignalAction SAL_CALL osl_raiseSignal(sal_Int32 UserSignal, void* UserData);
97 /** Enables or disables error reporting
99 On default error reporting is enabled after process startup.
101 @param bEnable [in]
102 Enables or disables error reporting.
104 @return
105 sal_True if previous state of error reporting was enabled<br>
106 sal_False if previous state of error reporting was disbaled<br>
109 sal_Bool SAL_CALL osl_setErrorReporting( sal_Bool bEnable );
111 #ifdef __cplusplus
113 #endif
115 #endif /* _OSL_SIGNAL_H_ */