]> git.rkrishnan.org Git - dttsp.git/blob - jDttSP/banal.h
e6af09b3f27eb0f751237872c887293d5d37e9b8
[dttsp.git] / jDttSP / banal.h
1 /* banal.h
2    stuff we're too embarrassed to declare otherwise
3    
4    This file is part of a program that implements a Software-Defined Radio.
5    
6    Copyright (C) 2004 by Frank Brickle, AB2KT and Bob McGwier, N4HY
7    
8    This program 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 of the License, or
11    (at your option) any later 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  USA
21    
22    The authors can be reached by email at
23    
24    ab2kt@arrl.net
25    or
26    rwmcgwier@comcast.net
27    
28    or by paper mail at
29    
30    The DTTS Microwave Society
31    6 Kathleen Place
32    Bridgewater, NJ 08807
33 */
34
35 #ifndef _banal_h
36
37 #define _banal_h
38
39 #include <fromsys.h>
40 #include <datatypes.h>
41
42 #ifndef min
43 #define min(a, b) ((a) < (b) ? (a) : (b))
44 #endif
45 #ifndef max
46 #define max(a, b) ((a) > (b) ? (a) : (b))
47 #endif
48 #define abs(a) ((a) >= 0 ? (a) : -(a))
49
50 #define MONDO 1e15
51 #define BITSY 1e-15
52
53 #define TRUE 1
54 #define FALSE 0
55
56 extern void nilfunc(void);
57 extern INLINE double sqr(double);
58 extern int popcnt(int);
59 extern int npoof2(int);
60 extern int nblock2(int);
61
62 extern int in_blocks(int count, int block_size);
63
64 extern FILE *efopen(char *path, char *mode);
65 extern FILE *efreopen(char *path, char *mode, FILE *strm);
66 extern size_t filesize(char *path);
67 extern size_t fdsize(int fd);
68
69 extern struct timeval now_tv(void);
70 extern struct timeval diff_tv(struct timeval *, struct timeval *);
71 extern struct timeval sum_tv(struct timeval *, struct timeval *);
72 extern char *fmt_tv(struct timeval *);
73 extern char *since(struct timeval *);
74 extern struct timeval now_tv(void);
75
76 extern int hinterp_vec(REAL *, int, REAL *, int);
77
78 extern void status_message(char *msg);
79
80 extern FILE *find_rcfile(char *base);
81
82 extern unsigned long hash(unsigned char *str);
83
84 #endif