Tagged files with gromacs 3.0 header and added some license info
[alexxy/gromacs.git] / include / string2.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 3.0
11  * 
12  * Copyright (c) 1991-2001
13  * BIOSON Research Institute, Dept. of Biophysical Chemistry
14  * University of Groningen, The Netherlands
15  * 
16  * This program is free software; you can redistribute it and/or
17  * modify it under the terms of the GNU General Public License
18  * as published by the Free Software Foundation; either version 2
19  * of the License, or (at your option) any later version.
20  * 
21  * If you want to redistribute modifications, please consider that
22  * scientific software is very special. Version control is crucial -
23  * bugs must be traceable. We will be happy to consider code for
24  * inclusion in the official distribution, but derived work must not
25  * be called official GROMACS. Details are found in the README & COPYING
26  * files - if they are missing, get the official version at www.gromacs.org.
27  * 
28  * To help us fund GROMACS development, we humbly ask that you cite
29  * the papers on the package - you can find them in the top README file.
30  * 
31  * Do check out http://www.gromacs.org , or mail us at gromacs@gromacs.org .
32  * 
33  * And Hey:
34  * Giving Russians Opium May Alter Current Situation
35  */
36
37 #ifndef _string2_h
38 #define _string2_h
39
40 static char *SRCID_string2_h = "$Id$";
41 #ifdef HAVE_CONFIG_H
42 #include <config.h>
43 #endif
44
45 #ifdef HAVE_IDENT
46 #ident  "@(#) string2.h 1.13 11/23/92"
47 #endif /* HAVE_IDENT */
48
49 /*
50  *
51  * string2.h
52  * David van der Spoel
53  *
54  */
55
56 #ifdef CPLUSPLUS
57 extern "C" {
58 #endif
59
60 #include <string.h>
61 #include <stdio.h>
62 #include "typedefs.h"
63
64 #define CONTINUE    '\\'
65 #define COMMENTSIGN ';'
66
67 extern int continuing(char *s);
68
69 extern char *fgets2(char *s, int n, FILE *stream);
70
71 extern void strip_comment (char *line);
72
73 extern int break_line (char *line,
74                        char *variable,
75                        char *value);
76
77 extern void upstring (char *str);
78
79 extern void ltrim (char *str);
80
81 extern void rtrim (char *str);
82
83 extern void trim (char *str);
84
85 extern void nice_header (FILE *out,char *fn);
86
87 extern int strcasecmp_min(const char *str1, const char *str2);
88 /* This funny version of strcasecmp, is not only case-insensitive,
89  * but also ignores '-' and '_'.
90  */
91
92 extern int gmx_strcasecmp(const char *str1, const char *str2);
93
94 extern char *gmx_strdup(const char *src);
95
96 #ifndef HAVE_STRCASECMP
97 #define strcasecmp gmx_strcasecmp
98 #endif
99
100 #ifndef HAVE_STRDUP
101 #define strdup gmx_strdup
102 #endif
103
104 extern char *wrap_lines(char *buf,int line_width, int indent);
105 /* wraps lines at 'linewidth', indenting all following
106  * lines by 'indent' spaces. A temp buffer is allocated and returned,
107  * which can be disposed of if no longer needed.
108  */
109
110 #ifdef CPLUSPLUS
111 }
112 #endif
113
114 #endif  /* _string2_h */