Ejemplo n.º 1
0
void print_pargs(FILE *fp, int npargs,t_pargs pa[],bool bLeadingSpace)
{
  bool bShowHidden;
  char buf[32],buf2[256],tmp[256];
  char *wdesc;
  int  i;
  
  /* Cannot call opt2parg_bSet here, because it crashes when the option
   * is not in the list (mdrun)
   */
  bShowHidden = FALSE;
  for(i=0; (i<npargs); i++) 
    if ((strcmp(pa[i].option,"-hidden")==0) && (pa[i].bSet))
      bShowHidden = TRUE;
  
  if (npargs > 0) {
    fprintf(fp,"%s%-12s %-6s %-6s  %-s\n",
	    bLeadingSpace ? " " : "","Option","Type","Value","Description");
    fprintf(fp,"%s------------------------------------------------------\n",
	    bLeadingSpace ? " " : "");
    for(i=0; (i<npargs); i++) {
      if (bShowHidden || !is_hidden(&pa[i])) {
	wdesc = pargs_print_line(&pa[i],bLeadingSpace);
	fprintf(fp,"%s",wdesc);
	sfree(wdesc);
      }
    }
    fprintf(fp,"\n");
  }
}
Ejemplo n.º 2
0
static void write_wikiman(FILE *out,
                          const char *program,
                          int nldesc, const char **desc,
                          int nfile, t_filenm *fnm,
                          int npargs, t_pargs *pa,
                          int nbug, const char **bugs, gmx_bool bHeader,
                          t_linkdata *links)
{
    int   i;
    char  buf[256], link[10];
    char *tmp, *tmp2;
    fprintf(out, "<page>\n<title>Manual:%s_%s</title>\n", program,
            VERSION);
    fprintf(out, "<revision>\n");
    fprintf(out, "<timestamp>%s</timestamp>\n", mydate(buf, 255, TRUE));
    fprintf(out, "<text xml:space=\"preserve\">\n");
    if (nldesc > 0)
    {
        fprintf(out, "== Description ==\n");
        print_tty_formatted(out, nldesc, desc, 0, links, program, TRUE);
        fprintf(out, "\n");
    }
    if (nbug > 0)
    {
        fprintf(out, "== Known Problems ==\n");
        for (i = 0; i < nbug; i++)
        {
            snew(tmp, strlen(bugs[i])+3);
            strcpy(tmp, "* ");
            strcpy(tmp+2, bugs[i]);
            fprintf(out, "%s\n", NWR(tmp));
            sfree(tmp);
        }
    }
    if (nfile > 0)
    {
        fprintf(out, "\n== Files ==\n");
        pr_html_files(out, nfile, fnm, program, links, TRUE);
    }
    if (npargs > 0)
    {
        fprintf(out, "\n== Options ==\n");
        fprintf(out, " %-12s %-6s %-6s  %-s\n",
                "Option", "Type", "Value", "Description");
        fprintf(out, " ------------------------------------------------------\n");
        for (i = 0; (i < npargs); i++)
        {
            tmp = NWR(pargs_print_line(&pa[i], TRUE));
            fprintf(out, "%s", tmp);
            sfree(tmp);
        }
    }
    fprintf(out, "[[category:Manual_Pages_%s|%s]]\n", VERSION, program);
    fprintf(out, "</text>\n");
    fprintf(out, "</revision>\n");
    fprintf(out, "</page>\n\n");
}