summaryrefslogtreecommitdiffstats
path: root/src/vf_strings.h
blob: 29ccd7849a0d161f0a4bbf2309e909a7ad465915 (plain)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
/*******************************************************************************

    (C) Nick Marley, 2001 -

    This software is distributed under the GNU Lesser General Public Licence.
    Please read and understand the comments at the top of vf_iface.h before use!

FILE
    $Workfile$
    $Revision: 1.6 $
    $Author: tilda $

ORIGINAL AUTHOR
    Nick Marley

DESCRIPTION
    String handling functions.  The library uses the p_ functions (where hopefully
    the 'p' stands for 'portable') and they are provided here in terms of C runtime
    functions or implemented explicitly.

REFERENCES
    (none)

MODIFICATION HISTORY
 *  $Log: vf_strings.h,v $
 *  Revision 1.6  2002/10/26 16:09:23  tilda
 *  IID629125 - Ensure string functions used are portable.
 *
 *  Revision 1.5  2002/10/08 21:27:20  tilda
 *  Correct #endif directive.
 *
 *  Revision 1.4  2001/11/05 21:07:19  tilda
 *  Various changes for initial version of vfedit.
 *
 *  Revision 1.3  2001/10/14 20:42:37  tilda
 *  Addition of group searching.
 *
 *  Revision 1.2  2001/10/13 14:58:56  tilda
 *  Tidy up version headers, add vf_strings.h where needed.
 *
 *  Revision 1.1  2001/10/13 14:50:33  tilda
 *  Add string array code to unify handling of names / values.
 * 
 *******************************************************************************/

#ifndef _VF_STRINGS_H_
#define _VF_STRINGS_H_

#ifndef NORCSID
static const char vf_strings_h_vss_id[] = "$Header: /cvsroot/vformat/src/vformat/src/vf_strings.h,v 1.6 2002/10/26 16:09:23 tilda Exp $";
#endif

/*=============================================================================*
 Public Includes
 *============================================================================*/
/* None */

/*=============================================================================*
 Public Defines
 *============================================================================*/
/* None */

/*=============================================================================*
 Public Types
 *============================================================================*/
/* None */

/*=============================================================================*
 Public Functions
 *============================================================================*/


/*----------------------------------------------------------------------------*
 * NAME
 *      p_strlen()
 * 
 * DESCRIPTION
 *      Find length of string.
 *
 * RETURNS
 *      Length of strings.
 *----------------------------------------------------------------------------*/

extern int p_strlen(
    const char *p_string                /* String to measure */
    );


/*----------------------------------------------------------------------------*
 * NAME
 *      p_strcpy()
 * 
 * DESCRIPTION
 *      Copy string to buffer.
 *
 * RETURNS
 *      Pointer to buffer.
 *----------------------------------------------------------------------------*/

extern char *p_strcpy(
    char *p_string1,                /* Buffer to copy to */
    const char *p_string2           /* String to copy */
    );


/*----------------------------------------------------------------------------*
 * NAME
 *      p_strcmp()
 * 
 * DESCRIPTION
 *      Case sensitive string comparison.
 *
 * RETURNS
 *      0<=>strings match, !=0 else.
 *----------------------------------------------------------------------------*/

extern int p_strcmp(
    const char *p_string1,
    const char *p_string2
    );


/*----------------------------------------------------------------------------*
 * NAME
 *      p_strcat()
 * 
 * DESCRIPTION
 *      Append one string to another.
 *
 * RETURNS
 *      Pointer to resulting string.
 *----------------------------------------------------------------------------*/

extern char *p_strcat(
    char *p_string1,                /* String to append to */
    const char *p_string2           /* String to append */
    );


/*----------------------------------------------------------------------------*
 * NAME
 *      p_strstr()
 * 
 * DESCRIPTION
 *      Case sensitive string searching function.
 *
 * RETURNS
 *      Pointer to position "looked for" has been located or NULL if !found.
 *----------------------------------------------------------------------------*/

extern char *p_strstr(
    const char *p_searched,             /* Buffer searched */
    const char *p_lookedfor             /* String we're looking for */
    );


/*----------------------------------------------------------------------------*
 * NAME
 *      p_stricmp()
 * 
 * DESCRIPTION
 *      Case insensitive string comparison function.
 *
 * RETURNS
 *      0<=>strings match, !=0 else.
 *----------------------------------------------------------------------------*/

extern int p_stricmp(
    const char *p_string1,              /* First string */
    const char *p_string2               /* Second string */
    );


/*----------------------------------------------------------------------------*
 * NAME
 *      p_stristr()
 * 
 * DESCRIPTION
 *      Case insensitive string searching function.
 *
 * RETURNS
 *      Pointer to position "looked for" has been located or NULL if !found.
 *----------------------------------------------------------------------------*/

extern char *p_stristr(
    const char *p_searched,             /* Buffer searched */
    const char *p_lookedfor             /* String we're looking for */
    );

/*----------------------------------------------------------------------------*
 * NAME
 *      p_memcpy()
 * 
 * DESCRIPTION
 *      Copy characetrs between buffers.  No checks on overlap.
 *
 * RETURNS
 *      (none)
 *----------------------------------------------------------------------------*/

extern void p_memcpy(
    void *p_destination,            /* Pointer to buffer */
    const void *p_source,           /* Source of copy */
    uint32_t length                 /* Number of characters to copy */
    );


/*----------------------------------------------------------------------------*
 * NAME
 *      p_memset()
 * 
 * DESCRIPTION
 *      Fill buffer with indicated character.
 *
 * RETURNS
 *      (none)
 *----------------------------------------------------------------------------*/

extern void p_memset(
    void *p_destination,            /* Pointer to buffer */
    uint8_t v,                      /* Character to fill with */
    uint32_t length                 /* Length of buffer to set */
    );


/*=============================================================================*
 End of file
 *============================================================================*/

#endif /*_VF_STRINGS_H_*/