pv_svar.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * $Id$
  3. *
  4. * Copyright (C) 2006 voice-system.ro
  5. *
  6. * This file is part of Kamailio, a free SIP server.
  7. *
  8. * Kamailio 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. * Kamailio is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. *
  22. */
  23. /*!
  24. * \file
  25. * \brief Script variables
  26. */
  27. #ifndef _PV_SVAR_H_
  28. #define _PV_SVAR_H_
  29. #include "../../usr_avp.h"
  30. #define VAR_VAL_STR (1<<0)
  31. typedef struct script_val {
  32. int flags;
  33. int_str value;
  34. } script_val_t, *script_val_p;
  35. typedef struct script_var {
  36. str name;
  37. script_val_t v;
  38. struct script_var *next;
  39. } script_var_t, *script_var_p;
  40. script_var_t* add_var(str *name);
  41. script_var_t* set_var_value(script_var_t *var, int_str *value, int flags);
  42. script_var_t* get_var_by_name(str *name);
  43. void reset_vars(void);
  44. void destroy_vars(void);
  45. void destroy_vars_list(script_var_t *svl);
  46. #endif