Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

stat_api.h 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* Copyright (c) 2015, Vsevolod Stakhov
  2. * All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions are met:
  6. * * Redistributions of source code must retain the above copyright
  7. * notice, this list of conditions and the following disclaimer.
  8. * * Redistributions in binary form must reproduce the above copyright
  9. * notice, this list of conditions and the following disclaimer in the
  10. * documentation and/or other materials provided with the distribution.
  11. *
  12. * THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY
  13. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  15. * DISCLAIMED. IN NO EVENT SHALL AUTHOR BE LIABLE FOR ANY
  16. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  17. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  18. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  20. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  21. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  22. */
  23. #ifndef STAT_API_H_
  24. #define STAT_API_H_
  25. #include "config.h"
  26. #include "task.h"
  27. /**
  28. * @file stat_api.h
  29. * High level statistics API
  30. */
  31. /**
  32. * Initialise statistics modules
  33. * @param cfg
  34. */
  35. void rspamd_stat_init (struct rspamd_config *cfg);
  36. /**
  37. * Classify the task specified and insert symbols if needed
  38. * @param task
  39. * @return TRUE if task has been classified
  40. */
  41. gboolean rspamd_stat_classify (struct rspamd_task *task, GError **err);
  42. /**
  43. * Learn task as spam or ham, task must be processed prior to this call
  44. * @param task task to learn
  45. * @param spam if TRUE learn spam, otherwise learn ham
  46. * @return TRUE if task has been learned
  47. */
  48. gboolean rspamd_stat_learn (struct rspamd_task *task, gboolean spam, GError **err);
  49. void rspamd_stat_unload (void);
  50. #endif /* STAT_API_H_ */