/**< an apr_file_getc()-like function */
apr_status_t (*getch) (char *ch, void *param);
/**< an apr_file_gets()-like function */
- apr_status_t (*getstr) (void *buf, size_t bufsiz, void *param);
+ apr_status_t (*getstr) (void *buf, apr_size_t bufsiz, void *param);
/**< a close handler function */
apr_status_t (*close) (void *param);
/**< the argument passed to getch/getstr/close */
const char *descr,
void *param,
apr_status_t (*getc_func) (char *ch, void *param),
- apr_status_t (*gets_func) (void *buf, size_t bufsiz, void *param),
+ apr_status_t (*gets_func) (void *buf, apr_size_t bufsiz, void *param),
apr_status_t (*close_func) (void *param));
/**
* @param cfp File to read from
* @return error status, APR_ENOSPC if bufsize is too small for the line
*/
-AP_DECLARE(apr_status_t) ap_cfg_getline(char *buf, size_t bufsize, ap_configfile_t *cfp);
+AP_DECLARE(apr_status_t) ap_cfg_getline(char *buf, apr_size_t bufsize, ap_configfile_t *cfp);
/**
* Read one char from open configfile_t, increase line number upon LF
* @param r The current request
* @return the maximum number of bytes in XML request msg body
*/
-AP_DECLARE(size_t) ap_get_limit_xml_body(const request_rec *r);
+AP_DECLARE(apr_size_t) ap_get_limit_xml_body(const request_rec *r);
/**
* Install a custom response handler for a given status
* @param length The amount of data to send
* @return The number of bytes sent
*/
-AP_DECLARE(size_t) ap_send_mmap(apr_mmap_t *mm, request_rec *r, size_t offset,
- size_t length);
+AP_DECLARE(apr_size_t) ap_send_mmap(apr_mmap_t *mm,
+ request_rec *r,
+ apr_size_t offset,
+ apr_size_t length);
#endif
* @param pmatch the pmatch array returned from ap_pregex
* @return The substituted string, or NULL on error
*/
-AP_DECLARE(char *) ap_pregsub(apr_pool_t *p, const char *input, const char *source,
- size_t nmatch, ap_regmatch_t pmatch[]);
+AP_DECLARE(char *) ap_pregsub(apr_pool_t *p, const char *input,
+ const char *source, apr_size_t nmatch,
+ ap_regmatch_t pmatch[]);
/**
* After performing a successful regex match, you may use this function to
*/
AP_DECLARE(apr_status_t) ap_pregsub_ex(apr_pool_t *p, char **result,
const char *input, const char *source,
- size_t nmatch, ap_regmatch_t pmatch[],
+ apr_size_t nmatch,
+ ap_regmatch_t pmatch[],
apr_size_t maxlen);
/**
*/
AP_DECLARE(apr_status_t) ap_varbuf_regsub(struct ap_varbuf *vb,
const char *input,
- const char *source, size_t nmatch,
+ const char *source,
+ apr_size_t nmatch,
ap_regmatch_t pmatch[],
apr_size_t maxlen);
/* arr_elts_getstr() returns the next line from the string array. */
-static apr_status_t arr_elts_getstr(void *buf, size_t bufsiz, void *param)
+static apr_status_t arr_elts_getstr(void *buf, apr_size_t bufsiz, void *param)
{
arr_elts_param_t *arr_param = (arr_elts_param_t *)param;
char *elt;
/* LimitXMLRequestBody handling */
#define AP_LIMIT_UNSET ((long) -1)
-#define AP_DEFAULT_LIMIT_XML_BODY ((size_t)1000000)
+#define AP_DEFAULT_LIMIT_XML_BODY ((apr_size_t)1000000)
#define AP_MIN_SENDFILE_BYTES (256)
return NULL;
}
-AP_DECLARE(size_t) ap_get_limit_xml_body(const request_rec *r)
+AP_DECLARE(apr_size_t) ap_get_limit_xml_body(const request_rec *r)
{
core_dir_config *conf;
if (conf->limit_xml_body == AP_LIMIT_UNSET)
return AP_DEFAULT_LIMIT_XML_BODY;
- return (size_t)conf->limit_xml_body;
+ return (apr_size_t)conf->limit_xml_body;
}
#if !defined (RLIMIT_CPU) || !(defined (RLIMIT_DATA) || defined (RLIMIT_VMEM) || defined(RLIMIT_AS)) || !defined (RLIMIT_NPROC)
#if APR_HAS_MMAP
/* send data from an in-memory buffer */
-AP_DECLARE(size_t) ap_send_mmap(apr_mmap_t *mm, request_rec *r, size_t offset,
- size_t length)
+AP_DECLARE(apr_size_t) ap_send_mmap(apr_mmap_t *mm,
+ request_rec *r,
+ apr_size_t offset,
+ apr_size_t length)
{
conn_rec *c = r->connection;
apr_bucket_brigade *bb = NULL;
seg_name = r->filename + filename_len;
delim = strchr(r->path_info + (*r->path_info == '/' ? 1 : 0), '/');
if (delim) {
- size_t path_info_len = delim - r->path_info;
+ apr_size_t path_info_len = delim - r->path_info;
*delim = '\0';
memcpy(seg_name, r->path_info, path_info_len + 1);
filename_len += path_info_len;
*delim = '/';
}
else {
- size_t path_info_len = strlen(r->path_info);
+ apr_size_t path_info_len = strlen(r->path_info);
memcpy(seg_name, r->path_info, path_info_len + 1);
filename_len += path_info_len;
r->path_info += path_info_len;
static apr_status_t regsub_core(apr_pool_t *p, char **result,
struct ap_varbuf *vb, const char *input,
- const char *source, size_t nmatch,
+ const char *source, apr_size_t nmatch,
ap_regmatch_t pmatch[], apr_size_t maxlen)
{
const char *src = input;
char *dst;
char c;
- size_t no;
+ apr_size_t no;
apr_size_t len = 0;
AP_DEBUG_ASSERT((result && p && !vb) || (vb && !p && !result));
#define AP_PREGSUB_MAXLEN (HUGE_STRING_LEN * 8)
#endif
AP_DECLARE(char *) ap_pregsub(apr_pool_t *p, const char *input,
- const char *source, size_t nmatch,
+ const char *source, apr_size_t nmatch,
ap_regmatch_t pmatch[])
{
char *result;
AP_DECLARE(apr_status_t) ap_pregsub_ex(apr_pool_t *p, char **result,
const char *input, const char *source,
- size_t nmatch, ap_regmatch_t pmatch[],
+ apr_size_t nmatch, ap_regmatch_t pmatch[],
apr_size_t maxlen)
{
apr_status_t rc = regsub_core(p, result, NULL, input, source, nmatch,
char *res;
if (!pos) {
- size_t len = strlen(*line);
+ apr_size_t len = strlen(*line);
res = apr_pstrmemdup(atrans, *line, len);
*line += len;
return res;
return apr_file_getc(ch, param);
}
-static apr_status_t cfg_getstr(void *buf, size_t bufsiz, void *param)
+static apr_status_t cfg_getstr(void *buf, apr_size_t bufsiz, void *param)
{
return apr_file_gets(buf, bufsiz, param);
}
AP_DECLARE(ap_configfile_t *) ap_pcfg_open_custom(
apr_pool_t *p, const char *descr, void *param,
apr_status_t (*getc_func) (char *ch, void *param),
- apr_status_t (*gets_func) (void *buf, size_t bufsize, void *param),
+ apr_status_t (*gets_func) (void *buf, apr_size_t bufsize, void *param),
apr_status_t (*close_func) (void *param))
{
ap_configfile_t *new_cfg = apr_palloc(p, sizeof(*new_cfg));
/* Read one line from open ap_configfile_t, strip LF, increase line number */
/* If custom handler does not define a getstr() function, read char by char */
-static apr_status_t ap_cfg_getline_core(char *buf, size_t bufsize,
+static apr_status_t ap_cfg_getline_core(char *buf, apr_size_t bufsize,
ap_configfile_t *cfp)
{
apr_status_t rc;
if (cfp->getstr != NULL) {
char *cp;
char *cbuf = buf;
- size_t cbufsize = bufsize;
+ apr_size_t cbufsize = bufsize;
while (1) {
++cfp->line_number;
}
} else {
/* No "get string" function defined; read character by character */
- size_t i = 0;
+ apr_size_t i = 0;
if (bufsize < 2) {
/* too small, assume caller is crazy */
/* Read one line from open ap_configfile_t, strip LF, increase line number */
/* If custom handler does not define a getstr() function, read char by char */
-AP_DECLARE(apr_status_t) ap_cfg_getline(char *buf, size_t bufsize, ap_configfile_t *cfp)
+AP_DECLARE(apr_status_t) ap_cfg_getline(char *buf, apr_size_t bufsize,
+ ap_configfile_t *cfp)
{
apr_status_t rc = ap_cfg_getline_core(buf, bufsize, cfp);
if (rc == APR_SUCCESS)
AP_DECLARE(apr_status_t) ap_varbuf_regsub(struct ap_varbuf *vb,
const char *input,
- const char *source, size_t nmatch,
+ const char *source,
+ apr_size_t nmatch,
ap_regmatch_t pmatch[],
apr_size_t maxlen)
{
char *last1, *last2;
char *cookie = apr_pstrdup(v->r->pool, val);
const char *name = apr_pstrcat(v->r->pool, v->name ? v->name : "", "=", NULL);
- size_t len = strlen(name);
+ apr_size_t len = strlen(name);
const char *new_cookie = "";
const char *comma = ",";
char *next1;