haiku/headers/compatibility/gnu/crypt.h
David Karoly 125b262675 libroot: introduce crypt_r
Change-Id: Ieacd1b383ac078a440227c7954f5531a36fbbd62
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5827
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-02-10 18:00:44 +00:00

47 lines
643 B
C

/*
* Copyright 2023, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _GNU_CRYPT_H_
#define _GNU_CRYPT_H_
#include <features.h>
#ifdef _DEFAULT_SOURCE
#include <sys/types.h>
#ifdef __cplusplus
extern "C" {
#endif
struct crypt_data {
int initialized;
char buf[512];
};
char *crypt_rn(const char *key, const char *salt, struct crypt_data *data, size_t size);
static inline char *
crypt_r(const char *key, const char *salt, struct crypt_data *data)
{
return crypt_rn(key, salt, data, sizeof(struct crypt_data));
}
#ifdef __cplusplus
}
#endif
#endif
#endif /* _GNU_CRYPT_H_ */