<HTML
><HEAD
><TITLE
>gnome-metadata</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.44"><LINK
REL="HOME"
TITLE="Gnome Library Reference Manual"
HREF="book1.html"><LINK
REL="UP"
TITLE="Gnome Library"
HREF="libgnome.html"><LINK
REL="PREVIOUS"
TITLE="gnome-i18n"
HREF="gnome-gnome-i18n.html"><LINK
REL="NEXT"
TITLE="gnome-mime-info"
HREF="gnome-gnome-mime-info.html"></HEAD
><BODY
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
BGCOLOR="#000000"
CELLPADDING="1"
CELLSPACING="0"
><TR
><TH
COLSPAN="4"
ALIGN="center"
><FONT
COLOR="#FFFFFF"
SIZE="5"
>Gnome Library Reference Manual</FONT
></TH
></TR
><TR
><TD
WIDTH="25%"
BGCOLOR="#C00000"
ALIGN="left"
><A
HREF="gnome-gnome-i18n.html"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>&#60;&#60;&#60; Previous Page</B
></FONT
></A
></TD
><TD
WIDTH="25%"
BGCOLOR="#0000C0"
ALIGN="center"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
><A
HREF="book1.html"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Home</B
></FONT
></A
></B
></FONT
></TD
><TD
WIDTH="25%"
BGCOLOR="#00C000"
ALIGN="center"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
><A
HREF="libgnome.html"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Up</B
></FONT
></A
></B
></FONT
></TD
><TD
WIDTH="25%"
BGCOLOR="#C00000"
ALIGN="right"
><A
HREF="gnome-gnome-mime-info.html"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Next Page &#62;&#62;&#62;</B
></FONT
></A
></TD
></TR
></TABLE
></DIV
><H1
><A
NAME="GNOME-GNOME-METADATA"
>gnome-metadata</A
></H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN2444"
></A
><H2
>Name</H2
>gnome-metadata&nbsp;--&nbsp;File metadata information storage.</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN2447"
></A
><H2
>Synopsis</H2
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
><TD
><PRE
CLASS="SYNOPSIS"
>&#13;#include &lt;gnome.h&gt;


enum        <A
HREF="gnome-gnome-metadata.html#GNOMEMETADATAERROR-T"
>GnomeMetadataError_t</A
>;
int         <A
HREF="gnome-gnome-metadata.html#GNOME-METADATA-SET"
>gnome_metadata_set</A
>              (const char *file,
                                             const char *name,
                                             int size,
                                             const char *data);
int         <A
HREF="gnome-gnome-metadata.html#GNOME-METADATA-REMOVE"
>gnome_metadata_remove</A
>           (const char *file,
                                             const char *name);
char**      <A
HREF="gnome-gnome-metadata.html#GNOME-METADATA-LIST"
>gnome_metadata_list</A
>             (const char *file);
int         <A
HREF="gnome-gnome-metadata.html#GNOME-METADATA-GET"
>gnome_metadata_get</A
>              (const char *file,
                                             const char *name,
                                             int *size,
                                             char **buffer);
int         <A
HREF="gnome-gnome-metadata.html#GNOME-METADATA-GET-FAST"
>gnome_metadata_get_fast</A
>         (const char *file,
                                             const char *name,
                                             int *size,
                                             char **buffer);
int         <A
HREF="gnome-gnome-metadata.html#GNOME-METADATA-RENAME"
>gnome_metadata_rename</A
>           (const char *from,
                                             const char *to);
int         <A
HREF="gnome-gnome-metadata.html#GNOME-METADATA-COPY"
>gnome_metadata_copy</A
>             (const char *from,
                                             const char *to);
int         <A
HREF="gnome-gnome-metadata.html#GNOME-METADATA-DELETE"
>gnome_metadata_delete</A
>           (const char *file);
void        <A
HREF="gnome-gnome-metadata.html#GNOME-METADATA-REGEX-ADD"
>gnome_metadata_regex_add</A
>        (const char *regex,
                                             const char *key,
                                             int size,
                                             const char *data);
void        <A
HREF="gnome-gnome-metadata.html#GNOME-METADATA-REGEX-REMOVE"
>gnome_metadata_regex_remove</A
>     (const char *regex,
                                             const char *key);
void        <A
HREF="gnome-gnome-metadata.html#GNOME-METADATA-TYPE-ADD"
>gnome_metadata_type_add</A
>         (const char *type,
                                             const char *key,
                                             int size,
                                             const char *data);
void        <A
HREF="gnome-gnome-metadata.html#GNOME-METADATA-TYPE-REMOVE"
>gnome_metadata_type_remove</A
>      (const char *type,
                                             const char *key);
void        <A
HREF="gnome-gnome-metadata.html#GNOME-METADATA-LOCK"
>gnome_metadata_lock</A
>             (void);
void        <A
HREF="gnome-gnome-metadata.html#GNOME-METADATA-UNLOCK"
>gnome_metadata_unlock</A
>           (void);</PRE
></TD
></TR
></TABLE
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN2465"
></A
><H2
>Description</H2
><P
>   One of the problems that a desktop environment faces is the fact
that it is usually necessary to have a mechanism for storing
information about a file's properties.  For example, applications
might want to bind an icon for a specific executable file or bind a
small thumbnail image for a graphic produced by a graphics program.
These icons should be semantically attached to the main file.</P
><P
>   The GNOME metadata was implemented by Tom Tromey at Cygnus, given a
number of design constraints and tradeoffs (described in detail in
<A
HREF="http://www.cygnus.com/~tromey/gnome/metadata.html"
TARGET="_top"
>[TROMEY]</A
>).</P
><P
>Here is a list of the GNOME metadata features:</P
><P
></P
><UL
><LI
><P
>Binding the information on a per-file basis: This
      is a per-user setting and each user keeps track of his own
      bindings.  System defaults apply on top of these.
      </P
></LI
><LI
><P
> Binding information by file content: Given the
      type of the file (using file signatures, similar to the
      Unix-file(1) command).  </P
></LI
><LI
><P
>Binding information by a regular expression.  For
      example, a default icon for gif files would be provided by a
      regular expression "*.\.gif$".  </P
></LI
><LI
><P
>The metadata system is optimized to provide a
      coherent GUI solution, rather than as a compromise to kludging
      existing command line tools.
    </P
></LI
><LI
><P
>Most ordinary uses of files will continue to work
      without metadata, just as they do now.
    </P
></LI
></UL
><P
>   There are a number of standard properties for file metadata in
GNOME, for example: "View" stores the action for viewing the file
contents; "Open" stores analogous action for editing; "Icon" which
contains the icon used for displaying the file on the desktop.  For a
complete list of the existing keys see <I
CLASS="EMPHASIS"
>FIXME</I
>.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN2484"
></A
><H2
>Details</H2
><DIV
CLASS="REFSECT2"
><A
NAME="AEN2486"
></A
><H3
><A
NAME="GNOMEMETADATAERROR-T"
></A
>enum GnomeMetadataError_t</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>typedef enum
{
	GNOME_METADATA_OK = 0,		   /* No error. */
	GNOME_METADATA_IO_ERROR,	   /* IO or other low-level
					      communications/storage
					      error.  */
	GNOME_METADATA_NOT_FOUND	   /* Information not found.  */
} GnomeMetadataError_t;</PRE
></TD
></TR
></TABLE
><P
>This describes the errors that can be returned by some gnome-metadata
functions.</P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN2491"
></A
><H3
><A
NAME="GNOME-METADATA-SET"
></A
>gnome_metadata_set ()</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>int         gnome_metadata_set              (const char *file,
                                             const char *name,
                                             int size,
                                             const char *data);</PRE
></TD
></TR
></TABLE
><P
>Sets metadata associated with <TT
CLASS="PARAMETER"
><I
>file</I
></TT
> and <TT
CLASS="PARAMETER"
><I
>name</I
></TT
>.</P
><P
></P
><DIV
CLASS="INFORMALTABLE"
><P
></P
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>file</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> File with which metadata will be associated</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>name</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> Metadata key.</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>size</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> Size in bytes of data</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>data</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> Data to be stored.</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><I
CLASS="EMPHASIS"
>Returns</I
> :</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="LITERAL"
>0</TT
> on success or an error code.</TD
></TR
></TABLE
><P
></P
></DIV
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN2525"
></A
><H3
><A
NAME="GNOME-METADATA-REMOVE"
></A
>gnome_metadata_remove ()</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>int         gnome_metadata_remove           (const char *file,
                                             const char *name);</PRE
></TD
></TR
></TABLE
><P
>Remove a piece of metadata associated with <TT
CLASS="PARAMETER"
><I
>file</I
></TT
>.</P
><P
></P
><DIV
CLASS="INFORMALTABLE"
><P
></P
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>file</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> File name</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>name</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> Metadata key.</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><I
CLASS="EMPHASIS"
>Returns</I
> :</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="LITERAL"
>0</TT
> on success, or an error code.</TD
></TR
></TABLE
><P
></P
></DIV
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN2550"
></A
><H3
><A
NAME="GNOME-METADATA-LIST"
></A
>gnome_metadata_list ()</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>char**      gnome_metadata_list             (const char *file);</PRE
></TD
></TR
></TABLE
><P
></P
><P
></P
><DIV
CLASS="INFORMALTABLE"
><P
></P
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>file</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> File name.</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><I
CLASS="EMPHASIS"
>Returns</I
> :</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
>an array of all metadata keys associated with <TT
CLASS="PARAMETER"
><I
>file</I
></TT
>.  The
array is <TT
CLASS="LITERAL"
>NULL</TT
> terminated.  The result can be freed with
<GTKDOCLINK
HREF="G-STRFREEV"
>g_strfreev</GTKDOCLINK
>().  This only returns keys for which there
is a particular association with <TT
CLASS="PARAMETER"
><I
>file</I
></TT
>.  It will not return keys
for which a regex or other match succeeds.</TD
></TR
></TABLE
><P
></P
></DIV
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN2573"
></A
><H3
><A
NAME="GNOME-METADATA-GET"
></A
>gnome_metadata_get ()</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>int         gnome_metadata_get              (const char *file,
                                             const char *name,
                                             int *size,
                                             char **buffer);</PRE
></TD
></TR
></TABLE
><P
>Get a piece of metadata associated with <TT
CLASS="PARAMETER"
><I
>file</I
></TT
>.  <TT
CLASS="PARAMETER"
><I
>size</I
></TT
> and <TT
CLASS="PARAMETER"
><I
>buffer</I
></TT
>
are result parameters.  *<TT
CLASS="PARAMETER"
><I
>buffer</I
></TT
> is <GTKDOCLINK
HREF="G-MALLOC"
>g_malloc</GTKDOCLINK
>()d.</P
><P
></P
><DIV
CLASS="INFORMALTABLE"
><P
></P
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>file</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> File name</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>name</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> Metadata key</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>size</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> Return parameter for size of data</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>buffer</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> Return parameter for data</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><I
CLASS="EMPHASIS"
>Returns</I
> :</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="LITERAL"
>0</TT
>, or an error code.  On error *<TT
CLASS="PARAMETER"
><I
>buffer</I
></TT
> will be set to <TT
CLASS="LITERAL"
>NULL</TT
>.</TD
></TR
></TABLE
><P
></P
></DIV
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN2612"
></A
><H3
><A
NAME="GNOME-METADATA-GET-FAST"
></A
>gnome_metadata_get_fast ()</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>int         gnome_metadata_get_fast         (const char *file,
                                             const char *name,
                                             int *size,
                                             char **buffer);</PRE
></TD
></TR
></TABLE
><P
>Like <A
HREF="gnome-gnome-metadata.html#GNOME-METADATA-GET"
>gnome_metadata_get</A
>(), but won't run the `file' command to
characterize the file type.</P
><P
></P
><DIV
CLASS="INFORMALTABLE"
><P
></P
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>file</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> File name</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>name</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> Metadata key</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>size</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> Return parameter for size of data</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>buffer</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> Return parameter for data</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><I
CLASS="EMPHASIS"
>Returns</I
> :</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="LITERAL"
>0</TT
>, or an error code.  On error *<TT
CLASS="PARAMETER"
><I
>buffer</I
></TT
> will be set to
<TT
CLASS="LITERAL"
>NULL</TT
>.</TD
></TR
></TABLE
><P
></P
></DIV
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN2647"
></A
><H3
><A
NAME="GNOME-METADATA-RENAME"
></A
>gnome_metadata_rename ()</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>int         gnome_metadata_rename           (const char *from,
                                             const char *to);</PRE
></TD
></TR
></TABLE
><P
>This function moves metadata associated with file <TT
CLASS="PARAMETER"
><I
>from</I
></TT
> to file
<TT
CLASS="PARAMETER"
><I
>to</I
></TT
>.  It should be called after a file is renamed.</P
><P
></P
><DIV
CLASS="INFORMALTABLE"
><P
></P
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>from</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> Source file name</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>to</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> Destination file name</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><I
CLASS="EMPHASIS"
>Returns</I
> :</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="LITERAL"
>0</TT
> on success, or an error code.</TD
></TR
></TABLE
><P
></P
></DIV
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN2673"
></A
><H3
><A
NAME="GNOME-METADATA-COPY"
></A
>gnome_metadata_copy ()</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>int         gnome_metadata_copy             (const char *from,
                                             const char *to);</PRE
></TD
></TR
></TABLE
><P
>This function copies metadata associated with file <TT
CLASS="PARAMETER"
><I
>from</I
></TT
> to file
<TT
CLASS="PARAMETER"
><I
>to</I
></TT
>.  It should be called after a file is copied.</P
><P
></P
><DIV
CLASS="INFORMALTABLE"
><P
></P
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>from</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> Source file name</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>to</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> Destination file name</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><I
CLASS="EMPHASIS"
>Returns</I
> :</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="LITERAL"
>0</TT
> on success, or an error code.</TD
></TR
></TABLE
><P
></P
></DIV
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN2699"
></A
><H3
><A
NAME="GNOME-METADATA-DELETE"
></A
>gnome_metadata_delete ()</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>int         gnome_metadata_delete           (const char *file);</PRE
></TD
></TR
></TABLE
><P
>This function deletes all metadata associated with <TT
CLASS="PARAMETER"
><I
>file</I
></TT
>.
It should be called after a file is deleted.</P
><P
></P
><DIV
CLASS="INFORMALTABLE"
><P
></P
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>file</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> File name</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><I
CLASS="EMPHASIS"
>Returns</I
> :</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="LITERAL"
>0</TT
> on success, or an error code.</TD
></TR
></TABLE
><P
></P
></DIV
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN2720"
></A
><H3
><A
NAME="GNOME-METADATA-REGEX-ADD"
></A
>gnome_metadata_regex_add ()</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>void        gnome_metadata_regex_add        (const char *regex,
                                             const char *key,
                                             int size,
                                             const char *data);</PRE
></TD
></TR
></TABLE
><P
>Add a regular expression to the internal list.  This regex is used
when matching requests for the metadata <TT
CLASS="PARAMETER"
><I
>key</I
></TT
>.</P
><P
></P
><DIV
CLASS="INFORMALTABLE"
><P
></P
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>regex</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> The regular expression.</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>key</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> The metadata key.</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>size</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> Size of data in bytes.</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>data</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> The data.</TD
></TR
></TABLE
><P
></P
></DIV
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN2748"
></A
><H3
><A
NAME="GNOME-METADATA-REGEX-REMOVE"
></A
>gnome_metadata_regex_remove ()</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>void        gnome_metadata_regex_remove     (const char *regex,
                                             const char *key);</PRE
></TD
></TR
></TABLE
><P
>Remove the regular expression from the internal list.</P
><P
></P
><DIV
CLASS="INFORMALTABLE"
><P
></P
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>regex</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> The regular expression.</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>key</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> The metadata key.</TD
></TR
></TABLE
><P
></P
></DIV
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN2767"
></A
><H3
><A
NAME="GNOME-METADATA-TYPE-ADD"
></A
>gnome_metadata_type_add ()</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>void        gnome_metadata_type_add         (const char *type,
                                             const char *key,
                                             int size,
                                             const char *data);</PRE
></TD
></TR
></TABLE
><P
>Add a file type to the internal list.  This pairing is used
when matching requests for the metadata <TT
CLASS="PARAMETER"
><I
>key</I
></TT
>.</P
><P
></P
><DIV
CLASS="INFORMALTABLE"
><P
></P
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>type</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> File type</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>key</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> The metadata key.</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>size</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> Size of data in bytes.</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>data</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> The data.</TD
></TR
></TABLE
><P
></P
></DIV
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN2795"
></A
><H3
><A
NAME="GNOME-METADATA-TYPE-REMOVE"
></A
>gnome_metadata_type_remove ()</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>void        gnome_metadata_type_remove      (const char *type,
                                             const char *key);</PRE
></TD
></TR
></TABLE
><P
>Remove a type/key pairing from the internal list.</P
><P
></P
><DIV
CLASS="INFORMALTABLE"
><P
></P
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>type</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> The file type.</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>key</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> The metadata key.</TD
></TR
></TABLE
><P
></P
></DIV
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN2814"
></A
><H3
><A
NAME="GNOME-METADATA-LOCK"
></A
>gnome_metadata_lock ()</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>void        gnome_metadata_lock             (void);</PRE
></TD
></TR
></TABLE
><P
>Locks the metadata system.  Used if you are going to invoke
many metadata operations to speed up metadata access.</P
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN2820"
></A
><H3
><A
NAME="GNOME-METADATA-UNLOCK"
></A
>gnome_metadata_unlock ()</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>void        gnome_metadata_unlock           (void);</PRE
></TD
></TR
></TABLE
><P
>Unlocks the metadata system.  Used if you are going to invoke
many metadata operations to speed up metadata access.</P
><P
></P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><BR
CLEAR="all"><BR><TABLE
WIDTH="100%"
BORDER="0"
BGCOLOR="#000000"
CELLPADDING="1"
CELLSPACING="0"
><TR
><TD
WIDTH="25%"
BGCOLOR="#C00000"
ALIGN="left"
><A
HREF="gnome-gnome-i18n.html"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>&#60;&#60;&#60; Previous Page</B
></FONT
></A
></TD
><TD
WIDTH="25%"
BGCOLOR="#0000C0"
ALIGN="center"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
><A
HREF="book1.html"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Home</B
></FONT
></A
></B
></FONT
></TD
><TD
WIDTH="25%"
BGCOLOR="#00C000"
ALIGN="center"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
><A
HREF="libgnome.html"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Up</B
></FONT
></A
></B
></FONT
></TD
><TD
WIDTH="25%"
BGCOLOR="#C00000"
ALIGN="right"
><A
HREF="gnome-gnome-mime-info.html"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Next Page &#62;&#62;&#62;</B
></FONT
></A
></TD
></TR
><TR
><TD
COLSPAN="2"
ALIGN="left"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>gnome-i18n</B
></FONT
></TD
><TD
COLSPAN="2"
ALIGN="right"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>gnome-mime-info</B
></FONT
></TD
></TR
></TABLE
></DIV
></BODY
></HTML
>