3
3
* Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
4
4
* Copyright (C) 2012 Intel Corporation
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of version 2 of the GNU Lesser General Public
8
* License as published by the Free Software Foundation.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* General Public License for more details.
15
* You should have received a copy of the GNU Lesser General Public
16
* License along with this library; if not, write to the
17
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18
* Boston, MA 02110-1301, USA.
6
* This library is free software; you can redistribute it and/or modify it
7
* under the terms of the GNU Lesser General Public License as published by
8
* the Free Software Foundation.
10
* This library is distributed in the hope that it will be useful, but
11
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15
* You should have received a copy of the GNU Lesser General Public License
16
* along with this library; if not, see <http://www.gnu.org/licenses/>.
21
19
* Rodrigo Moya <rodrigo@ximian.com>
121
* @v1: (allow-none): a %NULL-terminated string array, or %NULL
122
* @v2: (allow-none): another %NULL-terminated string array, or %NULL
124
* Compares @v1 and @v2 for equality, handling %NULL gracefully.
126
* The arguments types are generic for compatibility with #GEqualFunc.
128
* Returns: whether @v1 and @v2 are identical
133
e_util_strv_equal (gconstpointer v1,
136
gchar **strv1 = (gchar **) v1;
137
gchar **strv2 = (gchar **) v2;
138
guint length1, length2, ii;
143
if (strv1 == NULL || strv2 == NULL)
146
length1 = g_strv_length (strv1);
147
length2 = g_strv_length (strv2);
149
if (length1 != length2)
152
for (ii = 0; ii < length1; ii++) {
153
if (!g_str_equal (strv1[ii], strv2[ii]))
122
161
* e_util_strdup_strip:
123
162
* @string: (allow-none): a string value, or %NULL
2066
2105
e_named_parameters,
2067
2106
e_named_parameters_ref,
2068
2107
e_named_parameters_unref);
2110
* e_named_timeout_add:
2111
* @interval: the time between calls to the function, in milliseconds
2112
* (1/1000ths of a second)
2113
* @function: function to call
2114
* @data: data to pass to @function
2116
* Similar to g_timeout_add(), but also names the #GSource for use in
2117
* debugging and profiling. The name is formed from @function and the
2118
* <literal>PACKAGE</literal> definintion from a <config.h> file.
2120
* Returns: the ID (greater than 0) of the event source
2126
* e_named_timeout_add_full:
2127
* @priority: the priority of the timeout source, typically in the
2128
* range between #G_PRIORITY_DEFAULT and #G_PRIORITY_HIGH
2129
* @interval: the time between calls to the function, in milliseconds
2130
* (1/1000ths of a second)
2131
* @function: function to call
2132
* @data: data to pass to @function
2133
* @notify: function to call when the timeout is removed, or %NULL
2135
* Similar to g_timeout_add_full(), but also names the #GSource for use
2136
* in debugging and profiling. The name is formed from @function and the
2137
* <literal>PACKAGE</literal> definition from a <config.h> file.
2139
* Returns: the ID (greater than 0) of the event source
2145
* e_named_timeout_add_seconds:
2146
* @interval: the time between calls to the function, in seconds
2147
* @function: function to call
2148
* @data: data to pass to @function
2150
* Similar to g_timeout_add_seconds(), but also names the #GSource for use
2151
* in debugging and profiling. The name is formed from @function and the
2152
* <literal>PACKAGE</literal> definition from a <config.h> file.
2154
* Returns: the ID (greater than 0) of the event source
2160
* e_named_timeout_add_seconds_full:
2161
* @priority: the priority of the timeout source, typically in the
2162
* range between #G_PRIORITY_DEFAULT and #G_PRIORITY_HIGH
2163
* @interval: the time between calls to the function, in seconds
2164
* @function: function to call
2165
* @data: data to pass to @function
2166
* @notify: function to call when the timeout is removed, or %NULL
2168
* Similar to g_timeout_add_seconds_full(), but also names the #GSource for
2169
* use in debugging and profiling. The name is formed from @function and the
2170
* <literal>PACKAGE</literal> definition from a <config.h> file.
2172
* Returns: the ID (greater than 0) of the event source
2178
* e_timeout_add_with_name:
2179
* @priority: the priority of the timeout source, typically in the
2180
* range between #G_PRIORITY_DEFAULT and #G_PRIORITY_HIGH
2181
* @interval: the time between calls to the function, in milliseconds
2182
* (1/1000ths of a second)
2183
* @name: (allow-none): debug name for the source
2184
* @function: function to call
2185
* @data: data to pass to @function
2186
* @notify: (allow-none): function to call when the timeout is removed,
2189
* Similar to g_timeout_add_full(), but also names the #GSource as @name.
2191
* You might find e_named_timeout_add() or e_named_timeout_add_full() more
2192
* convenient. Those macros name the #GSource implicitly.
2194
* Returns: the ID (greather than 0) of the event source
2199
e_timeout_add_with_name (gint priority,
2202
GSourceFunc function,
2204
GDestroyNotify notify)
2208
g_return_val_if_fail (function != NULL, 0);
2210
tag = g_timeout_add_full (
2211
priority, interval, function, data, notify);
2212
g_source_set_name_by_id (tag, name);
2218
* e_timeout_add_seconds_with_name:
2219
* @priority: the priority of the timeout source, typically in the
2220
* range between #G_PRIORITY_DEFAULT and #G_PRIORITY_HIGH
2221
* @interval: the time between calls to the function, in seconds
2222
* @name: (allow-none): debug name for the source
2223
* @function: function to call
2224
* @data: data to pass to @function
2225
* @notify: (allow-none): function to call when the timeout is removed,
2228
* Similar to g_timeout_add_seconds_full(), but also names the #GSource as
2231
* You might find e_named_timeout_add_seconds() or
2232
* e_named_timeout_add_seconds_full() more convenient. Those macros name
2233
* the #GSource implicitly.
2235
* Returns: the ID (greater than 0) of the event source
2240
e_timeout_add_seconds_with_name (gint priority,
2243
GSourceFunc function,
2245
GDestroyNotify notify)
2249
g_return_val_if_fail (function != NULL, 0);
2251
tag = g_timeout_add_seconds_full (
2252
priority, interval, function, data, notify);
2253
g_source_set_name_by_id (tag, name);