Changeset 9990 for trunk/psLib/src/db/psDB.c
- Timestamp:
- Nov 14, 2006, 3:34:42 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/db/psDB.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/db/psDB.c
r9985 r9990 12 12 * @author Joshua Hoblitt 13 13 * 14 * @version $Revision: 1.11 0$ $Name: not supported by cvs2svn $15 * @date $Date: 2006-11-15 0 0:54:22 $14 * @version $Revision: 1.111 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2006-11-15 01:34:42 $ 16 16 * 17 17 * Copyright (C) 2005-2006 Joshua Hoblitt, University of Hawaii … … 68 68 static psHash *mysqlToSqlLookupTable = NULL; 69 69 static psHash *pTypeToMysqlLookupTable = NULL; 70 71 // free func 72 static void psDBFree(psDB *dbh); 70 73 71 74 // database utility functions … … 120 123 /*****************************************************************************/ 121 124 122 psDB *psDB Init(const char *host,123 const char *user,124 const char *passwd,125 const char *dbname,126 unsigned int port)125 psDB *psDBAlloc(const char *host, 126 const char *user, 127 const char *passwd, 128 const char *dbname, 129 unsigned int port) 127 130 { 128 131 MYSQL *mysql; … … 180 183 } 181 184 185 // don't set the deallocator func until after we've setup the lookup tables 186 // so an alloc error doesn't try to free potentionally uncreated tables 187 psMemSetDeallocator(dbh, (psFreeFunc) psDBFree); 188 182 189 psTrace("psLib.db", PS_LOG_INFO, "connected to database %s", dbname); 183 190 … … 185 192 } 186 193 187 void psDBCleanup(psDB *dbh)194 static void psDBFree(psDB *dbh) 188 195 { 189 196 // quietly handle NULLs … … 194 201 // Attempt to close specified database connection 195 202 mysql_close(dbh->mysql); 196 psFree(dbh);197 203 198 204 // ASC WARNING NOTE: the psDBSQLToPTypeTableCleanup cleanup routine
Note:
See TracChangeset
for help on using the changeset viewer.
