168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
|
/*
** Uses P(zKey) to fetch a CGI environment variable. If that var is
** NULL or starts with '0' or 'f' then this function returns false,
** else it returns true.
*/
int ajax_p_bool(char const *zKey){
const * zVal = P(zKey);
return (!zVal || '0'==*zVal || 'f'==*zVal) ? 0 : 1;
}
/*
** Helper for /ajax routes. Clears the CGI content buffer, sets an
** HTTP error status code, and queues up a JSON response in the form
** of an object:
|
|
|
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
|
/*
** Uses P(zKey) to fetch a CGI environment variable. If that var is
** NULL or starts with '0' or 'f' then this function returns false,
** else it returns true.
*/
int ajax_p_bool(char const *zKey){
const char * zVal = P(zKey);
return (!zVal || '0'==*zVal || 'f'==*zVal) ? 0 : 1;
}
/*
** Helper for /ajax routes. Clears the CGI content buffer, sets an
** HTTP error status code, and queues up a JSON response in the form
** of an object:
|