Apache HTTPD
util_varbuf.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
31#ifndef AP_VARBUF_H
32#define AP_VARBUF_H
33
34#include "apr.h"
35#include "apr_allocator.h"
36
37#include "httpd.h"
38
39#ifdef __cplusplus
40extern "C" {
41#endif
42
43#define AP_VARBUF_UNKNOWN APR_SIZE_MAX
44struct ap_varbuf_info;
45
47struct ap_varbuf {
50 char *buf;
51
54 apr_size_t avail;
55
59 apr_size_t strlen;
60
64
67};
68
81 apr_size_t init_size);
82
96AP_DECLARE(void) ap_varbuf_grow(struct ap_varbuf *vb, apr_size_t new_size);
97
106AP_DECLARE(void) ap_varbuf_free(struct ap_varbuf *vb);
107
119AP_DECLARE(void) ap_varbuf_strmemcat(struct ap_varbuf *vb, const char *str,
120 int len);
121
139AP_DECLARE(char *) ap_varbuf_pdup(apr_pool_t *p, struct ap_varbuf *vb,
140 const char *prepend, apr_size_t prepend_len,
141 const char *append, apr_size_t append_len,
142 apr_size_t *new_len);
143
144
151#define ap_varbuf_strcat(vb, str) ap_varbuf_strmemcat(vb, str, strlen(str))
152
172 const char *input,
173 const char *source,
174 apr_size_t nmatch,
176 apr_size_t maxlen);
177
189 ap_configfile_t *cfp,
190 apr_size_t max_len);
191
192#ifdef __cplusplus
193}
194#endif
195
196#endif /* !AP_VARBUF_H */
#define AP_DECLARE(type)
Definition ap_config.h:67
const char apr_size_t ap_regmatch_t * pmatch
Definition ap_regex.h:172
const char apr_size_t len
Definition ap_regex.h:187
const char apr_size_t nmatch
Definition ap_regex.h:172
APR Internal Memory Allocation.
apr_status_t ap_varbuf_cfg_getline(struct ap_varbuf *vb, ap_configfile_t *cfp, apr_size_t max_len)
Definition util.c:1207
void ap_varbuf_free(struct ap_varbuf *vb)
Definition util.c:3081
void ap_varbuf_grow(struct ap_varbuf *vb, apr_size_t new_size)
Definition util.c:2971
void ap_varbuf_strmemcat(struct ap_varbuf *vb, const char *str, int len)
Definition util.c:3061
apr_status_t ap_varbuf_regsub(struct ap_varbuf *vb, const char *input, const char *source, apr_size_t nmatch, ap_regmatch_t pmatch[], apr_size_t maxlen)
Definition util.c:3123
char * ap_varbuf_pdup(apr_pool_t *p, struct ap_varbuf *vb, const char *prepend, apr_size_t prepend_len, const char *append, apr_size_t append_len, apr_size_t *new_len)
Definition util.c:3090
void ap_varbuf_init(apr_pool_t *pool, struct ap_varbuf *vb, apr_size_t init_size)
Definition util.c:2959
const char int apr_pool_t * pool
Definition apr_cstr.h:84
const char * input
Definition apr_cstr.h:93
int apr_status_t
Definition apr_errno.h:44
apr_sockaddr_t apr_sockaddr_t apr_sockaddr_t * source
HTTP Daemon routines.
apr_pool_t * p
Definition md_event.c:32
apr_pool_t * pool
Definition util_varbuf.h:63
apr_size_t avail
Definition util_varbuf.h:54
apr_size_t strlen
Definition util_varbuf.h:59
char * buf
Definition util_varbuf.h:50
struct ap_varbuf_info * info
Definition util_varbuf.h:66
#define str