~ubuntu-branches/ubuntu/utopic/binkd/utopic-proposed

« back to all changes in this revision

Viewing changes to getw.h

  • Committer: Bazaar Package Importer
  • Author(s): Marco d'Itri
  • Date: 2002-03-24 22:52:25 UTC
  • Revision ID: james.westby@ubuntu.com-20020324225225-7ru6itlapn03nl35
Tags: upstream-0.9.5a
ImportĀ upstreamĀ versionĀ 0.9.5a

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * getwordx public domain library v.2.0
 
3
 * (c) 1995,1996,1997 <maloff@tts.magadan.su>
 
4
 */
 
5
/*
 
6
 * $Id: getw.h,v 2.0 2001/01/10 12:12:38 gul Exp $
 
7
 *
 
8
 * $Log: getw.h,v $
 
9
 * Revision 2.0  2001/01/10 12:12:38  gul
 
10
 * Binkd is under CVS again
 
11
 *
 
12
 *
 
13
 */
 
14
 
 
15
#define MAX_ENV_VAR_NAME 256
 
16
 
 
17
/*
 
18
 * Supported flags:
 
19
 */
 
20
#define GWX_SUBST 1                    /* Perform %VAR% substs */
 
21
#define GWX_HASH  2                    /* Process `#' comments */
 
22
#define GWX_NOESC 4                    /* Treat `\' as a regular character */
 
23
 
 
24
/* Example: fldsep == ":", fldskip == " \t" */
 
25
#define DEF_FLDSEP  " \t\n\r"
 
26
#define DEF_FLDSKIP " \t\n\r"
 
27
 
 
28
/*
 
29
 * Src is a source string, n is a word number (1...), returned string must
 
30
 * be free()'d. Returns 0 if there is no word #n.
 
31
 */
 
32
char *getwordx2 (char *src, int n, int flags, char *fldsep, char *fldskip);
 
33
 
 
34
#define getwordx(src,n,flags) \
 
35
                getwordx2(src, n, flags, DEF_FLDSEP, DEF_FLDSKIP)
 
36
#define getword(src,n) getwordx(src, n, GWX_SUBST | GWX_HASH)