/*
This file is part of BOP.
Copyright (C) 2004 Patrick Davalan
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
The GNU General Public License text is also available at
http://www.gnu.org/
or on the Copyright holder web site :
http://patrick.davalan.free.fr/gnu-gpl.html
*/
// change the include to #include <bop.2/bop.h>
#include "bop.h"
#define DEBUG 0
int
main( )
{
BopcHandle * container ;
BopcHandle * newCont ;
BoplHandle * lHandle ;
BophHandle * hash ;
BopsHandle * stack ;
BoplEntry * list ;
bopmTrace( ) ;
container = bopcNew( NULL, "higher" ) ;
// create some objects
lHandle = boplNew( container, "list-object 1" ) ;
hash = bophNew( container, "hash 1", 0 , NULL, NULL ) ;
hash = bophNew( container, "hash 2", 900 , NULL, NULL ) ;
stack = bopsNew( container, "stack 1", 0, 0 ) ;
bopsXSet( stack ) ;
list = boplNewList( lHandle ) ;
list = boplNewList( lHandle ) ;
list = boplNewList( lHandle ) ;
hash = bophNew( container, "hash 3", 900 , NULL, NULL ) ;
lHandle = boplNew( container, "list-object 2" ) ;
hash = bophNew( container, " hash 4", 1000 , NULL, NULL ) ;
// a new container in container with some objects
newCont = bopcNew( container, "cont 1" ) ;
stack = bopsNew( newCont, "stack 1.1", 2048, 1024 ) ;
lHandle = boplNew( newCont, "list-object 1.1" ) ;
stack = bopsNew( newCont, "stack 1.2", 0, 0 ) ;
lHandle = boplNew( newCont, "list-object 1.2" ) ;
list = boplNewList( lHandle ) ;
list = boplNewList( lHandle ) ;
// some other objects in top level container
lHandle = boplNew( container, "list-object 3" ) ;
stack = bopsNew( container, "stack 2", 666, 666 ) ;
bopsXSet( stack ) ;
list = boplNewList( lHandle ) ;
list = boplNewList( lHandle ) ;
hash = bophNew( container, "hash 5", 0 , NULL, NULL ) ;
// list all this
bopcList( stderr, container ) ;
// close trace file before freeing memory,
// the only way to have bop memory leaks
bopmUntrace( ) ;
// free the container, whatever is in !
bopcDelete( NULL, container ) ;
bopmMem( ) ;
exit( EXIT_SUCCESS ) ;
}