5 Copyright (C) 2009, 2011
6 The 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/filehighlight.h"
33 /*** global variables ****************************************************************************/
35 /*** file scope macro definitions ****************************************************************/
37 /*** file scope type declarations ****************************************************************/
39 /*** file scope variables ************************************************************************/
41 /*** file scope functions ************************************************************************/
44 mc_fhl_filter_free (void *data
)
46 mc_fhl_filter_t
*filter
= (mc_fhl_filter_t
*) data
;
48 g_free (filter
->fgcolor
);
49 g_free (filter
->bgcolor
);
50 mc_search_free (filter
->search_condition
);
54 /* --------------------------------------------------------------------------------------------- */
57 mc_fhl_array_free (mc_fhl_t
* fhl
)
59 if (fhl
->filters
!= NULL
)
61 g_ptr_array_foreach (fhl
->filters
, (GFunc
) mc_fhl_filter_free
, NULL
);
62 fhl
->filters
= (GPtrArray
*) g_ptr_array_free (fhl
->filters
, TRUE
);
66 /* --------------------------------------------------------------------------------------------- */
67 /*** public functions ****************************************************************************/
68 /* --------------------------------------------------------------------------------------------- */
71 mc_fhl_new (gboolean need_auto_fill
)
75 fhl
= g_try_new0 (mc_fhl_t
, 1);
82 if (!mc_fhl_init_from_standard_files (fhl
))
88 if (!mc_fhl_parse_ini_file (fhl
))
97 /* --------------------------------------------------------------------------------------------- */
100 mc_fhl_free (mc_fhl_t
** fhl
)
102 if (fhl
== NULL
|| *fhl
== NULL
)
111 /* --------------------------------------------------------------------------------------------- */
114 mc_fhl_clear (mc_fhl_t
* fhl
)
118 mc_config_deinit (fhl
->config
);
119 mc_fhl_array_free (fhl
);
123 /* --------------------------------------------------------------------------------------------- */