NAMD
strlib.h
Go to the documentation of this file.
1 
7 /*
8  strlib contains a number of useful routines for doing file I/O
9  and some basic string manipulation. These routines are used for
10  reading in the parameter and .psf files
11 */
12 
13 #ifndef STRLIB_H
14 
15 #define STRLIB_H
16 
17 #include <stdio.h>
18 #include <ctype.h>
19 #include <stdlib.h>
20 #include <string.h>
21 
22 #ifdef WIN32
23 #define strcasecmp(s,t) stricmp(s,t)
24 #define strncasecmp(s,t,n) strnicmp(s,t,n)
25 #else
26 #include <strings.h>
27 #endif
28 
29 #include "common.h"
30 
31 void NAMD_truncate(char *); // Remove trailing spaces from
32  // a string
33 int NAMD_read_line(FILE *, char *, int bufsize=512); // Read in a line from a file
34 int NAMD_find_word(const char *, const char *); // Check for given word in a
35  // string
36 int NAMD_blank_string(char *); // Check to see if a string
37  // is blank
38 void NAMD_find_first_word(char *, char *);
39  // Find the first word in a string
40 int NAMD_read_int(FILE *, const char *); // Read an integer from a file
41 void NAMD_pad(char *, size_t); // Pad a string with leading spaces
42 void NAMD_remove_comment(char *); // Remove comments at the end of
43  // a line demarked by !
44 
45 #endif
46 
int NAMD_read_line(FILE *fd, char *buf, int bufsize)
Definition: strlib.C:38
void NAMD_find_first_word(char *source, char *word)
Definition: strlib.C:258
int NAMD_blank_string(char *str)
Definition: strlib.C:222
int NAMD_find_word(const char *source, const char *search)
Definition: strlib.C:180
void NAMD_truncate(char *str)
Definition: strlib.C:145
void NAMD_pad(char *str, size_t length)
Definition: strlib.C:382
int NAMD_read_int(FILE *fd, const char *msg)
Definition: strlib.C:302
void NAMD_remove_comment(char *str)
Definition: strlib.C:119