chkstrings.c 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /***************************************************************************
  2. * _ _ ____ _
  3. * Project ___| | | | _ \| |
  4. * / __| | | | |_) | |
  5. * | (__| |_| | _ <| |___
  6. * \___|\___/|_| \_\_____|
  7. *
  8. * Copyright (C) 1998 - 2020, 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.haxx.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. ***************************************************************************/
  22. #include <stdlib.h>
  23. #pragma enum(int)
  24. #include "curl_setup.h"
  25. #include "urldata.h"
  26. /* The following defines indicate the expected dupstring enum values
  27. * in curl_easy_setopt_ccsid() in packages/OS400/ccsidcurl.c. If a
  28. * mismatch is flagged during the build, it indicates that curl_easy_setopt_ccsid()
  29. * may need updating to perform data EBCDIC to ASCII data conversion on
  30. * the string.
  31. * Once any applicable changes to curl_easy_setopt_ccsid() have been
  32. * made, the EXPECTED_STRING_LASTZEROTERMINATED/EXPECTED_STRING_LAST
  33. * values can be updated to match the latest enum values in urldata.h.
  34. */
  35. #define EXPECTED_STRING_LASTZEROTERMINATED (STRING_DNS_LOCAL_IP6 + 1)
  36. #define EXPECTED_STRING_LAST (STRING_COPYPOSTFIELDS + 1)
  37. int main(int argc, char *argv[])
  38. {
  39. int rc = 0;
  40. if (STRING_LASTZEROTERMINATED != EXPECTED_STRING_LASTZEROTERMINATED)
  41. {
  42. fprintf(stderr,"STRING_LASTZEROTERMINATED(%d) is not expected value(%d).\n",
  43. STRING_LASTZEROTERMINATED, EXPECTED_STRING_LASTZEROTERMINATED);
  44. rc += 1;
  45. }
  46. if (STRING_LAST != EXPECTED_STRING_LAST)
  47. {
  48. fprintf(stderr,"STRING_LAST(%d) is not expected value(%d).\n",
  49. STRING_LAST, EXPECTED_STRING_LAST);
  50. rc += 2;
  51. }
  52. if (rc != 0)
  53. {
  54. fprintf(stderr,"curl_easy_setopt_ccsid() in packages/OS400/ccsidcurl.c"
  55. " may need updating if new strings are provided as input via the curl API.\n");
  56. }
  57. return rc;
  58. }