Apache2
apr_strings.h
Go to the documentation of this file.
1 /* Licensed to the Apache Software Foundation (ASF) under one or more
2  * contributor license agreements. See the NOTICE file distributed with
3  * this work for additional information regarding copyright ownership.
4  * The ASF licenses this file to You under the Apache License, Version 2.0
5  * (the "License"); you may not use this file except in compliance with
6  * the License. You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 /* Portions of this file are covered by */
18 /* -*- mode: c; c-file-style: "k&r" -*-
19 
20  strnatcmp.c -- Perform 'natural order' comparisons of strings in C.
21  Copyright (C) 2000 by Martin Pool <mbp@humbug.org.au>
22 
23  This software is provided 'as-is', without any express or implied
24  warranty. In no event will the authors be held liable for any damages
25  arising from the use of this software.
26 
27  Permission is granted to anyone to use this software for any purpose,
28  including commercial applications, and to alter it and redistribute it
29  freely, subject to the following restrictions:
30 
31  1. The origin of this software must not be misrepresented; you must not
32  claim that you wrote the original software. If you use this software
33  in a product, an acknowledgment in the product documentation would be
34  appreciated but is not required.
35  2. Altered source versions must be plainly marked as such, and must not be
36  misrepresented as being the original software.
37  3. This notice may not be removed or altered from any source distribution.
38 */
39 
40 #ifndef APR_STRINGS_H
41 #define APR_STRINGS_H
42 
48 #include "apr.h"
49 #include "apr_errno.h"
50 #include "apr_pools.h"
51 #define APR_WANT_IOVEC
52 #include "apr_want.h"
53 
54 #if APR_HAVE_STDARG_H
55 #include <stdarg.h>
56 #endif
57 
58 #ifdef __cplusplus
59 extern "C" {
60 #endif /* __cplusplus */
61 
76 APR_DECLARE(int) apr_strnatcmp(char const *a, char const *b);
77 
87 APR_DECLARE(int) apr_strnatcasecmp(char const *a, char const *b);
88 
95 APR_DECLARE(char *) apr_pstrdup(apr_pool_t *p, const char *s);
96 
110 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
111  __attribute__((alloc_size(3)))
112 #endif
113  ;
114 
125 APR_DECLARE(char *) apr_pstrndup(apr_pool_t *p, const char *s, apr_size_t n);
126 
135 APR_DECLARE(void *) apr_pmemdup(apr_pool_t *p, const void *m, apr_size_t n)
136 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
137  __attribute__((alloc_size(3)))
138 #endif
139  ;
140 
148 #if defined(__GNUC__) && __GNUC__ >= 4
149  __attribute__((sentinel))
150 #endif
151  ;
152 
161 APR_DECLARE(char *) apr_pstrcatv(apr_pool_t *p, const struct iovec *vec,
162  apr_size_t nvec, apr_size_t *nbytes);
163 
172 APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap);
173 
182 APR_DECLARE_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...)
183  __attribute__((format(printf,2,3)));
184 
194 
217 APR_DECLARE(char *) apr_cpystrn(char *dst, const char *src,
218  apr_size_t dst_size);
219 
227 APR_DECLARE(char *) apr_collapse_spaces(char *dest, const char *src);
228 
237  char ***argv_out,
238  apr_pool_t *token_context);
239 
257 APR_DECLARE(char *) apr_strtok(char *str, const char *sep, char **last);
258 
290  const char *format, ...)
291  __attribute__((format(printf,3,4)));
292 
301 APR_DECLARE(int) apr_vsnprintf(char *buf, apr_size_t len, const char *format,
302  va_list ap);
311 APR_DECLARE(char *) apr_itoa(apr_pool_t *p, int n);
312 
319 APR_DECLARE(char *) apr_ltoa(apr_pool_t *p, long n);
320 
328 
345 APR_DECLARE(apr_status_t) apr_strtoff(apr_off_t *offset, const char *buf,
346  char **end, int base);
347 
363 APR_DECLARE(apr_int64_t) apr_strtoi64(const char *buf, char **end, int base);
364 
373 
383 
386 #ifdef __cplusplus
387 }
388 #endif
389 
390 #endif /* !APR_STRINGS_H */
APR Platform Definitions.
APR Error Codes.
APR memory allocation.
APR Standard Headers Support.
int int apr_vsnprintf(char *buf, apr_size_t len, const char *format, va_list ap)
int apr_snprintf(char *buf, apr_size_t len, const char *format,...) __attribute__((format(printf
dav_buffer apr_size_t size
Definition: mod_dav.h:461
dav_buffer const char * str
Definition: mod_dav.h:465
const char * s
Definition: mod_dav.h:1327
dav_error * src
Definition: mod_dav.h:186
int apr_status_t
Definition: apr_errno.h:44
off_t apr_off_t
Definition: apr.h:396
#define __attribute__(__x)
Definition: apr.h:63
size_t apr_size_t
Definition: apr.h:394
int64_t apr_int64_t
Definition: apr.h:386
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
char * apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap)
char * apr_pstrmemdup(apr_pool_t *p, const char *s, apr_size_t n)
apr_status_t apr_strtoff(apr_off_t *offset, const char *buf, char **end, int base)
char * apr_pstrcatv(apr_pool_t *p, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes)
int apr_strnatcasecmp(char const *a, char const *b)
char * apr_strtok(char *str, const char *sep, char **last)
apr_int64_t apr_strtoi64(const char *buf, char **end, int base)
char apr_status_t apr_memzero_explicit(void *buffer, apr_size_t size)
apr_status_t apr_tokenize_to_argv(const char *arg_str, char ***argv_out, apr_pool_t *token_context)
char * apr_ltoa(apr_pool_t *p, long n)
char * apr_cpystrn(char *dst, const char *src, apr_size_t dst_size)
char * apr_pstrcat(apr_pool_t *p,...)
char * apr_pstrdup(apr_pool_t *p, const char *s)
char * apr_psprintf(apr_pool_t *p, const char *fmt,...) __attribute__((format(printf
char * apr_off_t_toa(apr_pool_t *p, apr_off_t n)
int apr_strnatcmp(char const *a, char const *b)
void * apr_pmemdup(apr_pool_t *p, const void *m, apr_size_t n)
char * apr_pstrndup(apr_pool_t *p, const char *s, apr_size_t n)
char * apr_itoa(apr_pool_t *p, int n)
apr_int64_t apr_atoi64(const char *buf)
char * apr_strfsize(apr_off_t size, char *buf)
char * apr_collapse_spaces(char *dest, const char *src)
#define APR_DECLARE(x)
Definition: macros.h:6
#define APR_DECLARE_NONSTD(x)
Definition: macros.h:7
apr_pool_t * p