list.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * $Id$
  3. *
  4. * UNIXODBC module
  5. *
  6. * Copyright (C) 2005-2006 Marco Lorrai
  7. * Copyright (C) 2008 1&1 Internet AG
  8. *
  9. * This file is part of Kamailio, a free SIP server.
  10. *
  11. * Kamailio is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License as published by
  13. * the Free Software Foundation; either version 2 of the License, or
  14. * (at your option) any later version
  15. *
  16. * Kamailio is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  24. *
  25. *
  26. * History:
  27. * --------
  28. * 2005-12-01 initial commit (chgen)
  29. * 2006-04-04 simplified link list (sgupta)
  30. * 2006-05-05 removed static allocation of 1k per column data (sgupta)
  31. */
  32. #ifndef _UNIXODBC_LIST_H_
  33. #define _UNIXODBC_LIST_H_
  34. #include <stdio.h>
  35. #include <stdlib.h>
  36. #include "connection.h"
  37. typedef struct list
  38. {
  39. struct list* next;
  40. char** data;
  41. unsigned long* lengths;
  42. int rownum;
  43. } list;
  44. /*!
  45. * \brief Create a list
  46. * \param start start of the list
  47. * \param link inserted element
  48. * \param n number of values
  49. * \param value inserted value
  50. * \return 0 on success, -1 on failure
  51. */
  52. int db_unixodbc_list_insert(list** start, list** link, int n, strn* value);
  53. /*!
  54. * \brief Destroy a list
  55. * \param link list element(s)
  56. */
  57. void db_unixodbc_list_destroy(list* link);
  58. #endif