Apache2
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
40 extern "C" {
41 #endif
42 
43 #define AP_VARBUF_UNKNOWN APR_SIZE_MAX
44 struct ap_varbuf_info;
45 
47 struct ap_varbuf {
50  char *buf;
51 
55 
60 
64 
66  struct ap_varbuf_info *info;
67 };
68 
81  apr_size_t init_size);
82 
96 AP_DECLARE(void) ap_varbuf_grow(struct ap_varbuf *vb, apr_size_t new_size);
97 
107 
119 AP_DECLARE(void) ap_varbuf_strmemcat(struct ap_varbuf *vb, const char *str,
120  int len);
121 
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,
175  ap_regmatch_t pmatch[],
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 */
APR Platform Definitions.
APR Internal Memory Allocation.
apr_status_t ap_varbuf_cfg_getline(struct ap_varbuf *vb, ap_configfile_t *cfp, apr_size_t max_len)
void ap_varbuf_free(struct ap_varbuf *vb)
void ap_varbuf_grow(struct ap_varbuf *vb, apr_size_t new_size)
void ap_varbuf_strmemcat(struct ap_varbuf *vb, const char *str, int len)
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)
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)
void ap_varbuf_init(apr_pool_t *pool, struct ap_varbuf *vb, apr_size_t init_size)
dav_buffer const char * str
Definition: mod_dav.h:465
apr_bucket_brigade request_rec apr_pool_t * pool
Definition: mod_dav.h:557
int apr_status_t
Definition: apr_errno.h:44
size_t apr_size_t
Definition: apr.h:394
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
HTTP Daemon routines.
#define AP_DECLARE(x)
Definition: macros.h:1
Definition: http_config.h:268
Definition: ap_regex.h:118
Definition: util_varbuf.h:47
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
apr_pool_t * p