bdb_uri.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * $Id$
  3. *
  4. * BDB Database Driver for SIP-router
  5. *
  6. * Copyright (C) 2008 iptelorg GmbH
  7. *
  8. * This file is part of SIP-router, a free SIP server.
  9. *
  10. * SIP-router is free software; you can redistribute it and/or modify it under the
  11. * terms of the GNU General Public License as published by the Free Software
  12. * Foundation; either version 2 of the License, or (at your option) any later
  13. * version.
  14. *
  15. * SIP-router is distributed in the hope that it will be useful, but WITHOUT ANY
  16. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  17. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  18. * details.
  19. *
  20. * You should have received a copy of the GNU General Public License along
  21. * with this program; if not, write to the Free Software Foundation, Inc.,
  22. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  23. */
  24. #ifndef _BDB_URI_H_
  25. #define _BDB_URI_H_
  26. /** \addtogroup bdb
  27. * @{
  28. */
  29. /*! \file
  30. * Berkeley DB : The functions parsing and interpreting bdb: URIs.
  31. *
  32. * \ingroup database
  33. */
  34. #include "../../lib/srdb2/db_uri.h"
  35. #include "../../lib/srdb2/db_drv.h"
  36. #include <db.h>
  37. /*! BDB driver specific payload to attach to db_uri structures.
  38. * This is the BDB specific structure that will be attached
  39. * to generic db_uri structures in the database API in SER. The
  40. * structure contains parsed elements of the ldap: URI.
  41. */
  42. typedef struct bdb_uri {
  43. db_drv_t drv;
  44. char* uri; /**< The whole URI, including scheme */
  45. str path;
  46. } bdb_uri_t, *bdb_uri_p;
  47. /*! Create a new bdb_uri structure and parse the URI in parameter.
  48. * This function builds a new bdb_uri structure from the body of
  49. * the generic URI given to it in parameter.
  50. * @param uri A generic db_uri structure.
  51. * @retval 0 on success
  52. * @retval A negative number on error.
  53. */
  54. int bdb_uri(db_uri_t* uri);
  55. /** @} */
  56. #endif /* _BDB_URI_H_ */