5 Copyright (C) 2009-2024
6 Free Software Foundation, Inc.
9 Slava Zanko <slavazanko@gmail.com>, 2009.
11 This file is part of the Midnight Commander.
13 The Midnight Commander is free software: you can redistribute it
14 and/or modify it under the terms of the GNU General Public License as
15 published by the Free Software Foundation, either version 3 of the License,
16 or (at your option) any later version.
18 The Midnight Commander is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
23 You should have received a copy of the GNU General Public License
24 along with this program. If not, see <http://www.gnu.org/licenses/>.
29 #include "lib/global.h"
30 #include "lib/util.h" /* MC_PTR_FREE */
32 #include "lib/filehighlight.h"
36 /*** global variables ****************************************************************************/
38 /*** file scope macro definitions ****************************************************************/
40 /*** file scope type declarations ****************************************************************/
42 /*** file scope variables ************************************************************************/
44 /* --------------------------------------------------------------------------------------------- */
45 /*** file scope functions ************************************************************************/
46 /* --------------------------------------------------------------------------------------------- */
48 /* --------------------------------------------------------------------------------------------- */
49 /*** public functions ****************************************************************************/
50 /* --------------------------------------------------------------------------------------------- */
53 mc_fhl_filter_free (gpointer data
)
55 mc_fhl_filter_t
*filter
= (mc_fhl_filter_t
*) data
;
57 g_free (filter
->fgcolor
);
58 g_free (filter
->bgcolor
);
59 mc_search_free (filter
->search_condition
);
63 /* --------------------------------------------------------------------------------------------- */
66 mc_fhl_array_free (mc_fhl_t
*fhl
)
68 if (fhl
->filters
!= NULL
)
70 g_ptr_array_free (fhl
->filters
, TRUE
);
75 /* --------------------------------------------------------------------------------------------- */
78 mc_fhl_new (gboolean need_auto_fill
)
82 fhl
= g_try_new0 (mc_fhl_t
, 1);
89 if (!mc_fhl_init_from_standard_files (fhl
))
95 if (!mc_fhl_parse_ini_file (fhl
))
104 /* --------------------------------------------------------------------------------------------- */
107 mc_fhl_free (mc_fhl_t
**fhl
)
109 if (fhl
== NULL
|| *fhl
== NULL
)
117 /* --------------------------------------------------------------------------------------------- */
120 mc_fhl_clear (mc_fhl_t
*fhl
)
124 mc_config_deinit (fhl
->config
);
125 mc_fhl_array_free (fhl
);
129 /* --------------------------------------------------------------------------------------------- */