IRC client framework (wrapper around libircclient library).
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

dcc.h 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright (C) 2004-2012 George Yunaev gyunaev@ulduzsoft.com
  3. *
  4. * This library is free software; you can redistribute it and/or modify it
  5. * under the terms of the GNU Lesser General Public License as published by
  6. * the Free Software Foundation; either version 3 of the License, or (at your
  7. * option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
  12. * License for more details.
  13. */
  14. #ifndef INCLUDE_IRC_DCC_H
  15. #define INCLUDE_IRC_DCC_H
  16. /*
  17. * This structure keeps the state of a single DCC connection.
  18. */
  19. struct irc_dcc_session_s {
  20. irc_dcc_session_t * next;
  21. irc_dcc_t id;
  22. void * ctx;
  23. socket_t sock; /*!< DCC socket */
  24. int dccmode; /*!< Boolean value to differ chat vs send
  25. requests. Changes the cb behavior - when
  26. it is chat, data is sent by lines with
  27. stripped CRLFs. In file mode, the data
  28. is sent as-is */
  29. int state;
  30. time_t timeout;
  31. FILE * dccsend_file_fp;
  32. size_t received_file_size;
  33. size_t file_confirm_offset;
  34. struct sockaddr_in remote_addr;
  35. char incoming_buf[LIBIRC_DCC_BUFFER_SIZE];
  36. size_t incoming_offset;
  37. char outgoing_buf[LIBIRC_DCC_BUFFER_SIZE];
  38. size_t outgoing_offset;
  39. port_mutex_t mutex_outbuf;
  40. irc_dcc_callback_t cb;
  41. };
  42. #endif /* INCLUDE_IRC_DCC_H */