Initial import of the CDE 2.1.30 sources from the Open Group.
[oweals/cde.git] / cde / lib / DtSvc / DtCodelibs / buf.h
1 /*
2  * File:        buf.h $XConsortium: buf.h /main/3 1995/10/26 16:07:20 rswiston $
3  *
4  * (c) Copyright 1993, 1994 Hewlett-Packard Company
5  * (c) Copyright 1993, 1994 International Business Machines Corp.
6  * (c) Copyright 1993, 1994 Sun Microsystems, Inc.
7  * (c) Copyright 1993, 1994 Novell, Inc.
8  */
9 #include <codelibs/boolean.h>
10 #define __PRIVATE_
11 #include <codelibs/privbuf.h>
12
13 #define NOQUOTE         0
14 #define SINGLEQUOTE     1
15 #define DOUBLEQUOTE     2
16 #define EXPANDQUOTE     4
17
18 typedef unsigned char Quote;
19
20 class _SHXcomponents;
21
22 class _SHXbuf
23 {
24     boolean glob;
25     boolean completion;
26     boolean is_pattern;
27     Quote _quote;
28     boolean _new_token;
29     privbuf_charbuf buf;
30     privbuf_charbuf flags;
31     privbuf_strvec vec;
32     void start_token();
33     void filegen();
34     void expand(_SHXcomponents&, char* const, char*, int);
35 public:
36     _SHXbuf()                    {reset(TRUE, FALSE);}
37     void reset(boolean glob, boolean completion);
38     void append(int const ch, char flag = 0);
39     void append(char const *cp, char flag = 0);
40     int ntokens()                {return vec.size();}
41     boolean new_token()          {return _new_token;}
42     Quote quote()                {return _quote;}
43     void quote(Quote);
44     char **vector();
45 };
46
47 #ifndef NULL
48 #define NULL 0
49 #endif