|
Packit Service |
c3aa71 |
/* xmemdup0.h -- copy a block of arbitrary bytes, plus a trailing NUL
|
|
Packit Service |
c3aa71 |
|
|
Packit Service |
c3aa71 |
Copyright (C) 2008-2015 Free Software Foundation, Inc.
|
|
Packit Service |
c3aa71 |
|
|
Packit Service |
c3aa71 |
This program is free software: you can redistribute it and/or modify
|
|
Packit Service |
c3aa71 |
it under the terms of the GNU General Public License as published by
|
|
Packit Service |
c3aa71 |
the Free Software Foundation; either version 3 of the License, or
|
|
Packit Service |
c3aa71 |
(at your option) any later version.
|
|
Packit Service |
c3aa71 |
|
|
Packit Service |
c3aa71 |
This program is distributed in the hope that it will be useful,
|
|
Packit Service |
c3aa71 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
c3aa71 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit Service |
c3aa71 |
GNU General Public License for more details.
|
|
Packit Service |
c3aa71 |
|
|
Packit Service |
c3aa71 |
You should have received a copy of the GNU General Public License
|
|
Packit Service |
c3aa71 |
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
Packit Service |
c3aa71 |
|
|
Packit Service |
c3aa71 |
#ifndef XMEMDUP_H_
|
|
Packit Service |
c3aa71 |
# define XMEMDUP_H_
|
|
Packit Service |
c3aa71 |
|
|
Packit Service |
c3aa71 |
# include <stddef.h>
|
|
Packit Service |
c3aa71 |
|
|
Packit Service |
c3aa71 |
|
|
Packit Service |
c3aa71 |
# ifdef __cplusplus
|
|
Packit Service |
c3aa71 |
extern "C" {
|
|
Packit Service |
c3aa71 |
# endif
|
|
Packit Service |
c3aa71 |
|
|
Packit Service |
c3aa71 |
/* This function is always triggered when memory is exhausted.
|
|
Packit Service |
c3aa71 |
It must be defined by the application, either explicitly
|
|
Packit Service |
c3aa71 |
or by using gnulib's xalloc-die module. This is the
|
|
Packit Service |
c3aa71 |
function to call when one wants the program to die because of a
|
|
Packit Service |
c3aa71 |
memory allocation failure. */
|
|
Packit Service |
c3aa71 |
extern _Noreturn void xalloc_die (void);
|
|
Packit Service |
c3aa71 |
|
|
Packit Service |
c3aa71 |
char *xmemdup0 (void const *p, size_t s);
|
|
Packit Service |
c3aa71 |
|
|
Packit Service |
c3aa71 |
# ifdef __cplusplus
|
|
Packit Service |
c3aa71 |
}
|
|
Packit Service |
c3aa71 |
# endif
|
|
Packit Service |
c3aa71 |
|
|
Packit Service |
c3aa71 |
#endif /* !XMEMDUP0_H_ */
|