Imported Upstream version 4.6.0
[debian/atlc] / src / non_gui / check_parameters_of_create_bmp_for_microstrip_coupler.c
1
2
3 /* atlc - arbitrary transmission line calculator, for the analysis of
4 transmission lines are directional couplers. 
5
6 Copyright (C) 2002. Dr. David Kirkby, PhD (G8WRB).
7
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either package_version 2
11 of the License, or (at your option) any later package_version.
12
13 This program 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 this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
21 USA.
22
23 Dr. David Kirkby, e-mail drkirkby at ntlworld.com 
24
25 */
26 #include "config.h"
27
28 #ifdef HAVE_STRING_H
29 #include <string.h>
30 #endif
31
32 #ifdef HAVE_STRINGS_H
33 #include <strings.h>
34 #endif
35
36 #ifdef HAVE_STDLIB_H
37 #include <stdlib.h>
38 #endif  
39
40 #include "definitions.h"
41
42 #ifdef ENABLE_POSIX_THREADS
43 #include <pthread.h>
44 #endif
45
46 #include "exit_codes.h"
47
48 void check_parameters_of_create_bmp_for_microstrip_coupler(struct transmission_line_properties pcb) 
49 {
50       if ( pcb.ww <= 0)
51         exit_with_msg_and_exit_code("w <= 0",ARGUMENT_w_OUT_OF_RANGE);
52       if ( pcb.ss <= 0)
53         exit_with_msg_and_exit_code("s <= 0",ARGUMENT_s_OUT_OF_RANGE);
54       if ( pcb.gg <= 0)
55         exit_with_msg_and_exit_code("g <= 0",ARGUMENT_g_OUT_OF_RANGE);
56       if ( pcb.hh <= 0)
57         exit_with_msg_and_exit_code("h <= 0",ARGUMENT_h_OUT_OF_RANGE);
58       if ( pcb.tt <= 0)
59         exit_with_msg_and_exit_code("0 <= 0",ARGUMENT_t_OUT_OF_RANGE);
60       if ( pcb.Er1 < 1)
61         exit_with_msg_and_exit_code("0 <= 0",ARGUMENT_Er1_OUT_OF_RANGE);
62       if ( pcb.Er2 < 1)
63         exit_with_msg_and_exit_code("0 <= 0",ARGUMENT_Er2_OUT_OF_RANGE);
64 }