Blame crypt-static.c

Packit 13e0ca
/* Copyright (C) 2007-2017 Thorsten Kukuk
Packit 13e0ca
Packit 13e0ca
   This library is free software; you can redistribute it and/or
Packit 13e0ca
   modify it under the terms of the GNU Lesser General Public License
Packit 13e0ca
   as published by the Free Software Foundation; either version 2.1 of
Packit 13e0ca
   the License, or (at your option) any later version.
Packit 13e0ca
Packit 13e0ca
   This library is distributed in the hope that it will be useful,
Packit 13e0ca
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 13e0ca
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 13e0ca
   GNU Lesser General Public License for more details.
Packit 13e0ca
Packit 13e0ca
   You should have received a copy of the GNU Lesser General Public
Packit 13e0ca
   License along with this library; if not, see
Packit 13e0ca
   <https://www.gnu.org/licenses/>.  */
Packit 13e0ca
Packit 13e0ca
#include "crypt-port.h"
Packit 13e0ca
#include "crypt-base.h"
Packit 13e0ca
Packit 13e0ca
/* The functions that use global state objects are isolated in their
Packit 13e0ca
   own files so that a statically-linked program that doesn't use them
Packit 13e0ca
   will not have the state objects in its data segment.  */
Packit 13e0ca
Packit 13e0ca
#if INCLUDE_crypt || INCLUDE_fcrypt
Packit 13e0ca
char *
Packit 13e0ca
crypt (const char *key, const char *setting)
Packit 13e0ca
{
Packit 13e0ca
  static struct crypt_data nr_crypt_ctx;
Packit 13e0ca
  return crypt_r (key, setting, &nr_crypt_ctx);
Packit 13e0ca
}
Packit 13e0ca
#endif
Packit 13e0ca
Packit 13e0ca
#if INCLUDE_crypt
Packit 13e0ca
SYMVER_crypt;
Packit 13e0ca
#endif
Packit 13e0ca
Packit 13e0ca
#if INCLUDE_fcrypt
Packit 13e0ca
strong_alias (crypt, fcrypt);
Packit 13e0ca
SYMVER_fcrypt;
Packit 13e0ca
#endif