prepare.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright (C) 2005 RingCentral Inc.
  3. * Created by Dmitry Semyonov <[email protected]>
  4. *
  5. *
  6. * This file is part of ser, a free SIP server.
  7. *
  8. * ser is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version
  12. *
  13. * For a license to use the ser software under conditions
  14. * other than those described here, or to purchase support for this
  15. * software, please contact iptel.org by e-mail at the following addresses:
  16. * [email protected]
  17. *
  18. * ser is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. * GNU General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU General Public License
  24. * along with this program; if not, write to the Free Software
  25. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  26. */
  27. #ifndef _PREPARE_H
  28. #define _PREPARE_H
  29. #include "../../db/db_key.h"
  30. #include "../../db/db_val.h"
  31. #include "../../db/db_op.h"
  32. void prepare_where(db_key_t* _k, db_op_t* _op, db_val_t* _v, int _n);
  33. /*
  34. * prepare_select(), prepare_insert(), prepare_delete(), and prepare_update()
  35. * functions automatically begin new statement. Other functions continue
  36. * to build current statement.
  37. */
  38. void prepare_select(db_key_t* _c, int _nc);
  39. void prepare_from(const char* _t);
  40. void prepare_order_by(db_key_t _o);
  41. void prepare_insert(const char* _t);
  42. void prepare_insert_columns(db_key_t* _k, int _n);
  43. void prepare_insert_values(db_val_t* _v, int _n);
  44. void prepare_delete(const char* _t);
  45. void prepare_update(const char* _t);
  46. void prepare_update_set(db_key_t* _k, db_val_t* _v, int _n);
  47. const char *prepared_sql(void);
  48. size_t prepared_sql_len(void);
  49. #endif /* _PREPARE_H */