2 #***************************************************************************
4 # Project ___| | | | _ \| |
6 # | (__| |_| | _ <| |___
7 # \___|\___/|_| \_\_____|
9 # Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
11 # This software is licensed as described in the file COPYING, which
12 # you should have received as part of this distribution. The terms
13 # are also available at https://curl.se/docs/copyright.html.
15 # You may opt to use, copy, modify, merge, publish, distribute and/or sell
16 # copies of the Software, and permit persons to whom the Software is
17 # furnished to do so, under the terms of the COPYING file.
19 # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20 # KIND, either express or implied.
22 # SPDX-License-Identifier: curl
24 ###########################################################################
28 $l =~ s/([^\x20-\x7f])/sprintf "%%%02x", ord $1/eg;
34 open(my $fh, "-|", "perl $root/lib/optiontable.pl < $root/include/curl/curl.h");
39 open($fh, "<", "$root/lib/easyoptions.c");
44 if(join("", @gen) ne join("", @file)) {
45 print "easyoptions.c need to be regenerated!\n";
47 printf "easyoptions.c is %u lines\n", scalar(@file);
48 printf "generated file is %u lines\n", scalar(@gen);
50 for my $i (0 .. $#gen) {
51 # strip CRLFs to unify
52 $gen[$i] =~ s/[\r\n]//g;
53 $file[$i] =~ s/[\r\n]//g;
54 if($gen[$i] ne $file[$i]) {
55 printf "File: %u:%s\nGen: %u:%s\n",
56 $i+1, showline($file[$i]),
57 $i+1, showline($gen[$i]);
60 # only show 10 lines diff