db_uri.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * $Id$
  3. *
  4. * Copyright (C) 2001-2005 FhG FOKUS
  5. * Copyright (C) 2006-2007 iptelorg GmbH
  6. *
  7. * This file is part of ser, a free SIP server.
  8. *
  9. * ser is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version
  13. *
  14. * For a license to use the ser software under conditions
  15. * other than those described here, or to purchase support for this
  16. * software, please contact iptel.org by e-mail at the following addresses:
  17. * [email protected]
  18. *
  19. * ser is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public License
  25. * along with this program; if not, write to the Free Software
  26. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  27. */
  28. #ifndef _DB_URI_H
  29. #define _DB_URI_H 1
  30. /** \ingroup DB_API
  31. * @{
  32. */
  33. #include "db_gen.h"
  34. #include "../../str.h"
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif /* __cplusplus */
  38. struct db_uri;
  39. typedef unsigned char (db_uri_cmp_t)(struct db_uri* uri1, struct db_uri* uri2);
  40. typedef struct db_uri {
  41. db_gen_t gen; /* Generic part of the structure */
  42. str scheme; /* URI scheme */
  43. str body; /* Entire URI body */
  44. db_uri_cmp_t* cmp; /* Comparison function */
  45. } db_uri_t;
  46. /*
  47. * Create a database URI structure
  48. */
  49. struct db_uri* db_uri(const char* uri);
  50. void db_uri_free(struct db_uri* uri);
  51. unsigned char db_uri_cmp(struct db_uri* uri1, struct db_uri* uri2);
  52. db_uri_cmp_t db_uri_cmp;
  53. #ifdef __cplusplus
  54. }
  55. #endif /* __cplusplus */
  56. /** @} */
  57. #endif /* _DB_URI_H */