response_headers_handler.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /** **************************************************************************
  2. * response_headers_handler.h
  3. *
  4. * Copyright 2008 Bryan Ischo <[email protected]>
  5. *
  6. * This file is part of libs3.
  7. *
  8. * libs3 is free software: you can redistribute it and/or modify it under the
  9. * terms of the GNU Lesser General Public License as published by the Free
  10. * Software Foundation, version 3 of the License.
  11. *
  12. * In addition, as a special exception, the copyright holders give
  13. * permission to link the code of this library and its programs with the
  14. * OpenSSL library, and distribute linked combinations including the two.
  15. *
  16. * libs3 is distributed in the hope that it will be useful, but WITHOUT ANY
  17. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  18. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  19. * details.
  20. *
  21. * You should have received a copy of the GNU Lesser General Public License
  22. * version 3 along with libs3, in a file named COPYING. If not, see
  23. * <http://www.gnu.org/licenses/>.
  24. *
  25. ************************************************************************** **/
  26. #ifndef RESPONSE_HEADERS_HANDLER_H
  27. #define RESPONSE_HEADERS_HANDLER_H
  28. #include "libs3.h"
  29. #include "string_buffer.h"
  30. #include "util.h"
  31. #ifdef WINSCP
  32. #include "ne_request.h"
  33. #endif
  34. typedef struct ResponseHeadersHandler
  35. {
  36. // The structure to pass to the headers callback. This is filled in by
  37. // the ResponseHeadersHandler from the headers added to it.
  38. S3ResponseProperties responseProperties;
  39. // Set to 1 after the done call has been made
  40. int done;
  41. // copied into here. We allow 128 bytes for each header, plus \0 term.
  42. string_multibuffer(responsePropertyStrings, 5 * 129);
  43. // responseproperties.metaHeaders strings get copied into here
  44. string_multibuffer(responseMetaDataStrings,
  45. COMPACTED_METADATA_BUFFER_SIZE);
  46. // Response meta data
  47. S3NameValue responseMetaData[S3_MAX_METADATA_COUNT];
  48. } ResponseHeadersHandler;
  49. void response_headers_handler_initialize(ResponseHeadersHandler *handler);
  50. void response_headers_handler_add(ResponseHeadersHandler *handler,
  51. const char * header_name, const char * header_value); // WINSCP (neon API)
  52. void response_headers_handler_done(ResponseHeadersHandler *handler,
  53. ne_request *NeonRequest); // WINSCP (neon API)
  54. #ifdef WINSCP
  55. typedef int NeonCode;
  56. #endif
  57. #endif /* RESPONSE_HEADERS_HANDLER_H */