f9c39dafc2d7e332ff85b153f0be381e90536fc4
[com/gs-lite.git] / include / lfta / gencsvinclude.pl
1 #! /usr/bin/perl
2
3 # ------------------------------------------------
4 #   Copyright 2014 AT&T Intellectual Property
5 #   Licensed under the Apache License, Version 2.0 (the "License");
6 #   you may not use this file except in compliance with the License.
7 #   You may obtain a copy of the License at
8 #
9 #     http://www.apache.org/licenses/LICENSE-2.0
10 #
11 #   Unless required by applicable law or agreed to in writing, software
12 #   distributed under the License is distributed on an "AS IS" BASIS,
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 #   See the License for the specific language governing permissions and
15 #   limitations under the License.
16 # -------------------------------------------
17
18 open(I,"cat ../packet.h | grep '#define CSVELEMENTS' | cut -f 3 -d ' ' |");
19 $num=<I>;
20 close(I);
21 chomp $num;
22 printf("#ifndef CSV_MACRO_H\n#define CSV_MACRO_H\n");
23 for($x=1;$x<=$num;$x++) {
24         printf "#define get_csv_float_to_timestamp_pos$x(X,Y) get_csv_float_to_timestamp((X),(Y),$x)\n";
25         printf "#define get_csv_uint_pos$x(X,Y) get_csv_uint((X),(Y),$x)\n";
26     printf "#define get_csv_ullong_pos$x(X,Y) get_csv_ullong((X),(Y),$x)\n";
27     printf "#define get_csv_ip_pos$x(X,Y) get_csv_ip((X),(Y),$x)\n";
28     printf "#define get_csv_ipv6_pos$x(X,Y) get_csv_ipv6((X),(Y),$x)\n";
29     printf "#define get_csv_string_pos$x(X,Y) get_csv_string((X),(Y),$x)\n";
30     printf "#define get_csv_v_str_pos$x(X,Y) get_csv_string((X),(Y),$x)\n";
31     printf "#define get_csv_bool_pos$x(X,Y) get_csv_bool((X),(Y),$x)\n";
32     printf "#define get_csv_int_pos$x(X,Y) get_csv_int((X),(Y),$x)\n";
33     printf "#define get_csv_llong_pos$x(X,Y) get_csv_llong((X),(Y),$x)\n";
34     printf "#define get_csv_float_pos$x(X,Y) get_csv_float((X),(Y),$x)\n";
35 }
36 print("#endif\n");