File size: 2,393 Bytes
2b6ccf8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/*
 * Copyright (C) 1999-2010 Anthony Lomax <anthony@alomax.net, http://www.alomax.net>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.

 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser Public License for more details.

 * You should have received a copy of the GNU Lesser Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.

 */


/* util.h

   AJL utility functions.

*/


/*
	by Anthony Lomax
	Geosciences Azur, Valbonne, France
*/



#include <stdlib.h>
#include <stdio.h>


#ifndef MAXLINE
#define MAXLINE 1024    // 20200125 AJL - changed from 101 to 1204
#endif

#ifndef VERY_SMALL_DOUBLE
#define VERY_SMALL_DOUBLE 1.0e-30
#endif

extern char package_name[MAXLINE];
extern char prog_name[MAXLINE];
extern char prog_ver[MAXLINE];
extern char prog_date[MAXLINE];
extern char prog_copyright[MAXLINE];
extern int message_flag;
extern char MsgStr[100 * MAXLINE];

/*** function to copy file by Jan Wiszniowski 2022-01-31*/
void copy_file(char* in_name, char* out_name);


/*** function to display command usage */
void disp_usage(const char * , const char *);

/*** function to display error message */
void nll_puterr(const char *);

/*** function to display error message */
void nll_puterr2(const char *, const char *);

/*** function to display message */
void nll_putmsg(int , const char *);

/*** function to display message */
void nll_putmsg2(int imsg_level, const char *pmessage1, const char *pmessage2);

/*** function to display program information */
void DispProgInfo();

/*** function to check that int val is in range */
int checkRangeInt(const char * name, const char * param, int val,
	int checkMin, int min, int checkMax, int max);

/*** function to check that double val is in range */
int checkRangeDouble(const char * name, const char * param, double val,
	int checkMin, double min, int checkMax, double max);

/* misc structures */

/* 3D vector or point */
// AEH/AJL 20080709 - already in geometry.h
/*
struct Vect3D {
	double x;
	double y;
	double z;
};
*/