Imported Upstream version 3.0
[debian/gnuradio] / gnuradio-core / src / lib / filter / generate_gr_freq_xlating_fir_filter_XXX.py
1 #!/bin/env python
2 # -*- python -*-
3 #
4 # Copyright 2003,2004 Free Software Foundation, Inc.
5
6 # This file is part of GNU Radio
7
8 # GNU Radio is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2, or (at your option)
11 # any later version.
12
13 # GNU Radio is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 # GNU General Public License for more details.
17
18 # You should have received a copy of the GNU General Public License
19 # along with GNU Radio; see the file COPYING.  If not, write to
20 # the Free Software Foundation, Inc., 51 Franklin Street,
21 # Boston, MA 02110-1301, USA.
22
23
24 import re
25 from generate_utils import *
26
27 # files to generate
28
29 fx_signatures = [ 'scf', 'scc', 'fcf', 'fcc', 'ccf', 'ccc' ]
30
31 roots = ['gr_freq_xlating_fir_filter_XXX']
32
33 def expand_h_cc_i (root, code3):
34     d = init_dict (root, code3)
35     expand_template (d, root + '.h.t')
36     expand_template (d, root + '.cc.t')
37     expand_template (d, root + '.i.t')
38
39 def init_dict (root, code3):
40     name = re.sub ('X+', code3, root)
41     d = standard_dict (name, code3)
42     d['FIR_TYPE'] = 'gr_fir_' + i_code (code3) + 'cc'
43     return d
44
45
46 def generate ():
47     for r in roots:
48         for s in fx_signatures:
49             expand_h_cc_i (r, s)
50
51
52 if __name__ == '__main__':
53     generate ()