File: strutil.h

package info (click to toggle)
grep-dctrl 1.3a
  • links: PTS
  • area: main
  • in suites: potato
  • size: 660 kB
  • ctags: 403
  • sloc: ansic: 4,004; sh: 358; makefile: 226; sed: 93
file content (29 lines) | stat: -rw-r--r-- 537 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29


#ifndef STRUTIL_H__
#define STRUTIL_H__

#include <string.h>

/* Return a pointer to first nonblank character in s.  */
const char *
left_trimmed (const char * s);

/* Mutate s and trim whitespace off its right end.  */
void
trim_right (char * s);

/* Chop off everything after and including the first comchar in line.
   This mutates line!  */
inline static void
chop_comment (char * line, char comchar)
{
  char * comstart;

  comstart = strchr (line, comchar);
  
  if (comstart != 0)
    *comstart = 0;
}

#endif /* STRUTIL_H__ */