TclBerkeleyDB.cpp

Go to the documentation of this file.
00001 /* ****************************************************************** **
00002 **    OpenSees - Open System for Earthquake Engineering Simulation    **
00003 **          Pacific Earthquake Engineering Research Center            **
00004 **                                                                    **
00005 **                                                                    **
00006 ** (C) Copyright 1999, The Regents of the University of California    **
00007 ** All Rights Reserved.                                               **
00008 **                                                                    **
00009 ** Commercial use of this program without express permission of the   **
00010 ** University of California, Berkeley, is strictly prohibited.  See   **
00011 ** file 'COPYRIGHT'  in main directory for information on usage and   **
00012 ** redistribution,  and for a DISCLAIMER OF ALL WARRANTIES.           **
00013 **                                                                    **
00014 ** Developed by:                                                      **
00015 **   Frank McKenna (fmckenna@ce.berkeley.edu)                         **
00016 **   Gregory L. Fenves (fenves@ce.berkeley.edu)                       **
00017 **   Filip C. Filippou (filippou@ce.berkeley.edu)                     **
00018 **                                                                    **
00019 ** ****************************************************************** */
00020                                                                         
00021 // $Revision: 1.1 $
00022 // $Date: 2005/07/25 18:06:09 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/database/TclBerkeleyDB.cpp,v $
00024                                                                         
00025 // Written: fmk
00026 
00027 // Description: This file contains the function invoked when the user invokes
00028 // the MySQL command in the interpreter. 
00029 //
00030 // What: "@(#) TclCommand_MySQL.C, revA"
00031 
00032 #include <OPS_Globals.h>
00033 #include <stdlib.h>
00034 #include <string.h>
00035 #include <tcl.h>
00036 
00037 #include <BerkeleyDbDatastore.h>
00038 
00039 #ifdef _USRDLL
00040 #define DllExport _declspec(dllexport)
00041 #else
00042 #define DllExport
00043 #endif
00044 
00045 extern "C" DllExport int
00046 TclCommand_BerkeleyDB(ClientData clientData, 
00047                       Tcl_Interp *interp,  
00048                       int argc, 
00049                       TCL_Char **argv, 
00050                       Domain *theDomain, 
00051                       FEM_ObjectBroker *theBroker,
00052                       FE_Datastore **theDatabase)
00053 {
00054   
00055   // delete the old database
00056   if (*theDatabase != 0)
00057     delete (*theDatabase);
00058   
00059   (*theDatabase) = new BerkeleyDbDatastore(argv[2], *theDomain, *theBroker);
00060 
00061   if (*theDatabase == 0) {
00062     opserr << "WARNING database MySql dabaseName? - out of memory\n";
00063     return TCL_ERROR;
00064   }
00065   
00066   return TCL_OK;
00067 }
00068 

Generated on Mon Oct 23 15:05:00 2006 for OpenSees by doxygen 1.5.0