<HTML ><HEAD ><TITLE >bonobo-storage</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.64 "><LINK REL="HOME" TITLE="Bonobo API Reference Manual" HREF="book1.html"><LINK REL="UP" TITLE="Storage and Persistance" HREF="bonobo-storage.html"><LINK REL="PREVIOUS" TITLE="Storage and Persistance" HREF="bonobo-storage.html"><LINK REL="NEXT" TITLE="BonoboStream" HREF="bonobo-bonobo-stream.html"></HEAD ><BODY CLASS="REFENTRY" 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" >Bonobo API Reference Manual</FONT ></TH ></TR ><TR ><TD WIDTH="25%" BGCOLOR="#C00000" ALIGN="left" ><A HREF="bonobo-storage.html" ><FONT COLOR="#FFFFFF" SIZE="3" ><B ><<< 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="bonobo-storage.html" ><FONT COLOR="#FFFFFF" SIZE="3" ><B >Up</B ></FONT ></A ></B ></FONT ></TD ><TD WIDTH="25%" BGCOLOR="#C00000" ALIGN="right" ><A HREF="bonobo-bonobo-stream.html" ><FONT COLOR="#FFFFFF" SIZE="3" ><B >Next Page >>></B ></FONT ></A ></TD ></TR ></TABLE ></DIV ><H1 ><A NAME="BONOBO-BONOBO-STORAGE" >bonobo-storage</A ></H1 ><DIV CLASS="REFNAMEDIV" ><A NAME="AEN5991" ></A ><H2 >Name</H2 >bonobo-storage -- Abstract implementation of the Bonobo::Storage interface</DIV ><DIV CLASS="REFSYNOPSISDIV" ><A NAME="AEN5994" ></A ><H2 >Synopsis</H2 ><TABLE BORDER="0" BGCOLOR="#D6E8FF" WIDTH="100%" CELLPADDING="6" ><TR ><TD ><PRE CLASS="SYNOPSIS" > typedef <A HREF="bonobo-bonobo-storage.html#BONOBOSTORAGE" >BonoboStorage</A >; typedef <A HREF="bonobo-bonobo-storage.html#BONOBOSTORAGECLASS" >BonoboStorageClass</A >; <A HREF="bonobo-bonobo-storage.html#BONOBOSTORAGE" >BonoboStorage</A >* <A HREF="bonobo-bonobo-storage.html#BONOBO-STORAGE-OPEN" >bonobo_storage_open</A > (const char *driver, const char *path, <GTKDOCLINK HREF="GINT" >gint</GTKDOCLINK > flags, <GTKDOCLINK HREF="GINT" >gint</GTKDOCLINK > mode); <A HREF="bonobo-bonobo-storage.html#BONOBOSTORAGE" >BonoboStorage</A >* <A HREF="bonobo-bonobo-storage.html#BONOBO-STORAGE-OPEN-FULL" >bonobo_storage_open_full</A > (const char *driver, const char *path, <GTKDOCLINK HREF="GINT" >gint</GTKDOCLINK > flags, <GTKDOCLINK HREF="GINT" >gint</GTKDOCLINK > mode, <GTKDOCLINK HREF="CORBA-ENVIRONMENT" >CORBA_Environment</GTKDOCLINK > *opt_ev); void <A HREF="bonobo-bonobo-storage.html#BONOBO-STORAGE-COPY-TO" >bonobo_storage_copy_to</A > (<A HREF="bonobo-storage.html" >Bonobo_Storage</A > src, <A HREF="bonobo-storage.html" >Bonobo_Storage</A > dest, <GTKDOCLINK HREF="CORBA-ENVIRONMENT" >CORBA_Environment</GTKDOCLINK > *ev); void <A HREF="bonobo-bonobo-storage.html#BONOBO-STORAGE-WRITE-CLASS-ID" >bonobo_storage_write_class_id</A > (<A HREF="bonobo-bonobo-storage.html#BONOBOSTORAGE" >BonoboStorage</A > *storage, char *class_id); void <A HREF="bonobo-bonobo-storage.html#BONOBO-STREAM-WRITE-CLASS-ID" >bonobo_stream_write_class_id</A > (<A HREF="bonobo-bonobo-stream.html#BONOBOSTREAM" >BonoboStream</A > *stream, char *class_id); </PRE ></TD ></TR ></TABLE ></DIV ><DIV CLASS="REFSECT1" ><A NAME="AEN6016" ></A ><H2 >Object Hierarchy</H2 ><TABLE BORDER="0" BGCOLOR="#D6E8FF" WIDTH="100%" CELLPADDING="6" ><TR ><TD ><PRE CLASS="SYNOPSIS" > <GTKDOCLINK HREF="GTKOBJECT" >GtkObject</GTKDOCLINK > +----<A HREF="bonobo-bonobo-object.html#BONOBOOBJECT" >BonoboObject</A > +----<GTKDOCLINK HREF="BONOBOXOBJECT" >BonoboXObject</GTKDOCLINK > +----BonoboStorage</PRE ></TD ></TR ></TABLE ></DIV ><DIV CLASS="REFSECT1" ><A NAME="AEN6022" ></A ><H2 >Description</H2 ><P >The BonoboStorage C interface is extremely simple, this is since the CORBA client interface is where the action occurs. It is anticipated that relatively few people need to implement the Bonobo/Storage IDL interface.</P ><P >The common entry point for BonoboStorage is that of opening a storage using the bonobo_storage_open function, perhaps by a container to use to persist a compound document: <DIV CLASS="EXAMPLE" ><A NAME="AEN6026" ></A ><P ><B >Example 1. An example storage use case</B ></P ><TABLE BORDER="0" BGCOLOR="#D8F8D8" WIDTH="100%" CELLPADDING="6" ><TR ><TD ><PRE CLASS="PROGRAMLISTING" >void container_save (SampleApp *app, const char *filename, CORBA_Environment *ev) { BonoboStorage *storage; Bonobo_Storage corba_storage; GList *components; int i; storage = bonobo_storage_open (STORAGE_TYPE, filename, Bonobo_Storage_READ | Bonobo_Storage_WRITE | Bonobo_Storage_CREATE, 0664); g_return_if_fail (storage); corba_storage = BONOBO_OBJREF (storage); ... Serialize components to streams created in the storage ... Bonobo_Storage_commit (corba_storage, ev); CORBA_exception_free (ev); bonobo_object_unref (BONOBO_OBJECT (storage)); } </PRE ></TD ></TR ></TABLE ></DIV > </P ></DIV ><DIV CLASS="REFSECT1" ><A NAME="AEN6029" ></A ><H2 >Details</H2 ><DIV CLASS="REFSECT2" ><A NAME="AEN6031" ></A ><H3 ><A NAME="BONOBOSTORAGE" ></A >BonoboStorage</H3 ><TABLE BORDER="0" BGCOLOR="#D6E8FF" WIDTH="100%" CELLPADDING="6" ><TR ><TD ><PRE CLASS="PROGRAMLISTING" >typedef struct { BonoboXObject object; BonoboStoragePrivate *priv; } BonoboStorage;</PRE ></TD ></TR ></TABLE ><P ></P ></DIV ><HR><DIV CLASS="REFSECT2" ><A NAME="AEN6036" ></A ><H3 ><A NAME="BONOBOSTORAGECLASS" ></A >BonoboStorageClass</H3 ><TABLE BORDER="0" BGCOLOR="#D6E8FF" WIDTH="100%" CELLPADDING="6" ><TR ><TD ><PRE CLASS="PROGRAMLISTING" >typedef struct { BonoboXObjectClass parent_class; POA_Bonobo_Storage__epv epv; /* virtual methods */ Bonobo_StorageInfo *(*get_info) (BonoboStorage *storage, const CORBA_char *path, const Bonobo_StorageInfoFields mask, CORBA_Environment *ev); void (*set_info) (BonoboStorage *storage, const CORBA_char *path, const Bonobo_StorageInfo * info, const Bonobo_StorageInfoFields mask, CORBA_Environment *ev); BonoboStream *(*open_stream) (BonoboStorage *storage, const CORBA_char *path, Bonobo_Storage_OpenMode, CORBA_Environment *ev); BonoboStorage *(*open_storage) (BonoboStorage *storage, const CORBA_char *path, Bonobo_Storage_OpenMode, CORBA_Environment *ev); void (*copy_to) (BonoboStorage *storage, Bonobo_Storage target, CORBA_Environment *ev); void (*rename) (BonoboStorage *storage, const CORBA_char *path_name, const CORBA_char *new_path_name, CORBA_Environment *ev); void (*commit) (BonoboStorage *storage, CORBA_Environment *ev); void (*revert) (BonoboStorage *storage, CORBA_Environment *ev); Bonobo_Storage_DirectoryList * (*list_contents) (BonoboStorage *storage, const CORBA_char *path, Bonobo_StorageInfoFields mask, CORBA_Environment *ev); void (*erase) (BonoboStorage *storage, const CORBA_char *path, CORBA_Environment *ev); } BonoboStorageClass;</PRE ></TD ></TR ></TABLE ><P ></P ></DIV ><HR><DIV CLASS="REFSECT2" ><A NAME="AEN6041" ></A ><H3 ><A NAME="BONOBO-STORAGE-OPEN" ></A >bonobo_storage_open ()</H3 ><TABLE BORDER="0" BGCOLOR="#D6E8FF" WIDTH="100%" CELLPADDING="6" ><TR ><TD ><PRE CLASS="PROGRAMLISTING" ><A HREF="bonobo-bonobo-storage.html#BONOBOSTORAGE" >BonoboStorage</A >* bonobo_storage_open (const char *driver, const char *path, <GTKDOCLINK HREF="GINT" >gint</GTKDOCLINK > flags, <GTKDOCLINK HREF="GINT" >gint</GTKDOCLINK > mode);</PRE ></TD ></TR ></TABLE ><P >Opens or creates the file named at <TT CLASS="PARAMETER" ><I >path</I ></TT > with the stream driver <TT CLASS="PARAMETER" ><I >driver</I ></TT >.</P ><P ><TT CLASS="PARAMETER" ><I >driver</I ></TT > is one of: "efs", "vfs" or "fs" for now, please use the macros for this though, see bonobo-stream.h eg. BONOBO_IO_DRIVER_FS</P ><P ></P ><P ></P ><TABLE CLASS="VARIABLELIST" BORDER="0" CELLSPACING="0" CELLPADDING="4" WIDTH="100%" BGCOLOR="#FFD0D0" ><TBODY ><TR ><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="20%" ><A NAME="AEN6055"><SPAN STYLE="white-space: nowrap" ><TT CLASS="PARAMETER" ><I >driver</I ></TT > :</SPAN ></TD ><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="80%" ><P > driver to use for opening.</P ></TD ></TR ><TR ><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="20%" ><A NAME="AEN6060"><SPAN STYLE="white-space: nowrap" ><TT CLASS="PARAMETER" ><I >path</I ></TT > :</SPAN ></TD ><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="80%" ><P > path where the base file resides</P ></TD ></TR ><TR ><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="20%" ><A NAME="AEN6065"><SPAN STYLE="white-space: nowrap" ><TT CLASS="PARAMETER" ><I >flags</I ></TT > :</SPAN ></TD ><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="80%" ><P > Bonobo Storage OpenMode</P ></TD ></TR ><TR ><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="20%" ><A NAME="AEN6070"><SPAN STYLE="white-space: nowrap" ><TT CLASS="PARAMETER" ><I >mode</I ></TT > :</SPAN ></TD ><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="80%" ><P > Unix open(2) mode</P ></TD ></TR ><TR ><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="20%" ><A NAME="AEN6075"><SPAN STYLE="white-space: nowrap" ><I CLASS="EMPHASIS" >Returns</I > :</SPAN ></TD ><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="80%" ><P > a created BonoboStorage object.</P ></TD ></TR ></TBODY ></TABLE ></DIV ><HR><DIV CLASS="REFSECT2" ><A NAME="AEN6080" ></A ><H3 ><A NAME="BONOBO-STORAGE-OPEN-FULL" ></A >bonobo_storage_open_full ()</H3 ><TABLE BORDER="0" BGCOLOR="#D6E8FF" WIDTH="100%" CELLPADDING="6" ><TR ><TD ><PRE CLASS="PROGRAMLISTING" ><A HREF="bonobo-bonobo-storage.html#BONOBOSTORAGE" >BonoboStorage</A >* bonobo_storage_open_full (const char *driver, const char *path, <GTKDOCLINK HREF="GINT" >gint</GTKDOCLINK > flags, <GTKDOCLINK HREF="GINT" >gint</GTKDOCLINK > mode, <GTKDOCLINK HREF="CORBA-ENVIRONMENT" >CORBA_Environment</GTKDOCLINK > *opt_ev);</PRE ></TD ></TR ></TABLE ><P ></P ><P ></P ><TABLE CLASS="VARIABLELIST" BORDER="0" CELLSPACING="0" CELLPADDING="4" WIDTH="100%" BGCOLOR="#FFD0D0" ><TBODY ><TR ><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="20%" ><A NAME="AEN6090"><SPAN STYLE="white-space: nowrap" ><TT CLASS="PARAMETER" ><I >driver</I ></TT > :</SPAN ></TD ><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="80%" ><P ></P ></TD ></TR ><TR ><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="20%" ><A NAME="AEN6095"><SPAN STYLE="white-space: nowrap" ><TT CLASS="PARAMETER" ><I >path</I ></TT > :</SPAN ></TD ><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="80%" ><P ></P ></TD ></TR ><TR ><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="20%" ><A NAME="AEN6100"><SPAN STYLE="white-space: nowrap" ><TT CLASS="PARAMETER" ><I >flags</I ></TT > :</SPAN ></TD ><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="80%" ><P ></P ></TD ></TR ><TR ><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="20%" ><A NAME="AEN6105"><SPAN STYLE="white-space: nowrap" ><TT CLASS="PARAMETER" ><I >mode</I ></TT > :</SPAN ></TD ><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="80%" ><P ></P ></TD ></TR ><TR ><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="20%" ><A NAME="AEN6110"><SPAN STYLE="white-space: nowrap" ><TT CLASS="PARAMETER" ><I >opt_ev</I ></TT > :</SPAN ></TD ><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="80%" ><P ></P ></TD ></TR ><TR ><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="20%" ><A NAME="AEN6115"><SPAN STYLE="white-space: nowrap" ><I CLASS="EMPHASIS" >Returns</I > :</SPAN ></TD ><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="80%" ><P > </P ></TD ></TR ></TBODY ></TABLE ></DIV ><HR><DIV CLASS="REFSECT2" ><A NAME="AEN6120" ></A ><H3 ><A NAME="BONOBO-STORAGE-COPY-TO" ></A >bonobo_storage_copy_to ()</H3 ><TABLE BORDER="0" BGCOLOR="#D6E8FF" WIDTH="100%" CELLPADDING="6" ><TR ><TD ><PRE CLASS="PROGRAMLISTING" >void bonobo_storage_copy_to (<A HREF="bonobo-storage.html" >Bonobo_Storage</A > src, <A HREF="bonobo-storage.html" >Bonobo_Storage</A > dest, <GTKDOCLINK HREF="CORBA-ENVIRONMENT" >CORBA_Environment</GTKDOCLINK > *ev);</PRE ></TD ></TR ></TABLE ><P >Implements a pure CORBA method for copying one storage into another, this is used by several BonoboStorage implemetations where a fast case localy copy cannot work.</P ><P ></P ><P ></P ><TABLE CLASS="VARIABLELIST" BORDER="0" CELLSPACING="0" CELLPADDING="4" WIDTH="100%" BGCOLOR="#FFD0D0" ><TBODY ><TR ><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="20%" ><A NAME="AEN6130"><SPAN STYLE="white-space: nowrap" ><TT CLASS="PARAMETER" ><I >src</I ></TT > :</SPAN ></TD ><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="80%" ><P > the source storage</P ></TD ></TR ><TR ><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="20%" ><A NAME="AEN6135"><SPAN STYLE="white-space: nowrap" ><TT CLASS="PARAMETER" ><I >dest</I ></TT > :</SPAN ></TD ><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="80%" ><P > the destination storage</P ></TD ></TR ><TR ><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="20%" ><A NAME="AEN6140"><SPAN STYLE="white-space: nowrap" ><TT CLASS="PARAMETER" ><I >ev</I ></TT > :</SPAN ></TD ><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="80%" ><P > CORBA exception environment</P ></TD ></TR ></TBODY ></TABLE ></DIV ><HR><DIV CLASS="REFSECT2" ><A NAME="AEN6145" ></A ><H3 ><A NAME="BONOBO-STORAGE-WRITE-CLASS-ID" ></A >bonobo_storage_write_class_id ()</H3 ><TABLE BORDER="0" BGCOLOR="#D6E8FF" WIDTH="100%" CELLPADDING="6" ><TR ><TD ><PRE CLASS="PROGRAMLISTING" >void bonobo_storage_write_class_id (<A HREF="bonobo-bonobo-storage.html#BONOBOSTORAGE" >BonoboStorage</A > *storage, char *class_id);</PRE ></TD ></TR ></TABLE ><P ></P ><P ></P ><TABLE CLASS="VARIABLELIST" BORDER="0" CELLSPACING="0" CELLPADDING="4" WIDTH="100%" BGCOLOR="#FFD0D0" ><TBODY ><TR ><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="20%" ><A NAME="AEN6152"><SPAN STYLE="white-space: nowrap" ><TT CLASS="PARAMETER" ><I >storage</I ></TT > :</SPAN ></TD ><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="80%" ><P ></P ></TD ></TR ><TR ><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="20%" ><A NAME="AEN6157"><SPAN STYLE="white-space: nowrap" ><TT CLASS="PARAMETER" ><I >class_id</I ></TT > :</SPAN ></TD ><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="80%" ><P > </P ></TD ></TR ></TBODY ></TABLE ></DIV ><HR><DIV CLASS="REFSECT2" ><A NAME="AEN6162" ></A ><H3 ><A NAME="BONOBO-STREAM-WRITE-CLASS-ID" ></A >bonobo_stream_write_class_id ()</H3 ><TABLE BORDER="0" BGCOLOR="#D6E8FF" WIDTH="100%" CELLPADDING="6" ><TR ><TD ><PRE CLASS="PROGRAMLISTING" >void bonobo_stream_write_class_id (<A HREF="bonobo-bonobo-stream.html#BONOBOSTREAM" >BonoboStream</A > *stream, char *class_id);</PRE ></TD ></TR ></TABLE ><P ></P ><P ></P ><TABLE CLASS="VARIABLELIST" BORDER="0" CELLSPACING="0" CELLPADDING="4" WIDTH="100%" BGCOLOR="#FFD0D0" ><TBODY ><TR ><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="20%" ><A NAME="AEN6169"><SPAN STYLE="white-space: nowrap" ><TT CLASS="PARAMETER" ><I >stream</I ></TT > :</SPAN ></TD ><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="80%" ><P ></P ></TD ></TR ><TR ><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="20%" ><A NAME="AEN6174"><SPAN STYLE="white-space: nowrap" ><TT CLASS="PARAMETER" ><I >class_id</I ></TT > :</SPAN ></TD ><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="80%" ><P > </P ></TD ></TR ></TBODY ></TABLE ></DIV ></DIV ><DIV CLASS="REFSECT1" ><A NAME="AEN6179" ></A ><H2 >See Also</H2 ><P ><A HREF="bonobo-bonobo-persist.html#BONOBOPERSIST" >BonoboPersist</A > <GTKDOCLINK HREF="BONOBOPERSISTSTREAM" >BonoboPersistStream</GTKDOCLINK ></P ></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="bonobo-storage.html" ><FONT COLOR="#FFFFFF" SIZE="3" ><B ><<< 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="bonobo-storage.html" ><FONT COLOR="#FFFFFF" SIZE="3" ><B >Up</B ></FONT ></A ></B ></FONT ></TD ><TD WIDTH="25%" BGCOLOR="#C00000" ALIGN="right" ><A HREF="bonobo-bonobo-stream.html" ><FONT COLOR="#FFFFFF" SIZE="3" ><B >Next Page >>></B ></FONT ></A ></TD ></TR ><TR ><TD COLSPAN="2" ALIGN="left" ><FONT COLOR="#FFFFFF" SIZE="3" ><B >Storage and Persistance</B ></FONT ></TD ><TD COLSPAN="2" ALIGN="right" ><FONT COLOR="#FFFFFF" SIZE="3" ><B >BonoboStream</B ></FONT ></TD ></TR ></TABLE ></DIV ></BODY ></HTML >