Removed refs to charmm files in share/top/Makefile.am
[gromacs/qmmm-gamess-us.git] / include / string2.h
blobffd158030cad79855a9b76f5121ccc4175469b36
1 /*
2 *
3 * This source code is part of
4 *
5 * G R O M A C S
6 *
7 * GROningen MAchine for Chemical Simulations
8 *
9 * VERSION 3.2.0
10 * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
11 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
12 * Copyright (c) 2001-2004, The GROMACS development team,
13 * check out http://www.gromacs.org for more information.
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
20 * If you want to redistribute modifications, please consider that
21 * scientific software is very special. Version control is crucial -
22 * bugs must be traceable. We will be happy to consider code for
23 * inclusion in the official distribution, but derived work must not
24 * be called official GROMACS. Details are found in the README & COPYING
25 * files - if they are missing, get the official version at www.gromacs.org.
27 * To help us fund GROMACS development, we humbly ask that you cite
28 * the papers on the package - you can find them in the top README file.
30 * For more info, check our website at http://www.gromacs.org
32 * And Hey:
33 * Gromacs Runs On Most of All Computer Systems
35 /*! \file
36 * \brief Generic string handling functions.
38 #ifndef _string2_h
39 #define _string2_h
41 #ifdef HAVE_CONFIG_H
42 #include <config.h>
43 #endif
47 * string2.h
48 * David van der Spoel
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
56 #include <string.h>
57 #include <stdio.h>
58 #include "typedefs.h"
60 #include "types/simple.h"
62 #define CONTINUE '\\'
63 #define COMMENTSIGN ';'
65 extern int continuing(char *s);
67 extern char *fgets2(char *s, int n, FILE *stream);
69 extern void strip_comment (char *line);
71 extern int break_line (char *line,
72 char *variable,
73 char *value);
75 extern void upstring (char *str);
77 extern void ltrim (char *str);
79 extern void rtrim (char *str);
81 extern void trim (char *str);
83 extern void nice_header (FILE *out,const char *fn);
85 extern int strcasecmp_min(const char *str1, const char *str2);
86 extern int strncasecmp_min(const char *str1, const char *str2, int n);
87 /* This funny version of strcasecmp, is not only case-insensitive,
88 * but also ignores '-' and '_'.
91 extern int gmx_strcasecmp(const char *str1, const char *str2);
92 extern int gmx_strncasecmp(const char *str1, const char *str2, int n);
94 extern char *gmx_strdup(const char *src);
95 extern char *gmx_strndup(const char *src, int n);
97 #ifndef HAVE_STRCASECMP
98 #define strcasecmp gmx_strcasecmp
99 #define strncasecmp gmx_strncasecmp
100 #endif
102 #ifndef HAVE_STRDUP
103 #define strdup gmx_strdup
104 #endif
106 #define strndup gmx_strndup
108 /** Pattern matcing with wildcards. */
109 extern int
110 gmx_wcmatch(const char *pattern, const char *src);
112 /** Return value for gmx_wcmatch() when there is no match. */
113 #define GMX_NO_WCMATCH 1
116 /* this is our implementation of strsep, the thread-safe replacement for
117 strtok */
118 extern char *gmx_strsep(char **stringp, const char *delim);
121 extern char *wrap_lines(const char *buf,int line_width, int indent,
122 bool bIndentFirst);
123 /* wraps lines at 'linewidth', indenting all following
124 * lines by 'indent' spaces. A temp buffer is allocated and returned,
125 * which can be disposed of if no longer needed.
126 * If !bIndentFirst, then the first line will not be indented, only
127 * the lines that are created due to wapping.
131 extern char **split(char sep,char *str);
132 /* Implementation of the well-known Perl function split */
135 #include <stdlib.h>
136 #include <stdio.h>
137 #include <ctype.h>
138 #include "errno.h"
140 gmx_large_int_t
141 str_to_large_int_t(const char *str, char **endptr);
143 #ifdef __cplusplus
145 #endif
147 #endif /* _string2_h */