1 /*  Copyright 1999 Enhanced Software Technologies Inc.
2  * Released for public use under a BSD-style Open Source license.
3  * See file "LICENSE" for more information.
4 
5  * dstring.h -- dynamically allocated string functions.
6  *
7  * RCS CHANGE LOG
8  * Revision 1.2  2000/04/05 22:09:19  eric
9  * Daily checkin...
10  *
11  * Revision 1.1  2000/03/28 23:54:28  eric
12  * Initial checkin -- aescrypt/aesget
13  *
14  * Revision 1.4  1999/09/28 19:34:13  eric
15  * added d_lpad and d_rpad routines.
16  *
17  * Revision 1.3  1999/09/13 16:08:44  eric
18  * Added Ocotillo licensing info
19  *
20  * Revision 1.2  1999/08/27 20:52:26  eric
21  * Whoops! changed d_split1 to d_split to match the actual code!
22  *
23  * Revision 1.1  1999/08/25 22:08:48  eric
24  * Initial revision, dynamic string routines for "C".
25  *
26  */
27 
28 #ifndef DSTRING_H
29 #define DSTRING_H 1
30 
31 #include <stdio.h>
32 
33 struct d_split_array {  /* result of d_split */
34   char *str1;
35   char *str2;
36 };
37 struct d_split2_array {  /* result of d_split2 */
38   char *str1;
39   char *str2;
40   char *str3;
41 };
42 
43 char *d_getline(FILE *file,int limit); /* get a line, malloc'ing a string. */
44 char *d_trim(char *src);               /* trim whitespace. */
45 
46 char *d_lpad(char *src,int ch, int len); /* left pad with char to a length. */
47 char *d_rpad(char *src,int ch, int len); /* right pad with char to a length */
48 
49 char *d_dup(char *src);                /* return malloc'ed duplicate */
50 char *d_cat(char *src1, char *src2);   /* return malloc'ed concatenation */
51 struct d_split_array *d_split(char *src, int ch);     /* split line into 2 pieces */
52 struct d_split2_array *d_split2(char *src,int ch); /* split line into THREE pieces */
53 
54 #endif
55 
56 
57 
58 
59