XS/Structs.xs

filter: Statementstmt 15.9% 124 / 780 Branchbran 9.3% 62 / 660 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 12.9% 186 / 1440 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« lib/Astro/Nova.xs ↑ Summary XS/EllipticMotion.xs »
1 ### WARNING! AUTO-GENERATED! ALL CHANGES WILL BE LOST!
2  
3  
4 MODULE=Astro::Nova PACKAGE=Astro::Nova::DMS
5  
6 struct ln_dms*
7 new(class, ...)
8 SV* class
9 PREINIT:
10 char* CLASS;
11 HV* tmphash;
12 int iStack;
13 SV** saveSV;
14 CODE:
15 1 ▶ if (sv_isobject(class)) {
Branch: 1 branch
BranchTrueFalseTotal
if (sv_isobject(class)) { 0 1 1
16 0 CLASS = (char*)sv_reftype(SvRV(class), 1);
17 }
18 else {
19 1 ▶ if (!SvPOK(class))
Branch: 1 branch
BranchTrueFalseTotal
if (!SvPOK(class)) 0 1 1
20 0 croak("Need an object or class name as first argument to the constructor of Astro::Nova::DMS");
21 1 CLASS = (char*)SvPV_nolen(class);
22 }
23 1 RETVAL = (struct ln_dms*)safemalloc( sizeof(struct ln_dms) );
24 1 ▶ if (RETVAL == NULL) {
Branch: 1 branch
BranchTrueFalseTotal
if (RETVAL == NULL) { 0 1 1
25 0 warn("unable to malloc struct ln_dms");
26 0 XSRETURN_UNDEF;
27 }
28 1 RETVAL->neg = 0;
29 1 RETVAL->seconds = 0.;
30 1 RETVAL->minutes = 0;
31 1 RETVAL->degrees = 0;
32 1 if (items > 1) {
33 1 if (!(items % 2)) {
34 1 ▶ safefree(RETVAL);
Branch: 1 branch
BranchTrueFalseTotal
safefree(RETVAL); 0 1 1
35 0 ▶ croak("Uneven number of arguments to constructor of Astro::Nova::DMS");
Branch: 1 branch
BranchTrueFalseTotal
croak("Uneven number of arguments to constructor of Astro::Nova::DMS"); 0 0 0
36 0 }
37 0 tmphash = (HV*)sv_2mortal((SV*)newHV());
38 for (iStack = 1; iStack < items; iStack += 2) {
39 0 HE *he;
40 0 ▶ he = hv_store_ent(tmphash, ST(iStack), newSVsv(ST(iStack+1)), 0);
Branch: 1 branch
BranchTrueFalseTotal
he = hv_store_ent(tmphash, ST(iStack), newSVsv(ST(iStack+1)), 0); 0 0 0
41 if (!he)
42 0 croak("Failed to write value to hash.");
43 0 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 0 0 0
44 0 saveSV = hv_fetchs(tmphash, "neg", 0);
45 if (saveSV != NULL && SvOK(*saveSV)) {
46 0 RETVAL->neg = SvIV(*saveSV);
47 0 ▶ }
Branch: 2 branches
BranchTrueFalseTotal
} 0 0 0
} 0 0 0
48 0  
49 saveSV = hv_fetchs(tmphash, "seconds", 0);
50 if (saveSV != NULL && SvOK(*saveSV)) {
51 0 RETVAL->seconds = SvNV(*saveSV);
52 0 ▶ }
Branch: 2 branches
BranchTrueFalseTotal
} 0 0 0
} 0 0 0
53 0  
54 saveSV = hv_fetchs(tmphash, "minutes", 0);
55 if (saveSV != NULL && SvOK(*saveSV)) {
56 0 RETVAL->minutes = SvIV(*saveSV);
57 0 ▶ }
Branch: 2 branches
BranchTrueFalseTotal
} 0 0 0
} 0 0 0
58 0  
59 saveSV = hv_fetchs(tmphash, "degrees", 0);
60 if (saveSV != NULL && SvOK(*saveSV)) {
61 0 RETVAL->degrees = SvIV(*saveSV);
62 0 ▶ }
Branch: 2 branches
BranchTrueFalseTotal
} 0 0 0
} 0 0 0
63 0  
64 }
65 OUTPUT:
66 0 RETVAL
67 0 ▶
Branch: 2 branches
BranchTrueFalseTotal
0 0 0
0 0 0
68 0  
69 void
70 DESTROY(self)
71 0 struct ln_dms* self
72 0 ▶ CODE:
Branch: 2 branches
BranchTrueFalseTotal
CODE: 0 0 0
CODE: 0 0 0
73 0 safefree( (char*)self );
74  
75 unsigned short
76 get_neg( self )
77 struct ln_dms* self
78 CODE:
79 RETVAL = self->neg;
80 OUTPUT:
81 RETVAL
82  
83 void
84 set_neg( self, val )
85 1 struct ln_dms* self
86 unsigned short val
87 PPCODE:
88 self->neg = val;
89  
90  
91 0 ▶double
Branch: 1 branch
BranchTrueFalseTotal
double 0 0 0
92 get_seconds( self )
93 struct ln_dms* self
94 CODE:
95 RETVAL = self->seconds;
96 OUTPUT:
97 RETVAL
98  
99 void
100 0 set_seconds( self, val )
101 struct ln_dms* self
102 double val
103 PPCODE:
104 self->seconds = val;
105  
106  
107 0 ▶unsigned short
Branch: 1 branch
BranchTrueFalseTotal
unsigned short 0 0 0
108 get_minutes( self )
109 struct ln_dms* self
110 CODE:
111 RETVAL = self->minutes;
112 OUTPUT:
113 RETVAL
114  
115 void
116 0 set_minutes( self, val )
117 struct ln_dms* self
118 unsigned short val
119 PPCODE:
120 self->minutes = val;
121  
122  
123 1 ▶unsigned short
Branch: 1 branch
BranchTrueFalseTotal
unsigned short 0 1 1
124 get_degrees( self )
125 struct ln_dms* self
126 CODE:
127 RETVAL = self->degrees;
128 OUTPUT:
129 RETVAL
130  
131 void
132 0 set_degrees( self, val )
133 struct ln_dms* self
134 unsigned short val
135 PPCODE:
136 self->degrees = val;
137  
138  
139 0 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
0 0 0
140 MODULE=Astro::Nova PACKAGE=Astro::Nova::HLnLatPosn
141  
142 struct lnh_lnlat_posn*
143 new(class, ...)
144 SV* class
145 PREINIT:
146 char* CLASS;
147 HV* tmphash;
148 0 int iStack;
149 SV** saveSV;
150 CODE:
151 if (sv_isobject(class)) {
152 CLASS = (char*)sv_reftype(SvRV(class), 1);
153 }
154 else {
155 0 ▶ if (!SvPOK(class))
Branch: 1 branch
BranchTrueFalseTotal
if (!SvPOK(class)) 0 0 0
156 croak("Need an object or class name as first argument to the constructor of Astro::Nova::HLnLatPosn");
157 CLASS = (char*)SvPV_nolen(class);
158 }
159 RETVAL = (struct lnh_lnlat_posn*)safemalloc( sizeof(struct lnh_lnlat_posn) );
160 if (RETVAL == NULL) {
161 warn("unable to malloc struct lnh_lnlat_posn");
162 XSRETURN_UNDEF;
163 }
164 0 Zero(&(RETVAL->lng), 1, struct ln_dms);
165 Zero(&(RETVAL->lat), 1, struct ln_dms);
166 if (items > 1) {
167 if (!(items % 2)) {
168 safefree(RETVAL);
169 croak("Uneven number of arguments to constructor of Astro::Nova::HLnLatPosn");
170 }
171 0 ▶ tmphash = (HV*)sv_2mortal((SV*)newHV());
Branch: 1 branch
BranchTrueFalseTotal
tmphash = (HV*)sv_2mortal((SV*)newHV()); 0 0 0
172 for (iStack = 1; iStack < items; iStack += 2) {
173 HE *he;
174 he = hv_store_ent(tmphash, ST(iStack), newSVsv(ST(iStack+1)), 0);
175 if (!he)
176 croak("Failed to write value to hash.");
177 }
178 saveSV = hv_fetchs(tmphash, "lng", 0);
179 if (saveSV != NULL && SvOK(*saveSV)) {
180 0 if ( sv_isobject(*saveSV) && (SvTYPE(SvRV(*saveSV)) == SVt_PVMG) ) {
181 struct ln_dms* original = (struct ln_dms*)SvIV((SV*)SvRV( *saveSV ));
182 Copy(original, &(RETVAL->lng), 1, struct ln_dms);
183 }
184 else {
185 warn("Invalid argument passed to constructor");
186 XSRETURN_UNDEF;
187 }
188
189 }
190  
191 saveSV = hv_fetchs(tmphash, "lat", 0);
192 if (saveSV != NULL && SvOK(*saveSV)) {
193 if ( sv_isobject(*saveSV) && (SvTYPE(SvRV(*saveSV)) == SVt_PVMG) ) {
194 struct ln_dms* original = (struct ln_dms*)SvIV((SV*)SvRV( *saveSV ));
195 4 ▶ Copy(original, &(RETVAL->lat), 1, struct ln_dms);
Branch: 1 branch
BranchTrueFalseTotal
Copy(original, &(RETVAL->lat), 1, struct ln_dms); 0 4 4
196 0 }
197 else {
198 warn("Invalid argument passed to constructor");
199 4 ▶ XSRETURN_UNDEF;
Branch: 1 branch
BranchTrueFalseTotal
XSRETURN_UNDEF; 0 4 4
200 0 }
201 4
202 }
203 4  
204 4 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 0 4 4
205 0 OUTPUT:
206 0 RETVAL
207
208 4  
209 4 void
210 4 DESTROY(self)
211 4 struct lnh_lnlat_posn* self
212 4 ▶ CODE:
Branch: 1 branch
BranchTrueFalseTotal
CODE: 2 2 4
213 2 ▶ safefree( (char*)self );
Branch: 1 branch
BranchTrueFalseTotal
safefree( (char*)self ); 0 2 2
214 0  
215 0 struct ln_dms*
216 get_lng( self )
217 2 struct lnh_lnlat_posn* self
218 7 ▶ INIT:
Branch: 1 branch
BranchTrueFalseTotal
INIT: 5 2 7
219 const char* CLASS = "Astro::Nova::DMS"; /* hack to work around perlobject.map */
220 5 CODE:
221 5 ▶ RETVAL = (struct ln_dms*)safemalloc( sizeof( struct ln_dms ) );
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = (struct ln_dms*)safemalloc( sizeof( struct ln_dms ) ); 0 5 5
222 0 if( RETVAL == NULL ){
223 warn("unable to malloc struct ln_dms");
224 2 XSRETURN_UNDEF;
225 2 ▶ }
Branch: 2 branches
BranchTrueFalseTotal
} 1 1 2
} 1 0 1
226 1 Copy(&(self->lng), (RETVAL), 1, struct ln_dms);
227 OUTPUT:
228 RETVAL
229 2  
230 2 ▶void
Branch: 2 branches
BranchTrueFalseTotal
void 1 1 2
void 1 0 1
231 1 set_lng( self, val )
232 struct lnh_lnlat_posn* self
233 struct ln_dms* val
234 2 PPCODE:
235 2 ▶ Copy(val, &(self->lng), 1, struct ln_dms);
Branch: 2 branches
BranchTrueFalseTotal
Copy(val, &(self->lng), 1, struct ln_dms); 1 1 2
Copy(val, &(self->lng), 1, struct ln_dms); 1 0 1
236 1  
237  
238 struct ln_dms*
239 2 get_lat( self )
240 2 ▶ struct lnh_lnlat_posn* self
Branch: 2 branches
BranchTrueFalseTotal
struct lnh_lnlat_posn* self 1 1 2
struct lnh_lnlat_posn* self 1 0 1
241 1 INIT:
242 const char* CLASS = "Astro::Nova::DMS"; /* hack to work around perlobject.map */
243 CODE:
244 RETVAL = (struct ln_dms*)safemalloc( sizeof( struct ln_dms ) );
245 if( RETVAL == NULL ){
246 warn("unable to malloc struct ln_dms");
247 XSRETURN_UNDEF;
248 }
249 Copy(&(self->lat), (RETVAL), 1, struct ln_dms);
250 OUTPUT:
251 RETVAL
252  
253 5 void
254 set_lat( self, val )
255 struct lnh_lnlat_posn* self
256 struct ln_dms* val
257 PPCODE:
258 Copy(val, &(self->lat), 1, struct ln_dms);
259 12 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
6 6 12
260  
261  
262 MODULE=Astro::Nova PACKAGE=Astro::Nova::RstTime
263  
264 struct ln_rst_time*
265 new(class, ...)
266 SV* class
267 PREINIT:
268 2 char* CLASS;
269 HV* tmphash;
270 int iStack;
271 SV** saveSV;
272 CODE:
273 if (sv_isobject(class)) {
274 CLASS = (char*)sv_reftype(SvRV(class), 1);
275 12 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 0 12 12
276 else {
277 if (!SvPOK(class))
278 croak("Need an object or class name as first argument to the constructor of Astro::Nova::RstTime");
279 CLASS = (char*)SvPV_nolen(class);
280 }
281 RETVAL = (struct ln_rst_time*)safemalloc( sizeof(struct ln_rst_time) );
282 if (RETVAL == NULL) {
283 warn("unable to malloc struct ln_rst_time");
284 3 XSRETURN_UNDEF;
285 }
286 RETVAL->transit = 0.;
287 RETVAL->rise = 0.;
288 RETVAL->set = 0.;
289 if (items > 1) {
290 if (!(items % 2)) {
291 12 ▶ safefree(RETVAL);
Branch: 1 branch
BranchTrueFalseTotal
safefree(RETVAL); 0 12 12
292 croak("Uneven number of arguments to constructor of Astro::Nova::RstTime");
293 }
294 tmphash = (HV*)sv_2mortal((SV*)newHV());
295 for (iStack = 1; iStack < items; iStack += 2) {
296 HE *he;
297 he = hv_store_ent(tmphash, ST(iStack), newSVsv(ST(iStack+1)), 0);
298 if (!he)
299 croak("Failed to write value to hash.");
300 2 }
301 saveSV = hv_fetchs(tmphash, "transit", 0);
302 if (saveSV != NULL && SvOK(*saveSV)) {
303 RETVAL->transit = SvNV(*saveSV);
304 }
305  
306 saveSV = hv_fetchs(tmphash, "rise", 0);
307 15 ▶ if (saveSV != NULL && SvOK(*saveSV)) {
Branch: 1 branch
BranchTrueFalseTotal
if (saveSV != NULL && SvOK(*saveSV)) { 6 9 15
308 RETVAL->rise = SvNV(*saveSV);
309 }
310  
311 saveSV = hv_fetchs(tmphash, "set", 0);
312 if (saveSV != NULL && SvOK(*saveSV)) {
313 RETVAL->set = SvNV(*saveSV);
314 }
315  
316 4 }
317 OUTPUT:
318 RETVAL
319
320  
321 void
322 DESTROY(self)
323 struct ln_rst_time* self
324 CODE:
325 safefree( (char*)self );
326  
327 double
328 get_transit( self )
329 struct ln_rst_time* self
330 CODE:
331 1 ▶ RETVAL = self->transit;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = self->transit; 0 1 1
332 0 OUTPUT:
333 RETVAL
334  
335 1 ▶void
Branch: 1 branch
BranchTrueFalseTotal
void 0 1 1
336 0 set_transit( self, val )
337 1 struct ln_rst_time* self
338 double val
339 1 PPCODE:
340 1 ▶ self->transit = val;
Branch: 1 branch
BranchTrueFalseTotal
self->transit = val; 0 1 1
341 0  
342 0  
343 double
344 1 get_rise( self )
345 1 struct ln_rst_time* self
346 1 ▶ CODE:
Branch: 1 branch
BranchTrueFalseTotal
CODE: 0 1 1
347 0 ▶ RETVAL = self->rise;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = self->rise; 0 0 0
348 0 OUTPUT:
349 0 RETVAL
350  
351 0 void
352 0 ▶set_rise( self, val )
Branch: 1 branch
BranchTrueFalseTotal
set_rise( self, val ) 0 0 0
353 struct ln_rst_time* self
354 0 double val
355 0 ▶ PPCODE:
Branch: 1 branch
BranchTrueFalseTotal
PPCODE: 0 0 0
356 0 self->rise = val;
357  
358 0  
359 0 ▶double
Branch: 2 branches
BranchTrueFalseTotal
double 0 0 0
double 0 0 0
360 0 get_set( self )
361 struct ln_rst_time* self
362 CODE:
363 0 RETVAL = self->set;
364 0 ▶ OUTPUT:
Branch: 2 branches
BranchTrueFalseTotal
OUTPUT: 0 0 0
OUTPUT: 0 0 0
365 0 RETVAL
366  
367 void
368 set_set( self, val )
369 struct ln_rst_time* self
370 double val
371 PPCODE:
372 self->set = val;
373  
374  
375  
376 MODULE=Astro::Nova PACKAGE=Astro::Nova::HelioPosn
377 1  
378 struct ln_helio_posn*
379 new(class, ...)
380 SV* class
381 PREINIT:
382 char* CLASS;
383 0 ▶ HV* tmphash;
Branch: 1 branch
BranchTrueFalseTotal
HV* tmphash; 0 0 0
384 int iStack;
385 SV** saveSV;
386 CODE:
387 if (sv_isobject(class)) {
388 CLASS = (char*)sv_reftype(SvRV(class), 1);
389 }
390 else {
391 if (!SvPOK(class))
392 0 croak("Need an object or class name as first argument to the constructor of Astro::Nova::HelioPosn");
393 CLASS = (char*)SvPV_nolen(class);
394 }
395 RETVAL = (struct ln_helio_posn*)safemalloc( sizeof(struct ln_helio_posn) );
396 if (RETVAL == NULL) {
397 warn("unable to malloc struct ln_helio_posn");
398 XSRETURN_UNDEF;
399 0 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 0 0 0
400 RETVAL->B = 0.;
401 RETVAL->R = 0.;
402 RETVAL->L = 0.;
403 if (items > 1) {
404 if (!(items % 2)) {
405 safefree(RETVAL);
406 croak("Uneven number of arguments to constructor of Astro::Nova::HelioPosn");
407 }
408 0 tmphash = (HV*)sv_2mortal((SV*)newHV());
409 for (iStack = 1; iStack < items; iStack += 2) {
410 HE *he;
411 he = hv_store_ent(tmphash, ST(iStack), newSVsv(ST(iStack+1)), 0);
412 if (!he)
413 croak("Failed to write value to hash.");
414 }
415 saveSV = hv_fetchs(tmphash, "B", 0);
416 if (saveSV != NULL && SvOK(*saveSV)) {
417 RETVAL->B = SvNV(*saveSV);
418 }
419  
420 saveSV = hv_fetchs(tmphash, "R", 0);
421 if (saveSV != NULL && SvOK(*saveSV)) {
422 RETVAL->R = SvNV(*saveSV);
423 0 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 0 0 0
424 0  
425 saveSV = hv_fetchs(tmphash, "L", 0);
426 if (saveSV != NULL && SvOK(*saveSV)) {
427 0 ▶ RETVAL->L = SvNV(*saveSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVAL->L = SvNV(*saveSV); 0 0 0
428 0 }
429 0  
430 }
431 0 OUTPUT:
432 0 ▶ RETVAL
Branch: 1 branch
BranchTrueFalseTotal
RETVAL 0 0 0
433 0
434 0  
435 void
436 0 DESTROY(self)
437 0 struct ln_helio_posn* self
438 0 ▶ CODE:
Branch: 1 branch
BranchTrueFalseTotal
CODE: 0 0 0
439 0 ▶ safefree( (char*)self );
Branch: 1 branch
BranchTrueFalseTotal
safefree( (char*)self ); 0 0 0
440 0  
441 0 double
442 get_B( self )
443 0 struct ln_helio_posn* self
444 0 ▶ CODE:
Branch: 1 branch
BranchTrueFalseTotal
CODE: 0 0 0
445 RETVAL = self->B;
446 0 OUTPUT:
447 0 ▶ RETVAL
Branch: 1 branch
BranchTrueFalseTotal
RETVAL 0 0 0
448 0  
449 void
450 0 set_B( self, val )
451 0 ▶ struct ln_helio_posn* self
Branch: 2 branches
BranchTrueFalseTotal
struct ln_helio_posn* self 0 0 0
struct ln_helio_posn* self 0 0 0
452 0 ▶ double val
Branch: 2 branches
BranchTrueFalseTotal
double val 0 0 0
double val 0 0 0
453 0 PPCODE:
454 0 self->B = val;
455  
456  
457 0 double
458 0 get_R( self )
459 struct ln_helio_posn* self
460 CODE:
461 RETVAL = self->R;
462 OUTPUT:
463 0 RETVAL
464 0 ▶ 
Branch: 2 branches
BranchTrueFalseTotal
0 0 0
0 0 0
465 0 ▶void
Branch: 2 branches
BranchTrueFalseTotal
void 0 0 0
void 0 0 0
466 0 set_R( self, val )
467 0 struct ln_helio_posn* self
468 double val
469 PPCODE:
470 0 self->R = val;
471 0  
472  
473 double
474 get_L( self )
475 struct ln_helio_posn* self
476 CODE:
477 RETVAL = self->L;
478 OUTPUT:
479 RETVAL
480  
481 void
482 set_L( self, val )
483 struct ln_helio_posn* self
484 double val
485 0 PPCODE:
486 self->L = val;
487  
488  
489  
490 MODULE=Astro::Nova PACKAGE=Astro::Nova::EllOrbit
491 0  
492 struct ln_ell_orbit*
493 0 new(class, ...)
494 0 ▶ SV* class
Branch: 1 branch
BranchTrueFalseTotal
SV* class 0 0 0
495 0 PREINIT:
496 0 char* CLASS;
497 HV* tmphash;
498 0 int iStack;
499 SV** saveSV;
500 CODE:
501 if (sv_isobject(class)) {
502 CLASS = (char*)sv_reftype(SvRV(class), 1);
503 }
504 else {
505 if (!SvPOK(class))
506 croak("Need an object or class name as first argument to the constructor of Astro::Nova::EllOrbit");
507 0 CLASS = (char*)SvPV_nolen(class);
508 }
509 RETVAL = (struct ln_ell_orbit*)safemalloc( sizeof(struct ln_ell_orbit) );
510 if (RETVAL == NULL) {
511 warn("unable to malloc struct ln_ell_orbit");
512 XSRETURN_UNDEF;
513 }
514 0 RETVAL->i = 0.;
515 RETVAL->JD = 0.;
516 0 RETVAL->w = 0.;
517 0 ▶ RETVAL->omega = 0.;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL->omega = 0.; 0 0 0
518 0 RETVAL->e = 0.;
519 0 RETVAL->n = 0.;
520 RETVAL->a = 0.;
521 0 if (items > 1) {
522 if (!(items % 2)) {
523 safefree(RETVAL);
524 croak("Uneven number of arguments to constructor of Astro::Nova::EllOrbit");
525 }
526 tmphash = (HV*)sv_2mortal((SV*)newHV());
527 for (iStack = 1; iStack < items; iStack += 2) {
528 HE *he;
529 he = hv_store_ent(tmphash, ST(iStack), newSVsv(ST(iStack+1)), 0);
530 0 if (!he)
531 croak("Failed to write value to hash.");
532 }
533 saveSV = hv_fetchs(tmphash, "i", 0);
534 if (saveSV != NULL && SvOK(*saveSV)) {
535 RETVAL->i = SvNV(*saveSV);
536 }
537  
538 saveSV = hv_fetchs(tmphash, "JD", 0);
539 if (saveSV != NULL && SvOK(*saveSV)) {
540 RETVAL->JD = SvNV(*saveSV);
541 }
542  
543 saveSV = hv_fetchs(tmphash, "w", 0);
544 if (saveSV != NULL && SvOK(*saveSV)) {
545 0 ▶ RETVAL->w = SvNV(*saveSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVAL->w = SvNV(*saveSV); 0 0 0
546 0 }
547  
548 saveSV = hv_fetchs(tmphash, "omega", 0);
549 0 ▶ if (saveSV != NULL && SvOK(*saveSV)) {
Branch: 1 branch
BranchTrueFalseTotal
if (saveSV != NULL && SvOK(*saveSV)) { 0 0 0
550 0 RETVAL->omega = SvNV(*saveSV);
551 0 }
552  
553 0 saveSV = hv_fetchs(tmphash, "e", 0);
554 0 ▶ if (saveSV != NULL && SvOK(*saveSV)) {
Branch: 1 branch
BranchTrueFalseTotal
if (saveSV != NULL && SvOK(*saveSV)) { 0 0 0
555 0 RETVAL->e = SvNV(*saveSV);
556 0 }
557  
558 0 saveSV = hv_fetchs(tmphash, "n", 0);
559 0 if (saveSV != NULL && SvOK(*saveSV)) {
560 0 RETVAL->n = SvNV(*saveSV);
561 0 }
562 0  
563 0 saveSV = hv_fetchs(tmphash, "a", 0);
564 0 ▶ if (saveSV != NULL && SvOK(*saveSV)) {
Branch: 1 branch
BranchTrueFalseTotal
if (saveSV != NULL && SvOK(*saveSV)) { 0 0 0
565 0 ▶ RETVAL->a = SvNV(*saveSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVAL->a = SvNV(*saveSV); 0 0 0
566 0 }
567 0  
568 }
569 0 OUTPUT:
570 0 ▶ RETVAL
Branch: 1 branch
BranchTrueFalseTotal
RETVAL 0 0 0
571
572 0  
573 0 ▶void
Branch: 1 branch
BranchTrueFalseTotal
void 0 0 0
574 0 DESTROY(self)
575 struct ln_ell_orbit* self
576 0 CODE:
577 0 ▶ safefree( (char*)self );
Branch: 2 branches
BranchTrueFalseTotal
safefree( (char*)self ); 0 0 0
safefree( (char*)self ); 0 0 0
578 0  
579 double
580 get_i( self )
581 0 struct ln_ell_orbit* self
582 0 ▶ CODE:
Branch: 2 branches
BranchTrueFalseTotal
CODE: 0 0 0
CODE: 0 0 0
583 0 RETVAL = self->i;
584 OUTPUT:
585 RETVAL
586 0  
587 0 ▶void
Branch: 2 branches
BranchTrueFalseTotal
void 0 0 0
void 0 0 0
588 0 set_i( self, val )
589 struct ln_ell_orbit* self
590 double val
591 0 PPCODE:
592 0 ▶ self->i = val;
Branch: 2 branches
BranchTrueFalseTotal
self->i = val; 0 0 0
self->i = val; 0 0 0
593 0  
594  
595 double
596 0 get_JD( self )
597 0 ▶ struct ln_ell_orbit* self
Branch: 2 branches
BranchTrueFalseTotal
struct ln_ell_orbit* self 0 0 0
struct ln_ell_orbit* self 0 0 0
598 0 CODE:
599 RETVAL = self->JD;
600 OUTPUT:
601 0 RETVAL
602 0 ▶ 
Branch: 2 branches
BranchTrueFalseTotal
0 0 0
0 0 0
603 0 void
604 set_JD( self, val )
605 struct ln_ell_orbit* self
606 double val
607 PPCODE:
608 self->JD = val;
609  
610  
611 double
612 get_w( self )
613 struct ln_ell_orbit* self
614 CODE:
615 0 RETVAL = self->w;
616 OUTPUT:
617 RETVAL
618  
619 void
620 set_w( self, val )
621 0 ▶ struct ln_ell_orbit* self
Branch: 1 branch
BranchTrueFalseTotal
struct ln_ell_orbit* self 0 0 0
622 double val
623 PPCODE:
624 self->w = val;
625  
626  
627 double
628 get_omega( self )
629 struct ln_ell_orbit* self
630 0 CODE:
631 RETVAL = self->omega;
632 OUTPUT:
633 RETVAL
634  
635 void
636 set_omega( self, val )
637 0 ▶ struct ln_ell_orbit* self
Branch: 1 branch
BranchTrueFalseTotal
struct ln_ell_orbit* self 0 0 0
638 double val
639 PPCODE:
640 self->omega = val;
641  
642  
643 double
644 get_e( self )
645 struct ln_ell_orbit* self
646 0 CODE:
647 RETVAL = self->e;
648 OUTPUT:
649 RETVAL
650  
651 void
652 set_e( self, val )
653 0 ▶ struct ln_ell_orbit* self
Branch: 1 branch
BranchTrueFalseTotal
struct ln_ell_orbit* self 0 0 0
654 double val
655 PPCODE:
656 self->e = val;
657  
658  
659 double
660 get_n( self )
661 struct ln_ell_orbit* self
662 0 CODE:
663 RETVAL = self->n;
664 OUTPUT:
665 RETVAL
666  
667 void
668 set_n( self, val )
669 0 ▶ struct ln_ell_orbit* self
Branch: 1 branch
BranchTrueFalseTotal
struct ln_ell_orbit* self 0 0 0
670 double val
671 PPCODE:
672 self->n = val;
673  
674  
675 double
676 get_a( self )
677 struct ln_ell_orbit* self
678 0 CODE:
679 RETVAL = self->a;
680 OUTPUT:
681 RETVAL
682  
683 void
684 set_a( self, val )
685 0 ▶ struct ln_ell_orbit* self
Branch: 1 branch
BranchTrueFalseTotal
struct ln_ell_orbit* self 0 0 0
686 double val
687 PPCODE:
688 self->a = val;
689  
690  
691  
692 MODULE=Astro::Nova PACKAGE=Astro::Nova::HypOrbit
693  
694 0 struct ln_hyp_orbit*
695 new(class, ...)
696 SV* class
697 PREINIT:
698 char* CLASS;
699 HV* tmphash;
700 int iStack;
701 0 ▶ SV** saveSV;
Branch: 1 branch
BranchTrueFalseTotal
SV** saveSV; 0 0 0
702 CODE:
703 if (sv_isobject(class)) {
704 CLASS = (char*)sv_reftype(SvRV(class), 1);
705 }
706 else {
707 if (!SvPOK(class))
708 croak("Need an object or class name as first argument to the constructor of Astro::Nova::HypOrbit");
709 CLASS = (char*)SvPV_nolen(class);
710 0 }
711 RETVAL = (struct ln_hyp_orbit*)safemalloc( sizeof(struct ln_hyp_orbit) );
712 if (RETVAL == NULL) {
713 warn("unable to malloc struct ln_hyp_orbit");
714 XSRETURN_UNDEF;
715 }
716 RETVAL->q = 0.;
717 RETVAL->e = 0.;
718 RETVAL->JD = 0.;
719 RETVAL->omega = 0.;
720 RETVAL->w = 0.;
721 RETVAL->i = 0.;
722 if (items > 1) {
723 if (!(items % 2)) {
724 safefree(RETVAL);
725 1 ▶ croak("Uneven number of arguments to constructor of Astro::Nova::HypOrbit");
Branch: 1 branch
BranchTrueFalseTotal
croak("Uneven number of arguments to constructor of Astro::Nova::HypOrbit"); 0 1 1
726 0 }
727 tmphash = (HV*)sv_2mortal((SV*)newHV());
728 for (iStack = 1; iStack < items; iStack += 2) {
729 1 ▶ HE *he;
Branch: 1 branch
BranchTrueFalseTotal
HE *he; 0 1 1
730 0 he = hv_store_ent(tmphash, ST(iStack), newSVsv(ST(iStack+1)), 0);
731 1 if (!he)
732 croak("Failed to write value to hash.");
733 1 }
734 1 ▶ saveSV = hv_fetchs(tmphash, "q", 0);
Branch: 1 branch
BranchTrueFalseTotal
saveSV = hv_fetchs(tmphash, "q", 0); 0 1 1
735 0 if (saveSV != NULL && SvOK(*saveSV)) {
736 0 RETVAL->q = SvNV(*saveSV);
737 }
738 1  
739 1 saveSV = hv_fetchs(tmphash, "e", 0);
740 1 if (saveSV != NULL && SvOK(*saveSV)) {
741 1 RETVAL->e = SvNV(*saveSV);
742 1 }
743 1  
744 1 saveSV = hv_fetchs(tmphash, "JD", 0);
745 1 ▶ if (saveSV != NULL && SvOK(*saveSV)) {
Branch: 1 branch
BranchTrueFalseTotal
if (saveSV != NULL && SvOK(*saveSV)) { 0 1 1
746 0 ▶ RETVAL->JD = SvNV(*saveSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVAL->JD = SvNV(*saveSV); 0 0 0
747 0 }
748 0  
749 saveSV = hv_fetchs(tmphash, "omega", 0);
750 0 if (saveSV != NULL && SvOK(*saveSV)) {
751 0 ▶ RETVAL->omega = SvNV(*saveSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVAL->omega = SvNV(*saveSV); 0 0 0
752 }
753 0  
754 0 ▶ saveSV = hv_fetchs(tmphash, "w", 0);
Branch: 1 branch
BranchTrueFalseTotal
saveSV = hv_fetchs(tmphash, "w", 0); 0 0 0
755 0 if (saveSV != NULL && SvOK(*saveSV)) {
756 RETVAL->w = SvNV(*saveSV);
757 0 }
758 0 ▶ 
Branch: 2 branches
BranchTrueFalseTotal
0 0 0
0 0 0
759 0 saveSV = hv_fetchs(tmphash, "i", 0);
760 if (saveSV != NULL && SvOK(*saveSV)) {
761 RETVAL->i = SvNV(*saveSV);
762 0 }
763 0 ▶ 
Branch: 2 branches
BranchTrueFalseTotal
0 0 0
0 0 0
764 0 }
765 OUTPUT:
766 RETVAL
767 0
768 0 ▶ 
Branch: 2 branches
BranchTrueFalseTotal
0 0 0
0 0 0
769 0 void
770 DESTROY(self)
771 struct ln_hyp_orbit* self
772 0 CODE:
773 0 ▶ safefree( (char*)self );
Branch: 2 branches
BranchTrueFalseTotal
safefree( (char*)self ); 0 0 0
safefree( (char*)self ); 0 0 0
774 0  
775 double
776 get_q( self )
777 0 struct ln_hyp_orbit* self
778 0 ▶ CODE:
Branch: 2 branches
BranchTrueFalseTotal
CODE: 0 0 0
CODE: 0 0 0
779 0 RETVAL = self->q;
780 OUTPUT:
781 RETVAL
782 0  
783 0 ▶void
Branch: 2 branches
BranchTrueFalseTotal
void 0 0 0
void 0 0 0
784 0 set_q( self, val )
785 struct ln_hyp_orbit* self
786 double val
787 0 PPCODE:
788 0 ▶ self->q = val;
Branch: 2 branches
BranchTrueFalseTotal
self->q = val; 0 0 0
self->q = val; 0 0 0
789 0  
790  
791 double
792 get_e( self )
793 struct ln_hyp_orbit* self
794 CODE:
795 RETVAL = self->e;
796 OUTPUT:
797 RETVAL
798  
799 void
800 set_e( self, val )
801 1 struct ln_hyp_orbit* self
802 double val
803 PPCODE:
804 self->e = val;
805  
806  
807 0 ▶double
Branch: 1 branch
BranchTrueFalseTotal
double 0 0 0
808 get_JD( self )
809 struct ln_hyp_orbit* self
810 CODE:
811 RETVAL = self->JD;
812 OUTPUT:
813 RETVAL
814  
815 void
816 0 set_JD( self, val )
817 struct ln_hyp_orbit* self
818 double val
819 PPCODE:
820 self->JD = val;
821  
822  
823 0 ▶double
Branch: 1 branch
BranchTrueFalseTotal
double 0 0 0
824 get_omega( self )
825 struct ln_hyp_orbit* self
826 CODE:
827 RETVAL = self->omega;
828 OUTPUT:
829 RETVAL
830  
831 void
832 0 set_omega( self, val )
833 struct ln_hyp_orbit* self
834 double val
835 PPCODE:
836 self->omega = val;
837  
838  
839 0 ▶double
Branch: 1 branch
BranchTrueFalseTotal
double 0 0 0
840 get_w( self )
841 struct ln_hyp_orbit* self
842 CODE:
843 RETVAL = self->w;
844 OUTPUT:
845 RETVAL
846  
847 void
848 0 set_w( self, val )
849 struct ln_hyp_orbit* self
850 double val
851 PPCODE:
852 self->w = val;
853  
854  
855 0 ▶double
Branch: 1 branch
BranchTrueFalseTotal
double 0 0 0
856 get_i( self )
857 struct ln_hyp_orbit* self
858 CODE:
859 RETVAL = self->i;
860 OUTPUT:
861 RETVAL
862  
863 void
864 0 set_i( self, val )
865 struct ln_hyp_orbit* self
866 double val
867 PPCODE:
868 self->i = val;
869  
870  
871 0 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
0 0 0
872 MODULE=Astro::Nova PACKAGE=Astro::Nova::HMS
873  
874 struct ln_hms*
875 new(class, ...)
876 SV* class
877 PREINIT:
878 char* CLASS;
879 HV* tmphash;
880 0 int iStack;
881 SV** saveSV;
882 CODE:
883 if (sv_isobject(class)) {
884 CLASS = (char*)sv_reftype(SvRV(class), 1);
885 }
886 else {
887 0 ▶ if (!SvPOK(class))
Branch: 1 branch
BranchTrueFalseTotal
if (!SvPOK(class)) 0 0 0
888 croak("Need an object or class name as first argument to the constructor of Astro::Nova::HMS");
889 CLASS = (char*)SvPV_nolen(class);
890 }
891 RETVAL = (struct ln_hms*)safemalloc( sizeof(struct ln_hms) );
892 if (RETVAL == NULL) {
893 warn("unable to malloc struct ln_hms");
894 XSRETURN_UNDEF;
895 }
896 0 RETVAL->seconds = 0.;
897 RETVAL->minutes = 0;
898 RETVAL->hours = 0;
899 if (items > 1) {
900 if (!(items % 2)) {
901 safefree(RETVAL);
902 croak("Uneven number of arguments to constructor of Astro::Nova::HMS");
903 0 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 0 0 0
904 tmphash = (HV*)sv_2mortal((SV*)newHV());
905 for (iStack = 1; iStack < items; iStack += 2) {
906 HE *he;
907 he = hv_store_ent(tmphash, ST(iStack), newSVsv(ST(iStack+1)), 0);
908 if (!he)
909 croak("Failed to write value to hash.");
910 }
911 saveSV = hv_fetchs(tmphash, "seconds", 0);
912 0 if (saveSV != NULL && SvOK(*saveSV)) {
913 RETVAL->seconds = SvNV(*saveSV);
914 }
915  
916 saveSV = hv_fetchs(tmphash, "minutes", 0);
917 if (saveSV != NULL && SvOK(*saveSV)) {
918 RETVAL->minutes = SvIV(*saveSV);
919 }
920  
921 saveSV = hv_fetchs(tmphash, "hours", 0);
922 if (saveSV != NULL && SvOK(*saveSV)) {
923 RETVAL->hours = SvIV(*saveSV);
924 }
925  
926 }
927 0 ▶ OUTPUT:
Branch: 1 branch
BranchTrueFalseTotal
OUTPUT: 0 0 0
928 0 RETVAL
929
930  
931 0 ▶void
Branch: 1 branch
BranchTrueFalseTotal
void 0 0 0
932 0 DESTROY(self)
933 0 struct ln_hms* self
934 CODE:
935 0 safefree( (char*)self );
936 0 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
0 0 0
937 0 double
938 0 get_seconds( self )
939 struct ln_hms* self
940 0 CODE:
941 0 RETVAL = self->seconds;
942 0 ▶ OUTPUT:
Branch: 1 branch
BranchTrueFalseTotal
OUTPUT: 0 0 0
943 0 ▶ RETVAL
Branch: 1 branch
BranchTrueFalseTotal
RETVAL 0 0 0
944 0  
945 0 void
946 set_seconds( self, val )
947 0 struct ln_hms* self
948 0 ▶ double val
Branch: 1 branch
BranchTrueFalseTotal
double val 0 0 0
949 PPCODE:
950 0 self->seconds = val;
951 0 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
0 0 0
952 0  
953 unsigned short
954 0 get_minutes( self )
955 0 ▶ struct ln_hms* self
Branch: 2 branches
BranchTrueFalseTotal
struct ln_hms* self 0 0 0
struct ln_hms* self 0 0 0
956 0 CODE:
957 RETVAL = self->minutes;
958 OUTPUT:
959 0 RETVAL
960 0 ▶ 
Branch: 2 branches
BranchTrueFalseTotal
0 0 0
0 0 0
961 0 void
962 set_minutes( self, val )
963 struct ln_hms* self
964 unsigned short val
965 PPCODE:
966 self->minutes = val;
967  
968  
969 unsigned short
970 get_hours( self )
971 struct ln_hms* self
972 CODE:
973 0 RETVAL = self->hours;
974 OUTPUT:
975 RETVAL
976  
977 void
978 set_hours( self, val )
979 0 ▶ struct ln_hms* self
Branch: 1 branch
BranchTrueFalseTotal
struct ln_hms* self 0 0 0
980 unsigned short val
981 PPCODE:
982 self->hours = val;
983  
984  
985  
986 MODULE=Astro::Nova PACKAGE=Astro::Nova::LnLatPosn
987  
988 0 struct ln_lnlat_posn*
989 new(class, ...)
990 SV* class
991 PREINIT:
992 char* CLASS;
993 HV* tmphash;
994 int iStack;
995 0 ▶ SV** saveSV;
Branch: 1 branch
BranchTrueFalseTotal
SV** saveSV; 0 0 0
996 CODE:
997 if (sv_isobject(class)) {
998 CLASS = (char*)sv_reftype(SvRV(class), 1);
999 }
1000 else {
1001 if (!SvPOK(class))
1002 croak("Need an object or class name as first argument to the constructor of Astro::Nova::LnLatPosn");
1003 CLASS = (char*)SvPV_nolen(class);
1004 0 }
1005 RETVAL = (struct ln_lnlat_posn*)safemalloc( sizeof(struct ln_lnlat_posn) );
1006 if (RETVAL == NULL) {
1007 warn("unable to malloc struct ln_lnlat_posn");
1008 XSRETURN_UNDEF;
1009 }
1010 RETVAL->lng = 0.;
1011 RETVAL->lat = 0.;
1012 if (items > 1) {
1013 if (!(items % 2)) {
1014 safefree(RETVAL);
1015 croak("Uneven number of arguments to constructor of Astro::Nova::LnLatPosn");
1016 }
1017 tmphash = (HV*)sv_2mortal((SV*)newHV());
1018 for (iStack = 1; iStack < items; iStack += 2) {
1019 0 ▶ HE *he;
Branch: 1 branch
BranchTrueFalseTotal
HE *he; 0 0 0
1020 0 he = hv_store_ent(tmphash, ST(iStack), newSVsv(ST(iStack+1)), 0);
1021 if (!he)
1022 croak("Failed to write value to hash.");
1023 0 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 0 0 0
1024 0 saveSV = hv_fetchs(tmphash, "lng", 0);
1025 0 if (saveSV != NULL && SvOK(*saveSV)) {
1026 RETVAL->lng = SvNV(*saveSV);
1027 0 }
1028 0 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
0 0 0
1029 0 saveSV = hv_fetchs(tmphash, "lat", 0);
1030 0 if (saveSV != NULL && SvOK(*saveSV)) {
1031 RETVAL->lat = SvNV(*saveSV);
1032 0 }
1033 0  
1034 0 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 0 0 0
1035 0 ▶ OUTPUT:
Branch: 1 branch
BranchTrueFalseTotal
OUTPUT: 0 0 0
1036 0 RETVAL
1037 0
1038  
1039 0 void
1040 0 ▶DESTROY(self)
Branch: 1 branch
BranchTrueFalseTotal
DESTROY(self) 0 0 0
1041 struct ln_lnlat_posn* self
1042 0 CODE:
1043 0 ▶ safefree( (char*)self );
Branch: 1 branch
BranchTrueFalseTotal
safefree( (char*)self ); 0 0 0
1044 0  
1045 double
1046 0 get_lng( self )
1047 0 ▶ struct ln_lnlat_posn* self
Branch: 2 branches
BranchTrueFalseTotal
struct ln_lnlat_posn* self 0 0 0
struct ln_lnlat_posn* self 0 0 0
1048 0 CODE:
1049 RETVAL = self->lng;
1050 OUTPUT:
1051 0 RETVAL
1052 0 ▶ 
Branch: 2 branches
BranchTrueFalseTotal
0 0 0
0 0 0
1053 0 void
1054 set_lng( self, val )
1055 struct ln_lnlat_posn* self
1056 double val
1057 PPCODE:
1058 self->lng = val;
1059  
1060  
1061 double
1062 get_lat( self )
1063 struct ln_lnlat_posn* self
1064 CODE:
1065 0 RETVAL = self->lat;
1066 OUTPUT:
1067 RETVAL
1068  
1069 void
1070 set_lat( self, val )
1071 0 ▶ struct ln_lnlat_posn* self
Branch: 1 branch
BranchTrueFalseTotal
struct ln_lnlat_posn* self 0 0 0
1072 double val
1073 PPCODE:
1074 self->lat = val;
1075  
1076  
1077  
1078 MODULE=Astro::Nova PACKAGE=Astro::Nova::Nutation
1079  
1080 0 struct ln_nutation*
1081 new(class, ...)
1082 SV* class
1083 PREINIT:
1084 char* CLASS;
1085 HV* tmphash;
1086 int iStack;
1087 0 ▶ SV** saveSV;
Branch: 1 branch
BranchTrueFalseTotal
SV** saveSV; 0 0 0
1088 CODE:
1089 if (sv_isobject(class)) {
1090 CLASS = (char*)sv_reftype(SvRV(class), 1);
1091 }
1092 else {
1093 if (!SvPOK(class))
1094 croak("Need an object or class name as first argument to the constructor of Astro::Nova::Nutation");
1095 CLASS = (char*)SvPV_nolen(class);
1096 0 }
1097 RETVAL = (struct ln_nutation*)safemalloc( sizeof(struct ln_nutation) );
1098 if (RETVAL == NULL) {
1099 warn("unable to malloc struct ln_nutation");
1100 XSRETURN_UNDEF;
1101 }
1102 RETVAL->longitude = 0.;
1103 RETVAL->ecliptic = 0.;
1104 RETVAL->obliquity = 0.;
1105 if (items > 1) {
1106 if (!(items % 2)) {
1107 safefree(RETVAL);
1108 croak("Uneven number of arguments to constructor of Astro::Nova::Nutation");
1109 }
1110 tmphash = (HV*)sv_2mortal((SV*)newHV());
1111 0 ▶ for (iStack = 1; iStack < items; iStack += 2) {
Branch: 1 branch
BranchTrueFalseTotal
for (iStack = 1; iStack < items; iStack += 2) { 0 0 0
1112 0 HE *he;
1113 he = hv_store_ent(tmphash, ST(iStack), newSVsv(ST(iStack+1)), 0);
1114 if (!he)
1115 0 ▶ croak("Failed to write value to hash.");
Branch: 1 branch
BranchTrueFalseTotal
croak("Failed to write value to hash."); 0 0 0
1116 0 }
1117 0 saveSV = hv_fetchs(tmphash, "longitude", 0);
1118 if (saveSV != NULL && SvOK(*saveSV)) {
1119 0 RETVAL->longitude = SvNV(*saveSV);
1120 0 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 0 0 0
1121 0  
1122 0 saveSV = hv_fetchs(tmphash, "ecliptic", 0);
1123 if (saveSV != NULL && SvOK(*saveSV)) {
1124 0 RETVAL->ecliptic = SvNV(*saveSV);
1125 0 }
1126 0  
1127 0 ▶ saveSV = hv_fetchs(tmphash, "obliquity", 0);
Branch: 1 branch
BranchTrueFalseTotal
saveSV = hv_fetchs(tmphash, "obliquity", 0); 0 0 0
1128 0 ▶ if (saveSV != NULL && SvOK(*saveSV)) {
Branch: 1 branch
BranchTrueFalseTotal
if (saveSV != NULL && SvOK(*saveSV)) { 0 0 0
1129 0 RETVAL->obliquity = SvNV(*saveSV);
1130 0 }
1131  
1132 0 }
1133 0 ▶ OUTPUT:
Branch: 1 branch
BranchTrueFalseTotal
OUTPUT: 0 0 0
1134 RETVAL
1135 0
1136 0 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
0 0 0
1137 0 void
1138 DESTROY(self)
1139 0 struct ln_nutation* self
1140 0 ▶ CODE:
Branch: 2 branches
BranchTrueFalseTotal
CODE: 0 0 0
CODE: 0 0 0
1141 0 safefree( (char*)self );
1142  
1143 double
1144 0 get_longitude( self )
1145 0 ▶ struct ln_nutation* self
Branch: 2 branches
BranchTrueFalseTotal
struct ln_nutation* self 0 0 0
struct ln_nutation* self 0 0 0
1146 0 CODE:
1147 RETVAL = self->longitude;
1148 OUTPUT:
1149 0 RETVAL
1150 0 ▶ 
Branch: 2 branches
BranchTrueFalseTotal
0 0 0
0 0 0
1151 0 void
1152 set_longitude( self, val )
1153 struct ln_nutation* self
1154 double val
1155 PPCODE:
1156 self->longitude = val;
1157  
1158  
1159 double
1160 get_ecliptic( self )
1161 struct ln_nutation* self
1162 CODE:
1163 0 RETVAL = self->ecliptic;
1164 OUTPUT:
1165 RETVAL
1166  
1167 void
1168 set_ecliptic( self, val )
1169 0 ▶ struct ln_nutation* self
Branch: 1 branch
BranchTrueFalseTotal
struct ln_nutation* self 0 0 0
1170 double val
1171 PPCODE:
1172 self->ecliptic = val;
1173  
1174  
1175 double
1176 get_obliquity( self )
1177 struct ln_nutation* self
1178 0 CODE:
1179 RETVAL = self->obliquity;
1180 OUTPUT:
1181 RETVAL
1182  
1183 void
1184 set_obliquity( self, val )
1185 0 ▶ struct ln_nutation* self
Branch: 1 branch
BranchTrueFalseTotal
struct ln_nutation* self 0 0 0
1186 double val
1187 PPCODE:
1188 self->obliquity = val;
1189  
1190  
1191  
1192 MODULE=Astro::Nova PACKAGE=Astro::Nova::ParOrbit
1193  
1194 0 struct ln_par_orbit*
1195 new(class, ...)
1196 SV* class
1197 PREINIT:
1198 char* CLASS;
1199 HV* tmphash;
1200 int iStack;
1201 0 ▶ SV** saveSV;
Branch: 1 branch
BranchTrueFalseTotal
SV** saveSV; 0 0 0
1202 CODE:
1203 if (sv_isobject(class)) {
1204 CLASS = (char*)sv_reftype(SvRV(class), 1);
1205 }
1206 else {
1207 if (!SvPOK(class))
1208 croak("Need an object or class name as first argument to the constructor of Astro::Nova::ParOrbit");
1209 CLASS = (char*)SvPV_nolen(class);
1210 0 }
1211 RETVAL = (struct ln_par_orbit*)safemalloc( sizeof(struct ln_par_orbit) );
1212 if (RETVAL == NULL) {
1213 warn("unable to malloc struct ln_par_orbit");
1214 XSRETURN_UNDEF;
1215 }
1216 RETVAL->i = 0.;
1217 RETVAL->JD = 0.;
1218 RETVAL->omega = 0.;
1219 RETVAL->w = 0.;
1220 RETVAL->q = 0.;
1221 if (items > 1) {
1222 if (!(items % 2)) {
1223 safefree(RETVAL);
1224 croak("Uneven number of arguments to constructor of Astro::Nova::ParOrbit");
1225 0 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 0 0 0
1226 0 tmphash = (HV*)sv_2mortal((SV*)newHV());
1227 for (iStack = 1; iStack < items; iStack += 2) {
1228 HE *he;
1229 0 ▶ he = hv_store_ent(tmphash, ST(iStack), newSVsv(ST(iStack+1)), 0);
Branch: 1 branch
BranchTrueFalseTotal
he = hv_store_ent(tmphash, ST(iStack), newSVsv(ST(iStack+1)), 0); 0 0 0
1230 0 if (!he)
1231 0 croak("Failed to write value to hash.");
1232 }
1233 0 saveSV = hv_fetchs(tmphash, "i", 0);
1234 0 ▶ if (saveSV != NULL && SvOK(*saveSV)) {
Branch: 1 branch
BranchTrueFalseTotal
if (saveSV != NULL && SvOK(*saveSV)) { 0 0 0
1235 0 RETVAL->i = SvNV(*saveSV);
1236 0 }
1237  
1238 0 saveSV = hv_fetchs(tmphash, "JD", 0);
1239 0 if (saveSV != NULL && SvOK(*saveSV)) {
1240 0 RETVAL->JD = SvNV(*saveSV);
1241 0 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 0 0 0
1242 0 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
0 0 0
1243 0 saveSV = hv_fetchs(tmphash, "omega", 0);
1244 0 if (saveSV != NULL && SvOK(*saveSV)) {
1245 RETVAL->omega = SvNV(*saveSV);
1246 0 }
1247 0 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
0 0 0
1248 saveSV = hv_fetchs(tmphash, "w", 0);
1249 0 if (saveSV != NULL && SvOK(*saveSV)) {
1250 0 ▶ RETVAL->w = SvNV(*saveSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVAL->w = SvNV(*saveSV); 0 0 0
1251 0 }
1252  
1253 0 saveSV = hv_fetchs(tmphash, "q", 0);
1254 0 ▶ if (saveSV != NULL && SvOK(*saveSV)) {
Branch: 2 branches
BranchTrueFalseTotal
if (saveSV != NULL && SvOK(*saveSV)) { 0 0 0
if (saveSV != NULL && SvOK(*saveSV)) { 0 0 0
1255 0 RETVAL->q = SvNV(*saveSV);
1256 }
1257  
1258 0 }
1259 0 ▶ OUTPUT:
Branch: 2 branches
BranchTrueFalseTotal
OUTPUT: 0 0 0
OUTPUT: 0 0 0
1260 0 RETVAL
1261
1262  
1263 0 void
1264 0 ▶DESTROY(self)
Branch: 2 branches
BranchTrueFalseTotal
DESTROY(self) 0 0 0
DESTROY(self) 0 0 0
1265 0 struct ln_par_orbit* self
1266 CODE:
1267 safefree( (char*)self );
1268  
1269 double
1270 get_i( self )
1271 struct ln_par_orbit* self
1272 CODE:
1273 RETVAL = self->i;
1274 OUTPUT:
1275 RETVAL
1276  
1277 1 void
1278 set_i( self, val )
1279 struct ln_par_orbit* self
1280 double val
1281 PPCODE:
1282 self->i = val;
1283 0 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
0 0 0
1284  
1285 double
1286 get_JD( self )
1287 struct ln_par_orbit* self
1288 CODE:
1289 RETVAL = self->JD;
1290 OUTPUT:
1291 RETVAL
1292 0  
1293 void
1294 set_JD( self, val )
1295 struct ln_par_orbit* self
1296 double val
1297 PPCODE:
1298 self->JD = val;
1299 0 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
0 0 0
1300  
1301 double
1302 get_omega( self )
1303 struct ln_par_orbit* self
1304 CODE:
1305 RETVAL = self->omega;
1306 OUTPUT:
1307 RETVAL
1308 0  
1309 void
1310 set_omega( self, val )
1311 struct ln_par_orbit* self
1312 double val
1313 PPCODE:
1314 self->omega = val;
1315 0 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
0 0 0
1316  
1317 double
1318 get_w( self )
1319 struct ln_par_orbit* self
1320 CODE:
1321 RETVAL = self->w;
1322 OUTPUT:
1323 RETVAL
1324 0  
1325 void
1326 set_w( self, val )
1327 struct ln_par_orbit* self
1328 double val
1329 PPCODE:
1330 self->w = val;
1331  
1332  
1333 double
1334 get_q( self )
1335 struct ln_par_orbit* self
1336 CODE:
1337 RETVAL = self->q;
1338 OUTPUT:
1339 0 ▶ RETVAL
Branch: 1 branch
BranchTrueFalseTotal
RETVAL 0 0 0
1340 0  
1341 void
1342 set_q( self, val )
1343 0 ▶ struct ln_par_orbit* self
Branch: 1 branch
BranchTrueFalseTotal
struct ln_par_orbit* self 0 0 0
1344 0 double val
1345 0 PPCODE:
1346 self->q = val;
1347 0  
1348 0 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
0 0 0
1349 0  
1350 0 MODULE=Astro::Nova PACKAGE=Astro::Nova::HHrzPosn
1351  
1352 0 struct lnh_hrz_posn*
1353 0 new(class, ...)
1354 0 SV* class
1355 0 ▶ PREINIT:
Branch: 1 branch
BranchTrueFalseTotal
PREINIT: 0 0 0
1356 0 ▶ char* CLASS;
Branch: 1 branch
BranchTrueFalseTotal
char* CLASS; 0 0 0
1357 0 HV* tmphash;
1358 0 int iStack;
1359 SV** saveSV;
1360 0 CODE:
1361 0 ▶ if (sv_isobject(class)) {
Branch: 1 branch
BranchTrueFalseTotal
if (sv_isobject(class)) { 0 0 0
1362 CLASS = (char*)sv_reftype(SvRV(class), 1);
1363 0 }
1364 0 ▶ else {
Branch: 1 branch
BranchTrueFalseTotal
else { 0 0 0
1365 0 if (!SvPOK(class))
1366 croak("Need an object or class name as first argument to the constructor of Astro::Nova::HHrzPosn");
1367 0 CLASS = (char*)SvPV_nolen(class);
1368 0 ▶ }
Branch: 2 branches
BranchTrueFalseTotal
} 0 0 0
} 0 0 0
1369 0 RETVAL = (struct lnh_hrz_posn*)safemalloc( sizeof(struct lnh_hrz_posn) );
1370 if (RETVAL == NULL) {
1371 warn("unable to malloc struct lnh_hrz_posn");
1372 0 XSRETURN_UNDEF;
1373 0 ▶ }
Branch: 2 branches
BranchTrueFalseTotal
} 0 0 0
} 0 0 0
1374 0 Zero(&(RETVAL->az), 1, struct ln_dms);
1375 Zero(&(RETVAL->alt), 1, struct ln_dms);
1376 if (items > 1) {
1377 0 if (!(items % 2)) {
1378 0 ▶ safefree(RETVAL);
Branch: 2 branches
BranchTrueFalseTotal
safefree(RETVAL); 0 0 0
safefree(RETVAL); 0 0 0
1379 0 croak("Uneven number of arguments to constructor of Astro::Nova::HHrzPosn");
1380 }
1381 tmphash = (HV*)sv_2mortal((SV*)newHV());
1382 for (iStack = 1; iStack < items; iStack += 2) {
1383 HE *he;
1384 he = hv_store_ent(tmphash, ST(iStack), newSVsv(ST(iStack+1)), 0);
1385 if (!he)
1386 croak("Failed to write value to hash.");
1387 }
1388 saveSV = hv_fetchs(tmphash, "az", 0);
1389 if (saveSV != NULL && SvOK(*saveSV)) {
1390 if ( sv_isobject(*saveSV) && (SvTYPE(SvRV(*saveSV)) == SVt_PVMG) ) {
1391 4 struct ln_dms* original = (struct ln_dms*)SvIV((SV*)SvRV( *saveSV ));
1392 Copy(original, &(RETVAL->az), 1, struct ln_dms);
1393 }
1394 else {
1395 warn("Invalid argument passed to constructor");
1396 XSRETURN_UNDEF;
1397 0 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 0 0 0
1398
1399 }
1400  
1401 saveSV = hv_fetchs(tmphash, "alt", 0);
1402 if (saveSV != NULL && SvOK(*saveSV)) {
1403 if ( sv_isobject(*saveSV) && (SvTYPE(SvRV(*saveSV)) == SVt_PVMG) ) {
1404 struct ln_dms* original = (struct ln_dms*)SvIV((SV*)SvRV( *saveSV ));
1405 Copy(original, &(RETVAL->alt), 1, struct ln_dms);
1406 0 }
1407 else {
1408 warn("Invalid argument passed to constructor");
1409 XSRETURN_UNDEF;
1410 }
1411
1412 }
1413 0 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
0 0 0
1414 }
1415 OUTPUT:
1416 RETVAL
1417
1418  
1419 void
1420 DESTROY(self)
1421 struct lnh_hrz_posn* self
1422 0 CODE:
1423 safefree( (char*)self );
1424  
1425 struct ln_dms*
1426 get_az( self )
1427 struct lnh_hrz_posn* self
1428 INIT:
1429 4 ▶ const char* CLASS = "Astro::Nova::DMS"; /* hack to work around perlobject.map */
Branch: 1 branch
BranchTrueFalseTotal
const char* CLASS = "Astro::Nova::DMS"; /* hack to work around perlobject.map */ 0 4 4
1430 CODE:
1431 RETVAL = (struct ln_dms*)safemalloc( sizeof( struct ln_dms ) );
1432 if( RETVAL == NULL ){
1433 warn("unable to malloc struct ln_dms");
1434 XSRETURN_UNDEF;
1435 }
1436 Copy(&(self->az), (RETVAL), 1, struct ln_dms);
1437 OUTPUT:
1438 1 RETVAL
1439  
1440 void
1441 set_az( self, val )
1442 struct lnh_hrz_posn* self
1443 struct ln_dms* val
1444 PPCODE:
1445 Copy(val, &(self->az), 1, struct ln_dms);
1446  
1447  
1448 struct ln_dms*
1449 get_alt( self )
1450 struct lnh_hrz_posn* self
1451 INIT:
1452 const char* CLASS = "Astro::Nova::DMS"; /* hack to work around perlobject.map */
1453 0 ▶ CODE:
Branch: 1 branch
BranchTrueFalseTotal
CODE: 0 0 0
1454 0 RETVAL = (struct ln_dms*)safemalloc( sizeof( struct ln_dms ) );
1455 if( RETVAL == NULL ){
1456 warn("unable to malloc struct ln_dms");
1457 0 ▶ XSRETURN_UNDEF;
Branch: 1 branch
BranchTrueFalseTotal
XSRETURN_UNDEF; 0 0 0
1458 0 }
1459 0 Copy(&(self->alt), (RETVAL), 1, struct ln_dms);
1460 OUTPUT:
1461 0 RETVAL
1462 0 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
0 0 0
1463 0 void
1464 0 set_alt( self, val )
1465 struct lnh_hrz_posn* self
1466 0 struct ln_dms* val
1467 0 PPCODE:
1468 0 ▶ Copy(val, &(self->alt), 1, struct ln_dms);
Branch: 1 branch
BranchTrueFalseTotal
Copy(val, &(self->alt), 1, struct ln_dms); 0 0 0
1469 0 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
0 0 0
1470 0  
1471 0  
1472 MODULE=Astro::Nova PACKAGE=Astro::Nova::ZoneDate
1473 0  
1474 0 ▶struct ln_zonedate*
Branch: 1 branch
BranchTrueFalseTotal
struct ln_zonedate* 0 0 0
1475 new(class, ...)
1476 0 SV* class
1477 0 ▶ PREINIT:
Branch: 1 branch
BranchTrueFalseTotal
PREINIT: 0 0 0
1478 0 char* CLASS;
1479 HV* tmphash;
1480 0 int iStack;
1481 0 ▶ SV** saveSV;
Branch: 2 branches
BranchTrueFalseTotal
SV** saveSV; 0 0 0
SV** saveSV; 0 0 0
1482 0 ▶ CODE:
Branch: 2 branches
BranchTrueFalseTotal
CODE: 0 0 0
CODE: 0 0 0
1483 0 if (sv_isobject(class)) {
1484 0 CLASS = (char*)sv_reftype(SvRV(class), 1);
1485 }
1486 else {
1487 0 if (!SvPOK(class))
1488 0 croak("Need an object or class name as first argument to the constructor of Astro::Nova::ZoneDate");
1489 CLASS = (char*)SvPV_nolen(class);
1490 }
1491 RETVAL = (struct ln_zonedate*)safemalloc( sizeof(struct ln_zonedate) );
1492 if (RETVAL == NULL) {
1493 0 warn("unable to malloc struct ln_zonedate");
1494 0 ▶ XSRETURN_UNDEF;
Branch: 2 branches
BranchTrueFalseTotal
XSRETURN_UNDEF; 0 0 0
XSRETURN_UNDEF; 0 0 0
1495 0 ▶ }
Branch: 2 branches
BranchTrueFalseTotal
} 0 0 0
} 0 0 0
1496 0 RETVAL->gmtoff = 0;
1497 0 RETVAL->years = 0;
1498 RETVAL->days = 0;
1499 RETVAL->months = 0;
1500 0 RETVAL->hours = 0;
1501 0 RETVAL->minutes = 0;
1502 RETVAL->seconds = 0.;
1503 if (items > 1) {
1504 if (!(items % 2)) {
1505 safefree(RETVAL);
1506 croak("Uneven number of arguments to constructor of Astro::Nova::ZoneDate");
1507 }
1508 tmphash = (HV*)sv_2mortal((SV*)newHV());
1509 for (iStack = 1; iStack < items; iStack += 2) {
1510 HE *he;
1511 he = hv_store_ent(tmphash, ST(iStack), newSVsv(ST(iStack+1)), 0);
1512 if (!he)
1513 croak("Failed to write value to hash.");
1514 }
1515 0 saveSV = hv_fetchs(tmphash, "gmtoff", 0);
1516 if (saveSV != NULL && SvOK(*saveSV)) {
1517 RETVAL->gmtoff = SvIV(*saveSV);
1518 }
1519  
1520 saveSV = hv_fetchs(tmphash, "years", 0);
1521 0 if (saveSV != NULL && SvOK(*saveSV)) {
1522 RETVAL->years = SvIV(*saveSV);
1523 0 }
1524 0 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
0 0 0
1525 0 saveSV = hv_fetchs(tmphash, "days", 0);
1526 0 if (saveSV != NULL && SvOK(*saveSV)) {
1527 RETVAL->days = SvIV(*saveSV);
1528 0 }
1529  
1530 saveSV = hv_fetchs(tmphash, "months", 0);
1531 if (saveSV != NULL && SvOK(*saveSV)) {
1532 RETVAL->months = SvIV(*saveSV);
1533 }
1534  
1535 saveSV = hv_fetchs(tmphash, "hours", 0);
1536 if (saveSV != NULL && SvOK(*saveSV)) {
1537 0 RETVAL->hours = SvIV(*saveSV);
1538 }
1539  
1540 saveSV = hv_fetchs(tmphash, "minutes", 0);
1541 if (saveSV != NULL && SvOK(*saveSV)) {
1542 RETVAL->minutes = SvIV(*saveSV);
1543 }
1544 0  
1545 saveSV = hv_fetchs(tmphash, "seconds", 0);
1546 0 if (saveSV != NULL && SvOK(*saveSV)) {
1547 0 ▶ RETVAL->seconds = SvNV(*saveSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVAL->seconds = SvNV(*saveSV); 0 0 0
1548 0 }
1549 0  
1550 }
1551 0 OUTPUT:
1552 RETVAL
1553
1554  
1555 void
1556 DESTROY(self)
1557 struct ln_zonedate* self
1558 CODE:
1559 safefree( (char*)self );
1560 0  
1561 long
1562 get_gmtoff( self )
1563 struct ln_zonedate* self
1564 CODE:
1565 RETVAL = self->gmtoff;
1566 OUTPUT:
1567 RETVAL
1568  
1569 void
1570 set_gmtoff( self, val )
1571 struct ln_zonedate* self
1572 long val
1573 PPCODE:
1574 self->gmtoff = val;
1575 0 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
0 0 0
1576 0  
1577 int
1578 get_years( self )
1579 0 ▶ struct ln_zonedate* self
Branch: 1 branch
BranchTrueFalseTotal
struct ln_zonedate* self 0 0 0
1580 0 CODE:
1581 0 RETVAL = self->years;
1582 OUTPUT:
1583 0 RETVAL
1584 0 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
0 0 0
1585 0 void
1586 0 set_years( self, val )
1587 struct ln_zonedate* self
1588 0 int val
1589 0 PPCODE:
1590 0 self->years = val;
1591 0 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
0 0 0
1592 0 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
0 0 0
1593 0 int
1594 0 get_days( self )
1595 struct ln_zonedate* self
1596 0 CODE:
1597 0 ▶ RETVAL = self->days;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = self->days; 0 0 0
1598 OUTPUT:
1599 0 RETVAL
1600 0 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
0 0 0
1601 0 void
1602 set_days( self, val )
1603 0 struct ln_zonedate* self
1604 0 ▶ int val
Branch: 2 branches
BranchTrueFalseTotal
int val 0 0 0
int val 0 0 0
1605 0 PPCODE:
1606 self->days = val;
1607  
1608 0  
1609 0 ▶int
Branch: 2 branches
BranchTrueFalseTotal
int 0 0 0
int 0 0 0
1610 0 get_months( self )
1611 struct ln_zonedate* self
1612 CODE:
1613 0 RETVAL = self->months;
1614 0 ▶ OUTPUT:
Branch: 2 branches
BranchTrueFalseTotal
OUTPUT: 0 0 0
OUTPUT: 0 0 0
1615 0 RETVAL
1616  
1617 void
1618 set_months( self, val )
1619 struct ln_zonedate* self
1620 int val
1621 PPCODE:
1622 self->months = val;
1623  
1624  
1625 int
1626 get_hours( self )
1627 0 struct ln_zonedate* self
1628 CODE:
1629 RETVAL = self->hours;
1630 OUTPUT:
1631 RETVAL
1632  
1633 0 ▶void
Branch: 1 branch
BranchTrueFalseTotal
void 0 0 0
1634 set_hours( self, val )
1635 struct ln_zonedate* self
1636 int val
1637 PPCODE:
1638 self->hours = val;
1639  
1640  
1641 int
1642 0 get_minutes( self )
1643 struct ln_zonedate* self
1644 CODE:
1645 RETVAL = self->minutes;
1646 OUTPUT:
1647 RETVAL
1648  
1649 0 ▶void
Branch: 1 branch
BranchTrueFalseTotal
void 0 0 0
1650 set_minutes( self, val )
1651 struct ln_zonedate* self
1652 int val
1653 PPCODE:
1654 self->minutes = val;
1655  
1656  
1657 double
1658 0 get_seconds( self )
1659 struct ln_zonedate* self
1660 CODE:
1661 RETVAL = self->seconds;
1662 OUTPUT:
1663 RETVAL
1664  
1665 0 ▶void
Branch: 1 branch
BranchTrueFalseTotal
void 0 0 0
1666 set_seconds( self, val )
1667 struct ln_zonedate* self
1668 double val
1669 PPCODE:
1670 self->seconds = val;
1671  
1672  
1673  
1674 0 MODULE=Astro::Nova PACKAGE=Astro::Nova::HEquPosn
1675  
1676 struct lnh_equ_posn*
1677 new(class, ...)
1678 SV* class
1679 PREINIT:
1680 char* CLASS;
1681 HV* tmphash;
1682 int iStack;
1683 SV** saveSV;
1684 CODE:
1685 if (sv_isobject(class)) {
1686 CLASS = (char*)sv_reftype(SvRV(class), 1);
1687 }
1688 else {
1689 1 ▶ if (!SvPOK(class))
Branch: 1 branch
BranchTrueFalseTotal
if (!SvPOK(class)) 0 1 1
1690 0 croak("Need an object or class name as first argument to the constructor of Astro::Nova::HEquPosn");
1691 CLASS = (char*)SvPV_nolen(class);
1692 }
1693 1 ▶ RETVAL = (struct lnh_equ_posn*)safemalloc( sizeof(struct lnh_equ_posn) );
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = (struct lnh_equ_posn*)safemalloc( sizeof(struct lnh_equ_posn) ); 0 1 1
1694 0 if (RETVAL == NULL) {
1695 1 warn("unable to malloc struct lnh_equ_posn");
1696 XSRETURN_UNDEF;
1697 1 }
1698 1 ▶ Zero(&(RETVAL->dec), 1, struct ln_dms);
Branch: 1 branch
BranchTrueFalseTotal
Zero(&(RETVAL->dec), 1, struct ln_dms); 0 1 1
1699 0 Zero(&(RETVAL->ra), 1, struct ln_hms);
1700 0 if (items > 1) {
1701 if (!(items % 2)) {
1702 1 safefree(RETVAL);
1703 1 croak("Uneven number of arguments to constructor of Astro::Nova::HEquPosn");
1704 1 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 0 1 1
1705 0 ▶ tmphash = (HV*)sv_2mortal((SV*)newHV());
Branch: 1 branch
BranchTrueFalseTotal
tmphash = (HV*)sv_2mortal((SV*)newHV()); 0 0 0
1706 0 for (iStack = 1; iStack < items; iStack += 2) {
1707 0 HE *he;
1708 he = hv_store_ent(tmphash, ST(iStack), newSVsv(ST(iStack+1)), 0);
1709 0 if (!he)
1710 0 ▶ croak("Failed to write value to hash.");
Branch: 1 branch
BranchTrueFalseTotal
croak("Failed to write value to hash."); 0 0 0
1711 }
1712 0 saveSV = hv_fetchs(tmphash, "dec", 0);
1713 0 ▶ if (saveSV != NULL && SvOK(*saveSV)) {
Branch: 1 branch
BranchTrueFalseTotal
if (saveSV != NULL && SvOK(*saveSV)) { 0 0 0
1714 0 if ( sv_isobject(*saveSV) && (SvTYPE(SvRV(*saveSV)) == SVt_PVMG) ) {
1715 struct ln_dms* original = (struct ln_dms*)SvIV((SV*)SvRV( *saveSV ));
1716 0 Copy(original, &(RETVAL->dec), 1, struct ln_dms);
1717 0 ▶ }
Branch: 2 branches
BranchTrueFalseTotal
} 0 0 0
} 0 0 0
1718 0 else {
1719 warn("Invalid argument passed to constructor");
1720 XSRETURN_UNDEF;
1721 0 }
1722 0 ▶
Branch: 2 branches
BranchTrueFalseTotal
0 0 0
0 0 0
1723 0 }
1724  
1725 saveSV = hv_fetchs(tmphash, "ra", 0);
1726 if (saveSV != NULL && SvOK(*saveSV)) {
1727 if ( sv_isobject(*saveSV) && (SvTYPE(SvRV(*saveSV)) == SVt_PVMG) ) {
1728 struct ln_hms* original = (struct ln_hms*)SvIV((SV*)SvRV( *saveSV ));
1729 Copy(original, &(RETVAL->ra), 1, struct ln_hms);
1730 }
1731 else {
1732 warn("Invalid argument passed to constructor");
1733 XSRETURN_UNDEF;
1734 }
1735 2
1736 }
1737  
1738 }
1739 OUTPUT:
1740 RETVAL
1741 0 ▶
Branch: 1 branch
BranchTrueFalseTotal
0 0 0
1742  
1743 void
1744 DESTROY(self)
1745 struct lnh_equ_posn* self
1746 CODE:
1747 safefree( (char*)self );
1748  
1749 struct ln_dms*
1750 0 get_dec( self )
1751 struct lnh_equ_posn* self
1752 INIT:
1753 const char* CLASS = "Astro::Nova::DMS"; /* hack to work around perlobject.map */
1754 CODE:
1755 RETVAL = (struct ln_dms*)safemalloc( sizeof( struct ln_dms ) );
1756 if( RETVAL == NULL ){
1757 0 ▶ warn("unable to malloc struct ln_dms");
Branch: 1 branch
BranchTrueFalseTotal
warn("unable to malloc struct ln_dms"); 0 0 0
1758 XSRETURN_UNDEF;
1759 }
1760 Copy(&(self->dec), (RETVAL), 1, struct ln_dms);
1761 OUTPUT:
1762 RETVAL
1763  
1764 void
1765 set_dec( self, val )
1766 0 struct lnh_equ_posn* self
1767 struct ln_dms* val
1768 PPCODE:
1769 Copy(val, &(self->dec), 1, struct ln_dms);
1770  
1771  
1772 struct ln_hms*
1773 get_ra( self )
1774 struct lnh_equ_posn* self
1775 INIT:
1776 const char* CLASS = "Astro::Nova::HMS"; /* hack to work around perlobject.map */
1777 CODE:
1778 RETVAL = (struct ln_hms*)safemalloc( sizeof( struct ln_hms ) );
1779 if( RETVAL == NULL ){
1780 warn("unable to malloc struct ln_hms");
1781 0 ▶ XSRETURN_UNDEF;
Branch: 1 branch
BranchTrueFalseTotal
XSRETURN_UNDEF; 0 0 0
1782 0 }
1783 Copy(&(self->ra), (RETVAL), 1, struct ln_hms);
1784 OUTPUT:
1785 0 ▶ RETVAL
Branch: 1 branch
BranchTrueFalseTotal
RETVAL 0 0 0
1786 0  
1787 0 void
1788 set_ra( self, val )
1789 0 struct lnh_equ_posn* self
1790 0 ▶ struct ln_hms* val
Branch: 1 branch
BranchTrueFalseTotal
struct ln_hms* val 0 0 0
1791 0 PPCODE:
1792 0 Copy(val, &(self->ra), 1, struct ln_hms);
1793  
1794 0  
1795 0  
1796 0 MODULE=Astro::Nova PACKAGE=Astro::Nova::HrzPosn
1797 0 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
0 0 0
1798 0 ▶struct ln_hrz_posn*
Branch: 1 branch
BranchTrueFalseTotal
struct ln_hrz_posn* 0 0 0
1799 0 new(class, ...)
1800 0 SV* class
1801 PREINIT:
1802 0 char* CLASS;
1803 0 ▶ HV* tmphash;
Branch: 1 branch
BranchTrueFalseTotal
HV* tmphash; 0 0 0
1804 int iStack;
1805 0 SV** saveSV;
1806 0 ▶ CODE:
Branch: 1 branch
BranchTrueFalseTotal
CODE: 0 0 0
1807 0 if (sv_isobject(class)) {
1808 CLASS = (char*)sv_reftype(SvRV(class), 1);
1809 0 }
1810 0 ▶ else {
Branch: 2 branches
BranchTrueFalseTotal
else { 0 0 0
else { 0 0 0
1811 0 if (!SvPOK(class))
1812 croak("Need an object or class name as first argument to the constructor of Astro::Nova::HrzPosn");
1813 CLASS = (char*)SvPV_nolen(class);
1814 0 }
1815 0 ▶ RETVAL = (struct ln_hrz_posn*)safemalloc( sizeof(struct ln_hrz_posn) );
Branch: 2 branches
BranchTrueFalseTotal
RETVAL = (struct ln_hrz_posn*)safemalloc( sizeof(struct ln_hrz_posn) ); 0 0 0
RETVAL = (struct ln_hrz_posn*)safemalloc( sizeof(struct ln_hrz_posn) ); 0 0 0
1816 0 if (RETVAL == NULL) {
1817 warn("unable to malloc struct ln_hrz_posn");
1818 XSRETURN_UNDEF;
1819 0 }
1820 0 ▶ RETVAL->az = 0.;
Branch: 2 branches
BranchTrueFalseTotal
RETVAL->az = 0.; 0 0 0
RETVAL->az = 0.; 0 0 0
1821 0 RETVAL->alt = 0.;
1822 if (items > 1) {
1823 if (!(items % 2)) {
1824 safefree(RETVAL);
1825 croak("Uneven number of arguments to constructor of Astro::Nova::HrzPosn");
1826 }
1827 tmphash = (HV*)sv_2mortal((SV*)newHV());
1828 for (iStack = 1; iStack < items; iStack += 2) {
1829 HE *he;
1830 he = hv_store_ent(tmphash, ST(iStack), newSVsv(ST(iStack+1)), 0);
1831 if (!he)
1832 croak("Failed to write value to hash.");
1833 0 }
1834 saveSV = hv_fetchs(tmphash, "az", 0);
1835 if (saveSV != NULL && SvOK(*saveSV)) {
1836 RETVAL->az = SvNV(*saveSV);
1837 }
1838  
1839 0 ▶ saveSV = hv_fetchs(tmphash, "alt", 0);
Branch: 1 branch
BranchTrueFalseTotal
saveSV = hv_fetchs(tmphash, "alt", 0); 0 0 0
1840 if (saveSV != NULL && SvOK(*saveSV)) {
1841 RETVAL->alt = SvNV(*saveSV);
1842 }
1843  
1844 }
1845 OUTPUT:
1846 RETVAL
1847
1848 0  
1849 void
1850 DESTROY(self)
1851 struct ln_hrz_posn* self
1852 CODE:
1853 safefree( (char*)self );
1854  
1855 0 ▶double
Branch: 1 branch
BranchTrueFalseTotal
double 0 0 0
1856 get_az( self )
1857 struct ln_hrz_posn* self
1858 CODE:
1859 RETVAL = self->az;
1860 OUTPUT:
1861 RETVAL
1862  
1863 void
1864 0 set_az( self, val )
1865 struct ln_hrz_posn* self
1866 double val
1867 PPCODE:
1868 self->az = val;
1869  
1870  
1871 0 ▶double
Branch: 1 branch
BranchTrueFalseTotal
double 0 0 0
1872 get_alt( self )
1873 struct ln_hrz_posn* self
1874 CODE:
1875 RETVAL = self->alt;
1876 OUTPUT:
1877 RETVAL
1878  
1879 void
1880 0 set_alt( self, val )
1881 struct ln_hrz_posn* self
1882 double val
1883 PPCODE:
1884 self->alt = val;
1885  
1886  
1887  
1888 MODULE=Astro::Nova PACKAGE=Astro::Nova::GalPosn
1889  
1890 struct ln_gal_posn*
1891 new(class, ...)
1892 SV* class
1893 PREINIT:
1894 char* CLASS;
1895 1 ▶ HV* tmphash;
Branch: 1 branch
BranchTrueFalseTotal
HV* tmphash; 0 1 1
1896 0 int iStack;
1897 SV** saveSV;
1898 CODE:
1899 1 ▶ if (sv_isobject(class)) {
Branch: 1 branch
BranchTrueFalseTotal
if (sv_isobject(class)) { 0 1 1
1900 0 CLASS = (char*)sv_reftype(SvRV(class), 1);
1901 1 }
1902 else {
1903 1 if (!SvPOK(class))
1904 1 ▶ croak("Need an object or class name as first argument to the constructor of Astro::Nova::GalPosn");
Branch: 1 branch
BranchTrueFalseTotal
croak("Need an object or class name as first argument to the constructor of Astro::Nova::GalPosn"); 0 1 1
1905 0 CLASS = (char*)SvPV_nolen(class);
1906 0 }
1907 RETVAL = (struct ln_gal_posn*)safemalloc( sizeof(struct ln_gal_posn) );
1908 1 if (RETVAL == NULL) {
1909 1 warn("unable to malloc struct ln_gal_posn");
1910 1 XSRETURN_UNDEF;
1911 1 }
1912 1 RETVAL->b = 0.;
1913 1 RETVAL->l = 0.;
1914 1 if (items > 1) {
1915 1 ▶ if (!(items % 2)) {
Branch: 1 branch
BranchTrueFalseTotal
if (!(items % 2)) { 0 1 1
1916 0 ▶ safefree(RETVAL);
Branch: 1 branch
BranchTrueFalseTotal
safefree(RETVAL); 0 0 0
1917 0 croak("Uneven number of arguments to constructor of Astro::Nova::GalPosn");
1918 0 }
1919 tmphash = (HV*)sv_2mortal((SV*)newHV());
1920 0 for (iStack = 1; iStack < items; iStack += 2) {
1921 0 ▶ HE *he;
Branch: 1 branch
BranchTrueFalseTotal
HE *he; 0 0 0
1922 he = hv_store_ent(tmphash, ST(iStack), newSVsv(ST(iStack+1)), 0);
1923 0 if (!he)
1924 0 ▶ croak("Failed to write value to hash.");
Branch: 1 branch
BranchTrueFalseTotal
croak("Failed to write value to hash."); 0 0 0
1925 0 }
1926 saveSV = hv_fetchs(tmphash, "b", 0);
1927 0 if (saveSV != NULL && SvOK(*saveSV)) {
1928 0 ▶ RETVAL->b = SvNV(*saveSV);
Branch: 2 branches
BranchTrueFalseTotal
RETVAL->b = SvNV(*saveSV); 0 0 0
RETVAL->b = SvNV(*saveSV); 0 0 0
1929 0 }
1930  
1931 saveSV = hv_fetchs(tmphash, "l", 0);
1932 0 if (saveSV != NULL && SvOK(*saveSV)) {
1933 0 ▶ RETVAL->l = SvNV(*saveSV);
Branch: 2 branches
BranchTrueFalseTotal
RETVAL->l = SvNV(*saveSV); 0 0 0
RETVAL->l = SvNV(*saveSV); 0 0 0
1934 0 }
1935  
1936 }
1937 0 OUTPUT:
1938 0 ▶ RETVAL
Branch: 2 branches
BranchTrueFalseTotal
RETVAL 0 0 0
RETVAL 0 0 0
1939 0
1940  
1941 void
1942 0 DESTROY(self)
1943 0 ▶ struct ln_gal_posn* self
Branch: 2 branches
BranchTrueFalseTotal
struct ln_gal_posn* self 0 0 0
struct ln_gal_posn* self 0 0 0
1944 0 CODE:
1945 safefree( (char*)self );
1946  
1947 0 double
1948 0 ▶get_b( self )
Branch: 2 branches
BranchTrueFalseTotal
get_b( self ) 0 0 0
get_b( self ) 0 0 0
1949 0 struct ln_gal_posn* self
1950 CODE:
1951 RETVAL = self->b;
1952 0 OUTPUT:
1953 0 ▶ RETVAL
Branch: 2 branches
BranchTrueFalseTotal
RETVAL 0 0 0
RETVAL 0 0 0
1954 0  
1955 void
1956 set_b( self, val )
1957 0 struct ln_gal_posn* self
1958 0 ▶ double val
Branch: 2 branches
BranchTrueFalseTotal
double val 0 0 0
double val 0 0 0
1959 0 PPCODE:
1960 self->b = val;
1961  
1962  
1963 double
1964 get_l( self )
1965 struct ln_gal_posn* self
1966 CODE:
1967 RETVAL = self->l;
1968 OUTPUT:
1969 RETVAL
1970  
1971 1 void
1972 set_l( self, val )
1973 struct ln_gal_posn* self
1974 double val
1975 PPCODE:
1976 self->l = val;
1977 7 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
7 0 7
1978  
1979  
1980 MODULE=Astro::Nova PACKAGE=Astro::Nova::RectPosn
1981  
1982 struct ln_rect_posn*
1983 new(class, ...)
1984 SV* class
1985 PREINIT:
1986 0 char* CLASS;
1987 HV* tmphash;
1988 int iStack;
1989 SV** saveSV;
1990 CODE:
1991 if (sv_isobject(class)) {
1992 CLASS = (char*)sv_reftype(SvRV(class), 1);
1993 7 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 7 0 7
1994 else {
1995 if (!SvPOK(class))
1996 croak("Need an object or class name as first argument to the constructor of Astro::Nova::RectPosn");
1997 CLASS = (char*)SvPV_nolen(class);
1998 }
1999 RETVAL = (struct ln_rect_posn*)safemalloc( sizeof(struct ln_rect_posn) );
2000 if (RETVAL == NULL) {
2001 warn("unable to malloc struct ln_rect_posn");
2002 1 XSRETURN_UNDEF;
2003 }
2004 RETVAL->X = 0.;
2005 RETVAL->Z = 0.;
2006 RETVAL->Y = 0.;
2007 if (items > 1) {
2008 if (!(items % 2)) {
2009 7 ▶ safefree(RETVAL);
Branch: 1 branch
BranchTrueFalseTotal
safefree(RETVAL); 7 0 7
2010 croak("Uneven number of arguments to constructor of Astro::Nova::RectPosn");
2011 }
2012 tmphash = (HV*)sv_2mortal((SV*)newHV());
2013 for (iStack = 1; iStack < items; iStack += 2) {
2014 HE *he;
2015 he = hv_store_ent(tmphash, ST(iStack), newSVsv(ST(iStack+1)), 0);
2016 if (!he)
2017 croak("Failed to write value to hash.");
2018 1 }
2019 saveSV = hv_fetchs(tmphash, "X", 0);
2020 if (saveSV != NULL && SvOK(*saveSV)) {
2021 RETVAL->X = SvNV(*saveSV);
2022 }
2023  
2024 saveSV = hv_fetchs(tmphash, "Z", 0);
2025 7 ▶ if (saveSV != NULL && SvOK(*saveSV)) {
Branch: 1 branch
BranchTrueFalseTotal
if (saveSV != NULL && SvOK(*saveSV)) { 0 7 7
2026 RETVAL->Z = SvNV(*saveSV);
2027 }
2028  
2029 saveSV = hv_fetchs(tmphash, "Y", 0);
2030 if (saveSV != NULL && SvOK(*saveSV)) {
2031 RETVAL->Y = SvNV(*saveSV);
2032 }
2033  
2034 0 }
2035 OUTPUT:
2036 RETVAL
2037
2038  
2039 void
2040 DESTROY(self)
2041 10 ▶ struct ln_rect_posn* self
Branch: 1 branch
BranchTrueFalseTotal
struct ln_rect_posn* self 6 4 10
2042 CODE:
2043 safefree( (char*)self );
2044  
2045 double
2046 get_X( self )
2047 struct ln_rect_posn* self
2048 CODE:
2049 RETVAL = self->X;
2050 1 OUTPUT:
2051 RETVAL
2052  
2053 void
2054 set_X( self, val )
2055 struct ln_rect_posn* self
2056 double val
2057 7 ▶ PPCODE:
Branch: 1 branch
BranchTrueFalseTotal
PPCODE: 7 0 7
2058 self->X = val;
2059  
2060  
2061 double
2062 get_Z( self )
2063 struct ln_rect_posn* self
2064 CODE:
2065 RETVAL = self->Z;
2066 0 OUTPUT:
2067 RETVAL
2068  
2069 void
2070 set_Z( self, val )
2071 struct ln_rect_posn* self
2072 double val
2073 7 ▶ PPCODE:
Branch: 1 branch
BranchTrueFalseTotal
PPCODE: 0 7 7
2074 self->Z = val;
2075  
2076  
2077 double
2078 get_Y( self )
2079 struct ln_rect_posn* self
2080 CODE:
2081 RETVAL = self->Y;
2082 0 OUTPUT:
2083 RETVAL
2084  
2085 void
2086 set_Y( self, val )
2087 struct ln_rect_posn* self
2088 double val
2089 PPCODE:
2090 self->Y = val;
2091  
2092  
2093  
2094 MODULE=Astro::Nova PACKAGE=Astro::Nova::EquPosn
2095  
2096 struct ln_equ_posn*
2097 0 ▶new(class, ...)
Branch: 1 branch
BranchTrueFalseTotal
new(class, ...) 0 0 0
2098 0 SV* class
2099 PREINIT:
2100 char* CLASS;
2101 0 ▶ HV* tmphash;
Branch: 1 branch
BranchTrueFalseTotal
HV* tmphash; 0 0 0
2102 0 int iStack;
2103 0 SV** saveSV;
2104 CODE:
2105 0 if (sv_isobject(class)) {
2106 0 ▶ CLASS = (char*)sv_reftype(SvRV(class), 1);
Branch: 1 branch
BranchTrueFalseTotal
CLASS = (char*)sv_reftype(SvRV(class), 1); 0 0 0
2107 0 }
2108 0 else {
2109 if (!SvPOK(class))
2110 0 croak("Need an object or class name as first argument to the constructor of Astro::Nova::EquPosn");
2111 0 CLASS = (char*)SvPV_nolen(class);
2112 0 }
2113 0 RETVAL = (struct ln_equ_posn*)safemalloc( sizeof(struct ln_equ_posn) );
2114 0 if (RETVAL == NULL) {
2115 0 ▶ warn("unable to malloc struct ln_equ_posn");
Branch: 1 branch
BranchTrueFalseTotal
warn("unable to malloc struct ln_equ_posn"); 0 0 0
2116 0 ▶ XSRETURN_UNDEF;
Branch: 1 branch
BranchTrueFalseTotal
XSRETURN_UNDEF; 0 0 0
2117 0 }
2118 0 RETVAL->ra = 0.;
2119 RETVAL->dec = 0.;
2120 0 if (items > 1) {
2121 0 ▶ if (!(items % 2)) {
Branch: 1 branch
BranchTrueFalseTotal
if (!(items % 2)) { 0 0 0
2122 safefree(RETVAL);
2123 0 croak("Uneven number of arguments to constructor of Astro::Nova::EquPosn");
2124 0 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 0 0 0
2125 0 tmphash = (HV*)sv_2mortal((SV*)newHV());
2126 for (iStack = 1; iStack < items; iStack += 2) {
2127 0 HE *he;
2128 0 ▶ he = hv_store_ent(tmphash, ST(iStack), newSVsv(ST(iStack+1)), 0);
Branch: 2 branches
BranchTrueFalseTotal
he = hv_store_ent(tmphash, ST(iStack), newSVsv(ST(iStack+1)), 0); 0 0 0
he = hv_store_ent(tmphash, ST(iStack), newSVsv(ST(iStack+1)), 0); 0 0 0
2129 0 if (!he)
2130 croak("Failed to write value to hash.");
2131 }
2132 0 saveSV = hv_fetchs(tmphash, "ra", 0);
2133 0 ▶ if (saveSV != NULL && SvOK(*saveSV)) {
Branch: 2 branches
BranchTrueFalseTotal
if (saveSV != NULL && SvOK(*saveSV)) { 0 0 0
if (saveSV != NULL && SvOK(*saveSV)) { 0 0 0
2134 0 RETVAL->ra = SvNV(*saveSV);
2135 }
2136  
2137 0 saveSV = hv_fetchs(tmphash, "dec", 0);
2138 0 ▶ if (saveSV != NULL && SvOK(*saveSV)) {
Branch: 2 branches
BranchTrueFalseTotal
if (saveSV != NULL && SvOK(*saveSV)) { 0 0 0
if (saveSV != NULL && SvOK(*saveSV)) { 0 0 0
2139 0 RETVAL->dec = SvNV(*saveSV);
2140 }
2141  
2142 0 }
2143 0 ▶ OUTPUT:
Branch: 2 branches
BranchTrueFalseTotal
OUTPUT: 0 0 0
OUTPUT: 0 0 0
2144 0 RETVAL
2145
2146  
2147 0 void
2148 0 ▶DESTROY(self)
Branch: 2 branches
BranchTrueFalseTotal
DESTROY(self) 0 0 0
DESTROY(self) 0 0 0
2149 0 struct ln_equ_posn* self
2150 CODE:
2151 safefree( (char*)self );
2152  
2153 double
2154 get_ra( self )
2155 struct ln_equ_posn* self
2156 CODE:
2157 RETVAL = self->ra;
2158 OUTPUT:
2159 RETVAL
2160  
2161 0 void
2162 set_ra( self, val )
2163 struct ln_equ_posn* self
2164 double val
2165 PPCODE:
2166 self->ra = val;
2167 0 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
0 0 0
2168  
2169 double
2170 get_dec( self )
2171 struct ln_equ_posn* self
2172 CODE:
2173 RETVAL = self->dec;
2174 OUTPUT:
2175 RETVAL
2176 0  
2177 void
2178 set_dec( self, val )
2179 struct ln_equ_posn* self
2180 double val
2181 PPCODE:
2182 self->dec = val;
2183 0 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
0 0 0
2184  
2185  
2186 MODULE=Astro::Nova PACKAGE=Astro::Nova::Date
2187  
2188 struct ln_date*
2189 new(class, ...)
2190 SV* class
2191 PREINIT:
2192 0 char* CLASS;
2193 HV* tmphash;
2194 int iStack;
2195 SV** saveSV;
2196 CODE:
2197 if (sv_isobject(class)) {
2198 CLASS = (char*)sv_reftype(SvRV(class), 1);
2199 0 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 0 0 0
2200 else {
2201 if (!SvPOK(class))
2202 croak("Need an object or class name as first argument to the constructor of Astro::Nova::Date");
2203 CLASS = (char*)SvPV_nolen(class);
2204 }
2205 RETVAL = (struct ln_date*)safemalloc( sizeof(struct ln_date) );
2206 if (RETVAL == NULL) {
2207 warn("unable to malloc struct ln_date");
2208 0 XSRETURN_UNDEF;
2209 }
2210 RETVAL->months = 0;
2211 RETVAL->days = 0;
2212 RETVAL->years = 0;
2213 RETVAL->minutes = 0;
2214 RETVAL->hours = 0;
2215 0 ▶ RETVAL->seconds = 0.;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL->seconds = 0.; 0 0 0
2216 if (items > 1) {
2217 if (!(items % 2)) {
2218 safefree(RETVAL);
2219 croak("Uneven number of arguments to constructor of Astro::Nova::Date");
2220 }
2221 tmphash = (HV*)sv_2mortal((SV*)newHV());
2222 for (iStack = 1; iStack < items; iStack += 2) {
2223 HE *he;
2224 0 he = hv_store_ent(tmphash, ST(iStack), newSVsv(ST(iStack+1)), 0);
2225 if (!he)
2226 croak("Failed to write value to hash.");
2227 }
2228 saveSV = hv_fetchs(tmphash, "months", 0);
2229 if (saveSV != NULL && SvOK(*saveSV)) {
2230 RETVAL->months = SvIV(*saveSV);
2231 0 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 0 0 0
2232  
2233 saveSV = hv_fetchs(tmphash, "days", 0);
2234 if (saveSV != NULL && SvOK(*saveSV)) {
2235 RETVAL->days = SvIV(*saveSV);
2236 }
2237  
2238 saveSV = hv_fetchs(tmphash, "years", 0);
2239 if (saveSV != NULL && SvOK(*saveSV)) {
2240 0 RETVAL->years = SvIV(*saveSV);
2241 }
2242  
2243 saveSV = hv_fetchs(tmphash, "minutes", 0);
2244 if (saveSV != NULL && SvOK(*saveSV)) {
2245 RETVAL->minutes = SvIV(*saveSV);
2246 }
2247  
2248 saveSV = hv_fetchs(tmphash, "hours", 0);
2249 if (saveSV != NULL && SvOK(*saveSV)) {
2250 RETVAL->hours = SvIV(*saveSV);
2251 }
2252  
2253 saveSV = hv_fetchs(tmphash, "seconds", 0);
2254 if (saveSV != NULL && SvOK(*saveSV)) {
2255 1 ▶ RETVAL->seconds = SvNV(*saveSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVAL->seconds = SvNV(*saveSV); 0 1 1
2256 0 }
2257  
2258 }
2259 1 ▶ OUTPUT:
Branch: 1 branch
BranchTrueFalseTotal
OUTPUT: 0 1 1
2260 0 RETVAL
2261 1
2262  
2263 1 void
2264 1 ▶DESTROY(self)
Branch: 1 branch
BranchTrueFalseTotal
DESTROY(self) 0 1 1
2265 0 struct ln_date* self
2266 0 CODE:
2267 safefree( (char*)self );
2268 1  
2269 1 int
2270 1 ▶get_months( self )
Branch: 1 branch
BranchTrueFalseTotal
get_months( self ) 0 1 1
2271 0 ▶ struct ln_date* self
Branch: 1 branch
BranchTrueFalseTotal
struct ln_date* self 0 0 0
2272 0 CODE:
2273 0 RETVAL = self->months;
2274 OUTPUT:
2275 0 RETVAL
2276 0 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
0 0 0
2277 void
2278 0 set_months( self, val )
2279 0 ▶ struct ln_date* self
Branch: 1 branch
BranchTrueFalseTotal
struct ln_date* self 0 0 0
2280 0 int val
2281 PPCODE:
2282 0 self->months = val;
2283 0 ▶ 
Branch: 2 branches
BranchTrueFalseTotal
0 0 0
0 0 0
2284 0 ▶ 
Branch: 2 branches
BranchTrueFalseTotal
0 0 0
0 0 0
2285 0 int
2286 0 get_days( self )
2287 struct ln_date* self
2288 CODE:
2289 0 RETVAL = self->days;
2290 0 OUTPUT:
2291 RETVAL
2292  
2293 void
2294 set_days( self, val )
2295 0 struct ln_date* self
2296 0 ▶ int val
Branch: 2 branches
BranchTrueFalseTotal
int val 0 0 0
int val 0 0 0
2297 0 ▶ PPCODE:
Branch: 2 branches
BranchTrueFalseTotal
PPCODE: 0 0 0
PPCODE: 0 0 0
2298 0 self->days = val;
2299 0  
2300  
2301 int
2302 0 get_years( self )
2303 0 struct ln_date* self
2304 CODE:
2305 RETVAL = self->years;
2306 OUTPUT:
2307 RETVAL
2308  
2309 void
2310 set_years( self, val )
2311 struct ln_date* self
2312 int val
2313 PPCODE:
2314 self->years = val;
2315  
2316  
2317 1 int
2318 get_minutes( self )
2319 struct ln_date* self
2320 CODE:
2321 RETVAL = self->minutes;
2322 OUTPUT:
2323 3 RETVAL
2324  
2325 3 void
2326 3 ▶set_minutes( self, val )
Branch: 1 branch
BranchTrueFalseTotal
set_minutes( self, val ) 0 3 3
2327 0 struct ln_date* self
2328 0 int val
2329 PPCODE:
2330 3 self->minutes = val;
2331  
2332  
2333 int
2334 get_hours( self )
2335 struct ln_date* self
2336 CODE:
2337 RETVAL = self->hours;
2338 OUTPUT:
2339 1 RETVAL
2340  
2341 void
2342 set_hours( self, val )
2343 struct ln_date* self
2344 int val
2345 PPCODE:
2346 0 self->hours = val;
2347  
2348 0  
2349 0 ▶double
Branch: 1 branch
BranchTrueFalseTotal
double 0 0 0
2350 0 get_seconds( self )
2351 0 struct ln_date* self
2352 CODE:
2353 0 RETVAL = self->seconds;
2354 OUTPUT:
2355 RETVAL
2356  
2357 void
2358 set_seconds( self, val )
2359 struct ln_date* self
2360 double val
2361 PPCODE:
2362 0 self->seconds = val;
2363  
2364  
« lib/Astro/Nova.xs ↑ Summary XS/EllipticMotion.xs »