EPICS Base  7.0.6.1
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cantProceed.h
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2011 UChicago Argonne LLC, as Operator of Argonne
3 * National Laboratory.
4 * Copyright (c) 2002 The Regents of the University of California, as
5 * Operator of Los Alamos National Laboratory.
6 * SPDX-License-Identifier: EPICS
7 * EPICS BASE is distributed subject to a Software License Agreement found
8 * in file LICENSE that is included with this distribution.
9 \*************************************************************************/
10 
19 /* callocMustSucceed() and mallocMustSucceed() can be
20  * used in place of calloc() and malloc(). If size or count are zero, or the
21  * memory allocation fails, they output a message and call cantProceed().
22  */
23 
24 
25 #ifndef INCcantProceedh
26 #define INCcantProceedh
27 
28 #include <stdlib.h>
29 
30 #include "compilerDependencies.h"
31 #include "libComAPI.h"
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
46 LIBCOM_API void cantProceed(const char *errorMessage, ...)
47  EPICS_PRINTF_STYLE(1,2);
48 
64 LIBCOM_API void * callocMustSucceed(size_t count, size_t size,
65  const char *errorMessage);
71 LIBCOM_API void * mallocMustSucceed(size_t size, const char *errorMessage);
74 #ifdef __cplusplus
75 }
76 #endif
77 
78 #endif /* cantProceedh */
LIBCOM_API void * mallocMustSucceed(size_t size, const char *errorMessage)
A malloc() that never returns NULL.
LIBCOM_API void cantProceed(const char *errorMessage,...) EPICS_PRINTF_STYLE(1
Suspend this thread, the caller cannot continue or return.
Compiler specific declarations.
LIBCOM_API void * callocMustSucceed(size_t count, size_t size, const char *errorMessage)
A calloc() that never returns NULL.