2
0

flat_rpc.c 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * $Id$
  3. *
  4. * Copyright (C) 2004 FhG FOKUS
  5. * Copyright (C) 2008 iptelorg GmbH
  6. * Written by Jan Janak <[email protected]>
  7. *
  8. * This file is part of SER, a free SIP server.
  9. *
  10. * SER 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. * SER 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. /** \addtogroup flatstore
  25. * @{
  26. */
  27. /** \file
  28. * Flatstore management interface
  29. */
  30. #include "flat_rpc.h"
  31. #include "flatstore_mod.h"
  32. #include "km_flatstore_mod.h"
  33. #include <time.h>
  34. /** Register a new file rotation request.
  35. * This function can be called through the management interface in SER and it
  36. * will register a new file rotation request. This function only registers the
  37. * request, it will be carried out next time SER attempts to write new data
  38. * into the file.
  39. */
  40. static void rotate(rpc_t* rpc, void* c)
  41. {
  42. *km_flat_rotate = time(0);
  43. *flat_rotate = time(0);
  44. }
  45. static const char* flat_rotate_doc[2] = {
  46. "Close and reopen flatrotate files during log rotation.",
  47. 0
  48. };
  49. rpc_export_t flat_rpc[] = {
  50. {"flatstore.rotate", rotate, flat_rotate_doc, 0},
  51. {0, 0, 0, 0},
  52. };
  53. /** @} */