![]() |
![]() |
![]() |
MateConf Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
MateConfSchemaMateConfSchema — A MateConfSchema describes a MateConfEntry |
MateConfSchema; MateConfSchema * mateconf_schema_new (void
); void mateconf_schema_free (MateConfSchema *sc
); MateConfSchema * mateconf_schema_copy (const MateConfSchema *sc
); MateConfValueType mateconf_schema_get_type (const MateConfSchema *schema
); const char * mateconf_schema_get_locale (const MateConfSchema *schema
); const char * mateconf_schema_get_short_desc (const MateConfSchema *schema
); const char * mateconf_schema_get_long_desc (const MateConfSchema *schema
); const char * mateconf_schema_get_owner (const MateConfSchema *schema
); MateConfValue * mateconf_schema_get_default_value (const MateConfSchema *schema
); MateConfValueType mateconf_schema_get_car_type (const MateConfSchema *schema
); MateConfValueType mateconf_schema_get_cdr_type (const MateConfSchema *schema
); MateConfValueType mateconf_schema_get_list_type (const MateConfSchema *schema
); void mateconf_schema_set_type (MateConfSchema *sc
,MateConfValueType type
); void mateconf_schema_set_locale (MateConfSchema *sc
,const gchar *locale
); void mateconf_schema_set_short_desc (MateConfSchema *sc
,const gchar *desc
); void mateconf_schema_set_long_desc (MateConfSchema *sc
,const gchar *desc
); void mateconf_schema_set_owner (MateConfSchema *sc
,const gchar *owner
); void mateconf_schema_set_default_value (MateConfSchema *sc
,const MateConfValue *val
); void mateconf_schema_set_default_value_nocopy (MateConfSchema *sc
,MateConfValue *val
); void mateconf_schema_set_car_type (MateConfSchema *sc
,MateConfValueType type
); void mateconf_schema_set_cdr_type (MateConfSchema *sc
,MateConfValueType type
); void mateconf_schema_set_list_type (MateConfSchema *sc
,MateConfValueType type
);
A "schema" describes a key-value pair in a MateConf database. It may include information such as default value and value type, as well as documentation describing the pair, the name of the application that created the pair, etc.
A MateConfSchema duplicates some of the information about the value it describes, such as type information. In these cases, the type information provided describes what the type of the value should be, not what the type actually is.
typedef struct _MateConfSchema MateConfSchema;
An opaque data type representing a description of a key-value pair.
MateConfSchema * mateconf_schema_new (void
);
Creates a new MateConfSchema.
Returns : |
newly allocated MateConfSchema |
void mateconf_schema_free (MateConfSchema *sc
);
Deallocates a MateConfSchema. Also frees any allocated memory inside the MateConfSchema.
|
a MateConfSchema to destroy. |
MateConfSchema * mateconf_schema_copy (const MateConfSchema *sc
);
Copies a MateConfSchema. The copy is a deep copy, that is, any allocated memory inside the MateConfSchema will also be copied.
|
a MateConfSchema to copy. |
Returns : |
a newly allocated MateConfSchema |
MateConfValueType mateconf_schema_get_type (const MateConfSchema *schema
);
Returns the type of the entry described by a MateConfSchema
|
a MateConfSchema |
Returns : |
the entry type. |
const char * mateconf_schema_get_locale (const MateConfSchema *schema
);
Returns the locale for a MateConfSchema. The returned string is not a copy, so don't try to free it. It is "owned" by the MateConfSchema and will be destroyed when the MateConfSchema is destroyed.
|
a MateConfSchema |
Returns : |
the locale |
const char * mateconf_schema_get_short_desc (const MateConfSchema *schema
);
Returns the short description for a MateConfSchema. The returned string is not a copy, don't try to free it. It is "owned" by the MateConfSchema and will be destroyed when the MateConfSchema is destroyed.
|
a MateConfSchema. |
Returns : |
the short description. |
const char * mateconf_schema_get_long_desc (const MateConfSchema *schema
);
Returns the long description for a MateConfSchema. The returned string is not a copy, don't try to free it. It is "owned" by the MateConfSchema and will be destroyed when the MateConfSchema is destroyed.
|
a MateConfSchema |
Returns : |
the long description. |
const char * mateconf_schema_get_owner (const MateConfSchema *schema
);
Returns the owner of a MateConfSchema. The returned string is not a copy, don't try to free it. It is "owned" by the MateConfSchema and will be destroyed when the MateConfSchema is destroyed.
|
a MateConfSchema. |
Returns : |
the owner. |
MateConfValue * mateconf_schema_get_default_value (const MateConfSchema *schema
);
Returns the default value of the entry that is described by a MateConfSchema.
|
a MateConfSchema. |
Returns : |
the default value of the entry. |
MateConfValueType mateconf_schema_get_car_type (const MateConfSchema *schema
);
Returns the default type of the first member of the pair in the entry
(which should be of type MATECONF_VALUE_PAIR
) described by schema
.
|
a MateConfSchema. |
Returns : |
the type of the first member of the pair element of the entry. |
MateConfValueType mateconf_schema_get_cdr_type (const MateConfSchema *schema
);
Returns the default type of the second member of the pair in the entry
(which should be of type MATECONF_VALUE_PAIR
) described by schema
.
|
a MateConfSchema. |
Returns : |
the type of the second member of the pair element of the entry. |
MateConfValueType mateconf_schema_get_list_type (const MateConfSchema *schema
);
Returns the default type of the list elements of the entry (which should be
of default type MATECONF_VALUE_LIST
) described by schema
.
schema
: a MateConfSchema.
+Returns
: the type of the list elements of the entry.
|
|
Returns : |
void mateconf_schema_set_type (MateConfSchema *sc
,MateConfValueType type
);
Sets the MateConfValueType of the MateConfSchema to type
.
|
a MateConfSchema. |
|
the type. |
void mateconf_schema_set_locale (MateConfSchema *sc
,const gchar *locale
);
Sets the locale for a MateConfSchema to locale
. locale
is copied.
|
a MateConfSchema. |
|
the locale. |
void mateconf_schema_set_short_desc (MateConfSchema *sc
,const gchar *desc
);
Sets the short description of a MateConfSchema to desc
. desc
is copied.
|
a MateConfSchema. |
|
the short description. |
void mateconf_schema_set_long_desc (MateConfSchema *sc
,const gchar *desc
);
Sets the long description of a MateConfSchema to desc
. desc
is copied.
|
a MateConfSchema. |
|
the long description. |
void mateconf_schema_set_owner (MateConfSchema *sc
,const gchar *owner
);
Sets the "owner" of the MateConfSchema, where the owner is the name of the application that created the entry.
|
a MateConfSchema. |
|
the name of the creating application. |
void mateconf_schema_set_default_value (MateConfSchema *sc
,const MateConfValue *val
);
Sets the default value for the entry described by the MateConfSchema.
The MateConfValue is copied. Alternatively, use
mateconf_schema_set_default_value_nocopy()
.
|
a MateConfSchema. |
|
the default value. |
void mateconf_schema_set_default_value_nocopy (MateConfSchema *sc
,MateConfValue *val
);
Sets the default value for the entry described by the MateConfSchema.
The MateConfValue is not copied; the MateConfSchema takes ownership of it.
Alternatively, use mateconf_schema_set_default_value()
.
|
a MateConfSchema. |
|
the default value. |
void mateconf_schema_set_car_type (MateConfSchema *sc
,MateConfValueType type
);
Sets the MateConfValueType of the first member (car) of the entry (which
should be of type MATECONF_VALUE_PAIR
) described by MateConfSchema to type
.
|
a MateConfSchema. |
|
the type. |
void mateconf_schema_set_cdr_type (MateConfSchema *sc
,MateConfValueType type
);
Sets the MateConfValueType of the second member (cdr) of the entry (which
should be of type MATECONF_VALUE_PAIR
) described by MateConfSchema to type
.
|
a MateConfSchema. |
|
the type. |
void mateconf_schema_set_list_type (MateConfSchema *sc
,MateConfValueType type
);
Sets the MateConfValueType of the list elements of the entry (which
should be of type MATECONF_VALUE_LIST
) described by MateConfSchema to type
.
|
a MateConfSchema. |
|
the type. |