8fdea11b04b399611d3dd8d972de2a57f6e9d06b
[alexxy/gromacs.git] / src / contrib / prfn.c
1 /*
2  * $Id$
3  * 
4  *       This source code is part of
5  * 
6  *        G   R   O   M   A   C   S
7  * 
8  * GROningen MAchine for Chemical Simulations
9  * 
10  *               VERSION 2.0
11  * 
12  * Copyright (c) 1991-1999
13  * BIOSON Research Institute, Dept. of Biophysical Chemistry
14  * University of Groningen, The Netherlands
15  * 
16  * Please refer to:
17  * GROMACS: A message-passing parallel molecular dynamics implementation
18  * H.J.C. Berendsen, D. van der Spoel and R. van Drunen
19  * Comp. Phys. Comm. 91, 43-56 (1995)
20  * 
21  * Also check out our WWW page:
22  * http://md.chem.rug.nl/~gmx
23  * or e-mail to:
24  * gromacs@chem.rug.nl
25  * 
26  * And Hey:
27  * Great Red Oystrich Makes All Chemists Sane
28  */
29 static char *SRCID_prfn_c = "$Id$";
30
31 #include "filenm.h"
32 #include "futil.h"
33 #include "wman.h"
34
35 void pr_texdefs(FILE *fp)
36 {
37   int i;
38
39   fprintf(fp,"\\begin{table}\n");
40   fprintf(fp,"\\begin{tabularx}{\\linewidth}{|r@{\\tt.}lccX|}\n");
41   fprintf(fp,"\\dline\n");
42   fprintf(fp,"\\mc{2}{|c}{%s} & %4s & %7s & %s \\\\[-0.1ex]\n",
43           "Default","","Default","");
44   fprintf(fp,"\\mc{1}{|c}{%s} & \\mc{1}{c}{%s} & %4s & %7s & %s "
45           "\\\\[-0.1ex]\n",
46           "Name","Ext.","Type","Option","Description");
47   fprintf(fp,"\\hline\n");
48   for(i=0; (i<efNR); i++)
49     if ( (i!=efGCT) && (i!=efHAT) )
50       pr_def(fp,i);
51   fprintf(fp,"\\dline\n");
52   fprintf(fp,"\\end{tabularx}\n");
53   fprintf(fp,"\\caption{The {\\gromacs} file types.}\n");
54   fprintf(fp,"\\label{tab:form}\n");
55   fprintf(fp,"\\end{table}\n");
56 }
57
58 void pr_htmldefs(FILE *fp)
59 {
60   int i;
61
62   fprintf(fp,"<title>GROMACS</title>\n");
63   fprintf(fp,"<h1>GROMACS Files</h1>\n");
64   fprintf(fp,"<b>GRO</b>ningen <b>MA</b>chine for <b>S</b>imulating <b>C</b>hemistry\n");
65   fprintf(fp,"<p>\n");
66   fprintf(fp,"The following %d filetypes are used by Gromacs:\n",efNR);
67   fprintf(fp,"<dl>\n");
68   for(i=0; (i<efNR); i++) {
69     fprintf(fp,"<dt><a href=\"%s.html\">%s.%s</a> (%s)<dd>%s\n",
70             ftp2ext(i),ftp2defnm(i),ftp2ext(i),ftp2ftype(i),
71             check_html(ftp2desc(i),NULL));
72   }
73   fprintf(fp,"</dl>\n");
74 }
75
76
77 void main()
78 {
79   FILE *out;
80   
81   out=ffopen("files.tex","w");
82   pr_texdefs(out);
83   fclose(out);
84   
85   out=ffopen("files.html","w");
86   pr_htmldefs(out);
87   fclose(out);
88 }
89