5 Copyright (C) 2009 The Free Software Foundation, Inc.
8 Slava Zanko <slavazanko@gmail.com>, 2009.
10 This file is part of the Midnight Commander.
12 The Midnight Commander is free software; you can redistribute it
13 and/or modify it under the terms of the GNU General Public License as
14 published by the Free Software Foundation; either version 2 of the
15 License, or (at your option) any later version.
17 The Midnight Commander is distributed in the hope that it will be
18 useful, but WITHOUT ANY WARRANTY; without even the implied warranty
19 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
31 #include "lib/global.h"
32 #include "lib/filehighlight.h"
35 /*** global variables ****************************************************************************/
37 /*** file scope macro definitions ****************************************************************/
39 /*** file scope type declarations ****************************************************************/
41 /*** file scope variables ************************************************************************/
43 /*** file scope functions ************************************************************************/
44 /* --------------------------------------------------------------------------------------------- */
47 mc_fhl_array_free (mc_fhl_t
* fhl
)
50 mc_fhl_filter_t
*mc_filter
;
52 if (fhl
->filters
== NULL
)
55 for (i
= 0; i
< fhl
->filters
->len
; i
++) {
56 mc_filter
= (mc_fhl_filter_t
*) g_ptr_array_index (fhl
->filters
, i
);
58 g_free (mc_filter
->fgcolor
);
59 g_free (mc_filter
->bgcolor
);
61 if (mc_filter
->search_condition
!= NULL
)
62 mc_search_free (mc_filter
->search_condition
);
66 g_ptr_array_free (fhl
->filters
, TRUE
);
70 /* --------------------------------------------------------------------------------------------- */
71 /*** public functions ****************************************************************************/
72 /* --------------------------------------------------------------------------------------------- */
75 mc_fhl_new (gboolean need_auto_fill
)
80 fhl
= g_try_new0 (mc_fhl_t
, 1);
87 if (!mc_fhl_init_from_standart_files (fhl
)) {
92 if (!mc_fhl_parse_ini_file (fhl
)) {
100 /* --------------------------------------------------------------------------------------------- */
103 mc_fhl_free (mc_fhl_t
** fhl
)
105 if (fhl
== NULL
|| *fhl
== NULL
)
114 /* --------------------------------------------------------------------------------------------- */
117 mc_fhl_clear (mc_fhl_t
* fhl
)
123 mc_config_deinit (fhl
->config
);
125 mc_fhl_array_free (fhl
);
128 /* --------------------------------------------------------------------------------------------- */