/* Copyright (c) 2003 by Stefan Kurtz and The Institute for Genomic Research. This is OSI Certified Open Source Software. Please see the file LICENSE for licensing information and the file ACKNOWLEDGEMENTS for names of contributors to the code base. */ //\Ignore{ #include #include #include #include "optdesc.h" #include "errordef.h" #include "debugdef.h" #include "protodef.h" #include "spacedef.h" //} /* This file implements functions for processing options according to some option declarations. */ /*EE The following function initializes the table \texttt{options} storeing the information for all options. \texttt{numofoptions} is the number of options. */ void initoptions(OptionDescription *options,Uint numofoptions) { Uint i; DEBUG1(3,"option[0...%lu] is undeclared\n",(Showuint) (numofoptions-1)); for(i=0; i=numofoptions) { ERROR2("option number %ld out of range [0,%lu]", (Showsint) optnum, (Showuint) (numofoptions-1)); return -1; } if(optnum > 0 && options[optnum].declared) { ERROR1("option %lu already declared",(Showuint) optnum); return -2; } options[optnum].optname = optname; options[optnum].description = optdesc; options[optnum].optval = optnum; options[optnum].isalreadyset = False; options[optnum].declared = True; DEBUG1(3,"option %ld is declared\n",(Showsint) optnum); if(optnum == numofoptions-1) { for(i=0; i0) { printf("\\\\\\hline\n"); } if(opt[excludetab[i]].optname[0] == '-') { offset = UintConst(1); } else { offset = 0; } printf("\\Showoption{%s}& ",opt[excludetab[i]].optname+offset); for(j=i+1; excludetab[j] != -1; j++) { if(opt[excludetab[j]].optname[0] == '-') { offset = UintConst(1); } else { offset = 0; } printf("\\Showoption{%s} ",opt[excludetab[j]].optname+offset); } } printf("\\\\\\hline"); printf("\n\\end{tabular}\n"); }