| 1 |
/* libxcrypt interfaces for code compatibility. |
| 2 |
|
| 3 |
Copyright (C) 2018 Björn Esser <[email protected]> |
| 4 |
|
| 5 |
Redistribution and use in source and binary forms, with or without |
| 6 |
modification, are permitted. |
| 7 |
|
| 8 |
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND |
| 9 |
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 10 |
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 11 |
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE |
| 12 |
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 13 |
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
| 14 |
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 15 |
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 16 |
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
| 17 |
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 18 |
SUCH DAMAGE. */ |
| 19 |
|
| 20 |
#ifndef _XCRYPT_H |
| 21 |
#define _XCRYPT_H 1 |
| 22 |
|
| 23 |
#include <crypt.h> |
| 24 |
|
| 25 |
@BEGIN_DECLS@ |
| 26 |
|
| 27 |
/* For backward compatibility with older versions (v3.1.1 and earlier) |
| 28 |
of libcrypt, this header declares xcrypt, xcrypt_r, xcrypt_gensalt, |
| 29 |
and xcrypt_gensalt_r as alternative names for crypt, crypt_r, |
| 30 |
crypt_gensalt, and crypt_gensalt_rn, respectively. If glibc's |
| 31 |
<sys/cdefs.h> macro __REDIRECT_NTH (which declares an alternative |
| 32 |
name at the object-file level) is available, we use it. */ |
| 33 |
#ifdef __REDIRECT_NTH |
| 34 |
extern char * __REDIRECT_NTH (xcrypt, (const char *__phrase, |
| 35 |
const char *__setting), crypt); |
| 36 |
|
| 37 |
extern char * __REDIRECT_NTH (xcrypt_r, (const char *__phrase, |
| 38 |
const char *__setting, |
| 39 |
struct crypt_data *__restrict __data), crypt_r); |
| 40 |
|
| 41 |
extern char * __REDIRECT_NTH (xcrypt_gensalt, (const char *__prefix, |
| 42 |
unsigned long __count, const char *__rbytes, |
| 43 |
int __nrbytes), crypt_gensalt); |
| 44 |
|
| 45 |
extern char * __REDIRECT_NTH (xcrypt_gensalt_r, (const char *__prefix, |
| 46 |
unsigned long __count, const char *__rbytes, |
| 47 |
int __nrbytes, char *__output, |
| 48 |
int __output_size), crypt_gensalt_rn); |
| 49 |
#else |
| 50 |
# define xcrypt crypt |
| 51 |
# define xcrypt_r crypt_r |
| 52 |
# define xcrypt_gensalt crypt_gensalt |
| 53 |
# define xcrypt_gensalt_r crypt_gensalt_rn |
| 54 |
#endif |
| 55 |
|
| 56 |
@END_DECLS@ |
| 57 |
|
| 58 |
#endif /* xcrypt.h */ |