File: getw.h

package info (click to toggle)
binkd 1.1a-115-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,544 kB
  • sloc: ansic: 22,961; makefile: 1,126; perl: 368; sh: 320
file content (25 lines) | stat: -rw-r--r-- 768 bytes parent folder | download | duplicates (4)
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
/*
 * getwordx public domain library v.2.0
 * (c) 1995,1996,1997 <maloff@tts.magadan.su>
 */

/*
 * Supported flags:
 */
#define GWX_SUBST 1		       /* Perform %VAR% substs */
#define GWX_HASH  2		       /* Process `#' comments */
#define GWX_NOESC 4		       /* Treat `\' as a regular character */

/* Example: fldsep == ":", fldskip == " \t" */
#define DEF_FLDSEP  " \t\n\r"
#define DEF_FLDSKIP " \t\n\r"

/*
 * Src is a source string, n is a word number (1...), returned string must
 * be free()'d. Returns 0 if there is no word #n.
 */
char *getwordx2 (const char *src, int n, int flags, char *fldsep, char *fldskip);

#define getwordx(src,n,flags) \
		getwordx2(src, n, flags, DEF_FLDSEP, DEF_FLDSKIP)
#define getword(src,n) getwordx(src, n, GWX_SUBST | GWX_HASH)