[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apr-cvs
Subject:    cvs commit: apr-util/dbm apr_dbm.c
From:       trawick () apache ! org
Date:       2002-08-23 11:49:01
[Download RAW message or body]

trawick     2002/08/23 04:49:00

  Modified:    include  apr_dbm.h
               dbm      apr_dbm.c
  Log:
  change apr_dbm_get_usednames_ex() to return an error when
  the specified dbm type is not implemented/invalid
  
  Revision  Changes    Path
  1.18      +6 -5      apr-util/include/apr_dbm.h
  
  Index: apr_dbm.h
  ===================================================================
  RCS file: /home/cvs/apr-util/include/apr_dbm.h,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- apr_dbm.h	21 Aug 2002 21:42:41 -0000	1.17
  +++ apr_dbm.h	23 Aug 2002 11:49:00 -0000	1.18
  @@ -238,14 +238,15 @@
    * @param used1 The first pathname used by the apr_dbm implementation.
    * @param used2 The second pathname used by apr_dbm. If only one file is
    *              used by the specific implementation, this will be set to NULL.
  + * @return An error if the specified type is invalid.
    * @tip The dbm file(s) don't need to exist. This function only manipulates
    *      the pathnames.
    */
  -APU_DECLARE(void) apr_dbm_get_usednames_ex(apr_pool_t *pool,
  -                                        const char *type,
  -                                        const char *pathname,
  -                                        const char **used1,
  -                                        const char **used2);
  +APU_DECLARE(apr_status_t) apr_dbm_get_usednames_ex(apr_pool_t *pool,
  +                                                   const char *type,
  +                                                   const char *pathname,
  +                                                   const char **used1,
  +                                                   const char **used2);
   
   /**
    * If the specified file/path were passed to apr_dbm_open(), return the
  
  
  
  1.39      +12 -10    apr-util/dbm/apr_dbm.c
  
  Index: apr_dbm.c
  ===================================================================
  RCS file: /home/cvs/apr-util/dbm/apr_dbm.c,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- apr_dbm.c	21 Aug 2002 21:42:41 -0000	1.38
  +++ apr_dbm.c	23 Aug 2002 11:49:00 -0000	1.39
  @@ -181,41 +181,43 @@
       return errbuf;
   }
   
  -APU_DECLARE(void) apr_dbm_get_usednames_ex(apr_pool_t *p, 
  -                                           const char *type, 
  -                                           const char *pathname,
  -                                           const char **used1,
  -                                           const char **used2)
  +APU_DECLARE(apr_status_t) apr_dbm_get_usednames_ex(apr_pool_t *p, 
  +                                                   const char *type, 
  +                                                   const char *pathname,
  +                                                   const char **used1,
  +                                                   const char **used2)
   {
   #if APU_HAVE_GDBM
       if (!strcasecmp(type, "GDBM")) {
           (*apr_dbm_type_gdbm.getusednames)(p,pathname,used1,used2);
  -        return;
  +        return APR_SUCCESS;
       }
   #endif
   #if APU_HAVE_SDBM
       if (!strcasecmp(type, "SDBM")) {
           (*apr_dbm_type_sdbm.getusednames)(p,pathname,used1,used2);
  -        return;
  +        return APR_SUCCESS;
       }
   #endif
   #if APU_HAVE_DB
       if (!strcasecmp(type, "DB")) {
           (*apr_dbm_type_db.getusednames)(p,pathname,used1,used2);
  -        return;
  +        return APR_SUCCESS;
       }
   #endif
   #if APU_HAVE_NDBM
       if (!strcasecmp(type, "NDBM")) {
           (*apr_dbm_type_ndbm.getusednames)(p,pathname,used1,used2);
  -        return;
  +        return APR_SUCCESS;
       }
   #endif
   
       if (!strcasecmp(type, "default")) {
           (*DBM_VTABLE.getusednames)(p, pathname, used1, used2);
  -        return;
  +        return APR_SUCCESS;
       }
  +
  +    return APR_ENOTIMPL;
   } 
   
   APU_DECLARE(void) apr_dbm_get_usednames(apr_pool_t *p,
  
  
  
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic