chkstrings.c 2.4 KB

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