Linuxpops
3.01.04
Spectral Anaysis Package for Single Dish Data
Main Page
Related Pages
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
history.c
Go to the documentation of this file.
1
/*
2
Copyright 2021 Arizona Board of Regents on behalf of the University of Arizona.
3
4
For commercial uses, to obtain a license to sell and or sublicense copies of
5
the Software please contact the University of Arizona at Tech Launch Arizona:
6
lewish@tla.arizona.edu.
7
8
Permission is hereby granted, free of charge, to any person obtaining a copy
9
of this software and associated documentation files (the "Software"), to deal
10
in the Software without restriction for non-commercial use educational and
11
research purposes, including without limitation the rights to use, copy,
12
modify, merge, publish, distribute, and to permit persons to whom the Software
13
is furnished to do so, subject to the following conditions:
14
15
The entire above copyright notice and this permission notice shall be included
16
in all copies or substantial portions of the Software.
17
18
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
SOFTWARE.
25
26
1. Additional Required Provisions
27
28
1.1. Arbitration. The parties agree that if a dispute arises between them
29
concerning this Agreement, the parties may be required to submit the matter to
30
arbitration pursuant to Arizona law.
31
32
1.2. Applicable Law and Venue. This Agreement shall be interpreted pursuant
33
to the laws of the State of Arizona. Any arbitration or litigation between the
34
Parties shall be conducted in Pima County, ARIZONA, and LICENSEE hereby
35
submits to venue and jurisdiction in Pima County, ARIZONA.
36
37
1.3. Non-Discrimination. The Parties agree to be bound by state and federal
38
laws and regulations governing equal opportunity and non-discrimination and
39
immigration.
40
41
1.4. Appropriation of Funds. The Parties recognize that performance by
42
ARIZONA may depend upon appropriation of funds by the State Legislature of
43
ARIZONA. If the Legislature fails to appropriate the necessary funds, or if
44
ARIZONA’S appropriation is reduced during the fiscal year, ARIZONA may cancel
45
this Agreement without further duty or obligation. ARIZONA will notify
46
LICENSEE as soon as reasonably possible after it knows of the loss of funds.
47
48
1.5. Conflict of Interest. This Agreement is subject to the provisions of
49
A.R.S. 38-511 and other conflict of interest regulations. Within three years
50
of the EFFECTIVE DATE, ARIZONA may cancel this Agreement if any person
51
significantly involved in initiating, negotiating, drafting, securing, or
52
creating this Agreement for or on behalf of ARIZONA becomes an employee or
53
consultant in any capacity of LICENSEE with respect to the subject matter of
54
this Agreement.
55
56
*/
57
58
59
#include "
extern.h
"
60
61
int
listHistory
()
62
{
63
register
HIST_ENTRY **the_list;
64
register
int
i;
65
66
if
(
isSet
(
PF_F_FLAG
))
/* flush history ? */
67
{
68
rwHistory
(
WRITE_HISTORY
);
69
70
return
(0);
71
}
72
73
if
(
isSet
(
PF_T_FLAG
))
/* Toggle multi-history ? */
74
{
75
if
(
use_multi_hist
)
76
{
77
st_report
(
"Turning Multi-History Off"
);
78
79
use_multi_hist
= 0;
80
}
81
else
82
{
83
st_report
(
"Turning Multi-History On"
);
84
85
use_multi_hist
= 1;
86
}
87
88
return
(0);
89
}
90
91
the_list = history_list();
92
93
if
(the_list)
94
{
95
for
(i=0;the_list[i];i++)
96
{
97
st_report
(
"%d: %s"
, i + history_base, the_list[i]->line);
98
}
99
}
100
101
if
(
use_multi_hist
)
102
{
103
st_report
(
"Using Multi-History Mode"
);
104
}
105
else
106
{
107
st_report
(
"Using Single-History Mode"
);
108
}
109
110
return
(0);
111
}
112
113
114
int
rwHistory
(rw)
115
int rw;
116
{
117
int
num
;
118
char
tbuf[256], *cp;
119
120
cp = getenv(
"USER"
);
121
122
if
(
use_multi_hist
)
123
{
124
num =
envNumber
;
125
}
126
else
127
{
128
num = 0;
129
}
130
131
if
(cp)
132
{
133
if
(!
strcmp
(cp,
"obs"
))
134
{
135
sprintf(tbuf,
"%s/%s/.linuxpops-history-%02d"
,
obs_home
,
obs_inits
, num);
136
}
137
else
138
{
139
sprintf(tbuf,
"%s/.linuxpops-history-%02d"
,
obs_home
, num);
140
}
141
}
142
else
143
{
144
sprintf(tbuf,
"%s/.linuxpops-history-%02d"
,
obs_home
, num);
145
}
146
147
if
(rw ==
WRITE_HISTORY
)
148
{
149
st_report
(
"Writing out history to %s"
, tbuf);
150
write_history(tbuf);
151
}
152
else
153
if
(rw ==
READ_HISTORY
)
154
{
155
st_report
(
"Reading in history from %s"
, tbuf);
156
read_history(tbuf);
157
}
158
159
return
(0);
160
}
161
listHistory
int listHistory()
Definition:
history.c:61
HISTO_INFO::num
int num
Definition:
histogram.h:11
rwHistory
int rwHistory(int rw)
Definition:
history.c:114
envNumber
int envNumber
Definition:
env.c:71
WRITE_HISTORY
#define WRITE_HISTORY
Definition:
makemem.c:85
use_multi_hist
int use_multi_hist
Definition:
env.c:91
isSet
int isSet(int flag)
Definition:
parse.c:646
PF_F_FLAG
Definition:
parse.h:13
strcmp
int strcmp()
extern.h
READ_HISTORY
#define READ_HISTORY
Definition:
makemem.c:84
obs_home
char obs_home[256]
Definition:
makemem.c:97
st_report
void st_report()
obs_inits
char obs_inits[256]
Definition:
makemem.c:97
PF_T_FLAG
Definition:
parse.h:27
linuxpops
history.c
Generated on Mon Feb 21 2022 20:37:02 for Linuxpops by
1.8.5