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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
.help cqget Mar00 "Catquery Package"
.ih
NAME
cqget -- read configuration file keywords directly
.ih
SYNOPSIS
.nf
[ird]val = cq_fget[ird](cq, fname)
nelems = cq_fga[ird](cq, fname, [ird]array, max_nelems)
call cq_fgwrd (cq, fname, wrd, maxch)
call cq_fgstr (cq, fname, str, maxch)
nlines = cq_fgtext (cq, fname, text, maxch)
stat = cq_scan (cq)
pointer cq # the configuration file descriptor
char fname # the field or keyword to be located
int iarray # the returned integer array
int rarray # the returned real array
int darray # the returned double array
int max_nelems # the maximum size of the returned array
char wrd # the keyword word value to be read
char str # the keyword string value to be read
char text # the keyword text value to be read
int maxch # the maximum size of the word, string, text value
.fi
.ih
SYNOPSIS
.ls cq
The configuration file descriptor.
.le
.ls fname
The name of the field or keyword to be read.
.le
.ls [ird]array
The integer, real, or double array returned by a call to cq_fga[ird].
.le
.ls max_nelems
The maximum number of elements in the array returned by a call to
cq_fga[ird].
.le
.ls wrd, str, text
The word, string, or text value returned by a call to cq_fgwrd, cq_fgstr, or
cq_fgtext.
.le
.ls maxch
The maximum number of characters in the word, string, or text returned
by cq_fgwrd, cq_fgstr, cq_fgtext.
.le
.ih
DESCRIPTION
Cq_fgval[ird] is an integer, real, or double function which returns the
integer, real, or double value of the requested field or keyword as its
function value.
Cq_fga[ird] returns an integer, real, or double array for the requested
field. Cq_fga[ird] is an integer function which returns the number of elements
in the retrieved array as its function value.
Cq_fg[wrd/str/text] returns the next word, the entire string, or the
number of lines in the requested keyword. Cq_fgtext is an integer function
which returns the number of lines in the returned text as its functions
value.
.ih
NOTES
The cqget routines are used to read keywords or fields in the current catalog
or survey directly. The routines cq_setcat or cq_setcatn must be called before
the cqget routines can be used.
The cqget routines must be error checked to avoid task termination.
.ih
EXAMPLES
Sample catalog configuration file record.
.nf
begin usno2@noao
address inet:80:www.noao.edu:text
query GET /cgi-bin/usno/usnoextract?search=yes&ra=%-s&dec=%-s&width=%-s HTTP/1.0
\n\n
nquery 4
ra 00:00:00.00 hours %0.2h
dec 00:00:00.0 degrees %0.1h
radius 5.0 minutes %0.1f
qsystem J2000.0 INDEF %s
type stext
hskip 10
tskip 6
recsize 44
triml 0
trimr 4
nheader 1
csystem J2000.0
nfields 4
ra 1 0 d hours %12.3h
dec 2 0 d degrees %12.2h
mag1 3 0 r INDEF %4.1f
mag2 4 0 r INDEF %4.1f
.fi
Example 1: To fetch the query field which includes embedded blanks use cq_fgstr.
.nf
call cq_fgstr (cq, "query", buffer, SZ_LINE)
.fi
Example 2: To fetch the type field use cq_fgwrd.
.nf
call cq_fgwrd (cq, "type", buffer, SZ_LINE)
.fi
Example 3: To determine the number of query parameters.
.nf
nquery = cq_fgeti (cq, "nquery")
.fi
Example4: To return a text array which follows a numerically valued parameter.
.nf
nquery = cq_fgeti (cq, "nquery")
nlines = cq_fgtext (cq, "nquery", buffer, nquery * SZ_LINE)
.fi
.ih
SEE ALSO
.endhelp
|