Imported Upstream version 4.6.0
[debian/atlc] / tests / sysdata.c
1 /*
2 atlc - arbitrary transmission line calculator, for the analysis of
3 transmission lines are directional couplers. 
4
5 Copyright (C) 2002. Dr. David Kirkby, PhD (G8WRB).
6
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; either package_version 2
10 of the License, or (at your option) any later package_version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
20 USA.
21
22 Dr. David Kirkby, e-mail drkirkby@ntlworld.com 
23
24 */
25
26 #include "config.h"
27
28 #ifdef HAVE_STDIO_H
29 #include <stdio.h>
30 #endif
31
32 #ifdef HAVE_STDLIB_H
33 #include <stdlib.h>
34 #endif
35
36 #ifdef HAVE_SYS_TYPES_H
37 #include <sys/types.h>
38 #endif
39
40 #ifdef HAVE_TIME_H
41 #include <time.h>
42 #endif  
43
44 #ifdef HAVE_STRING_H
45 #include <string.h>
46 #endif  
47
48 #ifdef HAVE_UNISTD_H
49 #include <unistd.h> 
50 #endif
51
52 #include "defs.h"
53
54
55 int main()
56 {
57   struct computer_data data;
58
59   strcpy((char *) data.mhz,"unknown");
60   strcpy((char *) data.cpu_type,"unknown");
61   strcpy((char *) data.fpu_type,"unknown");
62   strcpy((char *) data.max_cpus,"unknown");
63   strcpy((char *) data.cpus,"unknown");
64   strcpy((char *) data.memory,"unknown");
65   strcpy((char *) data.sysname,"unknown");
66   strcpy((char *) data.nodename,"unknown");
67   strcpy((char *) data.release,"unknown");
68   strcpy((char *) data.version,"unknown");
69   strcpy((char *) data.machine,"unknown");
70   strcpy((char *) data.hw_provider,"unknown");
71   strcpy((char *) data.hw_platform,"unknown");
72   strcpy((char *) data.L1data,"unknown");
73   strcpy((char *) data.L1instruction,"unknown");
74   strcpy((char *) data.L2,"unknown");
75
76 #ifdef TRY_TO_GET_HARDWARE_INFO 
77   try_portable(&data);
78   try_aix(&data); 
79   try_bsd(&data); 
80   try_hpux(&data);
81   try_irix(&data);
82   try_linux(&data); 
83   try_solaris(&data);
84   try_tru64(&data); 
85   try_unicos(&data); 
86 #endif
87   printf("Hardware provider:    %s\n", data.hw_provider);
88   printf("Hardware platform:    %s\n",data.hw_platform);
89   printf("Machine:              %s\n",data.machine);
90   printf("Sysname:              %s\n",data.sysname);
91   printf("Release:              %s\n",data.release);
92   printf("Version:              %s\n",data.version);
93   printf("Nodename:             %s\n",data.nodename);
94   printf("#CPUs supported:      %s\n",data.max_cpus);
95   printf("#CPUs online:         %s\n",data.cpus);
96   printf("CPU type:             %s\n",data.cpu_type);
97   printf("FPU type:             %s\n",data.fpu_type);
98   printf("Speed:                %s MHz\n",data.mhz);
99   printf("RAM:                  %s Mb\n",data.memory);
100   printf("L1 data cache         %s kb\n",data.L1data);
101   printf("L1 instruction cache: %s kb\n",data.L1instruction);
102   printf("L2 cache:             %s kb\n",data.L2);
103   return(0);
104 }
105