24 static void add_d_mask_rule(
d_Mask *d_mask,
double a,
double b,
int inf);
25 static void parse_d_mask_rule(
char *vallist,
d_Mask *d_mask,
char *where);
26 static void init_d_mask_rules(
d_Mask *d_mask);
28 void init_d_mask_rules(
d_Mask *d_mask)
33 void add_d_mask_rule(
d_Mask *d_mask,
double a,
double b,
int inf)
38 I->
low = a <=
b ? a :
b;
51 for (I = mask->
list; I; I = I->
next) {
69 void parse_d_mask_rule(
char *vallist,
d_Mask *d_mask,
char *where)
75 if (sscanf(vallist,
"%lf-%lf", &a, &
b) == 2) {
77 add_d_mask_rule(d_mask, a,
b, 0);
80 else if (sscanf(vallist,
"%[^ -\t]-%lf", junk, &a) == 2)
81 add_d_mask_rule(d_mask, a, a, -1);
84 else if (sscanf(vallist,
"%lf-%[^ \t]", &a, junk) == 2)
85 add_d_mask_rule(d_mask, a, a, 1);
88 else if (sscanf(vallist,
"%lf", &a) == 1)
89 add_d_mask_rule(d_mask, a, a, 0);
94 G_warning(
_(
"%s: illegal value spec"), vallist);
108 init_d_mask_rules(*d_mask);
112 for (; *vallist; vallist++) {
113 if (*vallist[0] ==
'/') {
114 fd = fopen(*vallist,
"r");
120 while (fgets(buf,
sizeof buf, fd)) {
121 if (sscanf(buf,
"%1s",
x) != 1 || *
x ==
'#')
123 parse_d_mask_rule(buf, *d_mask, *vallist);
128 parse_d_mask_rule(*vallist, *d_mask, (
char *)
NULL);
void G_warning(const char *,...) __attribute__((format(printf
void G_usage(void)
Command line help/usage message.
void G_message(const char *,...) __attribute__((format(printf
void Rast3d_parse_vallist(char **vallist, d_Mask **d_mask)
int Rast3d_mask_d_select(DCELL *x, d_Mask *mask)
DCELL Rast3d_mask_match_d_interval(DCELL x, d_Interval *I)
struct _d_interval * next