2006-08-22 21:15:25 -07:00
|
|
|
/*
|
|
|
|
* mookeyfile.h
|
|
|
|
*
|
2007-06-24 10:56:20 -07:00
|
|
|
* Copyright (C) 2004-2007 by Yevgen Muntyan <muntyan@math.tamu.edu>
|
2006-08-22 21:15:25 -07:00
|
|
|
*
|
2007-06-24 10:56:20 -07:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
2007-09-23 09:47:28 -07:00
|
|
|
* License version 2.1 as published by the Free Software Foundation.
|
2006-08-22 21:15:25 -07:00
|
|
|
*
|
|
|
|
* See COPYING file that comes with this distribution.
|
|
|
|
*/
|
|
|
|
|
2007-06-10 02:06:03 -07:00
|
|
|
#ifndef MOO_KEY_FILE_H
|
|
|
|
#define MOO_KEY_FILE_H
|
2006-08-22 21:15:25 -07:00
|
|
|
|
|
|
|
#include <glib-object.h>
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
|
|
|
|
#define MOO_TYPE_KEY_FILE_ITEM (moo_key_file_item_get_type ())
|
|
|
|
|
|
|
|
#define MOO_TYPE_KEY_FILE (moo_key_file_get_type ())
|
|
|
|
#define MOO_KEY_FILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MOO_TYPE_KEY_FILE, MooKeyFile))
|
|
|
|
#define MOO_KEY_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MOO_TYPE_KEY_FILE, MooKeyFileClass))
|
|
|
|
#define MOO_IS_KEY_FILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MOO_TYPE_KEY_FILE))
|
|
|
|
#define MOO_IS_KEY_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MOO_TYPE_KEY_FILE))
|
|
|
|
#define MOO_KEY_FILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MOO_TYPE_KEY_FILE, MooKeyFileClass))
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _MooKeyFile MooKeyFile;
|
|
|
|
typedef struct _MooKeyFileItem MooKeyFileItem;
|
|
|
|
|
|
|
|
|
|
|
|
GType moo_key_file_get_type (void) G_GNUC_CONST;
|
|
|
|
GType moo_key_file_item_get_type (void) G_GNUC_CONST;
|
|
|
|
|
|
|
|
MooKeyFile *moo_key_file_new (void);
|
|
|
|
MooKeyFile *moo_key_file_new_from_file (const char *filename,
|
|
|
|
GError **error);
|
|
|
|
|
|
|
|
MooKeyFile *moo_key_file_ref (MooKeyFile *key_file);
|
|
|
|
void moo_key_file_unref (MooKeyFile *key_file);
|
|
|
|
|
2006-08-23 03:28:50 -07:00
|
|
|
char *moo_key_file_format (MooKeyFile *key_file,
|
|
|
|
const char *comment,
|
|
|
|
guint indent);
|
2006-08-22 21:15:25 -07:00
|
|
|
|
|
|
|
guint moo_key_file_n_items (MooKeyFile *key_file);
|
|
|
|
MooKeyFileItem *moo_key_file_nth_item (MooKeyFile *key_file,
|
|
|
|
guint n);
|
|
|
|
MooKeyFileItem *moo_key_file_new_item (MooKeyFile *key_file,
|
|
|
|
const char *name);
|
|
|
|
|
2006-08-23 03:28:50 -07:00
|
|
|
const char *moo_key_file_item_name (MooKeyFileItem *item);
|
|
|
|
|
|
|
|
const char *moo_key_file_item_get (MooKeyFileItem *item,
|
2006-08-22 21:15:25 -07:00
|
|
|
const char *key);
|
2006-08-31 08:21:39 -07:00
|
|
|
char *moo_key_file_item_steal (MooKeyFileItem *item,
|
|
|
|
const char *key);
|
2006-08-23 03:28:50 -07:00
|
|
|
void moo_key_file_item_set (MooKeyFileItem *item,
|
2006-08-22 21:15:25 -07:00
|
|
|
const char *key,
|
|
|
|
const char *value);
|
2006-08-31 08:21:39 -07:00
|
|
|
gboolean moo_key_file_item_steal_bool (MooKeyFileItem *item,
|
|
|
|
const char *key,
|
|
|
|
gboolean default_val);
|
2006-08-23 03:28:50 -07:00
|
|
|
void moo_key_file_item_set_bool (MooKeyFileItem *item,
|
2006-08-22 21:15:25 -07:00
|
|
|
const char *key,
|
|
|
|
gboolean value);
|
2006-08-31 08:21:39 -07:00
|
|
|
void moo_key_file_item_foreach (MooKeyFileItem *item,
|
|
|
|
GHFunc func,
|
|
|
|
gpointer data);
|
2006-08-22 21:15:25 -07:00
|
|
|
|
2006-08-23 03:28:50 -07:00
|
|
|
const char *moo_key_file_item_get_content (MooKeyFileItem *item);
|
2006-08-31 08:21:39 -07:00
|
|
|
char *moo_key_file_item_steal_content(MooKeyFileItem *item);
|
2006-08-23 03:28:50 -07:00
|
|
|
void moo_key_file_item_set_content (MooKeyFileItem *item,
|
2006-08-22 21:15:25 -07:00
|
|
|
const char *content);
|
|
|
|
|
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
2007-06-10 02:06:03 -07:00
|
|
|
#endif /* MOO_KEY_FILE_H */
|