## bonobo-storage

bonobo-storage — Abstract implementation of the Bonobo::Storage interface

## Synopsis

    #define     BonoboStream
    #define     BONOBO_STREAM                   (o)
    #define     BONOBO_STREAM_CLASS             (k)
    #define     BonoboStorage
    #define     BONOBO_STORAGE                  (o)
    #define     BONOBO_STORAGE_CLASS            (k)
    void        bonobo_storage_copy_to          (Bonobo_Storage src,
                                                 Bonobo_Storage dest,
                                                 CORBA_Environment *ev);

## Description

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.

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:

Example 2. An example storage use case

    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));
    }

## Details

### BonoboStream

    #define BonoboStream BonoboObject

### BONOBO_STREAM()

    #define BONOBO_STREAM(o)       ((BonoboStream *)(o))

`o` : |

### BONOBO_STREAM_CLASS()

    #define BONOBO_STREAM_CLASS(k) ((BonoboObjectClass *)(k))

`k` : |

### BonoboStorage

    #define BonoboStorage BonoboObject

### BONOBO_STORAGE()

    #define BONOBO_STORAGE(o)          ((BonoboStorage *)(o))

`o` : |

### BONOBO_STORAGE_CLASS()

    #define BONOBO_STORAGE_CLASS(k)    ((BonoboObjectClass *)(k))

`k` : |

### bonobo_storage_copy_to ()

    void        bonobo_storage_copy_to          (Bonobo_Storage src,
                                                 Bonobo_Storage dest,
                                                 CORBA_Environment *ev);

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.

`src` : | the source storage
`dest` : | the destination storage
`ev` : | CORBA exception environment

## See Also

BonoboPersist BonoboPersistStream