set flags and initialized constants from commandStr
calls qh_exit() if qh->NOerrexit
returns:
sets qh.qhull_command to command if needed
notes:
ignores first word (e.g., "qhull d")
use qh_strtol/strtod since strtol/strtod may or may not skip trailing spaces
see:
qh_initthresholds() continues processing of 'Pdn' and 'PDn'
'prompt' in unix_r.c for documentation
design:
for each space-delimited option group
if top-level option
check syntax
append appropriate option to option string
set appropriate global variable or append printFormat to print options
else
for each sub-option
check syntax
append appropriate option to option string
set appropriate global variable or append printFormat to print options
*/
voidqh_initflags(qhT*qh,char*command){
intk,i,lastproject;
char*s=command,*t,*prev_s,*start,key;
boolTisgeom=False,wasproject;
realTr;
if(qh->NOerrexit){
qh_fprintf(qh,qh->ferr,6245,"qhull initflags error: qh.NOerrexit was not cleared before calling qh_initflags(). It should be cleared after setjmp(). Exit qhull.");
qh_fprintf(qh,qh->ferr,7039,"qhull warning: real epsilon, %2.2g, is probably too large for joggle('QJn')\nRecompile with double precision reals(see user.h).\n",
REALepsilon);
#ifdef qh_NOmerge
if(qh->MERGING){
qh_fprintf(qh,qh->ferr,6045,"qhull input error: merging not installed(qh_NOmerge + 'Qx', 'Cn' or 'An')\n");
qh_fprintf(qh,qh->ferr,7041,"qhull input warning: 'QJ' (joggle) will usually prevent coincident input sites for options 'Fc' and 'FP'\n");
}
if(printmath&&(qh->hull_dim>3||qh->VORONOI)){
qh_fprintf(qh,qh->ferr,6056,"qhull input error: Mathematica and Maple output is only available for 2-d and 3-d convex hulls and 2-d Delaunay triangulations\n");
qh_errexit(qh,qh_ERRinput,NULL,NULL);
}
if(printgeom){
if(qh->hull_dim>4){
qh_fprintf(qh,qh->ferr,6057,"qhull input error: Geomview output is only available for 2-d, 3-d and 4-d\n");
qh_fprintf_stderr(6258,"qh_lib_check: Incorrect qhull library called. Caller uses non-reentrant Qhull with a dynamic qhT via qh_QHpointer. Library is reentrant.\n");
qh_fprintf_stderr(6262,"qh_lib_check: Expecting qhullLibraryType QHULL_NON_REENTRANT(0), QHULL_QH_POINTER(1), or QHULL_REENTRANT(2). Got %d\n",qhullLibraryType);
iserror=True;
}
if(qhTsize!=sizeof(qhT)){
qh_fprintf_stderr(6249,"qh_lib_check: Incorrect qhull library called. Size of qhT for caller is %d, but for library is %d.\n",qhTsize,sizeof(qhT));
iserror=True;
}
if(vertexTsize!=sizeof(vertexT)){
qh_fprintf_stderr(6250,"qh_lib_check: Incorrect qhull library called. Size of vertexT for caller is %d, but for library is %d.\n",vertexTsize,sizeof(vertexT));
iserror=True;
}
if(ridgeTsize!=sizeof(ridgeT)){
qh_fprintf_stderr(6251,"qh_lib_check: Incorrect qhull library called. Size of ridgeT for caller is %d, but for library is %d.\n",ridgeTsize,sizeof(ridgeT));
iserror=True;
}
if(facetTsize!=sizeof(facetT)){
qh_fprintf_stderr(6252,"qh_lib_check: Incorrect qhull library called. Size of facetT for caller is %d, but for library is %d.\n",facetTsize,sizeof(facetT));
iserror=True;
}
if(setTsize&&setTsize!=sizeof(setT)){
qh_fprintf_stderr(6253,"qh_lib_check: Incorrect qhull library called. Size of setT for caller is %d, but for library is %d.\n",setTsize,sizeof(setT));
iserror=True;
}
if(qhmemTsize&&qhmemTsize!=sizeof(qhmemT)){
qh_fprintf_stderr(6254,"qh_lib_check: Incorrect qhull library called. Size of qhmemT for caller is %d, but for library is %d.\n",qhmemTsize,sizeof(qhmemT));
iserror=True;
}
if(iserror){
qh_fprintf_stderr(6259,"qh_lib_check: Cannot continue. Library '%s' is reentrant (e.g., qhull_r.so)\n",qh_version2);
qh_exit(qh_ERRqhull);/* can not use qh_errexit() */