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,
30 #include "lib/global.h"
31 #include "lib/filehighlight.h"
34 /*** global variables ****************************************************************************/
36 /*** file scope macro definitions ****************************************************************/
38 /*** file scope type declarations ****************************************************************/
40 /*** file scope variables ************************************************************************/
42 /*** file scope functions ************************************************************************/
45 mc_fhl_filter_free (void *data
)
47 mc_fhl_filter_t
*filter
= (mc_fhl_filter_t
*) data
;
49 g_free (filter
->fgcolor
);
50 g_free (filter
->bgcolor
);
51 mc_search_free (filter
->search_condition
);
55 /* --------------------------------------------------------------------------------------------- */
58 mc_fhl_array_free (mc_fhl_t
* fhl
)
60 if (fhl
->filters
!= NULL
)
62 g_ptr_array_foreach (fhl
->filters
, (GFunc
) mc_fhl_filter_free
, NULL
);
63 fhl
->filters
= (GPtrArray
*) g_ptr_array_free (fhl
->filters
, TRUE
);
67 /* --------------------------------------------------------------------------------------------- */
68 /*** public functions ****************************************************************************/
69 /* --------------------------------------------------------------------------------------------- */
72 mc_fhl_new (gboolean need_auto_fill
)
76 fhl
= g_try_new0 (mc_fhl_t
, 1);
83 if (!mc_fhl_init_from_standard_files (fhl
))
89 if (!mc_fhl_parse_ini_file (fhl
))
98 /* --------------------------------------------------------------------------------------------- */
101 mc_fhl_free (mc_fhl_t
** fhl
)
103 if (fhl
== NULL
|| *fhl
== NULL
)
112 /* --------------------------------------------------------------------------------------------- */
115 mc_fhl_clear (mc_fhl_t
* fhl
)
119 mc_config_deinit (fhl
->config
);
120 mc_fhl_array_free (fhl
);
124 /* --------------------------------------------------------------------------------------------- */