2
0

chkstrings.c 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /***************************************************************************
  2. * _ _ ____ _
  3. * Project ___| | | | _ \| |
  4. * / __| | | | |_) | |
  5. * | (__| |_| | _ <| |___
  6. * \___|\___/|_| \_\_____|
  7. *
  8. * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  9. *
  10. * This software is licensed as described in the file COPYING, which
  11. * you should have received as part of this distribution. The terms
  12. * are also available at https://curl.se/docs/copyright.html.
  13. *
  14. * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. * copies of the Software, and permit persons to whom the Software is
  16. * furnished to do so, under the terms of the COPYING file.
  17. *
  18. * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. * KIND, either express or implied.
  20. *
  21. * SPDX-License-Identifier: curl
  22. *
  23. ***************************************************************************/
  24. #include <stdlib.h>
  25. #pragma enum(int)
  26. #include "curl_setup.h"
  27. #include "urldata.h"
  28. /* The following defines indicate the expected dupstring enum values in
  29. * curl_easy_setopt_ccsid() in packages/OS400/ccsidcurl.c. If a mismatch is
  30. * flagged during the build, it indicates that curl_easy_setopt_ccsid() may
  31. * need updating to perform data EBCDIC to ASCII data conversion on the
  32. * string.
  33. *
  34. * Once any applicable changes to curl_easy_setopt_ccsid() have been
  35. * made, the EXPECTED_STRING_LASTZEROTERMINATED/EXPECTED_STRING_LAST
  36. * values can be updated to match the latest enum values in urldata.h.
  37. */
  38. #define EXPECTED_STRING_LASTZEROTERMINATED (STRING_HAPROXY_CLIENT_IP + 1)
  39. #define EXPECTED_STRING_LAST (STRING_COPYPOSTFIELDS + 1)
  40. int main(int argc, char *argv[])
  41. {
  42. int rc = 0;
  43. if(STRING_LASTZEROTERMINATED != EXPECTED_STRING_LASTZEROTERMINATED) {
  44. fprintf(stderr,
  45. "STRING_LASTZEROTERMINATED(%d) is not expected value(%d).\n",
  46. STRING_LASTZEROTERMINATED, EXPECTED_STRING_LASTZEROTERMINATED);
  47. rc += 1;
  48. }
  49. if(STRING_LAST != EXPECTED_STRING_LAST) {
  50. fprintf(stderr, "STRING_LAST(%d) is not expected value(%d).\n",
  51. STRING_LAST, EXPECTED_STRING_LAST);
  52. rc += 2;
  53. }
  54. if(rc) {
  55. fprintf(stderr, "curl_easy_setopt_ccsid() in packages/OS400/ccsidcurl.c"
  56. " may need updating if new strings are provided as"
  57. " input via the curl API.\n");
  58. }
  59. return rc;
  60. }