apr_strings.h

Go to the documentation of this file.
00001 /* Licensed to the Apache Software Foundation (ASF) under one or more
00002  * contributor license agreements.  See the NOTICE file distributed with
00003  * this work for additional information regarding copyright ownership.
00004  * The ASF licenses this file to You under the Apache License, Version 2.0
00005  * (the "License"); you may not use this file except in compliance with
00006  * the License.  You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 /* Portions of this file are covered by */
00018 /* -*- mode: c; c-file-style: "k&r" -*-
00019 
00020   strnatcmp.c -- Perform 'natural order' comparisons of strings in C.
00021   Copyright (C) 2000 by Martin Pool <mbp@humbug.org.au>
00022 
00023   This software is provided 'as-is', without any express or implied
00024   warranty.  In no event will the authors be held liable for any damages
00025   arising from the use of this software.
00026 
00027   Permission is granted to anyone to use this software for any purpose,
00028   including commercial applications, and to alter it and redistribute it
00029   freely, subject to the following restrictions:
00030 
00031   1. The origin of this software must not be misrepresented; you must not
00032      claim that you wrote the original software. If you use this software
00033      in a product, an acknowledgment in the product documentation would be
00034      appreciated but is not required.
00035   2. Altered source versions must be plainly marked as such, and must not be
00036      misrepresented as being the original software.
00037   3. This notice may not be removed or altered from any source distribution.
00038 */
00039 
00040 #ifndef APR_STRINGS_H
00041 #define APR_STRINGS_H
00042 
00048 #include "apr.h"
00049 #include "apr_errno.h"
00050 #include "apr_pools.h"
00051 #define APR_WANT_IOVEC
00052 #include "apr_want.h"
00053 
00054 #if APR_HAVE_STDARG_H
00055 #include <stdarg.h>
00056 #endif
00057 
00058 #ifdef __cplusplus
00059 extern "C" {
00060 #endif /* __cplusplus */
00061 
00076 APR_DECLARE(int) apr_strnatcmp(char const *a, char const *b);
00077 
00087 APR_DECLARE(int) apr_strnatcasecmp(char const *a, char const *b);
00088 
00095 APR_DECLARE(char *) apr_pstrdup(apr_pool_t *p, const char *s);
00096 
00109 APR_DECLARE(char *) apr_pstrmemdup(apr_pool_t *p, const char *s, apr_size_t n);
00110 
00121 APR_DECLARE(char *) apr_pstrndup(apr_pool_t *p, const char *s, apr_size_t n);
00122 
00131 APR_DECLARE(void *) apr_pmemdup(apr_pool_t *p, const void *m, apr_size_t n);
00132 
00139 APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *p, ...);
00140 
00149 APR_DECLARE(char *) apr_pstrcatv(apr_pool_t *p, const struct iovec *vec,
00150                                  apr_size_t nvec, apr_size_t *nbytes);
00151 
00160 APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap);
00161 
00170 APR_DECLARE_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...)
00171         __attribute__((format(printf,2,3)));
00172 
00192 APR_DECLARE(char *) apr_cpystrn(char *dst, const char *src,
00193                                 apr_size_t dst_size);
00194 
00201 APR_DECLARE(char *) apr_collapse_spaces(char *dest, const char *src);
00202 
00210 APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str,
00211                                                char ***argv_out,
00212                                                apr_pool_t *token_context);
00213 
00225 APR_DECLARE(char *) apr_strtok(char *str, const char *sep, char **last);
00226 
00257 APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, apr_size_t len,
00258                                      const char *format, ...)
00259         __attribute__((format(printf,3,4)));
00260 
00269 APR_DECLARE(int) apr_vsnprintf(char *buf, apr_size_t len, const char *format,
00270                                va_list ap);
00279 APR_DECLARE(char *) apr_itoa(apr_pool_t *p, int n);
00280 
00287 APR_DECLARE(char *) apr_ltoa(apr_pool_t *p, long n);
00288 
00295 APR_DECLARE(char *) apr_off_t_toa(apr_pool_t *p, apr_off_t n);
00296 
00311 APR_DECLARE(apr_int64_t) apr_strtoi64(const char *buf, char **end, int base);
00312 
00319 APR_DECLARE(apr_int64_t) apr_atoi64(const char *buf);
00320 
00329 APR_DECLARE(char *) apr_strfsize(apr_off_t size, char *buf);
00330 
00333 #ifdef __cplusplus
00334 }
00335 #endif
00336 
00337 #endif  /* !APR_STRINGS_H */

Generated on Mon Nov 26 11:47:26 2007 for Apache Portable Runtime by  doxygen 1.5.2