10 |
|
#include <stdio.h> |
11 |
|
#include <stdlib.h> |
12 |
|
#include <math.h> |
13 |
+ |
#include "paths.h" |
14 |
|
#include "bsdfrep.h" |
15 |
|
|
16 |
|
typedef struct { |
22 |
|
|
23 |
|
typedef double eval_f(const FVECT vin, const FVECT vout, const void *p); |
24 |
|
|
24 |
– |
char *progname; /* needed by bsdfrep.c */ |
25 |
– |
|
25 |
|
/* Comparison function to put larger peaks first */ |
26 |
|
int |
27 |
|
cmpFWHM(const void *p0, const void *p1) |
126 |
|
int ndirs; |
127 |
|
FWHM *peaka; |
128 |
|
int i; |
129 |
< |
|
130 |
< |
progname = argv[0]; |
129 |
> |
/* set global progname */ |
130 |
> |
fixargv0(argv[0]); |
131 |
|
if (argc < 2) |
132 |
|
goto userr; |
133 |
|
|
193 |
|
printf("\t%.1f", 180./M_PI * getFWHM(peaka[i].rbs->invec, |
194 |
|
vout, sqrt(psa/M_PI), |
195 |
|
bsdf_eval, sd)); |
196 |
+ |
SDfreeCache(sd); |
197 |
|
} |
198 |
|
fputc('\n', stdout); |
199 |
|
} |
200 |
+ |
/* we're exiting, anyway... |
201 |
+ |
SDfreeCache(NULL); |
202 |
+ |
clear_bsdf_rep(); |
203 |
+ |
*/ |
204 |
|
return(0); |
205 |
|
userr: |
206 |
|
fprintf(stderr, "Usage: %s bsdf.sir [bsdfrep1.xml ..]\n", progname); |