IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 14, 2006, 3:34:42 PM (20 years ago)
Author:
jhoblitt
Message:

rename psDBInit() -> psDBAlloc() and set psDBFree() as the deallocator func
rename psDBCleanup() -> psDBFree() and make it private
add a macro/wrapper named psDBInit() around psDBAlloc()
add a macro/wrapper named psDBCleanup() around psFree()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/db/psDB.h

    r9544 r9990  
    1010 *  @author Joshua Hoblitt
    1111 *
    12  *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2006-10-13 22:26:14 $
     12 *  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2006-11-15 01:34:42 $
    1414 *
    1515 *  Copyright 2005 Joshua Hoblitt, University of Hawaii
     
    4040/** Opens a new database connection
    4141 *
    42  *  @return psDB*:      A new psDB object if the database connection is successful or NULL on
    43  *  failure.
    44  */
     42 *  @return psDB*:      A new psDB object if the database connection is
     43 *  successful or NULL on failure.
     44 */
     45psDB *psDBAlloc(
     46    const char *host,                  ///< Database server hostname
     47    const char *user,                  ///< Database username
     48    const char *passwd,                ///< Database password
     49    const char *dbname,                ///< Database namespace
     50    unsigned int port                  ///< Database port number
     51);
     52
     53/** Opens a new database connection
     54 *
     55 *  This function is deprecated favor of psDBAlloc()
     56 *
     57 *  @return psDB*:      A new psDB object if the database connection is
     58 *  successful or NULL on failure.
     59 */
     60#ifdef DOXYGEN
    4561psDB *psDBInit(
    4662    const char *host,                  ///< Database server hostname
     
    5066    unsigned int port                  ///< Database port number
    5167);
    52 
    53 /** Closes a database connection  */
     68#else // DOXYGEN
     69#define psDBInit(host, user, passwd, dbname, port) \
     70psDBAlloc(host, user, passwd, dbname, port)
     71#endif
     72
     73#ifdef DOXYGEN
     74/** Closes a database connection
     75 *
     76 *  This function is deprecated favor of psFree()
     77 */
    5478void psDBCleanup(
    5579    psDB *dbh                          ///< Database handle
    5680);
     81#else // DOXYGEN
     82#define psDBCleanup(dbh) \
     83psFree(dbh)
     84#endif
    5785
    5886/** Creates a new database namespace
Note: See TracChangeset for help on using the changeset viewer.