apr  1.7.0
About: APR (Apache Portable Runtime) project offers software libraries that provide a predictable and consistent interface to underlying platform-specific implementations (APR core library).
  Fossies Dox: apr-1.7.0.tar.bz2  ("inofficial" and yet experimental doxygen-generated source code documentation)  

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 
109 APR_DECLARE(char *) apr_pstrmemdup(apr_pool_t *p, const char *s, apr_size_t n)
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 
147 APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *p, ...)
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 
207 APR_DECLARE(char *) apr_cpystrn(char *dst, const char *src,
208  apr_size_t dst_size);
209 
217 APR_DECLARE(char *) apr_collapse_spaces(char *dest, const char *src);
218 
226 APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str,
227  char ***argv_out,
229 
247 APR_DECLARE(char *) apr_strtok(char *str, const char *sep, char **last);
248 
279 APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, apr_size_t len,
280  const char *format, ...)
281  __attribute__((format(printf,3,4)));
282 
291 APR_DECLARE(int) apr_vsnprintf(char *buf, apr_size_t len, const char *format,
292  va_list ap);
301 APR_DECLARE(char *) apr_itoa(apr_pool_t *p, int n);
302 
309 APR_DECLARE(char *) apr_ltoa(apr_pool_t *p, long n);
310 
317 APR_DECLARE(char *) apr_off_t_toa(apr_pool_t *p, apr_off_t n);
318 
335 APR_DECLARE(apr_status_t) apr_strtoff(apr_off_t *offset, const char *buf,
336  char **end, int base);
337 
353 APR_DECLARE(apr_int64_t) apr_strtoi64(const char *buf, char **end, int base);
354 
362 APR_DECLARE(apr_int64_t) apr_atoi64(const char *buf);
363 
372 APR_DECLARE(char *) apr_strfsize(apr_off_t size, char *buf);
373 
376 #ifdef __cplusplus
377 }
378 #endif
379 
380 #endif /* !APR_STRINGS_H */
m
const void * m
Definition: apr_strings.h:135
argv_out
char *** argv_out
Definition: apr_strings.h:227
apr_errno.h
APR Error Codes.
str
char ** str
Definition: apr_cstr.h:125
p
const char apr_int32_t apr_pool_t * p
Definition: apr_file_info.h:337
end
const char char ** end
Definition: apr_strings.h:335
buf
const char * buf
Definition: apr_strings.h:335
sep
const char * sep
Definition: apr_strings.h:247
offset
apr_seek_where_t apr_off_t * offset
Definition: apr_file_io.h:717
src
const char * src
Definition: apr_strings.h:207
size
apr_size_t size
Definition: apr_allocator.h:115
apr_want.h
APR Standard Headers Support.
s
const char * s
Definition: apr_strings.h:95
APR_DECLARE_NONSTD
APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *p
last
const char char ** last
Definition: apr_strings.h:247
fmt
const char * fmt
Definition: apr_strings.h:172
nvec
const struct iovec apr_size_t nvec
Definition: apr_strings.h:161
apr_pool_t
Definition: apr_pools.c:577
format
apr_size_t const char * format
Definition: apr_strings.h:279
vec
const struct iovec * vec
Definition: apr_strings.h:161
nbytes
const struct iovec apr_size_t apr_size_t * nbytes
Definition: apr_strings.h:161
__attribute__
const char __attribute__((format(printf, 2, 3)))
apr_status_t
int apr_status_t
Definition: apr_errno.h:44
n
const char apr_size_t n
Definition: apr_strings.h:109
APR_DECLARE
APR_DECLARE(int) apr_strnatcmp(char const *a
apr_pools.h
APR memory allocation.
len
apr_size_t len
Definition: apr_strings.h:279
token_context
char apr_pool_t * token_context
Definition: apr_strings.h:227
b
const char * b
Definition: apr_strings.h:76
base
const char char int base
Definition: apr_strings.h:335
ap
const char va_list ap
Definition: apr_strings.h:172
dst_size
const char apr_size_t dst_size
Definition: apr_strings.h:207