undef more TCP_ symbols
[ocurl.git] / errors.ml
bloba39e4ebacdcdce795d856f2b0e2d5b3c614d805e
1 let all = [
2 "CURLE_OK";
3 "CURLE_UNSUPPORTED_PROTOCOL";
4 "CURLE_FAILED_INIT";
5 "CURLE_URL_MALFORMAT";
6 "CURLE_URL_MALFORMAT_USER";
7 "CURLE_COULDNT_RESOLVE_PROXY";
8 "CURLE_COULDNT_RESOLVE_HOST";
9 "CURLE_COULDNT_CONNECT";
10 "CURLE_FTP_WEIRD_SERVER_REPLY";
11 "CURLE_FTP_ACCESS_DENIED";
12 "CURLE_FTP_USER_PASSWORD_INCORRECT";
13 "CURLE_FTP_WEIRD_PASS_REPLY";
14 "CURLE_FTP_WEIRD_USER_REPLY";
15 "CURLE_FTP_WEIRD_PASV_REPLY";
16 "CURLE_FTP_WEIRD_227_FORMAT";
17 "CURLE_FTP_CANT_GET_HOST";
18 "CURLE_FTP_CANT_RECONNECT";
19 "CURLE_FTP_COULDNT_SET_BINARY";
20 "CURLE_PARTIAL_FILE";
21 "CURLE_FTP_COULDNT_RETR_FILE";
22 "CURLE_FTP_WRITE_ERROR";
23 "CURLE_FTP_QUOTE_ERROR";
24 "CURLE_HTTP_RETURNED_ERROR";
25 "CURLE_WRITE_ERROR";
26 "CURLE_MALFORMAT_USER";
27 "CURLE_FTP_COULDNT_STOR_FILE";
28 "CURLE_READ_ERROR";
29 "CURLE_OUT_OF_MEMORY";
30 "CURLE_OPERATION_TIMEOUTED";
31 "CURLE_FTP_COULDNT_SET_ASCII";
32 "CURLE_FTP_PORT_FAILED";
33 "CURLE_FTP_COULDNT_USE_REST";
34 "CURLE_FTP_COULDNT_GET_SIZE";
35 "CURLE_HTTP_RANGE_ERROR";
36 "CURLE_HTTP_POST_ERROR";
37 "CURLE_SSL_CONNECT_ERROR";
38 "CURLE_BAD_DOWNLOAD_RESUME";
39 "CURLE_FILE_COULDNT_READ_FILE";
40 "CURLE_LDAP_CANNOT_BIND";
41 "CURLE_LDAP_SEARCH_FAILED";
42 "CURLE_LIBRARY_NOT_FOUND";
43 "CURLE_FUNCTION_NOT_FOUND";
44 "CURLE_ABORTED_BY_CALLBACK";
45 "CURLE_BAD_FUNCTION_ARGUMENT";
46 "CURLE_BAD_CALLING_ORDER";
47 "CURLE_INTERFACE_FAILED";
48 "CURLE_BAD_PASSWORD_ENTERED";
49 "CURLE_TOO_MANY_REDIRECTS";
50 "CURLE_UNKNOWN_TELNET_OPTION";
51 "CURLE_TELNET_OPTION_SYNTAX";
52 "CURLE_SSL_PEER_CERTIFICATE";
53 "CURLE_GOT_NOTHING";
54 "CURLE_SSL_ENGINE_NOTFOUND";
55 "CURLE_SSL_ENGINE_SETFAILED";
56 "CURLE_SEND_ERROR";
57 "CURLE_RECV_ERROR";
58 "CURLE_SHARE_IN_USE";
59 "CURLE_SSL_CERTPROBLEM";
60 "CURLE_SSL_CIPHER";
61 "CURLE_SSL_CACERT";
62 "CURLE_BAD_CONTENT_ENCODING";
63 "CURLE_LDAP_INVALID_URL";
64 "CURLE_FILESIZE_EXCEEDED";
65 "CURLE_FTP_SSL_FAILED";
66 "CURLE_SEND_FAIL_REWIND";
67 "CURLE_SSL_ENGINE_INITFAILED";
68 "CURLE_LOGIN_DENIED";
69 "CURLE_TFTP_NOTFOUND";
70 "CURLE_TFTP_PERM";
71 "CURLE_REMOTE_DISK_FULL";
72 "CURLE_TFTP_ILLEGAL";
73 "CURLE_TFTP_UNKNOWNID";
74 "CURLE_REMOTE_FILE_EXISTS";
75 "CURLE_TFTP_NOSUCHUSER";
76 "CURLE_CONV_FAILED";
77 "CURLE_CONV_REQD";
78 "CURLE_SSL_CACERT_BADFILE";
79 "CURLE_REMOTE_FILE_NOT_FOUND";
80 "CURLE_SSH";
81 "CURLE_SSL_SHUTDOWN_FAILED";
82 "CURLE_AGAIN";
85 let pr fmt = Printf.ksprintf print_endline fmt
87 let () =
88 match List.tl @@ Array.to_list @@ Sys.argv with
89 | [] | "c"::[] ->
90 all |> List.iteri begin fun i s ->
91 match s with
92 | "CURLE_OK" ->
93 pr " {\"%s\", %s}," s s
94 | _ ->
95 pr "#if HAVE_DECL_%s" s;
96 pr "#if %s != %d" s i;
97 pr "#warning error code mismatch: %s != %d" s i;
98 pr "#endif";
99 pr " {\"%s\", %s}," s s;
100 pr "#else";
101 pr " {\"%s\", -1}," s;
102 pr"#endif";
104 | "ml"::[] -> all |> List.iter (pr " | %s")
105 | "configure"::[] ->
106 Format.set_margin 80;
107 Format.open_box 0;
108 all |> List.iter (function "CURLE_OK" -> () | s -> Format.printf "%s,@ " s);
109 Format.close_box ();
110 | _ -> failwith "bad usage"