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 
23 #include <stdlib.h>
24 #pragma enum(int)
25 #include "curl_setup.h"
26 #include "urldata.h"
27 
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_SSL_EC_CURVES + 1)
39 #define EXPECTED_STRING_LAST                (STRING_AWS_SIGV4 + 1)
40 
main(int argc,char * argv[])41 int main(int argc, char *argv[])
42 {
43   int rc = 0;
44 
45   if(STRING_LASTZEROTERMINATED != EXPECTED_STRING_LASTZEROTERMINATED) {
46     fprintf(stderr,
47             "STRING_LASTZEROTERMINATED(%d) is not expected value(%d).\n",
48             STRING_LASTZEROTERMINATED, EXPECTED_STRING_LASTZEROTERMINATED);
49     rc += 1;
50   }
51   if(STRING_LAST != EXPECTED_STRING_LAST) {
52     fprintf(stderr, "STRING_LAST(%d) is not expected value(%d).\n",
53             STRING_LAST, EXPECTED_STRING_LAST);
54     rc += 2;
55   }
56   if(rc) {
57     fprintf(stderr, "curl_easy_setopt_ccsid() in packages/OS400/ccsidcurl.c"
58             " may need updating if new strings are provided as"
59             " input via the curl API.\n");
60   }
61   return rc;
62 }
63