View | Details | Raw Unified | Return to bug 39059
Collapse All | Expand All

(-)include/apr_strings.h (-11 / +12 lines)
Lines 61-67 Link Here
61
61
62
/**
62
/**
63
 * @defgroup apr_strings String routines
63
 * @defgroup apr_strings String routines
64
 * @ingroup APR 
64
 * @ingroup APR
65
 * @{
65
 * @{
66
 */
66
 */
67
67
Lines 76-82 Link Here
76
APR_DECLARE(int) apr_strnatcmp(char const *a, char const *b);
76
APR_DECLARE(int) apr_strnatcmp(char const *a, char const *b);
77
77
78
/**
78
/**
79
 * Do a natural order comparison of two strings ignoring the case of the 
79
 * Do a natural order comparison of two strings ignoring the case of the
80
 * strings.
80
 * strings.
81
 * @param a The first string to compare
81
 * @param a The first string to compare
82
 * @param b The second string to compare
82
 * @param b The second string to compare
Lines 109-115 Link Here
109
APR_DECLARE(char *) apr_pstrmemdup(apr_pool_t *p, const char *s, apr_size_t n);
109
APR_DECLARE(char *) apr_pstrmemdup(apr_pool_t *p, const char *s, apr_size_t n);
110
110
111
/**
111
/**
112
 * duplicate the first n characters of a string into memory allocated 
112
 * duplicate the first n characters of a string into memory allocated
113
 * out of a pool; the new string will be null-terminated
113
 * out of a pool; the new string will be null-terminated
114
 * @param p The pool to allocate out of
114
 * @param p The pool to allocate out of
115
 * @param s The string to duplicate
115
 * @param s The string to duplicate
Lines 144-154 Link Here
144
 * @param nbytes (output) strlen of new string (pass in NULL to omit)
144
 * @param nbytes (output) strlen of new string (pass in NULL to omit)
145
 * @return The new string
145
 * @return The new string
146
 */
146
 */
147
#ifndef SKYOS
147
APR_DECLARE(char *) apr_pstrcatv(apr_pool_t *p, const struct iovec *vec,
148
APR_DECLARE(char *) apr_pstrcatv(apr_pool_t *p, const struct iovec *vec,
148
                                 apr_size_t nvec, apr_size_t *nbytes);
149
                                 apr_size_t nvec, apr_size_t *nbytes);
149
150
#endif
150
/**
151
/**
151
 * printf-style style printing routine.  The data is output to a string 
152
 * printf-style style printing routine.  The data is output to a string
152
 * allocated from a pool
153
 * allocated from a pool
153
 * @param p The pool to allocate out of
154
 * @param p The pool to allocate out of
154
 * @param fmt The format of the string
155
 * @param fmt The format of the string
Lines 158-164 Link Here
158
APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap);
159
APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap);
159
160
160
/**
161
/**
161
 * printf-style style printing routine.  The data is output to a string 
162
 * printf-style style printing routine.  The data is output to a string
162
 * allocated from a pool
163
 * allocated from a pool
163
 * @param p The pool to allocate out of
164
 * @param p The pool to allocate out of
164
 * @param fmt The format of the string
165
 * @param fmt The format of the string
Lines 183-192 Link Here
183
 * <PRE>
184
 * <PRE>
184
 * Note the differences between this function and strncpy():
185
 * Note the differences between this function and strncpy():
185
 *  1) strncpy() doesn't always NUL terminate; apr_cpystrn() does.
186
 *  1) strncpy() doesn't always NUL terminate; apr_cpystrn() does.
186
 *  2) strncpy() pads the destination string with NULs, which is often 
187
 *  2) strncpy() pads the destination string with NULs, which is often
187
 *     unnecessary; apr_cpystrn() does not.
188
 *     unnecessary; apr_cpystrn() does not.
188
 *  3) strncpy() returns a pointer to the beginning of the dst string;
189
 *  3) strncpy() returns a pointer to the beginning of the dst string;
189
 *     apr_cpystrn() returns a pointer to the NUL terminator of dst, 
190
 *     apr_cpystrn() returns a pointer to the NUL terminator of dst,
190
 *     to allow a check for truncation.
191
 *     to allow a check for truncation.
191
 * </PRE>
192
 * </PRE>
192
 */
193
 */
Lines 203-209 Link Here
203
APR_DECLARE(char *) apr_collapse_spaces(char *dest, const char *src);
204
APR_DECLARE(char *) apr_collapse_spaces(char *dest, const char *src);
204
205
205
/**
206
/**
206
 * Convert the arguments to a program from one string to an array of 
207
 * Convert the arguments to a program from one string to an array of
207
 * strings terminated by a NULL pointer
208
 * strings terminated by a NULL pointer
208
 * @param arg_str The arguments to convert
209
 * @param arg_str The arguments to convert
209
 * @param argv_out Output location.  This is a pointer to an array of strings.
210
 * @param argv_out Output location.  This is a pointer to an array of strings.
Lines 214-220 Link Here
214
                                               apr_pool_t *token_context);
215
                                               apr_pool_t *token_context);
215
216
216
/**
217
/**
217
 * Split a string into separate null-terminated tokens.  The tokens are 
218
 * Split a string into separate null-terminated tokens.  The tokens are
218
 * delimited in the string by one or more characters from the sep
219
 * delimited in the string by one or more characters from the sep
219
 * argument.
220
 * argument.
220
 * @param str The string to separate; this should be specified on the
221
 * @param str The string to separate; this should be specified on the
Lines 310-316 Link Here
310
 *   digits are prefixed with '0x', in which case it will be treated as
311
 *   digits are prefixed with '0x', in which case it will be treated as
311
 *   base 16.
312
 *   base 16.
312
 */
313
 */
313
APR_DECLARE(apr_status_t) apr_strtoff(apr_off_t *offset, const char *buf, 
314
APR_DECLARE(apr_status_t) apr_strtoff(apr_off_t *offset, const char *buf,
314
                                      char **end, int base);
315
                                      char **end, int base);
315
316
316
/**
317
/**
(-)strings/apr_strings.c (-5 / +10 lines)
Lines 47-55 Link Here
47
 */
47
 */
48
48
49
#include "apr.h"
49
#include "apr.h"
50
#ifdef SKYOS
51
#include "apr_private.h"
50
#include "apr_strings.h"
52
#include "apr_strings.h"
53
#else
54
#include "apr_strings.h"
55
#include "apr_private.h"
56
#endif
51
#include "apr_general.h"
57
#include "apr_general.h"
52
#include "apr_private.h"
53
#include "apr_lib.h"
58
#include "apr_lib.h"
54
#define APR_WANT_STDIO
59
#define APR_WANT_STDIO
55
#define APR_WANT_STRFUNC
60
#define APR_WANT_STRFUNC
Lines 161-167 Link Here
161
        else {
166
        else {
162
            len = strlen(argp);
167
            len = strlen(argp);
163
        }
168
        }
164
 
169
165
        memcpy(cp, argp, len);
170
        memcpy(cp, argp, len);
166
        cp += len;
171
        cp += len;
167
    }
172
    }
Lines 197-203 Link Here
197
202
198
    /* Allocate the required string */
203
    /* Allocate the required string */
199
    res = (char *) apr_palloc(a, len + 1);
204
    res = (char *) apr_palloc(a, len + 1);
200
    
205
201
    /* Pass two --- copy the argument strings into the result space */
206
    /* Pass two --- copy the argument strings into the result space */
202
    src = vec;
207
    src = vec;
203
    dst = res;
208
    dst = res;
Lines 292-298 Link Here
292
     * in both the mult and add/sub operation.  Unlike the bsd impl,
297
     * in both the mult and add/sub operation.  Unlike the bsd impl,
293
     * we also work strictly in a signed int64 word as we haven't
298
     * we also work strictly in a signed int64 word as we haven't
294
     * implemented the unsigned type in win32.
299
     * implemented the unsigned type in win32.
295
     * 
300
     *
296
     * Set 'any' if any `digits' consumed; make it negative to indicate
301
     * Set 'any' if any `digits' consumed; make it negative to indicate
297
     * overflow.
302
     * overflow.
298
     */
303
     */
Lines 319-325 Link Here
319
	else if (c >= 's' && c <= 'z')
324
	else if (c >= 's' && c <= 'z')
320
	    c -= 'z' - 28;
325
	    c -= 'z' - 28;
321
#else
326
#else
322
#error "CANNOT COMPILE apr_strtoi64(), only ASCII and EBCDIC supported" 
327
#error "CANNOT COMPILE apr_strtoi64(), only ASCII and EBCDIC supported"
323
#endif
328
#endif
324
	else
329
	else
325
	    break;
330
	    break;

Return to bug 39059