2 * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved.
4 * This library is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License version 2.1 as
6 * published by the Free Software Foundation.
8 * This library is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
11 * License for more details.
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this library; if not, write to the Free Software Foundation,
15 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
17 * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
18 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
24 foreach_fn(gpointer key_p, gpointer value_p, gpointer user_data_p)
27 char *value = value_p;
29 hv_store(hv, key, strlen(key), newSVpv(value, 0), 0);
33 g_hash_table_to_hashref(GHashTable *hash)
35 HV *hv = (HV *)sv_2mortal((SV *)newHV());
37 g_hash_table_foreach(hash, foreach_fn, hv);
39 return newRV((SV *)hv);