X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fbase%2Flib_freeall.c;h=9133d08a7328468cae8615f35a3efff7ce40c13d;hp=d2d5870eeed3aaf498aa22481eba1a66a09317df;hb=3e37c7d3fa122563a9d88168926f61286ef30cd3;hpb=8890c8f28a1db5995ef17f52a7d8c0b9cf574210 diff --git a/ncurses/base/lib_freeall.c b/ncurses/base/lib_freeall.c index d2d5870e..9133d08a 100644 --- a/ncurses/base/lib_freeall.c +++ b/ncurses/base/lib_freeall.c @@ -1,5 +1,6 @@ /**************************************************************************** - * Copyright (c) 1998-2018,2019 Free Software Foundation, Inc. * + * Copyright 2018-2019,2020 Thomas E. Dickey * + * Copyright 1998-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,7 +40,7 @@ extern int malloc_errfd; /* FIXME */ #endif -MODULE_ID("$Id: lib_freeall.c,v 1.70 2019/12/07 20:28:03 tom Exp $") +MODULE_ID("$Id: lib_freeall.c,v 1.72 2020/02/02 23:34:34 tom Exp $") /* * Free all ncurses data. This is used for testing only (there's no practical @@ -159,7 +160,7 @@ NCURSES_SP_NAME(_nc_free_and_exit) (NCURSES_SP_DCLx int code) exit(code); } -#else +#else /* !HAVE_NC_FREEALL */ NCURSES_EXPORT(void) _nc_freeall(void) { @@ -175,7 +176,7 @@ NCURSES_SP_NAME(_nc_free_and_exit) (NCURSES_SP_DCLx int code) } exit(code); } -#endif +#endif /* HAVE_NC_FREEALL */ #if NCURSES_SP_FUNCS NCURSES_EXPORT(void) @@ -184,3 +185,16 @@ _nc_free_and_exit(int code) NCURSES_SP_NAME(_nc_free_and_exit) (CURRENT_SCREEN, code); } #endif + +NCURSES_EXPORT(void) +exit_curses(int code) +{ +#if NO_LEAKS +#if NCURSES_SP_FUNCS + NCURSES_SP_NAME(_nc_free_and_exit) (CURRENT_SCREEN, code); +#else + _nc_free_and_exit(code); /* deprecated... */ +#endif +#endif + exit(code); +}