50ffb859c3612abff8ca3d1dcadd2f885adc52de
[alexxy/gromacs.git] / include / strdb.h
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  * Green Red Orange Magenta Azure Cyan Skyblue
28  */
29
30 #ifndef _strdb_h
31 #define _strdb_h
32
33 static char *SRCID_strdb_h = "$Id$";
34
35 #ifdef HAVE_CONFIG_H
36 #include <config.h>
37 #endif
38
39 #ifdef HAVE_IDENT
40 #ident  "@(#) strdb.h 1.9 2/2/97"
41 #endif /* HAVE_IDENT */
42
43 #include "typedefs.h"
44
45 extern bool get_a_line(FILE *fp,char line[],int n);
46 /* Read a line of at most n characters form *fp to line. 
47  * Comment ';...' and leading spaces are removed, empty lines are skipped.
48  * Return FALSE when eof. 
49  */
50
51 extern bool get_header(char line[],char header[]);
52 /* Read a header between '[' and ']' from line to header.
53  * Returns FALSE no header is found.
54  */
55
56 extern int fget_lines(FILE *in,char ***strings);
57 /* Read an array of lines from file in. strings should be
58  * the address of an array of strings (to be malloced by this routine)
59  * return the number of strings.
60  */
61 extern int get_lines(char *db,char ***strings);
62 /* Open file db, or if non-existant file $GMXLIB/db and read strings 
63  * return the number of strings.
64  */
65
66 extern int search_str(int nstr,char **str,char *key);
67 /* Search an array of strings for key, return the index if found
68  * -1 if not found.
69  */
70
71 extern int get_strings(char *db,char ***strings);
72 /* Read an array of strings from file db or $GMXLIB/db. strings should be
73  * the address of an array of strings (to be malloced by this routine)
74  * return the number of strings.
75  */
76 extern int get_file(char *db,char ***strings);
77 /* Read an array of strings from file db or $GMXLIB/db. strings should be
78  * the address of an array of strings (to be malloced by this routine)
79  * Does not need number of lines as first line in the file. 
80  * return the number of strings.
81  */
82
83 #endif  /* _strdb_h */