libroot: introduce crypt_r
Change-Id: Ieacd1b383ac078a440227c7954f5531a36fbbd62 Reviewed-on: https://review.haiku-os.org/c/haiku/+/5827 Tested-by: Commit checker robot <[email protected]> Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* 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_ */
|
||||
Reference in New Issue
Block a user