formdata.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #ifndef HEADER_CURL_FORMDATA_H
  2. #define HEADER_CURL_FORMDATA_H
  3. /***************************************************************************
  4. * _ _ ____ _
  5. * Project ___| | | | _ \| |
  6. * / __| | | | |_) | |
  7. * | (__| |_| | _ <| |___
  8. * \___|\___/|_| \_\_____|
  9. *
  10. * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  11. *
  12. * This software is licensed as described in the file COPYING, which
  13. * you should have received as part of this distribution. The terms
  14. * are also available at https://curl.se/docs/copyright.html.
  15. *
  16. * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  17. * copies of the Software, and permit persons to whom the Software is
  18. * furnished to do so, under the terms of the COPYING file.
  19. *
  20. * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  21. * KIND, either express or implied.
  22. *
  23. * SPDX-License-Identifier: curl
  24. *
  25. ***************************************************************************/
  26. #include "curl_setup.h"
  27. #ifndef CURL_DISABLE_FORM_API
  28. /* used by FormAdd for temporary storage */
  29. struct FormInfo {
  30. char *name;
  31. size_t namelength;
  32. char *value;
  33. curl_off_t contentslength;
  34. char *contenttype;
  35. long flags;
  36. char *buffer; /* pointer to existing buffer used for file upload */
  37. size_t bufferlength;
  38. char *showfilename; /* The filename to show. If not set, the actual
  39. filename will be used */
  40. char *userp; /* pointer for the read callback */
  41. struct curl_slist *contentheader;
  42. struct FormInfo *more;
  43. bool name_alloc;
  44. bool value_alloc;
  45. bool contenttype_alloc;
  46. bool showfilename_alloc;
  47. };
  48. CURLcode Curl_getformdata(CURL *data,
  49. curl_mimepart *,
  50. struct curl_httppost *post,
  51. curl_read_callback fread_func);
  52. #endif /* CURL_DISABLE_FORM_API */
  53. #endif /* HEADER_CURL_FORMDATA_H */