150276Speter/****************************************************************************
2166124Srafan * Copyright (c) 1999-2005,2006 Free Software Foundation, Inc.              *
350276Speter *                                                                          *
450276Speter * Permission is hereby granted, free of charge, to any person obtaining a  *
550276Speter * copy of this software and associated documentation files (the            *
650276Speter * "Software"), to deal in the Software without restriction, including      *
750276Speter * without limitation the rights to use, copy, modify, merge, publish,      *
850276Speter * distribute, distribute with modifications, sublicense, and/or sell       *
950276Speter * copies of the Software, and to permit persons to whom the Software is    *
1050276Speter * furnished to do so, subject to the following conditions:                 *
1150276Speter *                                                                          *
1250276Speter * The above copyright notice and this permission notice shall be included  *
1350276Speter * in all copies or substantial portions of the Software.                   *
1450276Speter *                                                                          *
1550276Speter * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
1650276Speter * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
1750276Speter * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
1850276Speter * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
1950276Speter * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
2050276Speter * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
2150276Speter * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
2250276Speter *                                                                          *
2350276Speter * Except as contained in this notice, the name(s) of the above copyright   *
2450276Speter * holders shall not be used in advertising or otherwise to promote the     *
2550276Speter * sale, use or other dealings in this Software without prior written       *
2650276Speter * authorization.                                                           *
2750276Speter ****************************************************************************/
2850276Speter
2950276Speter/****************************************************************************
30166124Srafan *  Author: Thomas E. Dickey                    1999-on                     *
3150276Speter ****************************************************************************/
3250276Speter
3350276Speter/*
3450276Speter * free_ttype.c -- allocation functions for TERMTYPE
3550276Speter *
3650276Speter *	_nc_free_termtype()
3750276Speter *	use_extended_names()
3850276Speter *
3950276Speter */
4050276Speter
4150276Speter#include <curses.priv.h>
4250276Speter
4350276Speter#include <tic.h>
4450276Speter#include <term_entry.h>
4550276Speter
46166124SrafanMODULE_ID("$Id: free_ttype.c,v 1.13 2006/06/25 10:46:02 tom Exp $")
4750276Speter
4876726SpeterNCURSES_EXPORT(void)
49166124Srafan_nc_free_termtype(TERMTYPE *ptr)
5050276Speter{
51166124Srafan    T(("_nc_free_termtype(%s)", ptr->term_names));
52166124Srafan
5366963Speter    FreeIfNeeded(ptr->str_table);
5466963Speter    FreeIfNeeded(ptr->Booleans);
5566963Speter    FreeIfNeeded(ptr->Numbers);
5666963Speter    FreeIfNeeded(ptr->Strings);
5750276Speter#if NCURSES_XNAMES
5866963Speter    FreeIfNeeded(ptr->ext_str_table);
5966963Speter    FreeIfNeeded(ptr->ext_Names);
6050276Speter#endif
6166963Speter    memset(ptr, 0, sizeof(TERMTYPE));
62166124Srafan    _nc_free_entry(_nc_head, ptr);
6350276Speter}
6450276Speter
6550276Speter#if NCURSES_XNAMES
6676726SpeterNCURSES_EXPORT_VAR(bool) _nc_user_definable = TRUE;
6750276Speter
6876726SpeterNCURSES_EXPORT(int)
6976726Speteruse_extended_names(bool flag)
7050276Speter{
7166963Speter    int oldflag = _nc_user_definable;
72166124Srafan
73166124Srafan    T((T_CALLED("use_extended_names(%d)"), flag));
7466963Speter    _nc_user_definable = flag;
75166124Srafan    returnBool(oldflag);
7650276Speter}
7750276Speter#endif
78