af_gb_init:
   17|  1.24k|void af_gb_init() {
   18|  1.24k|  pointer_idx = 0;
   19|       |
   20|   126k|   for (int i = 0; i < GB_SIZE; i++) {
  ------------------
  |  |   10|   126k|#define GB_SIZE 100
  ------------------
  |  Branch (20:20): [True: 124k, False: 1.24k]
  ------------------
   21|       |     pointer_arr[i] = NULL;
   22|   124k|   }
   23|  1.24k|}
af_gb_cleanup:
   25|  1.24k|void af_gb_cleanup() {
   26|   126k|  for(int i = 0; i < GB_SIZE; i++) {
  ------------------
  |  |   10|   126k|#define GB_SIZE 100
  ------------------
  |  Branch (26:18): [True: 124k, False: 1.24k]
  ------------------
   27|   124k|    if (pointer_arr[i] != NULL) {
  ------------------
  |  Branch (27:9): [True: 4.57k, False: 120k]
  ------------------
   28|  4.57k|      free(pointer_arr[i]);
   29|  4.57k|    }
   30|   124k|  }
   31|  1.24k|}
af_get_null_terminated:
   33|  12.3k|char *af_get_null_terminated(const uint8_t **data, size_t *size) {
   34|  12.3k|#define STR_SIZE 75
   35|  12.3k|  if (*size < STR_SIZE || (int)*size < 0) {
  ------------------
  |  |   34|  24.6k|#define STR_SIZE 75
  ------------------
  |  Branch (35:7): [True: 7.76k, False: 4.57k]
  |  Branch (35:27): [True: 0, False: 4.57k]
  ------------------
   36|  7.76k|    return NULL;
   37|  7.76k|  }
   38|       |
   39|  4.57k|  char *new_s = malloc(STR_SIZE + 1);
  ------------------
  |  |   34|  4.57k|#define STR_SIZE 75
  ------------------
   40|  4.57k|  memcpy(new_s, *data, STR_SIZE);
  ------------------
  |  |   34|  4.57k|#define STR_SIZE 75
  ------------------
   41|  4.57k|  new_s[STR_SIZE] = '\0';
  ------------------
  |  |   34|  4.57k|#define STR_SIZE 75
  ------------------
   42|       |
   43|  4.57k|  *data = *data+STR_SIZE;
  ------------------
  |  |   34|  4.57k|#define STR_SIZE 75
  ------------------
   44|  4.57k|  *size -= STR_SIZE;
  ------------------
  |  |   34|  4.57k|#define STR_SIZE 75
  ------------------
   45|  4.57k|  return new_s;
   46|  12.3k|}
af_gb_get_null_terminated:
   64|  12.3k|char *af_gb_get_null_terminated(const uint8_t **data, size_t *size) {
   65|       |
   66|  12.3k|  char *nstr = af_get_null_terminated(data, size);
   67|  12.3k|  if (nstr == NULL) {
  ------------------
  |  Branch (67:7): [True: 7.76k, False: 4.57k]
  ------------------
   68|  7.76k|    return NULL;
   69|  7.76k|  }
   70|  4.57k|  pointer_arr[pointer_idx++] = (void*)nstr;
   71|  4.57k|  return nstr;
   72|  12.3k|}
af_get_short:
   90|  1.23k|short af_get_short(const uint8_t **data, size_t *size) {
   91|  1.23k|  if (*size <= 0) return 0;
  ------------------
  |  Branch (91:7): [True: 994, False: 237]
  ------------------
   92|    237|  short c = (short)(*data)[0];
   93|    237|  *data += 1;
   94|    237|  *size-=1;
   95|    237|  return c;
   96|  1.23k|}

LLVMFuzzerTestOneInput:
   42|  1.24k|int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
   43|       |  // Initialize fuzzing garbage collector. We use this to easily
   44|       |  // get data types seeded with random input from the fuzzer.
   45|  1.24k|  af_gb_init();
   46|       |
   47|  1.24k|  const uint8_t *data2 = data;
   48|  1.24k|  size_t size2 = size;
   49|       |
   50|  1.24k|  char *new_str = af_gb_get_null_terminated(&data2, &size2);
   51|  1.24k|  char *new_dst = af_gb_get_null_terminated(&data2, &size2);
   52|  1.24k|  if (new_str != NULL && new_dst != NULL) {
  ------------------
  |  Branch (52:7): [True: 1.23k, False: 15]
  |  Branch (52:26): [True: 1.23k, False: 3]
  ------------------
   53|  1.23k|    size_t new_str_len = strlen(new_str);
   54|       |
   55|       |    // Targets that do not require a pool
   56|       |
   57|  1.23k|    ap_cstr_casecmp(new_str, new_dst);
   58|  1.23k|    if (new_str_len > 2) {
  ------------------
  |  Branch (58:9): [True: 1.19k, False: 34]
  ------------------
   59|  1.19k|      ap_cstr_casecmpn(new_str, new_str + 2, new_str_len - 2);
   60|  1.19k|    }
   61|  1.23k|    ap_strcmp_match(new_str, new_dst);
   62|  1.23k|    ap_strcasecmp_match(new_str, new_dst);
   63|  1.23k|    ap_strcasestr(new_str, new_dst);
   64|       |
   65|  1.23k|    apr_interval_time_t timeout;
   66|  1.23k|    ap_timeout_parameter_parse(new_str, &timeout, "ms");
   67|       |
   68|  1.23k|    new_dst = af_gb_get_null_terminated(&data2, &size2);
   69|  1.23k|    if (new_dst != NULL) {
  ------------------
  |  Branch (69:9): [True: 399, False: 832]
  ------------------
   70|    399|      ap_getparents(new_dst);
   71|    399|    }
   72|       |
   73|  1.23k|    new_dst = af_gb_get_null_terminated(&data2, &size2);
   74|  1.23k|    if (new_dst != NULL) {
  ------------------
  |  Branch (74:9): [True: 323, False: 908]
  ------------------
   75|    323|      ap_no2slash(new_dst);
   76|    323|    }
   77|       |
   78|  1.23k|    new_dst = af_gb_get_null_terminated(&data2, &size2);
   79|  1.23k|    if (new_dst != NULL) {
  ------------------
  |  Branch (79:9): [True: 303, False: 928]
  ------------------
   80|    303|      ap_unescape_url(new_dst);
   81|    303|    }
   82|       |
   83|  1.23k|    new_dst = af_gb_get_null_terminated(&data2, &size2);
   84|  1.23k|    if (new_dst != NULL) {
  ------------------
  |  Branch (84:9): [True: 263, False: 968]
  ------------------
   85|    263|      ap_unescape_urlencoded(new_dst);
   86|    263|    }
   87|       |
   88|  1.23k|    new_dst = af_gb_get_null_terminated(&data2, &size2);
   89|  1.23k|    if (new_dst != NULL) {
  ------------------
  |  Branch (89:9): [True: 229, False: 1.00k]
  ------------------
   90|    229|      ap_content_type_tolower(new_dst);
   91|    229|    }
   92|       |
   93|  1.23k|    new_dst = malloc(new_str_len*3+1); // big enough for worst-case URL-escaped (%nn)
   94|  1.23k|    ap_escape_path_segment_buffer(new_dst, new_str);
   95|  1.23k|    free(new_dst);
   96|       |
   97|  1.23k|    new_dst = malloc(new_str_len*4+1); // big enough for worst-case log-escaped (\xnn)
   98|  1.23k|    ap_escape_errorlog_item(new_dst, new_str, new_str_len*4+1);
   99|  1.23k|    free(new_dst);
  100|       |
  101|       |    // Pool initialisation
  102|  1.23k|    if (apr_pool_initialize() == APR_SUCCESS) {
  ------------------
  |  |  225|  1.23k|#define APR_SUCCESS 0
  ------------------
  |  Branch (102:9): [True: 1.23k, False: 0]
  ------------------
  103|  1.23k|      apr_pool_t *pool = NULL;
  104|  1.23k|      apr_pool_create(&pool, NULL);
  ------------------
  |  |  301|  1.23k|    apr_pool_create_ex(newpool, parent, NULL, NULL)
  ------------------
  105|       |
  106|       |      // Targets that require a pool
  107|       |
  108|  1.23k|      new_dst = af_gb_get_null_terminated(&data2, &size2);
  109|  1.23k|      if (new_dst != NULL) {
  ------------------
  |  Branch (109:11): [True: 214, False: 1.01k]
  ------------------
  110|    214|        ap_make_dirstr_parent(pool, new_dst);
  111|    214|      }
  112|       |
  113|  1.23k|      ap_field_noparam(pool, new_str);
  114|       |
  115|  1.23k|      ap_escape_shell_cmd(pool, new_str);
  116|  1.23k|      ap_os_escape_path(pool, new_str, 0);
  117|  1.23k|      ap_escape_html2(pool, new_str, 0);
  118|  1.23k|      ap_escape_logitem(pool, new_str);
  119|       |
  120|       |      // This line causes some issues if something bad is allocated
  121|  1.23k|      ap_escape_quotes(pool, new_str);
  122|       |
  123|       |      // base64
  124|  1.23k|      ap_pbase64decode(pool, new_str);
  125|  1.23k|      ap_pbase64encode(pool, new_str);
  126|  1.23k|      new_dst = af_gb_get_null_terminated(&data2, &size2);
  127|  1.23k|      if (new_dst != NULL) {
  ------------------
  |  Branch (127:11): [True: 210, False: 1.02k]
  ------------------
  128|    210|        char *d;
  129|    210|        apr_size_t dlen;
  130|    210|        ap_pbase64decode_strict(pool, new_dst, &d, &dlen);
  131|    210|      }
  132|       |
  133|       |      // List functions
  134|  1.23k|      const char *tmp_s = new_str;
  135|  1.23k|      ap_get_list_item(pool, &tmp_s);
  136|  1.23k|      ap_find_list_item(pool, new_str, "kjahsdfkj");
  137|  1.23k|      ap_find_token(pool, new_str, "klsjdfk");
  138|  1.23k|      ap_find_last_token(pool, new_str, "sdadf");
  139|  1.23k|      apr_array_header_t *offers = NULL;
  140|  1.23k|      ap_parse_token_list_strict(pool, new_str, &offers, 0);
  141|       |
  142|  1.23k|      tmp_s = new_str;
  143|  1.23k|      ap_get_token(pool, &tmp_s, 1);
  144|       |
  145|  1.23k|      tmp_s = NULL;
  146|  1.23k|      ap_pstr2_alnum(pool, new_str, &tmp_s);
  147|       |
  148|  1.23k|      ap_is_chunked(pool, new_str);
  149|       |
  150|       |      // Word functions
  151|  1.23k|      tmp_s = new_str;
  152|  1.23k|      ap_getword(pool, &tmp_s, 0);
  153|  1.23k|      tmp_s = new_str;
  154|  1.23k|      ap_getword_conf2(pool, &tmp_s);
  155|  1.23k|      new_dst = af_gb_get_null_terminated(&data2, &size2);
  156|  1.23k|      if (new_dst != NULL) {
  ------------------
  |  Branch (156:11): [True: 171, False: 1.06k]
  ------------------
  157|    171|        char *d = new_dst;
  158|    171|        ap_getword_white_nc(pool, &d);
  159|    171|      }
  160|       |
  161|  1.23k|      ap_escape_urlencoded(pool, new_str);
  162|       |
  163|       |
  164|  1.23k|			char filename[256];
  165|  1.23k|			sprintf(filename, "/tmp/libfuzzer.%d", getpid());
  166|  1.23k|			FILE *fp = fopen(filename, "wb");
  167|  1.23k|			fwrite(data, size, 1, fp);
  168|  1.23k|			fclose(fp);
  169|       |
  170|       |			// Fuzzer logic here
  171|  1.23k|			ap_configfile_t *cfg;
  172|  1.23k|			ap_pcfg_openfile(&cfg, pool, filename);
  173|  1.23k|      char tmp_line[100];
  174|  1.23k|      if ((af_get_short(&data2, &size2) % 2) == 0) {
  ------------------
  |  Branch (174:11): [True: 1.11k, False: 113]
  ------------------
  175|  1.11k|        ap_cfg_getline(tmp_line, 100, cfg);
  176|  1.11k|      }
  177|    113|      else {
  178|    113|        cfg->getstr = NULL;
  179|    113|        ap_cfg_getline(tmp_line, 100, cfg);
  180|    113|      }
  181|       |			// Fuzzer logic end
  182|       |
  183|  1.23k|			unlink(filename);
  184|       |
  185|       |      // Cleanup
  186|  1.23k|      apr_pool_terminate();
  187|  1.23k|    }
  188|  1.23k|  }
  189|       |
  190|       |  // Cleanup all of the memory allocated by the fuzz headers.
  191|  1.24k|  af_gb_cleanup();
  192|  1.24k|  return 0;
  193|  1.24k|}

ap_field_noparam:
   94|  1.23k|{
   95|  1.23k|    const char *semi;
   96|       |
   97|  1.23k|    if (intype == NULL) return NULL;
  ------------------
  |  Branch (97:9): [True: 0, False: 1.23k]
  ------------------
   98|       |
   99|  1.23k|    semi = ap_strchr_c(intype, ';');
  ------------------
  |  | 2575|  1.23k|# define ap_strchr_c(s, c)   strchr(s, c)
  ------------------
  100|  1.23k|    if (semi == NULL) {
  ------------------
  |  Branch (100:9): [True: 1.13k, False: 101]
  ------------------
  101|  1.13k|        return apr_pstrdup(p, intype);
  102|  1.13k|    }
  103|    101|    else {
  104|    349|        while ((semi > intype) && apr_isspace(semi[-1])) {
  ------------------
  |  |  228|    345|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (228:24): [True: 248, False: 97]
  |  |  ------------------
  ------------------
  |  Branch (104:16): [True: 345, False: 4]
  ------------------
  105|    248|            semi--;
  106|    248|        }
  107|    101|        return apr_pstrmemdup(p, intype, semi - intype);
  108|    101|    }
  109|  1.23k|}
ap_strcmp_match:
  178|  4.90k|{
  179|  4.90k|    apr_size_t x, y;
  180|       |
  181|  7.52k|    for (x = 0, y = 0; expected[y]; ++y, ++x) {
  ------------------
  |  Branch (181:24): [True: 7.12k, False: 409]
  ------------------
  182|  7.12k|        if (expected[y] == '*') {
  ------------------
  |  Branch (182:13): [True: 577, False: 6.54k]
  ------------------
  183|    807|            while (expected[++y] == '*');
  ------------------
  |  Branch (183:20): [True: 230, False: 577]
  ------------------
  184|    577|            if (!expected[y])
  ------------------
  |  Branch (184:17): [True: 3, False: 574]
  ------------------
  185|      3|                return 0;
  186|  3.72k|            while (str[x]) {
  ------------------
  |  Branch (186:20): [True: 3.67k, False: 54]
  ------------------
  187|  3.67k|                int ret;
  188|  3.67k|                if ((ret = ap_strcmp_match(&str[x++], &expected[y])) != 1)
  ------------------
  |  Branch (188:21): [True: 520, False: 3.15k]
  ------------------
  189|    520|                    return ret;
  190|  3.67k|            }
  191|     54|            return -1;
  192|    574|        }
  193|  6.54k|        else if (!str[x])
  ------------------
  |  Branch (193:18): [True: 20, False: 6.52k]
  ------------------
  194|     20|            return -1;
  195|  6.52k|        else if ((expected[y] != '?') && (str[x] != expected[y]))
  ------------------
  |  Branch (195:18): [True: 5.14k, False: 1.38k]
  |  Branch (195:42): [True: 3.89k, False: 1.24k]
  ------------------
  196|  3.89k|            return 1;
  197|  7.12k|    }
  198|    409|    return (str[x] != '\0');
  199|  4.90k|}
ap_strcasecmp_match:
  202|  4.90k|{
  203|  4.90k|    apr_size_t x, y;
  204|       |
  205|  7.52k|    for (x = 0, y = 0; expected[y]; ++y, ++x) {
  ------------------
  |  Branch (205:24): [True: 7.12k, False: 409]
  ------------------
  206|  7.12k|        if (!str[x] && expected[y] != '*')
  ------------------
  |  Branch (206:13): [True: 22, False: 7.09k]
  |  Branch (206:24): [True: 20, False: 2]
  ------------------
  207|     20|            return -1;
  208|  7.10k|        if (expected[y] == '*') {
  ------------------
  |  Branch (208:13): [True: 577, False: 6.52k]
  ------------------
  209|    807|            while (expected[++y] == '*');
  ------------------
  |  Branch (209:20): [True: 230, False: 577]
  ------------------
  210|    577|            if (!expected[y])
  ------------------
  |  Branch (210:17): [True: 3, False: 574]
  ------------------
  211|      3|                return 0;
  212|  3.72k|            while (str[x]) {
  ------------------
  |  Branch (212:20): [True: 3.67k, False: 54]
  ------------------
  213|  3.67k|                int ret;
  214|  3.67k|                if ((ret = ap_strcasecmp_match(&str[x++], &expected[y])) != 1)
  ------------------
  |  Branch (214:21): [True: 520, False: 3.15k]
  ------------------
  215|    520|                    return ret;
  216|  3.67k|            }
  217|     54|            return -1;
  218|    574|        }
  219|  6.52k|        else if (expected[y] != '?'
  ------------------
  |  Branch (219:18): [True: 5.14k, False: 1.38k]
  ------------------
  220|  5.14k|                 && apr_tolower(str[x]) != apr_tolower(expected[y]))
  ------------------
  |  |  234|  5.14k|#define apr_tolower(c) (tolower(((unsigned char)(c))))
  ------------------
                               && apr_tolower(str[x]) != apr_tolower(expected[y]))
  ------------------
  |  |  234|  5.14k|#define apr_tolower(c) (tolower(((unsigned char)(c))))
  ------------------
  |  Branch (220:21): [True: 0, False: 0]
  |  Branch (220:21): [True: 0, False: 0]
  |  Branch (220:21): [Folded, False: 5.14k]
  |  Branch (220:21): [True: 3.89k, False: 1.24k]
  |  Branch (220:44): [True: 0, False: 0]
  |  Branch (220:44): [True: 0, False: 0]
  |  Branch (220:44): [Folded, False: 5.14k]
  ------------------
  221|  3.89k|            return 1;
  222|  7.10k|    }
  223|    409|    return (str[x] != '\0');
  224|  4.90k|}
ap_strcasestr:
  292|  1.23k|{
  293|  1.23k|    char *p1, *p2;
  294|  1.23k|    if (*s2 == '\0') {
  ------------------
  |  Branch (294:9): [True: 204, False: 1.02k]
  ------------------
  295|       |        /* an empty s2 */
  296|    204|        return((char *)s1);
  297|    204|    }
  298|  8.87k|    while(1) {
  ------------------
  |  Branch (298:11): [True: 8.87k, Folded]
  ------------------
  299|  47.5k|        for ( ; (*s1 != '\0') && (apr_tolower(*s1) != apr_tolower(*s2)); s1++);
  ------------------
  |  |  234|  46.6k|#define apr_tolower(c) (tolower(((unsigned char)(c))))
  ------------------
                      for ( ; (*s1 != '\0') && (apr_tolower(*s1) != apr_tolower(*s2)); s1++);
  ------------------
  |  |  234|  46.6k|#define apr_tolower(c) (tolower(((unsigned char)(c))))
  ------------------
  |  Branch (299:17): [True: 46.6k, False: 991]
  |  Branch (299:34): [True: 38.7k, False: 7.88k]
  |  Branch (299:35): [True: 0, False: 0]
  |  Branch (299:35): [True: 0, False: 0]
  |  Branch (299:35): [Folded, False: 46.6k]
  |  Branch (299:55): [True: 0, False: 0]
  |  Branch (299:55): [True: 0, False: 0]
  |  Branch (299:55): [Folded, False: 46.6k]
  ------------------
  300|  8.87k|        if (*s1 == '\0') {
  ------------------
  |  Branch (300:13): [True: 991, False: 7.88k]
  ------------------
  301|    991|            return(NULL);
  302|    991|        }
  303|       |        /* found first character of s2, see if the rest matches */
  304|  7.88k|        p1 = (char *)s1;
  305|  7.88k|        p2 = (char *)s2;
  306|  49.7k|        for (++p1, ++p2; apr_tolower(*p1) == apr_tolower(*p2); ++p1, ++p2) {
  ------------------
  |  |  234|  49.7k|#define apr_tolower(c) (tolower(((unsigned char)(c))))
  ------------------
                      for (++p1, ++p2; apr_tolower(*p1) == apr_tolower(*p2); ++p1, ++p2) {
  ------------------
  |  |  234|  49.7k|#define apr_tolower(c) (tolower(((unsigned char)(c))))
  ------------------
  |  Branch (306:26): [True: 0, False: 0]
  |  Branch (306:26): [True: 0, False: 0]
  |  Branch (306:26): [Folded, False: 49.7k]
  |  Branch (306:26): [True: 41.8k, False: 7.87k]
  |  Branch (306:46): [True: 0, False: 0]
  |  Branch (306:46): [True: 0, False: 0]
  |  Branch (306:46): [Folded, False: 49.7k]
  ------------------
  307|  41.8k|            if (*p1 == '\0') {
  ------------------
  |  Branch (307:17): [True: 9, False: 41.8k]
  ------------------
  308|       |                /* both strings ended together */
  309|      9|                return((char *)s1);
  310|      9|            }
  311|  41.8k|        }
  312|  7.87k|        if (*p2 == '\0') {
  ------------------
  |  Branch (312:13): [True: 27, False: 7.84k]
  ------------------
  313|       |            /* second string ended, a match */
  314|     27|            break;
  315|     27|        }
  316|       |        /* didn't find a match here, try starting at next character in s1 */
  317|  7.84k|        s1++;
  318|  7.84k|    }
  319|     27|    return((char *)s1);
  320|  1.02k|}
ap_normalize_path:
  492|    399|{
  493|    399|    int ret = 1;
  494|    399|    apr_size_t l = 1, w = 1, n;
  495|    399|    int decode_unreserved = (flags & AP_NORMALIZE_DECODE_UNRESERVED) != 0;
  ------------------
  |  | 1876|    399|#define AP_NORMALIZE_DECODE_UNRESERVED  (1u <<  2)
  ------------------
  496|    399|    int merge_slashes = (flags & AP_NORMALIZE_MERGE_SLASHES) != 0;
  ------------------
  |  | 1877|    399|#define AP_NORMALIZE_MERGE_SLASHES      (1u <<  3)
  ------------------
  497|       |
  498|    399|    if (!AP_IS_SLASH(path[0])) {
  ------------------
  |  | 2938|    399|#define AP_IS_SLASH(s) (s == '/')
  ------------------
  |  Branch (498:9): [True: 380, False: 19]
  ------------------
  499|       |        /* Besides "OPTIONS *", a request-target should start with '/'
  500|       |         * per RFC 7230 section 5.3, so anything else is invalid.
  501|       |         */
  502|    380|        if (path[0] == '*' && path[1] == '\0') {
  ------------------
  |  Branch (502:13): [True: 19, False: 361]
  |  Branch (502:31): [True: 1, False: 18]
  ------------------
  503|      1|            return 1;
  504|      1|        }
  505|       |        /* However, AP_NORMALIZE_ALLOW_RELATIVE can be used to bypass
  506|       |         * this restriction (e.g. for subrequest file lookups).
  507|       |         */
  508|    379|        if (!(flags & AP_NORMALIZE_ALLOW_RELATIVE) || path[0] == '\0') {
  ------------------
  |  | 1874|    379|#define AP_NORMALIZE_ALLOW_RELATIVE     (1u <<  0)
  ------------------
  |  Branch (508:13): [True: 0, False: 379]
  |  Branch (508:55): [True: 49, False: 330]
  ------------------
  509|     49|            return 0;
  510|     49|        }
  511|       |
  512|    330|        l = w = 0;
  513|    330|    }
  514|       |
  515|  16.3k|    while (path[l] != '\0') {
  ------------------
  |  Branch (515:12): [True: 15.9k, False: 349]
  ------------------
  516|       |        /* RFC-3986 section 2.3:
  517|       |         *  For consistency, percent-encoded octets in the ranges of
  518|       |         *  ALPHA (%41-%5A and %61-%7A), DIGIT (%30-%39), hyphen (%2D),
  519|       |         *  period (%2E), underscore (%5F), or tilde (%7E) should [...]
  520|       |         *  be decoded to their corresponding unreserved characters by
  521|       |         *  URI normalizers.
  522|       |         */
  523|  15.9k|        if (decode_unreserved && path[l] == '%') {
  ------------------
  |  Branch (523:13): [True: 0, False: 15.9k]
  |  Branch (523:34): [True: 0, False: 0]
  ------------------
  524|      0|            if (apr_isxdigit(path[l + 1]) && apr_isxdigit(path[l + 2])) {
  ------------------
  |  |  232|      0|#define apr_isxdigit(c) (isxdigit(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (232:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                          if (apr_isxdigit(path[l + 1]) && apr_isxdigit(path[l + 2])) {
  ------------------
  |  |  232|      0|#define apr_isxdigit(c) (isxdigit(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (232:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  525|      0|                const char c = x2c(&path[l + 1]);
  526|      0|                if (TEST_CHAR(c, T_URI_UNRESERVED)) {
  ------------------
  |  |   53|      0|#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))
  |  |  ------------------
  |  |  |  Branch (53:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  527|       |                    /* Replace last char and fall through as the current
  528|       |                     * read position */
  529|      0|                    l += 2;
  530|      0|                    path[l] = c;
  531|      0|                }
  532|      0|            }
  533|      0|            else {
  534|       |                /* Invalid encoding */
  535|      0|                ret = 0;
  536|      0|            }
  537|      0|        }
  538|       |
  539|  15.9k|        if (w == 0 || AP_IS_SLASH(path[w - 1])) {
  ------------------
  |  | 2938|  15.4k|#define AP_IS_SLASH(s) (s == '/')
  |  |  ------------------
  |  |  |  Branch (2938:24): [True: 840, False: 14.5k]
  |  |  ------------------
  ------------------
  |  Branch (539:13): [True: 548, False: 15.4k]
  ------------------
  540|       |            /* Collapse ///// sequences to / */
  541|  1.38k|            if (merge_slashes && AP_IS_SLASH(path[l])) {
  ------------------
  |  | 2938|      0|#define AP_IS_SLASH(s) (s == '/')
  |  |  ------------------
  |  |  |  Branch (2938:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (541:17): [True: 0, False: 1.38k]
  ------------------
  542|      0|                do {
  543|      0|                    l++;
  544|      0|                } while (AP_IS_SLASH(path[l]));
  ------------------
  |  | 2938|      0|#define AP_IS_SLASH(s) (s == '/')
  |  |  ------------------
  |  |  |  Branch (2938:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  545|      0|                continue;
  546|      0|            }
  547|       |
  548|  1.38k|            if (path[l] == '.') {
  ------------------
  |  Branch (548:17): [True: 627, False: 761]
  ------------------
  549|       |                /* Remove /./ segments */
  550|    627|                if (IS_SLASH_OR_NUL(path[l + 1])) {
  ------------------
  |  |  486|    627|#define IS_SLASH_OR_NUL(s) (s == '\0' || AP_IS_SLASH(s))
  |  |  ------------------
  |  |  |  | 2938|    625|#define AP_IS_SLASH(s) (s == '/')
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2938:24): [True: 191, False: 434]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (486:29): [True: 2, False: 625]
  |  |  ------------------
  ------------------
  551|    193|                    l++;
  552|    193|                    if (path[l]) {
  ------------------
  |  Branch (552:25): [True: 191, False: 2]
  ------------------
  553|    191|                        l++;
  554|    191|                    }
  555|    193|                    continue;
  556|    193|                }
  557|       |
  558|       |                /* Remove /xx/../ segments (or /xx/.%2e/ when
  559|       |                 * AP_NORMALIZE_DECODE_UNRESERVED is set since we
  560|       |                 * decoded only the first dot above).
  561|       |                 */
  562|    434|                n = l + 1;
  563|    434|                if ((path[n] == '.' || (decode_unreserved
  ------------------
  |  Branch (563:22): [True: 339, False: 95]
  |  Branch (563:41): [True: 0, False: 95]
  ------------------
  564|      0|                                        && path[n] == '%'
  ------------------
  |  Branch (564:44): [True: 0, False: 0]
  ------------------
  565|      0|                                        && path[++n] == '2'
  ------------------
  |  Branch (565:44): [True: 0, False: 0]
  ------------------
  566|      0|                                        && (path[++n] == 'e'
  ------------------
  |  Branch (566:45): [True: 0, False: 0]
  ------------------
  567|      0|                                            || path[n] == 'E')))
  ------------------
  |  Branch (567:48): [True: 0, False: 0]
  ------------------
  568|    339|                        && IS_SLASH_OR_NUL(path[n + 1])) {
  ------------------
  |  |  486|    339|#define IS_SLASH_OR_NUL(s) (s == '\0' || AP_IS_SLASH(s))
  |  |  ------------------
  |  |  |  | 2938|    335|#define AP_IS_SLASH(s) (s == '/')
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2938:24): [True: 236, False: 99]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (486:29): [True: 4, False: 335]
  |  |  ------------------
  ------------------
  569|       |                    /* Wind w back to remove the previous segment */
  570|    240|                    if (w > 1) {
  ------------------
  |  Branch (570:25): [True: 140, False: 100]
  ------------------
  571|    807|                        do {
  572|    807|                            w--;
  573|    807|                        } while (w && !AP_IS_SLASH(path[w - 1]));
  ------------------
  |  | 2938|    755|#define AP_IS_SLASH(s) (s == '/')
  ------------------
  |  Branch (573:34): [True: 755, False: 52]
  |  Branch (573:39): [True: 667, False: 88]
  ------------------
  574|    140|                    }
  575|    100|                    else {
  576|       |                        /* Already at root, ignore and return a failure
  577|       |                         * if asked to.
  578|       |                         */
  579|    100|                        if (flags & AP_NORMALIZE_NOT_ABOVE_ROOT) {
  ------------------
  |  | 1875|    100|#define AP_NORMALIZE_NOT_ABOVE_ROOT     (1u <<  1)
  ------------------
  |  Branch (579:29): [True: 100, False: 0]
  ------------------
  580|    100|                            ret = 0;
  581|    100|                        }
  582|    100|                    }
  583|       |
  584|       |                    /* Move l forward to the next segment */
  585|    240|                    l = n + 1;
  586|    240|                    if (path[l]) {
  ------------------
  |  Branch (586:25): [True: 236, False: 4]
  ------------------
  587|    236|                        l++;
  588|    236|                    }
  589|    240|                    continue;
  590|    240|                }
  591|    434|            }
  592|  1.38k|        }
  593|       |
  594|  15.5k|        path[w++] = path[l++];
  595|  15.5k|    }
  596|    349|    path[w] = '\0';
  597|       |
  598|    349|    return ret;
  599|    399|}
ap_getparents:
  605|    399|{
  606|    399|    if (!ap_normalize_path(name, AP_NORMALIZE_NOT_ABOVE_ROOT |
  ------------------
  |  | 1875|    399|#define AP_NORMALIZE_NOT_ABOVE_ROOT     (1u <<  1)
  ------------------
  |  Branch (606:9): [True: 76, False: 323]
  ------------------
  607|    399|                                 AP_NORMALIZE_ALLOW_RELATIVE)) {
  ------------------
  |  | 1874|    399|#define AP_NORMALIZE_ALLOW_RELATIVE     (1u <<  0)
  ------------------
  608|     76|        name[0] = '\0';
  609|     76|    }
  610|    399|}
ap_no2slash_ex:
  613|    323|{
  614|       |
  615|    323|    char *d, *s;
  616|       |
  617|    323|    if (!*name) {
  ------------------
  |  Branch (617:9): [True: 47, False: 276]
  ------------------
  618|     47|        return;
  619|     47|    }
  620|       |
  621|    276|    s = d = name;
  622|       |
  623|       |#ifdef HAVE_UNC_PATHS
  624|       |    /* Check for UNC names.  Leave leading two slashes. */
  625|       |    if (is_fs_path && s[0] == '/' && s[1] == '/')
  626|       |        *d++ = *s++;
  627|       |#endif
  628|       |
  629|  12.2k|    while (*s) {
  ------------------
  |  Branch (629:12): [True: 11.9k, False: 276]
  ------------------
  630|  11.9k|        if ((*d++ = *s) == '/') {
  ------------------
  |  Branch (630:13): [True: 213, False: 11.7k]
  ------------------
  631|    543|            do {
  632|    543|                ++s;
  633|    543|            } while (*s == '/');
  ------------------
  |  Branch (633:22): [True: 330, False: 213]
  ------------------
  634|    213|        }
  635|  11.7k|        else {
  636|  11.7k|            ++s;
  637|  11.7k|        }
  638|  11.9k|    }
  639|    276|    *d = '\0';
  640|    276|}
ap_no2slash:
  643|    323|{
  644|    323|    ap_no2slash_ex(name, 1);
  645|    323|}
ap_make_dirstr_parent:
  695|    214|{
  696|    214|    const char *last_slash = ap_strrchr_c(s, '/');
  ------------------
  |  | 2579|    214|# define ap_strrchr_c(s, c)  strrchr(s, c)
  ------------------
  697|    214|    char *d;
  698|    214|    int l;
  699|       |
  700|    214|    if (last_slash == NULL) {
  ------------------
  |  Branch (700:9): [True: 190, False: 24]
  ------------------
  701|    190|        return apr_pstrdup(p, "");
  702|    190|    }
  703|     24|    l = (last_slash - s) + 1;
  704|     24|    d = apr_pstrmemdup(p, s, l);
  705|       |
  706|     24|    return (d);
  707|    214|}
ap_getword:
  726|  1.23k|{
  727|  1.23k|    const char *pos = *line;
  728|  1.23k|    int len;
  729|  1.23k|    char *res;
  730|       |
  731|  55.8k|    while ((*pos != stop) && *pos) {
  ------------------
  |  Branch (731:12): [True: 54.5k, False: 1.23k]
  |  Branch (731:30): [True: 54.5k, False: 0]
  ------------------
  732|  54.5k|        ++pos;
  733|  54.5k|    }
  734|       |
  735|  1.23k|    len = pos - *line;
  736|  1.23k|    res = apr_pstrmemdup(atrans, *line, len);
  737|       |
  738|  1.23k|    if (stop) {
  ------------------
  |  Branch (738:9): [True: 0, False: 1.23k]
  ------------------
  739|      0|        while (*pos == stop) {
  ------------------
  |  Branch (739:16): [True: 0, False: 0]
  ------------------
  740|      0|            ++pos;
  741|      0|        }
  742|      0|    }
  743|  1.23k|    *line = pos;
  744|       |
  745|  1.23k|    return res;
  746|  1.23k|}
ap_getword_white_nc:
  749|    171|{
  750|    171|    return ap_getword_white(atrans, (const char **) line);
  751|    171|}
ap_getword_white:
  754|    171|{
  755|    171|    const char *pos = *line;
  756|    171|    int len;
  757|    171|    char *res;
  758|       |
  759|  3.17k|    while (!apr_isspace(*pos) && *pos) {
  ------------------
  |  |  228|  6.35k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  ------------------
  |  Branch (759:12): [True: 3.10k, False: 76]
  |  Branch (759:34): [True: 3.00k, False: 95]
  ------------------
  760|  3.00k|        ++pos;
  761|  3.00k|    }
  762|       |
  763|    171|    len = pos - *line;
  764|    171|    res = apr_pstrmemdup(atrans, *line, len);
  765|       |
  766|    425|    while (apr_isspace(*pos)) {
  ------------------
  |  |  228|    425|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (228:24): [True: 254, False: 171]
  |  |  ------------------
  ------------------
  767|    254|        ++pos;
  768|    254|    }
  769|       |
  770|    171|    *line = pos;
  771|       |
  772|    171|    return res;
  773|    171|}
ap_getword_conf:
  836|    104|{
  837|    104|    const char *str = *line, *strend;
  838|    104|    char *res;
  839|    104|    char quote;
  840|       |
  841|    358|    while (apr_isspace(*str))
  ------------------
  |  |  228|    358|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (228:24): [True: 254, False: 104]
  |  |  ------------------
  ------------------
  842|    254|        ++str;
  843|       |
  844|    104|    if (!*str) {
  ------------------
  |  Branch (844:9): [True: 0, False: 104]
  ------------------
  845|      0|        *line = str;
  846|      0|        return "";
  847|      0|    }
  848|       |
  849|    104|    if ((quote = *str) == '"' || quote == '\'') {
  ------------------
  |  Branch (849:9): [True: 74, False: 30]
  |  Branch (849:34): [True: 30, False: 0]
  ------------------
  850|    104|        strend = str + 1;
  851|  3.07k|        while (*strend && *strend != quote) {
  ------------------
  |  Branch (851:16): [True: 3.00k, False: 68]
  |  Branch (851:27): [True: 2.96k, False: 36]
  ------------------
  852|  2.96k|            if (*strend == '\\' && strend[1] &&
  ------------------
  |  Branch (852:17): [True: 673, False: 2.29k]
  |  Branch (852:36): [True: 664, False: 9]
  ------------------
  853|    664|                (strend[1] == quote || strend[1] == '\\')) {
  ------------------
  |  Branch (853:18): [True: 111, False: 553]
  |  Branch (853:40): [True: 205, False: 348]
  ------------------
  854|    316|                strend += 2;
  855|    316|            }
  856|  2.65k|            else {
  857|  2.65k|                ++strend;
  858|  2.65k|            }
  859|  2.96k|        }
  860|    104|        res = substring_conf(p, str + 1, strend - str - 1, quote);
  861|       |
  862|    104|        if (*strend == quote)
  ------------------
  |  Branch (862:13): [True: 36, False: 68]
  ------------------
  863|     36|            ++strend;
  864|    104|    }
  865|      0|    else {
  866|      0|        strend = str;
  867|      0|        while (*strend && !apr_isspace(*strend))
  ------------------
  |  |  228|      0|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  ------------------
  |  Branch (867:16): [True: 0, False: 0]
  |  Branch (867:27): [True: 0, False: 0]
  ------------------
  868|      0|            ++strend;
  869|       |
  870|      0|        res = substring_conf(p, str, strend - str, 0);
  871|      0|    }
  872|       |
  873|    262|    while (apr_isspace(*strend))
  ------------------
  |  |  228|    262|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (228:24): [True: 158, False: 104]
  |  |  ------------------
  ------------------
  874|    158|        ++strend;
  875|    104|    *line = strend;
  876|    104|    return res;
  877|    104|}
ap_getword_conf2:
  885|  1.23k|{
  886|  1.23k|    const char *str = *line, *strend;
  887|  1.23k|    char *res;
  888|  1.23k|    char quote;
  889|  1.23k|    int count = 1;
  890|       |
  891|  2.62k|    while (apr_isspace(*str))
  ------------------
  |  |  228|  2.62k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (228:24): [True: 1.39k, False: 1.23k]
  |  |  ------------------
  ------------------
  892|  1.39k|        ++str;
  893|       |
  894|  1.23k|    if (!*str) {
  ------------------
  |  Branch (894:9): [True: 17, False: 1.21k]
  ------------------
  895|     17|        *line = str;
  896|     17|        return "";
  897|     17|    }
  898|       |
  899|  1.21k|    if ((quote = *str) == '"' || quote == '\'')
  ------------------
  |  Branch (899:9): [True: 74, False: 1.14k]
  |  Branch (899:34): [True: 30, False: 1.11k]
  ------------------
  900|    104|        return ap_getword_conf(p, line);
  901|       |
  902|  1.11k|    if (quote == '{') {
  ------------------
  |  Branch (902:9): [True: 86, False: 1.02k]
  ------------------
  903|     86|        strend = str + 1;
  904|  3.97k|        while (*strend) {
  ------------------
  |  Branch (904:16): [True: 3.89k, False: 80]
  ------------------
  905|  3.89k|            if (*strend == '}' && !--count)
  ------------------
  |  Branch (905:17): [True: 154, False: 3.74k]
  |  Branch (905:35): [True: 6, False: 148]
  ------------------
  906|      6|                break;
  907|  3.89k|            if (*strend == '{')
  ------------------
  |  Branch (907:17): [True: 403, False: 3.48k]
  ------------------
  908|    403|                ++count;
  909|  3.89k|            if (*strend == '\\' && strend[1] == '\\') {
  ------------------
  |  Branch (909:17): [True: 385, False: 3.50k]
  |  Branch (909:36): [True: 181, False: 204]
  ------------------
  910|    181|                ++strend;
  911|    181|            }
  912|  3.89k|            ++strend;
  913|  3.89k|        }
  914|     86|        res = substring_conf(p, str + 1, strend - str - 1, 0);
  915|       |
  916|     86|        if (*strend == '}')
  ------------------
  |  Branch (916:13): [True: 6, False: 80]
  ------------------
  917|      6|            ++strend;
  918|     86|    }
  919|  1.02k|    else {
  920|  1.02k|        strend = str;
  921|  27.7k|        while (*strend && !apr_isspace(*strend))
  ------------------
  |  |  228|  27.1k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  ------------------
  |  Branch (921:16): [True: 27.1k, False: 548]
  |  Branch (921:27): [True: 26.7k, False: 476]
  ------------------
  922|  26.7k|            ++strend;
  923|       |
  924|  1.02k|        res = substring_conf(p, str, strend - str, 0);
  925|  1.02k|    }
  926|       |
  927|  2.69k|    while (apr_isspace(*strend))
  ------------------
  |  |  228|  2.69k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (228:24): [True: 1.58k, False: 1.11k]
  |  |  ------------------
  ------------------
  928|  1.58k|        ++strend;
  929|  1.11k|    *line = strend;
  930|  1.11k|    return res;
  931|  1.21k|}
ap_pcfg_openfile:
  961|  1.23k|{
  962|  1.23k|    ap_configfile_t *new_cfg;
  963|  1.23k|    apr_file_t *file = NULL;
  964|  1.23k|    apr_finfo_t finfo;
  965|  1.23k|    apr_status_t status;
  966|       |#ifdef DEBUG
  967|       |    char buf[120];
  968|       |#endif
  969|       |
  970|  1.23k|    if (name == NULL) {
  ------------------
  |  Branch (970:9): [True: 0, False: 1.23k]
  ------------------
  971|      0|        ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL, APLOGNO(00552)
  ------------------
  |  |  363|      0|#define ap_log_error(...) ap_log_error__(__VA_ARGS__)
  |  |  ------------------
  |  |  |  |  366|      0|    do { const server_rec *sr__ = s; if (APLOG_MODULE_IS_LEVEL(sr__, mi, level)) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  183|      0|          ( (((level)&APLOG_LEVELMASK) <= APLOG_NOTICE) ||       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|#define APLOG_LEVELMASK 15     /* mask off the level value */
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                         ( (((level)&APLOG_LEVELMASK) <= APLOG_NOTICE) ||       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   48|      0|#define APLOG_NOTICE    LOG_NOTICE      /* normal but significant condition */
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (183:13): [True: 0, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|            (s == NULL) ||                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (184:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  185|      0|            (ap_get_server_module_loglevel(s, module_index)      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  629|      0|    (ap_get_module_loglevel(&(s)->log,i))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  624|      0|    (((i) < 0 || (l)->module_levels == NULL || (l)->module_levels[i] < 0) ?  \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (624:7): [Folded, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (624:18): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (624:48): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  625|      0|     (l)->level :                                                         \
  |  |  |  |  |  |  |  |  |  |  626|      0|     (l)->module_levels[i])
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (185:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  186|      0|             >= ((level)&APLOG_LEVELMASK) ) )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|#define APLOG_LEVELMASK 15     /* mask off the level value */
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  367|      0|             ap_log_error_(file, line, mi, level, status, sr__, __VA_ARGS__);    \
  |  |  |  |  368|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (368:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  972|      0|               "Internal error: pcfg_openfile() called with NULL filename");
  973|      0|        return APR_EBADF;
  ------------------
  |  |  708|      0|#define APR_EBADF EBADF
  ------------------
  974|      0|    }
  975|       |
  976|  1.23k|    status = apr_file_open(&file, name, APR_READ | APR_BUFFERED,
  ------------------
  |  |  100|  1.23k|#define APR_READ             APR_FOPEN_READ       /**< @deprecated @see APR_FOPEN_READ */
  |  |  ------------------
  |  |  |  |   54|  1.23k|#define APR_FOPEN_READ       0x00001  /**< Open the file for reading */
  |  |  ------------------
  ------------------
                  status = apr_file_open(&file, name, APR_READ | APR_BUFFERED,
  ------------------
  |  |  107|  1.23k|#define APR_BUFFERED         APR_FOPEN_BUFFERED   /**< @deprecated @see APR_FOPEN_BUFFERED */
  |  |  ------------------
  |  |  |  |   65|  1.23k|#define APR_FOPEN_BUFFERED   0x00080  /**< Open the file for buffered I/O */
  |  |  ------------------
  ------------------
  977|  1.23k|                           APR_OS_DEFAULT, p);
  ------------------
  |  |  112|  1.23k|#define APR_OS_DEFAULT APR_FPROT_OS_DEFAULT /**< @deprecated @see APR_FPROT_OS_DEFAULT */
  |  |  ------------------
  |  |  |  |   94|  1.23k|#define APR_FPROT_OS_DEFAULT  0x0FFF /**< use OS's default permissions */
  |  |  ------------------
  ------------------
  978|       |#ifdef DEBUG
  979|       |    ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, NULL, APLOGNO(00553)
  980|       |                "Opening config file %s (%s)",
  981|       |                name, (status != APR_SUCCESS) ?
  982|       |                apr_strerror(status, buf, sizeof(buf)) : "successful");
  983|       |#endif
  984|  1.23k|    if (status != APR_SUCCESS)
  ------------------
  |  |  225|  1.23k|#define APR_SUCCESS 0
  ------------------
  |  Branch (984:9): [True: 0, False: 1.23k]
  ------------------
  985|      0|        return status;
  986|       |
  987|  1.23k|    status = apr_file_info_get(&finfo, APR_FINFO_TYPE, file);
  ------------------
  |  |  154|  1.23k|#define APR_FINFO_TYPE   0x00008000 /**< Type */
  ------------------
  988|  1.23k|    if (status != APR_SUCCESS)
  ------------------
  |  |  225|  1.23k|#define APR_SUCCESS 0
  ------------------
  |  Branch (988:9): [True: 0, False: 1.23k]
  ------------------
  989|      0|        return status;
  990|       |
  991|  1.23k|    if (finfo.filetype != APR_REG &&
  ------------------
  |  Branch (991:9): [True: 0, False: 1.23k]
  ------------------
  992|       |#if defined(WIN32) || defined(OS2) || defined(NETWARE)
  993|       |        ap_cstr_casecmp(apr_filepath_name_get(name), "nul") != 0) {
  994|       |#else
  995|      0|        strcmp(name, "/dev/null") != 0) {
  ------------------
  |  Branch (995:9): [True: 0, False: 0]
  ------------------
  996|      0|#endif /* WIN32 || OS2 */
  997|      0|        ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL, APLOGNO(00554)
  ------------------
  |  |  363|      0|#define ap_log_error(...) ap_log_error__(__VA_ARGS__)
  |  |  ------------------
  |  |  |  |  366|      0|    do { const server_rec *sr__ = s; if (APLOG_MODULE_IS_LEVEL(sr__, mi, level)) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  183|      0|          ( (((level)&APLOG_LEVELMASK) <= APLOG_NOTICE) ||       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|#define APLOG_LEVELMASK 15     /* mask off the level value */
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                         ( (((level)&APLOG_LEVELMASK) <= APLOG_NOTICE) ||       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   48|      0|#define APLOG_NOTICE    LOG_NOTICE      /* normal but significant condition */
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (183:13): [True: 0, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|            (s == NULL) ||                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (184:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  185|      0|            (ap_get_server_module_loglevel(s, module_index)      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  629|      0|    (ap_get_module_loglevel(&(s)->log,i))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  624|      0|    (((i) < 0 || (l)->module_levels == NULL || (l)->module_levels[i] < 0) ?  \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (624:7): [Folded, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (624:18): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (624:48): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  625|      0|     (l)->level :                                                         \
  |  |  |  |  |  |  |  |  |  |  626|      0|     (l)->module_levels[i])
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (185:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  186|      0|             >= ((level)&APLOG_LEVELMASK) ) )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|#define APLOG_LEVELMASK 15     /* mask off the level value */
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  367|      0|             ap_log_error_(file, line, mi, level, status, sr__, __VA_ARGS__);    \
  |  |  |  |  368|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (368:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  998|      0|                     "Access to file %s denied by server: not a regular file",
  999|      0|                     name);
 1000|      0|        apr_file_close(file);
 1001|      0|        return APR_EBADF;
  ------------------
  |  |  708|      0|#define APR_EBADF EBADF
  ------------------
 1002|      0|    }
 1003|       |
 1004|       |#ifdef WIN32
 1005|       |    /* Some twisted character [no pun intended] at MS decided that a
 1006|       |     * zero width joiner as the lead wide character would be ideal for
 1007|       |     * describing Unicode text files.  This was further convoluted to
 1008|       |     * another MSism that the same character mapped into utf-8, EF BB BF
 1009|       |     * would signify utf-8 text files.
 1010|       |     *
 1011|       |     * Since MS configuration files are all protecting utf-8 encoded
 1012|       |     * Unicode path, file and resource names, we already have the correct
 1013|       |     * WinNT encoding.  But at least eat the stupid three bytes up front.
 1014|       |     */
 1015|       |    {
 1016|       |        unsigned char buf[4];
 1017|       |        apr_size_t len = 3;
 1018|       |        status = apr_file_read(file, buf, &len);
 1019|       |        if ((status != APR_SUCCESS) || (len < 3)
 1020|       |              || memcmp(buf, "\xEF\xBB\xBF", 3) != 0) {
 1021|       |            apr_off_t zero = 0;
 1022|       |            apr_file_seek(file, APR_SET, &zero);
 1023|       |        }
 1024|       |    }
 1025|       |#endif
 1026|       |
 1027|  1.23k|    new_cfg = apr_palloc(p, sizeof(*new_cfg));
  ------------------
  |  |  425|  1.23k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.23k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.23k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  1.23k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1028|  1.23k|    new_cfg->param = file;
 1029|  1.23k|    new_cfg->name = apr_pstrdup(p, name);
 1030|  1.23k|    new_cfg->getch = cfg_getch;
 1031|  1.23k|    new_cfg->getstr = cfg_getstr;
 1032|  1.23k|    new_cfg->close = cfg_close;
 1033|  1.23k|    new_cfg->line_number = 0;
 1034|  1.23k|    *ret_cfg = new_cfg;
 1035|  1.23k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.23k|#define APR_SUCCESS 0
  ------------------
 1036|  1.23k|}
ap_cfg_getline:
 1202|  1.23k|{
 1203|  1.23k|    apr_status_t rc = ap_cfg_getline_core(buf, bufsize, 0, cfp);
 1204|  1.23k|    if (rc == APR_SUCCESS)
  ------------------
  |  |  225|  1.23k|#define APR_SUCCESS 0
  ------------------
  |  Branch (1204:9): [True: 1.03k, False: 192]
  ------------------
 1205|  1.03k|        cfg_trim_line(buf);
 1206|  1.23k|    return rc;
 1207|  1.23k|}
ap_size_list_item:
 1257|  1.23k|{
 1258|  1.23k|    const unsigned char *ptr = (const unsigned char *)*field;
 1259|  1.23k|    const unsigned char *token;
 1260|  1.23k|    int in_qpair, in_qstr, in_com;
 1261|       |
 1262|       |    /* Find first non-comma, non-whitespace byte */
 1263|       |
 1264|  2.90k|    while (*ptr == ',' || apr_isspace(*ptr))
  ------------------
  |  |  228|  2.62k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (228:24): [True: 1.39k, False: 1.23k]
  |  |  ------------------
  ------------------
  |  Branch (1264:12): [True: 284, False: 2.62k]
  ------------------
 1265|  1.67k|        ++ptr;
 1266|       |
 1267|  1.23k|    token = ptr;
 1268|       |
 1269|       |    /* Find the end of this item, skipping over dead bits */
 1270|       |
 1271|  1.23k|    for (in_qpair = in_qstr = in_com = 0;
 1272|  42.6k|         *ptr && (in_qpair || in_qstr || in_com || *ptr != ',');
  ------------------
  |  Branch (1272:10): [True: 41.6k, False: 956]
  |  Branch (1272:19): [True: 2.72k, False: 38.9k]
  |  Branch (1272:31): [True: 4.38k, False: 34.5k]
  |  Branch (1272:42): [True: 5.45k, False: 29.1k]
  |  Branch (1272:52): [True: 28.8k, False: 275]
  ------------------
 1273|  41.4k|         ++ptr) {
 1274|       |
 1275|  41.4k|        if (in_qpair) {
  ------------------
  |  Branch (1275:13): [True: 2.72k, False: 38.7k]
  ------------------
 1276|  2.72k|            in_qpair = 0;
 1277|  2.72k|        }
 1278|  38.7k|        else {
 1279|  38.7k|            switch (*ptr) {
 1280|  2.75k|                case '\\': in_qpair = 1;      /* quoted-pair         */
  ------------------
  |  Branch (1280:17): [True: 2.75k, False: 35.9k]
  ------------------
 1281|  2.75k|                           break;
 1282|  1.21k|                case '"' : if (!in_com)       /* quoted string delim */
  ------------------
  |  Branch (1282:17): [True: 1.21k, False: 37.4k]
  |  Branch (1282:32): [True: 951, False: 260]
  ------------------
 1283|    951|                               in_qstr = !in_qstr;
 1284|  1.21k|                           break;
 1285|  1.58k|                case '(' : if (!in_qstr)      /* comment (may nest)  */
  ------------------
  |  Branch (1285:17): [True: 1.58k, False: 37.1k]
  |  Branch (1285:32): [True: 1.42k, False: 167]
  ------------------
 1286|  1.42k|                               ++in_com;
 1287|  1.58k|                           break;
 1288|    550|                case ')' : if (in_com)        /* end comment         */
  ------------------
  |  Branch (1288:17): [True: 550, False: 38.1k]
  |  Branch (1288:32): [True: 249, False: 301]
  ------------------
 1289|    249|                               --in_com;
 1290|    550|                           break;
 1291|  32.5k|                default  : break;
  ------------------
  |  Branch (1291:17): [True: 32.5k, False: 6.10k]
  ------------------
 1292|  38.7k|            }
 1293|  38.7k|        }
 1294|  41.4k|    }
 1295|       |
 1296|  1.23k|    if ((*len = (ptr - token)) == 0) {
  ------------------
  |  Branch (1296:9): [True: 21, False: 1.21k]
  ------------------
 1297|     21|        *field = (const char *)ptr;
 1298|     21|        return NULL;
 1299|     21|    }
 1300|       |
 1301|       |    /* Advance field pointer to the next non-comma, non-white byte */
 1302|       |
 1303|  1.96k|    while (*ptr == ',' || apr_isspace(*ptr))
  ------------------
  |  |  228|  1.37k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (228:24): [True: 167, False: 1.21k]
  |  |  ------------------
  ------------------
  |  Branch (1303:12): [True: 590, False: 1.37k]
  ------------------
 1304|    757|        ++ptr;
 1305|       |
 1306|  1.21k|    *field = (const char *)ptr;
 1307|  1.21k|    return (const char *)token;
 1308|  1.23k|}
ap_get_list_item:
 1317|  1.23k|{
 1318|  1.23k|    const char *tok_start;
 1319|  1.23k|    const unsigned char *ptr;
 1320|  1.23k|    unsigned char *pos;
 1321|  1.23k|    char *token;
 1322|  1.23k|    int addspace = 0, in_qpair = 0, in_qstr = 0, in_com = 0, tok_len = 0;
 1323|       |
 1324|       |    /* Find the beginning and maximum length of the list item so that
 1325|       |     * we can allocate a buffer for the new string and reset the field.
 1326|       |     */
 1327|  1.23k|    if ((tok_start = ap_size_list_item(field, &tok_len)) == NULL) {
  ------------------
  |  Branch (1327:9): [True: 21, False: 1.21k]
  ------------------
 1328|     21|        return NULL;
 1329|     21|    }
 1330|  1.21k|    token = apr_palloc(p, tok_len + 1);
  ------------------
  |  |  425|  1.21k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.21k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.21k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  1.21k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1331|       |
 1332|       |    /* Scan the token again, but this time copy only the good bytes.
 1333|       |     * We skip extra whitespace and any whitespace around a '=', '/',
 1334|       |     * or ';' and lowercase normal characters not within a comment,
 1335|       |     * quoted-string or quoted-pair.
 1336|       |     */
 1337|  1.21k|    for (ptr = (const unsigned char *)tok_start, pos = (unsigned char *)token;
 1338|  42.6k|         *ptr && (in_qpair || in_qstr || in_com || *ptr != ',');
  ------------------
  |  Branch (1338:10): [True: 41.6k, False: 935]
  |  Branch (1338:19): [True: 2.72k, False: 38.9k]
  |  Branch (1338:31): [True: 4.38k, False: 34.5k]
  |  Branch (1338:42): [True: 5.45k, False: 29.1k]
  |  Branch (1338:52): [True: 28.8k, False: 275]
  ------------------
 1339|  41.4k|         ++ptr) {
 1340|       |
 1341|  41.4k|        if (in_qpair) {
  ------------------
  |  Branch (1341:13): [True: 2.72k, False: 38.7k]
  ------------------
 1342|  2.72k|            in_qpair = 0;
 1343|  2.72k|            *pos++ = *ptr;
 1344|  2.72k|        }
 1345|  38.7k|        else {
 1346|  38.7k|            switch (*ptr) {
 1347|  2.75k|                case '\\': in_qpair = 1;
  ------------------
  |  Branch (1347:17): [True: 2.75k, False: 35.9k]
  ------------------
 1348|  2.75k|                           if (addspace == 1)
  ------------------
  |  Branch (1348:32): [True: 99, False: 2.65k]
  ------------------
 1349|     99|                               *pos++ = ' ';
 1350|  2.75k|                           *pos++ = *ptr;
 1351|  2.75k|                           addspace = 0;
 1352|  2.75k|                           break;
 1353|  1.21k|                case '"' : if (!in_com)
  ------------------
  |  Branch (1353:17): [True: 1.21k, False: 37.4k]
  |  Branch (1353:32): [True: 951, False: 260]
  ------------------
 1354|    951|                               in_qstr = !in_qstr;
 1355|  1.21k|                           if (addspace == 1)
  ------------------
  |  Branch (1355:32): [True: 65, False: 1.14k]
  ------------------
 1356|     65|                               *pos++ = ' ';
 1357|  1.21k|                           *pos++ = *ptr;
 1358|  1.21k|                           addspace = 0;
 1359|  1.21k|                           break;
 1360|  1.58k|                case '(' : if (!in_qstr)
  ------------------
  |  Branch (1360:17): [True: 1.58k, False: 37.1k]
  |  Branch (1360:32): [True: 1.42k, False: 167]
  ------------------
 1361|  1.42k|                               ++in_com;
 1362|  1.58k|                           if (addspace == 1)
  ------------------
  |  Branch (1362:32): [True: 67, False: 1.52k]
  ------------------
 1363|     67|                               *pos++ = ' ';
 1364|  1.58k|                           *pos++ = *ptr;
 1365|  1.58k|                           addspace = 0;
 1366|  1.58k|                           break;
 1367|    550|                case ')' : if (in_com)
  ------------------
  |  Branch (1367:17): [True: 550, False: 38.1k]
  |  Branch (1367:32): [True: 249, False: 301]
  ------------------
 1368|    249|                               --in_com;
 1369|    550|                           *pos++ = *ptr;
 1370|    550|                           addspace = 0;
 1371|    550|                           break;
 1372|  1.72k|                case ' ' :
  ------------------
  |  Branch (1372:17): [True: 1.72k, False: 36.9k]
  ------------------
 1373|  2.79k|                case '\t': if (addspace)
  ------------------
  |  Branch (1373:17): [True: 1.07k, False: 37.6k]
  |  Branch (1373:32): [True: 1.19k, False: 1.60k]
  ------------------
 1374|  1.19k|                               break;
 1375|  1.60k|                           if (in_com || in_qstr)
  ------------------
  |  Branch (1375:32): [True: 451, False: 1.15k]
  |  Branch (1375:42): [True: 445, False: 709]
  ------------------
 1376|    896|                               *pos++ = *ptr;
 1377|    709|                           else
 1378|    709|                               addspace = 1;
 1379|  1.60k|                           break;
 1380|    297|                case '=' :
  ------------------
  |  Branch (1380:17): [True: 297, False: 38.4k]
  ------------------
 1381|    962|                case '/' :
  ------------------
  |  Branch (1381:17): [True: 665, False: 38.0k]
  ------------------
 1382|  1.29k|                case ';' : if (!(in_com || in_qstr))
  ------------------
  |  Branch (1382:17): [True: 328, False: 38.3k]
  |  Branch (1382:34): [True: 236, False: 1.05k]
  |  Branch (1382:44): [True: 221, False: 833]
  ------------------
 1383|    833|                               addspace = -1;
 1384|  1.29k|                           *pos++ = *ptr;
 1385|  1.29k|                           break;
 1386|  28.5k|                default  : if (addspace == 1)
  ------------------
  |  Branch (1386:17): [True: 28.5k, False: 10.1k]
  |  Branch (1386:32): [True: 401, False: 28.1k]
  ------------------
 1387|    401|                               *pos++ = ' ';
 1388|  28.5k|                           *pos++ = (in_com || in_qstr) ? *ptr
  ------------------
  |  Branch (1388:38): [True: 2.87k, False: 25.6k]
  |  Branch (1388:48): [True: 2.34k, False: 23.2k]
  ------------------
 1389|  28.5k|                                                        : apr_tolower(*ptr);
  ------------------
  |  |  234|  51.7k|#define apr_tolower(c) (tolower(((unsigned char)(c))))
  ------------------
  |  Branch (1389:59): [True: 0, False: 0]
  |  Branch (1389:59): [True: 0, False: 0]
  |  Branch (1389:59): [Folded, False: 23.2k]
  ------------------
 1390|  28.5k|                           addspace = 0;
 1391|  28.5k|                           break;
 1392|  38.7k|            }
 1393|  38.7k|        }
 1394|  41.4k|    }
 1395|  1.21k|    *pos = '\0';
 1396|       |
 1397|  1.21k|    return token;
 1398|  1.21k|}
ap_find_list_item:
 1541|  1.23k|{
 1542|  1.23k|    return find_list_item(p, line, tok, AP_ETAG_NONE);
 1543|  1.23k|}
ap_parse_token_list_strict:
 1568|  1.23k|{
 1569|  1.23k|    int in_leading_space = 1;
 1570|  1.23k|    int in_trailing_space = 0;
 1571|  1.23k|    int string_end = 0;
 1572|  1.23k|    const char *tok_begin;
 1573|  1.23k|    const char *cur;
 1574|       |
 1575|  1.23k|    if (!str_in) {
  ------------------
  |  Branch (1575:9): [True: 0, False: 1.23k]
  ------------------
 1576|      0|        return NULL;
 1577|      0|    }
 1578|       |
 1579|  1.23k|    tok_begin = cur = str_in;
 1580|       |
 1581|  14.6k|    while (!string_end) {
  ------------------
  |  Branch (1581:12): [True: 14.4k, False: 215]
  ------------------
 1582|  14.4k|        const unsigned char c = (unsigned char)*cur;
 1583|       |
 1584|  14.4k|        if (!TEST_CHAR(c, T_HTTP_TOKEN_STOP)) {
  ------------------
  |  |   53|  14.4k|#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))
  ------------------
  |  Branch (1584:13): [True: 10.4k, False: 4.02k]
  ------------------
 1585|       |            /* Non-separator character; we are finished with leading
 1586|       |             * whitespace. We must never have encountered any trailing
 1587|       |             * whitespace before the delimiter (comma) */
 1588|  10.4k|            in_leading_space = 0;
 1589|  10.4k|            if (in_trailing_space) {
  ------------------
  |  Branch (1589:17): [True: 25, False: 10.3k]
  ------------------
 1590|     25|                return "Encountered illegal whitespace in token";
 1591|     25|            }
 1592|  10.4k|        }
 1593|  4.02k|        else if (c == ' ' || c == '\t') {
  ------------------
  |  Branch (1593:18): [True: 820, False: 3.20k]
  |  Branch (1593:30): [True: 839, False: 2.36k]
  ------------------
 1594|       |            /* "Linear whitespace" only includes ASCII CRLF, space, and tab;
 1595|       |             * we can't get a CRLF since headers are split on them already,
 1596|       |             * so only look for a space or a tab */
 1597|  1.65k|            if (in_leading_space) {
  ------------------
  |  Branch (1597:17): [True: 1.04k, False: 611]
  ------------------
 1598|       |                /* We're still in leading whitespace */
 1599|  1.04k|                ++tok_begin;
 1600|  1.04k|            }
 1601|    611|            else {
 1602|       |                /* We must be in trailing whitespace */
 1603|    611|                ++in_trailing_space;
 1604|    611|            }
 1605|  1.65k|        }
 1606|  2.36k|        else if (c == ',' || c == '\0') {
  ------------------
  |  Branch (1606:18): [True: 1.16k, False: 1.20k]
  |  Branch (1606:30): [True: 215, False: 991]
  ------------------
 1607|  1.37k|            if (!in_leading_space) {
  ------------------
  |  Branch (1607:17): [True: 872, False: 503]
  ------------------
 1608|       |                /* If we're out of the leading space, we know we've read some
 1609|       |                 * characters of a token */
 1610|    872|                if (*tokens == NULL) {
  ------------------
  |  Branch (1610:21): [True: 270, False: 602]
  ------------------
 1611|    270|                    *tokens = apr_array_make(p, 4, sizeof(char *));
 1612|    270|                }
 1613|    872|                APR_ARRAY_PUSH(*tokens, char *) =
  ------------------
  |  |  150|    872|#define APR_ARRAY_PUSH(ary,type) (*((type *)apr_array_push(ary)))
  ------------------
 1614|    872|                    apr_pstrmemdup((*tokens)->pool, tok_begin,
 1615|    872|                                   (cur - tok_begin) - in_trailing_space);
 1616|    872|            }
 1617|       |            /* We're allowed to have null elements, just don't add them to the
 1618|       |             * array */
 1619|       |
 1620|  1.37k|            tok_begin = cur + 1;
 1621|  1.37k|            in_leading_space = 1;
 1622|  1.37k|            in_trailing_space = 0;
 1623|  1.37k|            string_end = (c == '\0');
 1624|  1.37k|        }
 1625|    991|        else {
 1626|       |            /* Encountered illegal separator char */
 1627|    991|            if (skip_invalid) {
  ------------------
  |  Branch (1627:17): [True: 0, False: 991]
  ------------------
 1628|       |                /* Skip to the next separator */
 1629|      0|                const char *temp;
 1630|      0|                temp = ap_strchr_c(cur, ',');
  ------------------
  |  | 2575|      0|# define ap_strchr_c(s, c)   strchr(s, c)
  ------------------
 1631|      0|                if(!temp) {
  ------------------
  |  Branch (1631:20): [True: 0, False: 0]
  ------------------
 1632|      0|                    temp = ap_strchr_c(cur, '\0');
  ------------------
  |  | 2575|      0|# define ap_strchr_c(s, c)   strchr(s, c)
  ------------------
 1633|      0|                }
 1634|       |
 1635|       |                /* Act like we haven't seen a token so we reset */
 1636|      0|                cur = temp - 1;
 1637|      0|                in_leading_space = 1;
 1638|      0|                in_trailing_space = 0;
 1639|      0|            }
 1640|    991|            else {
 1641|    991|                return apr_psprintf(p, "Encountered illegal separator "
 1642|    991|                                    "'\\x%.2x'", (unsigned int)c);
 1643|    991|            }
 1644|    991|        }
 1645|       |
 1646|  13.4k|        ++cur;
 1647|  13.4k|    }
 1648|       |
 1649|    215|    return NULL;
 1650|  1.23k|}
ap_get_token:
 1691|  1.23k|{
 1692|  1.23k|    const char *ptr = *accept_line;
 1693|  1.23k|    const char *tok_start;
 1694|  1.23k|    char *token;
 1695|       |
 1696|       |    /* Find first non-white byte */
 1697|       |
 1698|  2.62k|    while (apr_isspace(*ptr))
  ------------------
  |  |  228|  2.62k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (228:24): [True: 1.39k, False: 1.23k]
  |  |  ------------------
  ------------------
 1699|  1.39k|        ++ptr;
 1700|       |
 1701|  1.23k|    tok_start = ptr;
 1702|       |
 1703|       |    /* find token end, skipping over quoted strings.
 1704|       |     * (comments are already gone).
 1705|       |     */
 1706|       |
 1707|  33.8k|    while (*ptr && (accept_white || !apr_isspace(*ptr))
  ------------------
  |  |  228|      0|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  ------------------
  |  Branch (1707:12): [True: 32.9k, False: 861]
  |  Branch (1707:21): [True: 32.9k, False: 0]
  |  Branch (1707:37): [True: 0, False: 0]
  ------------------
 1708|  32.9k|           && *ptr != ';' && *ptr != ',') {
  ------------------
  |  Branch (1708:15): [True: 32.9k, False: 58]
  |  Branch (1708:30): [True: 32.6k, False: 312]
  ------------------
 1709|  32.6k|        if (*ptr++ == '"')
  ------------------
  |  Branch (1709:13): [True: 742, False: 31.8k]
  ------------------
 1710|  5.65k|            while (*ptr)
  ------------------
  |  Branch (1710:20): [True: 5.51k, False: 140]
  ------------------
 1711|  5.51k|                if (*ptr++ == '"')
  ------------------
  |  Branch (1711:21): [True: 602, False: 4.91k]
  ------------------
 1712|    602|                    break;
 1713|  32.6k|    }
 1714|       |
 1715|  1.23k|    token = apr_pstrmemdup(p, tok_start, ptr - tok_start);
 1716|       |
 1717|       |    /* Advance accept_line pointer to the next non-white byte */
 1718|       |
 1719|  1.23k|    while (apr_isspace(*ptr))
  ------------------
  |  |  228|  1.23k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (228:24): [True: 0, False: 1.23k]
  |  |  ------------------
  ------------------
 1720|      0|        ++ptr;
 1721|       |
 1722|  1.23k|    *accept_line = ptr;
 1723|  1.23k|    return token;
 1724|  1.23k|}
ap_find_token:
 1729|  1.23k|{
 1730|  1.23k|    const unsigned char *start_token;
 1731|  1.23k|    const unsigned char *s;
 1732|       |
 1733|  1.23k|    if (!line)
  ------------------
  |  Branch (1733:9): [True: 0, False: 1.23k]
  ------------------
 1734|      0|        return 0;
 1735|       |
 1736|  1.23k|    s = (const unsigned char *)line;
 1737|  4.97k|    for (;;) {
 1738|       |        /* find start of token, skip all stop characters */
 1739|  35.7k|        while (*s && TEST_CHAR(*s, T_HTTP_TOKEN_STOP)) {
  ------------------
  |  |   53|  35.1k|#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))
  |  |  ------------------
  |  |  |  Branch (53:25): [True: 30.8k, False: 4.27k]
  |  |  ------------------
  ------------------
  |  Branch (1739:16): [True: 35.1k, False: 696]
  ------------------
 1740|  30.8k|            ++s;
 1741|  30.8k|        }
 1742|  4.97k|        if (!*s) {
  ------------------
  |  Branch (1742:13): [True: 696, False: 4.27k]
  ------------------
 1743|    696|            return 0;
 1744|    696|        }
 1745|  4.27k|        start_token = s;
 1746|       |        /* find end of the token */
 1747|  22.8k|        while (*s && !TEST_CHAR(*s, T_HTTP_TOKEN_STOP)) {
  ------------------
  |  |   53|  22.4k|#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))
  ------------------
  |  Branch (1747:16): [True: 22.4k, False: 420]
  |  Branch (1747:22): [True: 18.6k, False: 3.85k]
  ------------------
 1748|  18.6k|            ++s;
 1749|  18.6k|        }
 1750|  4.27k|        if (!ap_cstr_casecmpn((const char *)start_token, (const char *)tok,
  ------------------
  |  Branch (1750:13): [True: 124, False: 4.15k]
  ------------------
 1751|  4.27k|                         s - start_token)) {
 1752|    124|            return 1;
 1753|    124|        }
 1754|  4.15k|        if (!*s) {
  ------------------
  |  Branch (1754:13): [True: 411, False: 3.74k]
  ------------------
 1755|    411|            return 0;
 1756|    411|        }
 1757|  4.15k|    }
 1758|  1.23k|}
ap_find_last_token:
 1784|  1.23k|{
 1785|       |    return find_last_token(p, line, tok) != NULL;
 1786|  1.23k|}
ap_is_chunked:
 1789|  1.23k|{
 1790|  1.23k|    const char *s;
 1791|       |
 1792|  1.23k|    if (!line) 
  ------------------
  |  Branch (1792:9): [True: 0, False: 1.23k]
  ------------------
 1793|      0|        return 0;
 1794|  1.23k|    if (!ap_cstr_casecmp(line, "chunked")) { 
  ------------------
  |  Branch (1794:9): [True: 9, False: 1.22k]
  ------------------
 1795|      9|        return 1;
 1796|      9|    }
 1797|       |
 1798|  1.22k|    s = find_last_token(p, line, "chunked");
 1799|       |
 1800|  1.22k|    if (!s) return 0;
  ------------------
  |  Branch (1800:9): [True: 1.19k, False: 23]
  ------------------
 1801|       | 
 1802|       |    /* eat spaces right-to-left to see what precedes "chunked" */
 1803|    376|    while (--s > line) { 
  ------------------
  |  Branch (1803:12): [True: 372, False: 4]
  ------------------
 1804|    372|        if (*s != ' ') break;
  ------------------
  |  Branch (1804:13): [True: 19, False: 353]
  ------------------
 1805|    372|    }
 1806|       |
 1807|       |    /* found delim, or leading ws (input wasn't parsed by httpd as a header) */
 1808|     23|    if (*s == ',' || *s == ' ') { 
  ------------------
  |  Branch (1808:9): [True: 1, False: 22]
  |  Branch (1808:22): [True: 1, False: 21]
  ------------------
 1809|      2|        return 1;
 1810|      2|    }
 1811|     21|    return 0;
 1812|     23|}
ap_escape_shell_cmd:
 1815|  1.23k|{
 1816|  1.23k|    char *cmd;
 1817|  1.23k|    unsigned char *d;
 1818|  1.23k|    const unsigned char *s;
 1819|  1.23k|    apr_size_t len = strlen(str);
 1820|       |
 1821|  1.23k|    ap_assert(len <= (APR_SIZE_MAX - 1) / 2);
  ------------------
  |  | 2476|  1.23k|#define ap_assert(exp) ((exp) ? (void)0 : ap_log_assert(#exp,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (2476:25): [True: 1.23k, False: 0]
  |  |  ------------------
  ------------------
 1822|  1.23k|    cmd = apr_palloc(p, 2 * len + 1);
  ------------------
  |  |  425|  1.23k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.23k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.23k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  1.23k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1823|  1.23k|    d = (unsigned char *)cmd;
 1824|  1.23k|    s = (const unsigned char *)str;
 1825|  55.8k|    for (; *s; ++s) {
  ------------------
  |  Branch (1825:12): [True: 54.5k, False: 1.23k]
  ------------------
 1826|       |
 1827|       |#if defined(OS2) || defined(WIN32)
 1828|       |        /*
 1829|       |         * Newlines to Win32/OS2 CreateProcess() are ill advised.
 1830|       |         * Convert them to spaces since they are effectively white
 1831|       |         * space to most applications
 1832|       |         */
 1833|       |        if (*s == '\r' || *s == '\n') {
 1834|       |             *d++ = ' ';
 1835|       |             continue;
 1836|       |         }
 1837|       |#endif
 1838|       |
 1839|  54.5k|        if (TEST_CHAR(*s, T_ESCAPE_SHELL_CMD)) {
  ------------------
  |  |   53|  54.5k|#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))
  |  |  ------------------
  |  |  |  Branch (53:25): [True: 16.0k, False: 38.5k]
  |  |  ------------------
  ------------------
 1840|  16.0k|            *d++ = '\\';
 1841|  16.0k|        }
 1842|  54.5k|        *d++ = *s;
 1843|  54.5k|    }
 1844|  1.23k|    *d = '\0';
 1845|       |
 1846|  1.23k|    return cmd;
 1847|  1.23k|}
ap_unescape_url:
 1948|    303|{
 1949|       |    /* Traditional */
 1950|    303|    return unescape_url(url, AP_SLASHES, NULL, 0);
  ------------------
  |  | 2939|    303|#define AP_SLASHES "/"
  ------------------
 1951|    303|}
ap_unescape_urlencoded:
 1986|    263|{
 1987|    263|    char *slider;
 1988|       |
 1989|       |    /* replace plus with a space */
 1990|    263|    if (query) {
  ------------------
  |  Branch (1990:9): [True: 263, False: 0]
  ------------------
 1991|  10.9k|        for (slider = query; *slider; slider++) {
  ------------------
  |  Branch (1991:30): [True: 10.7k, False: 263]
  ------------------
 1992|  10.7k|            if (*slider == '+') {
  ------------------
  |  Branch (1992:17): [True: 202, False: 10.5k]
  ------------------
 1993|    202|                *slider = ' ';
 1994|    202|            }
 1995|  10.7k|        }
 1996|    263|    }
 1997|       |
 1998|       |    /* unescape everything else */
 1999|    263|    return unescape_url(query, NULL, NULL, 0);
 2000|    263|}
ap_escape_path_segment_buffer:
 2058|  1.23k|{
 2059|  1.23k|    const unsigned char *s = (const unsigned char *)segment;
 2060|  1.23k|    unsigned char *d = (unsigned char *)copy;
 2061|  1.23k|    unsigned c;
 2062|       |
 2063|  55.8k|    while ((c = *s)) {
  ------------------
  |  Branch (2063:12): [True: 54.5k, False: 1.23k]
  ------------------
 2064|  54.5k|        if (TEST_CHAR(c, T_ESCAPE_PATH_SEGMENT)) {
  ------------------
  |  |   53|  54.5k|#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))
  |  |  ------------------
  |  |  |  Branch (53:25): [True: 28.7k, False: 25.8k]
  |  |  ------------------
  ------------------
 2065|  28.7k|            d = c2x(c, '%', d);
 2066|  28.7k|        }
 2067|  25.8k|        else {
 2068|  25.8k|            *d++ = c;
 2069|  25.8k|        }
 2070|  54.5k|        ++s;
 2071|  54.5k|    }
 2072|  1.23k|    *d = '\0';
 2073|  1.23k|    return copy;
 2074|  1.23k|}
ap_os_escape_path:
 2084|  1.23k|{
 2085|       |    /* Allocate +3 for potential "./" and trailing NULL.
 2086|       |     * Allocate another +1 to allow the caller to add a trailing '/' (see
 2087|       |     * comment in 'ap_sub_req_lookup_dirent')
 2088|       |     */
 2089|  1.23k|    apr_size_t len = strlen(path);
 2090|  1.23k|    char *copy;
 2091|  1.23k|    const unsigned char *s;
 2092|  1.23k|    unsigned char *d;
 2093|  1.23k|    unsigned c;
 2094|       |
 2095|  1.23k|    ap_assert(len <= (APR_SIZE_MAX - 4) / 3);
  ------------------
  |  | 2476|  1.23k|#define ap_assert(exp) ((exp) ? (void)0 : ap_log_assert(#exp,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (2476:25): [True: 1.23k, False: 0]
  |  |  ------------------
  ------------------
 2096|  1.23k|    copy = apr_palloc(p, 3 * len + 3 + 1);
  ------------------
  |  |  425|  1.23k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.23k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.23k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  1.23k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2097|  1.23k|    s = (const unsigned char *)path;
 2098|  1.23k|    d = (unsigned char *)copy;
 2099|       |
 2100|  1.23k|    if (!partial) {
  ------------------
  |  Branch (2100:9): [True: 1.23k, False: 0]
  ------------------
 2101|  1.23k|        const char *colon = ap_strchr_c(path, ':');
  ------------------
  |  | 2575|  1.23k|# define ap_strchr_c(s, c)   strchr(s, c)
  ------------------
 2102|  1.23k|        const char *slash = ap_strchr_c(path, '/');
  ------------------
  |  | 2575|  1.23k|# define ap_strchr_c(s, c)   strchr(s, c)
  ------------------
 2103|       |
 2104|  1.23k|        if (colon && (!slash || colon < slash)) {
  ------------------
  |  Branch (2104:13): [True: 54, False: 1.17k]
  |  Branch (2104:23): [True: 44, False: 10]
  |  Branch (2104:33): [True: 5, False: 5]
  ------------------
 2105|     49|            *d++ = '.';
 2106|     49|            *d++ = '/';
 2107|     49|        }
 2108|  1.23k|    }
 2109|  55.8k|    while ((c = *s)) {
  ------------------
  |  Branch (2109:12): [True: 54.5k, False: 1.23k]
  ------------------
 2110|  54.5k|        if (TEST_CHAR(c, T_OS_ESCAPE_PATH)) {
  ------------------
  |  |   53|  54.5k|#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))
  |  |  ------------------
  |  |  |  Branch (53:25): [True: 27.4k, False: 27.1k]
  |  |  ------------------
  ------------------
 2111|  27.4k|            d = c2x(c, '%', d);
 2112|  27.4k|        }
 2113|  27.1k|        else {
 2114|  27.1k|            *d++ = c;
 2115|  27.1k|        }
 2116|  54.5k|        ++s;
 2117|  54.5k|    }
 2118|  1.23k|    *d = '\0';
 2119|  1.23k|    return copy;
 2120|  1.23k|}
ap_escape_urlencoded_buffer:
 2123|  1.23k|{
 2124|  1.23k|    const unsigned char *s = (const unsigned char *)buffer;
 2125|  1.23k|    unsigned char *d = (unsigned char *)copy;
 2126|  1.23k|    unsigned c;
 2127|       |
 2128|  55.8k|    while ((c = *s)) {
  ------------------
  |  Branch (2128:12): [True: 54.5k, False: 1.23k]
  ------------------
 2129|  54.5k|        if (TEST_CHAR(c, T_ESCAPE_URLENCODED)) {
  ------------------
  |  |   53|  54.5k|#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))
  |  |  ------------------
  |  |  |  Branch (53:25): [True: 33.3k, False: 21.2k]
  |  |  ------------------
  ------------------
 2130|  33.3k|            d = c2x(c, '%', d);
 2131|  33.3k|        }
 2132|  21.2k|        else if (c == ' ') {
  ------------------
  |  Branch (2132:18): [True: 2.89k, False: 18.3k]
  ------------------
 2133|  2.89k|            *d++ = '+';
 2134|  2.89k|        }
 2135|  18.3k|        else {
 2136|  18.3k|            *d++ = c;
 2137|  18.3k|        }
 2138|  54.5k|        ++s;
 2139|  54.5k|    }
 2140|  1.23k|    *d = '\0';
 2141|  1.23k|    return copy;
 2142|  1.23k|}
ap_escape_urlencoded:
 2145|  1.23k|{
 2146|  1.23k|    apr_size_t len = strlen(buffer);
 2147|  1.23k|    ap_assert(len <= (APR_SIZE_MAX - 1) / 3);
  ------------------
  |  | 2476|  1.23k|#define ap_assert(exp) ((exp) ? (void)0 : ap_log_assert(#exp,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (2476:25): [True: 1.23k, False: 0]
  |  |  ------------------
  ------------------
 2148|  1.23k|    return ap_escape_urlencoded_buffer(apr_palloc(p, 3 * len + 1), buffer);
  ------------------
  |  |  425|  1.23k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.23k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.23k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  1.23k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2149|  1.23k|}
ap_escape_html2:
 2154|  1.23k|{
 2155|  1.23k|    apr_size_t i, j;
 2156|  1.23k|    char *x;
 2157|       |
 2158|       |    /* first, count the number of extra characters */
 2159|  55.8k|    for (i = 0, j = 0; s[i] != '\0'; i++) {
  ------------------
  |  Branch (2159:24): [True: 54.5k, False: 1.23k]
  ------------------
 2160|  54.5k|        if (i + j > APR_SIZE_MAX - 6) {
  ------------------
  |  |  469|  54.5k|#define APR_SIZE_MAX    (~((apr_size_t)0))
  ------------------
  |  Branch (2160:13): [True: 0, False: 54.5k]
  ------------------
 2161|      0|            abort();
 2162|      0|        }
 2163|  54.5k|        if (s[i] == '<' || s[i] == '>')
  ------------------
  |  Branch (2163:13): [True: 165, False: 54.4k]
  |  Branch (2163:28): [True: 146, False: 54.2k]
  ------------------
 2164|    311|            j += 3;
 2165|  54.2k|        else if (s[i] == '&')
  ------------------
  |  Branch (2165:18): [True: 375, False: 53.9k]
  ------------------
 2166|    375|            j += 4;
 2167|  53.9k|        else if (s[i] == '"')
  ------------------
  |  Branch (2167:18): [True: 1.79k, False: 52.1k]
  ------------------
 2168|  1.79k|            j += 5;
 2169|  52.1k|        else if (toasc && !apr_isascii(s[i]))
  ------------------
  |  |  219|      0|#define apr_isascii(c) (isascii(((unsigned char)(c))))
  ------------------
  |  Branch (2169:18): [True: 0, False: 52.1k]
  |  Branch (2169:27): [True: 0, False: 0]
  ------------------
 2170|      0|            j += 5;
 2171|  54.5k|    }
 2172|       |
 2173|  1.23k|    if (j == 0)
  ------------------
  |  Branch (2173:9): [True: 845, False: 386]
  ------------------
 2174|    845|        return apr_pstrmemdup(p, s, i);
 2175|       |
 2176|    386|    x = apr_palloc(p, i + j + 1);
  ------------------
  |  |  425|    386|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|    386|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|    386|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|    386|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2177|  22.4k|    for (i = 0, j = 0; s[i] != '\0'; i++, j++)
  ------------------
  |  Branch (2177:24): [True: 22.0k, False: 386]
  ------------------
 2178|  22.0k|        if (s[i] == '<') {
  ------------------
  |  Branch (2178:13): [True: 165, False: 21.8k]
  ------------------
 2179|    165|            memcpy(&x[j], "&lt;", 4);
 2180|    165|            j += 3;
 2181|    165|        }
 2182|  21.8k|        else if (s[i] == '>') {
  ------------------
  |  Branch (2182:18): [True: 146, False: 21.7k]
  ------------------
 2183|    146|            memcpy(&x[j], "&gt;", 4);
 2184|    146|            j += 3;
 2185|    146|        }
 2186|  21.7k|        else if (s[i] == '&') {
  ------------------
  |  Branch (2186:18): [True: 375, False: 21.3k]
  ------------------
 2187|    375|            memcpy(&x[j], "&amp;", 5);
 2188|    375|            j += 4;
 2189|    375|        }
 2190|  21.3k|        else if (s[i] == '"') {
  ------------------
  |  Branch (2190:18): [True: 1.79k, False: 19.5k]
  ------------------
 2191|  1.79k|            memcpy(&x[j], "&quot;", 6);
 2192|  1.79k|            j += 5;
 2193|  1.79k|        }
 2194|  19.5k|        else if (toasc && !apr_isascii(s[i])) {
  ------------------
  |  |  219|      0|#define apr_isascii(c) (isascii(((unsigned char)(c))))
  ------------------
  |  Branch (2194:18): [True: 0, False: 19.5k]
  |  Branch (2194:27): [True: 0, False: 0]
  ------------------
 2195|      0|            char *esc = apr_psprintf(p, "&#%3.3d;", (unsigned char)s[i]);
 2196|      0|            memcpy(&x[j], esc, 6);
 2197|      0|            j += 5;
 2198|      0|        }
 2199|  19.5k|        else
 2200|  19.5k|            x[j] = s[i];
 2201|       |
 2202|    386|    x[j] = '\0';
 2203|    386|    return x;
 2204|  1.23k|}
ap_escape_logitem:
 2206|  1.23k|{
 2207|  1.23k|    char *ret;
 2208|  1.23k|    unsigned char *d;
 2209|  1.23k|    const unsigned char *s;
 2210|  1.23k|    apr_size_t length, escapes = 0;
 2211|       |
 2212|  1.23k|    if (!str) {
  ------------------
  |  Branch (2212:9): [True: 0, False: 1.23k]
  ------------------
 2213|      0|        return NULL;
 2214|      0|    }
 2215|       |
 2216|       |    /* Compute how many characters need to be escaped */
 2217|  1.23k|    s = (const unsigned char *)str;
 2218|  55.8k|    for (; *s; ++s) {
  ------------------
  |  Branch (2218:12): [True: 54.5k, False: 1.23k]
  ------------------
 2219|  54.5k|        if (TEST_CHAR(*s, T_ESCAPE_LOGITEM)) {
  ------------------
  |  |   53|  54.5k|#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))
  |  |  ------------------
  |  |  |  Branch (53:25): [True: 22.0k, False: 32.5k]
  |  |  ------------------
  ------------------
 2220|  22.0k|            escapes++;
 2221|  22.0k|        }
 2222|  54.5k|    }
 2223|       |    
 2224|       |    /* Compute the length of the input string, including NULL */
 2225|  1.23k|    length = s - (const unsigned char *)str + 1;
 2226|       |    
 2227|       |    /* Fast path: nothing to escape */
 2228|  1.23k|    if (escapes == 0) {
  ------------------
  |  Branch (2228:9): [True: 220, False: 1.01k]
  ------------------
 2229|    220|        return apr_pmemdup(p, str, length);
 2230|    220|    }
 2231|       |    
 2232|       |    /* Each escaped character needs up to 3 extra bytes (0 --> \x00) */
 2233|  1.01k|    ret = apr_palloc(p, length + 3 * escapes);
  ------------------
  |  |  425|  1.01k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.01k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.01k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  1.01k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2234|  1.01k|    d = (unsigned char *)ret;
 2235|  1.01k|    s = (const unsigned char *)str;
 2236|  51.2k|    for (; *s; ++s) {
  ------------------
  |  Branch (2236:12): [True: 50.2k, False: 1.01k]
  ------------------
 2237|  50.2k|        if (TEST_CHAR(*s, T_ESCAPE_LOGITEM)) {
  ------------------
  |  |   53|  50.2k|#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))
  |  |  ------------------
  |  |  |  Branch (53:25): [True: 22.0k, False: 28.1k]
  |  |  ------------------
  ------------------
 2238|  22.0k|            *d++ = '\\';
 2239|  22.0k|            switch(*s) {
 2240|    398|            case '\b':
  ------------------
  |  Branch (2240:13): [True: 398, False: 21.6k]
  ------------------
 2241|    398|                *d++ = 'b';
 2242|    398|                break;
 2243|  2.33k|            case '\n':
  ------------------
  |  Branch (2243:13): [True: 2.33k, False: 19.6k]
  ------------------
 2244|  2.33k|                *d++ = 'n';
 2245|  2.33k|                break;
 2246|    496|            case '\r':
  ------------------
  |  Branch (2246:13): [True: 496, False: 21.5k]
  ------------------
 2247|    496|                *d++ = 'r';
 2248|    496|                break;
 2249|  1.87k|            case '\t':
  ------------------
  |  Branch (2249:13): [True: 1.87k, False: 20.1k]
  ------------------
 2250|  1.87k|                *d++ = 't';
 2251|  1.87k|                break;
 2252|    427|            case '\v':
  ------------------
  |  Branch (2252:13): [True: 427, False: 21.6k]
  ------------------
 2253|    427|                *d++ = 'v';
 2254|    427|                break;
 2255|  4.39k|            case '\\':
  ------------------
  |  Branch (2255:13): [True: 4.39k, False: 17.6k]
  ------------------
 2256|  6.18k|            case '"':
  ------------------
  |  Branch (2256:13): [True: 1.79k, False: 20.2k]
  ------------------
 2257|  6.18k|                *d++ = *s;
 2258|  6.18k|                break;
 2259|  10.3k|            default:
  ------------------
  |  Branch (2259:13): [True: 10.3k, False: 11.7k]
  ------------------
 2260|  10.3k|                c2x(*s, 'x', d);
 2261|  10.3k|                d += 3;
 2262|  22.0k|            }
 2263|  22.0k|        }
 2264|  28.1k|        else {
 2265|  28.1k|            *d++ = *s;
 2266|  28.1k|        }
 2267|  50.2k|    }
 2268|  1.01k|    *d = '\0';
 2269|       |
 2270|  1.01k|    return ret;
 2271|  1.01k|}
ap_escape_errorlog_item:
 2275|  1.23k|{
 2276|  1.23k|    unsigned char *d, *ep;
 2277|  1.23k|    const unsigned char *s;
 2278|       |
 2279|  1.23k|    if (!source || !buflen) { /* be safe */
  ------------------
  |  Branch (2279:9): [True: 0, False: 1.23k]
  |  Branch (2279:20): [True: 0, False: 1.23k]
  ------------------
 2280|      0|        return 0;
 2281|      0|    }
 2282|       |
 2283|  1.23k|    d = (unsigned char *)dest;
 2284|  1.23k|    s = (const unsigned char *)source;
 2285|  1.23k|    ep = d + buflen - 1;
 2286|       |
 2287|  55.8k|    for (; d < ep && *s; ++s) {
  ------------------
  |  Branch (2287:12): [True: 55.8k, False: 21]
  |  Branch (2287:22): [True: 54.5k, False: 1.21k]
  ------------------
 2288|       |
 2289|  54.5k|        if (TEST_CHAR(*s, T_ESCAPE_LOGITEM)) {
  ------------------
  |  |   53|  54.5k|#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))
  |  |  ------------------
  |  |  |  Branch (53:25): [True: 22.0k, False: 32.5k]
  |  |  ------------------
  ------------------
 2290|  22.0k|            *d++ = '\\';
 2291|  22.0k|            if (d >= ep) {
  ------------------
  |  Branch (2291:17): [True: 0, False: 22.0k]
  ------------------
 2292|      0|                --d;
 2293|      0|                break;
 2294|      0|            }
 2295|       |
 2296|  22.0k|            switch(*s) {
 2297|    398|            case '\b':
  ------------------
  |  Branch (2297:13): [True: 398, False: 21.6k]
  ------------------
 2298|    398|                *d++ = 'b';
 2299|    398|                break;
 2300|  2.33k|            case '\n':
  ------------------
  |  Branch (2300:13): [True: 2.33k, False: 19.6k]
  ------------------
 2301|  2.33k|                *d++ = 'n';
 2302|  2.33k|                break;
 2303|    496|            case '\r':
  ------------------
  |  Branch (2303:13): [True: 496, False: 21.5k]
  ------------------
 2304|    496|                *d++ = 'r';
 2305|    496|                break;
 2306|  1.87k|            case '\t':
  ------------------
  |  Branch (2306:13): [True: 1.87k, False: 20.1k]
  ------------------
 2307|  1.87k|                *d++ = 't';
 2308|  1.87k|                break;
 2309|    427|            case '\v':
  ------------------
  |  Branch (2309:13): [True: 427, False: 21.6k]
  ------------------
 2310|    427|                *d++ = 'v';
 2311|    427|                break;
 2312|  4.39k|            case '\\':
  ------------------
  |  Branch (2312:13): [True: 4.39k, False: 17.6k]
  ------------------
 2313|  4.39k|                *d++ = *s;
 2314|  4.39k|                break;
 2315|  1.79k|            case '"': /* no need for this in error log */
  ------------------
  |  Branch (2315:13): [True: 1.79k, False: 20.2k]
  ------------------
 2316|  1.79k|                d[-1] = *s;
 2317|  1.79k|                break;
 2318|  10.3k|            default:
  ------------------
  |  Branch (2318:13): [True: 10.3k, False: 11.7k]
  ------------------
 2319|  10.3k|                if (d >= ep - 2) {
  ------------------
  |  Branch (2319:21): [True: 0, False: 10.3k]
  ------------------
 2320|      0|                    ep = --d; /* break the for loop as well */
 2321|      0|                    break;
 2322|      0|                }
 2323|  10.3k|                c2x(*s, 'x', d);
 2324|  10.3k|                d += 3;
 2325|  22.0k|            }
 2326|  22.0k|        }
 2327|  32.5k|        else {
 2328|  32.5k|            *d++ = *s;
 2329|  32.5k|        }
 2330|  54.5k|    }
 2331|  1.23k|    *d = '\0';
 2332|       |
 2333|  1.23k|    return (d - (unsigned char *)dest);
 2334|  1.23k|}
ap_str_tolower:
 2433|    229|{
 2434|  8.63k|    while (*str) {
  ------------------
  |  Branch (2434:12): [True: 8.40k, False: 229]
  ------------------
 2435|       |        *str = apr_tolower(*str);
  ------------------
  |  |  234|  8.40k|#define apr_tolower(c) (tolower(((unsigned char)(c))))
  ------------------
  |  Branch (2435:16): [True: 0, False: 0]
  |  Branch (2435:16): [True: 0, False: 0]
  |  Branch (2435:16): [Folded, False: 8.40k]
  ------------------
 2436|  8.40k|        ++str;
 2437|  8.40k|    }
 2438|    229|}
ap_pbase64decode:
 2500|  1.23k|{
 2501|  1.23k|    char *decoded;
 2502|       |
 2503|  1.23k|    decoded = (char *) apr_palloc(p, apr_base64_decode_len(bufcoded));
  ------------------
  |  |  425|  1.23k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.23k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.23k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  1.23k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2504|  1.23k|    apr_base64_decode(decoded, bufcoded);
 2505|       |
 2506|  1.23k|    return decoded;
 2507|  1.23k|}
ap_pbase64decode_strict:
 2514|    210|{
 2515|    210|    apr_size_t end_index;
 2516|    210|    int last_group_len;
 2517|    210|    const char *end;
 2518|       |
 2519|       |    /* Sanity check.
 2520|       |     * TODO: this would be a lot more efficient if we had access to the lookup
 2521|       |     * table used by APR. If that gets pulled in at any point, make use of it.
 2522|       |     */
 2523|    210|    end_index = strspn(encoded, "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
 2524|    210|                                "abcdefghijklmnopqrstuvwxyz"
 2525|    210|                                "0123456789+/");
 2526|       |
 2527|    210|    last_group_len = end_index % 4;
 2528|    210|    end = encoded + end_index;
 2529|       |
 2530|       |    /* The only non-alphabet character allowed is the padding character '=' at
 2531|       |     * the end of the string. There are two allowable padding cases for the last
 2532|       |     * group of four: "xY==" or "xyZ=". We require the final (non-padding)
 2533|       |     * character to have been zero-padded during encoding, which limits the
 2534|       |     * character choices.
 2535|       |     */
 2536|    210|    if (last_group_len == 1) {
  ------------------
  |  Branch (2536:9): [True: 9, False: 201]
  ------------------
 2537|       |        /* This isn't ever valid. */
 2538|      9|        return APR_EINVAL;
  ------------------
  |  |  715|      9|#define APR_EINVAL EINVAL
  ------------------
 2539|      9|    }
 2540|    201|    else if (last_group_len == 2) {
  ------------------
  |  Branch (2540:14): [True: 29, False: 172]
  ------------------
 2541|       |        /* ...xY== */
 2542|     29|        if (*end != '=' || end[1] != '=') {
  ------------------
  |  Branch (2542:13): [True: 17, False: 12]
  |  Branch (2542:28): [True: 10, False: 2]
  ------------------
 2543|     27|            return APR_EINVAL;
  ------------------
  |  |  715|     27|#define APR_EINVAL EINVAL
  ------------------
 2544|     27|        }
 2545|      2|        else if (!ap_strchr("AQgw", end[-1])) {
  ------------------
  |  | 2573|      2|# define ap_strchr(s, c)     strchr(s, c)
  ------------------
  |  Branch (2545:18): [True: 1, False: 1]
  ------------------
 2546|       |            /* Correctly zero-padded input data will result in a final character
 2547|       |             * that is one of the four above. */
 2548|      1|            return APR_EINVAL;
  ------------------
  |  |  715|      1|#define APR_EINVAL EINVAL
  ------------------
 2549|      1|        }
 2550|       |
 2551|      1|        end += 2;
 2552|      1|    }
 2553|    172|    else if (last_group_len == 3) {
  ------------------
  |  Branch (2553:14): [True: 31, False: 141]
  ------------------
 2554|       |        /* ...xyZ= */
 2555|     31|        if (*end != '=') {
  ------------------
  |  Branch (2555:13): [True: 28, False: 3]
  ------------------
 2556|     28|            return APR_EINVAL;
  ------------------
  |  |  715|     28|#define APR_EINVAL EINVAL
  ------------------
 2557|     28|        }
 2558|      3|        else if (!ap_strchr("AEIMQUYcgkosw048", end[-1])) {
  ------------------
  |  | 2573|      3|# define ap_strchr(s, c)     strchr(s, c)
  ------------------
  |  Branch (2558:18): [True: 1, False: 2]
  ------------------
 2559|       |            /* Correctly zero-padded input data will result in a final character
 2560|       |             * that is one of the sixteen above. */
 2561|      1|            return APR_EINVAL;
  ------------------
  |  |  715|      1|#define APR_EINVAL EINVAL
  ------------------
 2562|      1|        }
 2563|       |
 2564|      2|        end++;
 2565|      2|    }
 2566|       |
 2567|       |    /* At this point, if the encoded buffer is correct, we should be at the end
 2568|       |     * of the string. */
 2569|    144|    if (*end) {
  ------------------
  |  Branch (2569:9): [True: 104, False: 40]
  ------------------
 2570|    104|        return APR_EINVAL;
  ------------------
  |  |  715|    104|#define APR_EINVAL EINVAL
  ------------------
 2571|    104|    }
 2572|       |
 2573|     40|    *decoded = apr_palloc(p, apr_base64_decode_len(encoded));
  ------------------
  |  |  425|     40|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|     40|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|     40|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|     40|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2574|     40|    *len = apr_base64_decode(*decoded, encoded);
 2575|       |
 2576|     40|    return APR_SUCCESS;
  ------------------
  |  |  225|     40|#define APR_SUCCESS 0
  ------------------
 2577|    144|}
ap_pbase64encode:
 2580|  1.23k|{
 2581|  1.23k|    char *encoded;
 2582|  1.23k|    int l = strlen(string);
 2583|       |
 2584|  1.23k|    encoded = (char *) apr_palloc(p, apr_base64_encode_len(l));
  ------------------
  |  |  425|  1.23k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.23k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.23k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  1.23k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2585|  1.23k|    apr_base64_encode(encoded, string, l);
 2586|       |
 2587|  1.23k|    return encoded;
 2588|  1.23k|}
ap_content_type_tolower:
 2598|    229|{
 2599|    229|    char *semi;
 2600|       |
 2601|    229|    semi = strchr(str, ';');
 2602|    229|    if (semi) {
  ------------------
  |  Branch (2602:9): [True: 7, False: 222]
  ------------------
 2603|      7|        *semi = '\0';
 2604|      7|    }
 2605|       |
 2606|    229|    ap_str_tolower(str);
 2607|       |
 2608|    229|    if (semi) {
  ------------------
  |  Branch (2608:9): [True: 7, False: 222]
  ------------------
 2609|      7|        *semi = ';';
 2610|      7|    }
 2611|    229|}
ap_escape_quotes:
 2617|  1.23k|{
 2618|  1.23k|    apr_size_t size, extra = 0;
 2619|  1.23k|    const char *inchr = instring;
 2620|  1.23k|    char *outchr, *outstring;
 2621|       |
 2622|       |    /*
 2623|       |     * Look through the input string, jogging the length of the output
 2624|       |     * string up by an extra byte each time we find an unescaped ".
 2625|       |     */
 2626|  52.7k|    while (*inchr != '\0') {
  ------------------
  |  Branch (2626:12): [True: 51.5k, False: 1.23k]
  ------------------
 2627|  51.5k|        if (*inchr == '"') {
  ------------------
  |  Branch (2627:13): [True: 1.48k, False: 50.0k]
  ------------------
 2628|  1.48k|            extra++;
 2629|  1.48k|        }
 2630|       |        /*
 2631|       |         * If we find a slosh, and it's not the last byte in the string,
 2632|       |         * it's escaping something - advance past both bytes.
 2633|       |         */
 2634|  50.0k|        else if ((*inchr == '\\') && (inchr[1] != '\0')) {
  ------------------
  |  Branch (2634:18): [True: 3.09k, False: 46.9k]
  |  Branch (2634:38): [True: 3.05k, False: 43]
  ------------------
 2635|  3.05k|            inchr++;
 2636|  3.05k|        }
 2637|  51.5k|        inchr++;
 2638|  51.5k|    }
 2639|       |
 2640|  1.23k|    if (!extra) {
  ------------------
  |  Branch (2640:9): [True: 957, False: 274]
  ------------------
 2641|    957|        return apr_pstrdup(p, instring);
 2642|    957|    }
 2643|       |
 2644|       |    /* How large will the string become, once we escaped all the quotes?
 2645|       |     * The tricky cases are
 2646|       |     * - an `instring` that is already longer than `ptrdiff_t`
 2647|       |     *   can hold (which is an undefined case in C, as C defines ptrdiff_t as
 2648|       |     *   a signed difference between pointers into the same array and one index
 2649|       |     *   beyond).
 2650|       |     * - an `instring` that, including the `extra` chars we want to add, becomes
 2651|       |     *   even larger than apr_size_t can handle.
 2652|       |     * Since this function was not designed to ever return NULL for failure, we
 2653|       |     * can only trigger a hard assertion failure. It seems more a programming
 2654|       |     * mistake (or failure to verify the input causing this) that leads to this
 2655|       |     * situation.
 2656|       |     */
 2657|    274|    ap_assert(inchr - instring > 0);
  ------------------
  |  | 2476|    274|#define ap_assert(exp) ((exp) ? (void)0 : ap_log_assert(#exp,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (2476:25): [True: 274, False: 0]
  |  |  ------------------
  ------------------
 2658|    274|    size = ((apr_size_t)(inchr - instring)) + 1;
 2659|    274|    ap_assert(size + extra > size);
  ------------------
  |  | 2476|    274|#define ap_assert(exp) ((exp) ? (void)0 : ap_log_assert(#exp,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (2476:25): [True: 274, False: 0]
  |  |  ------------------
  ------------------
 2660|       |
 2661|    274|    outstring = apr_palloc(p, size + extra);
  ------------------
  |  |  425|    274|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|    274|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|    274|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|    274|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2662|    274|    inchr = instring;
 2663|    274|    outchr = outstring;
 2664|       |    /*
 2665|       |     * Now copy the input string to the output string, inserting a slosh
 2666|       |     * in front of every " that doesn't already have one.
 2667|       |     */
 2668|  14.7k|    while (*inchr != '\0') {
  ------------------
  |  Branch (2668:12): [True: 14.4k, False: 274]
  ------------------
 2669|  14.4k|        if (*inchr == '"') {
  ------------------
  |  Branch (2669:13): [True: 1.48k, False: 12.9k]
  ------------------
 2670|  1.48k|            *outchr++ = '\\';
 2671|  1.48k|        }
 2672|  12.9k|        else if ((*inchr == '\\') && (inchr[1] != '\0')) {
  ------------------
  |  Branch (2672:18): [True: 1.24k, False: 11.7k]
  |  Branch (2672:38): [True: 1.22k, False: 20]
  ------------------
 2673|  1.22k|            *outchr++ = *inchr++;
 2674|  1.22k|        }
 2675|  14.4k|        *outchr++ = *inchr++;
 2676|  14.4k|    }
 2677|    274|    *outchr = '\0';
 2678|    274|    return outstring;
 2679|    274|}
ap_timeout_parameter_parse:
 2718|  1.23k|{
 2719|  1.23k|    char *endp;
 2720|  1.23k|    const char *time_str;
 2721|  1.23k|    apr_int64_t tout;
 2722|  1.23k|    apr_uint64_t check;
 2723|       |
 2724|  1.23k|    tout = apr_strtoi64(timeout_parameter, &endp, 10);
 2725|  1.23k|    if (errno) {
  ------------------
  |  Branch (2725:9): [True: 9, False: 1.22k]
  ------------------
 2726|      9|        return errno;
 2727|      9|    }
 2728|  1.22k|    if (!endp || !*endp) {
  ------------------
  |  Branch (2728:9): [True: 0, False: 1.22k]
  |  Branch (2728:18): [True: 116, False: 1.10k]
  ------------------
 2729|    116|        time_str = default_time_unit;
 2730|    116|    }
 2731|  1.10k|    else {
 2732|  1.10k|        time_str = endp;
 2733|  1.10k|    }
 2734|       |
 2735|  1.22k|    if (tout < 0) { 
  ------------------
  |  Branch (2735:9): [True: 102, False: 1.12k]
  ------------------
 2736|    102|        return APR_EGENERAL;
  ------------------
  |  |  313|    102|#define APR_EGENERAL       (APR_OS_START_ERROR + 14)
  |  |  ------------------
  |  |  |  |  117|    102|#define APR_OS_START_ERROR     20000
  |  |  ------------------
  ------------------
 2737|    102|    }
 2738|       |
 2739|  1.12k|    switch (*time_str) {
 2740|       |        /* Time is in seconds */
 2741|     77|    case 's':
  ------------------
  |  Branch (2741:5): [True: 77, False: 1.04k]
  ------------------
 2742|    114|    case 'S':
  ------------------
  |  Branch (2742:5): [True: 37, False: 1.08k]
  ------------------
 2743|    114|        CHECK_OVERFLOW(tout, apr_time_sec(APR_INT64_MAX));
  ------------------
  |  | 2713|    114|#define CHECK_OVERFLOW(a, b) if (a > b) return APR_EGENERAL
  |  |  ------------------
  |  |  |  |  313|     49|#define APR_EGENERAL       (APR_OS_START_ERROR + 14)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|     49|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2713:34): [True: 49, False: 65]
  |  |  ------------------
  ------------------
 2744|     65|        check = apr_time_from_sec(tout);
  ------------------
  |  |   78|     65|#define apr_time_from_sec(sec) ((apr_time_t)(sec) * APR_USEC_PER_SEC)
  |  |  ------------------
  |  |  |  |   60|     65|#define APR_USEC_PER_SEC APR_TIME_C(1000000)
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|     65|#define APR_TIME_C(val) APR_INT64_C(val)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  394|     65| #define APR_INT64_C(val) INT64_C(val)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2745|     65|        break;
 2746|       |        /* Time is in hours */
 2747|     43|    case 'h':
  ------------------
  |  Branch (2747:5): [True: 43, False: 1.07k]
  ------------------
 2748|     87|    case 'H':
  ------------------
  |  Branch (2748:5): [True: 44, False: 1.07k]
  ------------------
 2749|     87|        CHECK_OVERFLOW(tout, apr_time_sec(APR_INT64_MAX / 3600));
  ------------------
  |  | 2713|     87|#define CHECK_OVERFLOW(a, b) if (a > b) return APR_EGENERAL
  |  |  ------------------
  |  |  |  |  313|     50|#define APR_EGENERAL       (APR_OS_START_ERROR + 14)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|     50|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2713:34): [True: 50, False: 37]
  |  |  ------------------
  ------------------
 2750|     37|        check = apr_time_from_sec(tout * 3600);
  ------------------
  |  |   78|     37|#define apr_time_from_sec(sec) ((apr_time_t)(sec) * APR_USEC_PER_SEC)
  |  |  ------------------
  |  |  |  |   60|     37|#define APR_USEC_PER_SEC APR_TIME_C(1000000)
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|     37|#define APR_TIME_C(val) APR_INT64_C(val)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  394|     37| #define APR_INT64_C(val) INT64_C(val)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2751|     37|        break;
 2752|    147|    case 'm':
  ------------------
  |  Branch (2752:5): [True: 147, False: 973]
  ------------------
 2753|    207|    case 'M':
  ------------------
  |  Branch (2753:5): [True: 60, False: 1.06k]
  ------------------
 2754|    207|        switch (*(++time_str)) {
 2755|       |        /* Time is in milliseconds */
 2756|    111|        case 's':
  ------------------
  |  Branch (2756:9): [True: 111, False: 96]
  ------------------
 2757|    114|        case 'S':
  ------------------
  |  Branch (2757:9): [True: 3, False: 204]
  ------------------
 2758|    114|            CHECK_OVERFLOW(tout, apr_time_as_msec(APR_INT64_MAX));
  ------------------
  |  | 2713|    114|#define CHECK_OVERFLOW(a, b) if (a > b) return APR_EGENERAL
  |  |  ------------------
  |  |  |  |  313|     31|#define APR_EGENERAL       (APR_OS_START_ERROR + 14)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|     31|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2713:34): [True: 31, False: 83]
  |  |  ------------------
  ------------------
 2759|     83|            check = apr_time_from_msec(tout);
  ------------------
  |  |   75|     83|#define apr_time_from_msec(msec) ((apr_time_t)(msec) * 1000)
  ------------------
 2760|     83|            break;
 2761|       |        /* Time is in minutes */
 2762|     44|        case 'i':
  ------------------
  |  Branch (2762:9): [True: 44, False: 163]
  ------------------
 2763|     90|        case 'I':
  ------------------
  |  Branch (2763:9): [True: 46, False: 161]
  ------------------
 2764|     90|            CHECK_OVERFLOW(tout, apr_time_sec(APR_INT64_MAX / 60));
  ------------------
  |  | 2713|     90|#define CHECK_OVERFLOW(a, b) if (a > b) return APR_EGENERAL
  |  |  ------------------
  |  |  |  |  313|     49|#define APR_EGENERAL       (APR_OS_START_ERROR + 14)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|     49|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2713:34): [True: 49, False: 41]
  |  |  ------------------
  ------------------
 2765|     41|            check = apr_time_from_sec(tout * 60);
  ------------------
  |  |   78|     41|#define apr_time_from_sec(sec) ((apr_time_t)(sec) * APR_USEC_PER_SEC)
  |  |  ------------------
  |  |  |  |   60|     41|#define APR_USEC_PER_SEC APR_TIME_C(1000000)
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|     41|#define APR_TIME_C(val) APR_INT64_C(val)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  394|     41| #define APR_INT64_C(val) INT64_C(val)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2766|     41|            break;
 2767|      3|        default:
  ------------------
  |  Branch (2767:9): [True: 3, False: 204]
  ------------------
 2768|      3|            return APR_EGENERAL;
  ------------------
  |  |  313|      3|#define APR_EGENERAL       (APR_OS_START_ERROR + 14)
  |  |  ------------------
  |  |  |  |  117|      3|#define APR_OS_START_ERROR     20000
  |  |  ------------------
  ------------------
 2769|    207|        }
 2770|    124|        break;
 2771|    712|    default:
  ------------------
  |  Branch (2771:5): [True: 712, False: 408]
  ------------------
 2772|    712|        return APR_EGENERAL;
  ------------------
  |  |  313|    712|#define APR_EGENERAL       (APR_OS_START_ERROR + 14)
  |  |  ------------------
  |  |  |  |  117|    712|#define APR_OS_START_ERROR     20000
  |  |  ------------------
  ------------------
 2773|  1.12k|    }
 2774|       |
 2775|    226|    *timeout = (apr_interval_time_t)check;
 2776|    226|    return APR_SUCCESS;
  ------------------
  |  |  225|    226|#define APR_SUCCESS 0
  ------------------
 2777|  1.12k|}
ap_str2_alnum:
 2829|  1.23k|AP_DECLARE(apr_status_t) ap_str2_alnum(const char *src, char *dest) {
 2830|       |
 2831|  55.8k|    for ( ; *src; src++, dest++)
  ------------------
  |  Branch (2831:13): [True: 54.5k, False: 1.23k]
  ------------------
 2832|  54.5k|    {
 2833|  54.5k|        if (!apr_isprint(*src))
  ------------------
  |  |  224|  54.5k|#define apr_isprint(c) (isprint(((unsigned char)(c))))
  ------------------
  |  Branch (2833:13): [True: 15.8k, False: 38.7k]
  ------------------
 2834|  15.8k|            *dest = 'x';
 2835|  38.7k|        else if (!apr_isalnum(*src))
  ------------------
  |  |  206|  38.7k|#define apr_isalnum(c) (isalnum(((unsigned char)(c))))
  ------------------
  |  Branch (2835:18): [True: 22.8k, False: 15.9k]
  ------------------
 2836|  22.8k|            *dest = '_';
 2837|  15.9k|        else
 2838|  15.9k|            *dest = (char)*src;
 2839|  54.5k|    }
 2840|  1.23k|    *dest = '\0';
 2841|  1.23k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.23k|#define APR_SUCCESS 0
  ------------------
 2842|       |
 2843|  1.23k|}
ap_pstr2_alnum:
 2847|  1.23k|{
 2848|  1.23k|    char *new = apr_palloc(p, strlen(src)+1);
  ------------------
  |  |  425|  1.23k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.23k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.23k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  1.23k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2849|  1.23k|    if (!new)
  ------------------
  |  Branch (2849:9): [True: 0, False: 1.23k]
  ------------------
 2850|      0|        return APR_ENOMEM;
  ------------------
  |  |  687|      0|#define APR_ENOMEM ENOMEM
  ------------------
 2851|  1.23k|    *dest = new;
 2852|  1.23k|    return ap_str2_alnum(src, new);
 2853|  1.23k|}
ap_cstr_casecmp:
 3708|  2.46k|{
 3709|  2.46k|    const unsigned char *u1 = (const unsigned char *)s1;
 3710|  2.46k|    const unsigned char *u2 = (const unsigned char *)s2;
 3711|  2.81k|    for (;;) {
 3712|  2.81k|        const int c2 = ucharmap[*u2++];
 3713|  2.81k|        const int cmp = (int)ucharmap[*u1++] - c2;
 3714|       |        /* Not necessary to test for !c1, this is caught by cmp */
 3715|  2.81k|        if (cmp || !c2)
  ------------------
  |  Branch (3715:13): [True: 2.44k, False: 368]
  |  Branch (3715:20): [True: 17, False: 351]
  ------------------
 3716|  2.46k|            return cmp;
 3717|  2.81k|    }
 3718|  2.46k|}
ap_cstr_casecmpn:
 3721|  5.96k|{
 3722|  5.96k|    const unsigned char *u1 = (const unsigned char *)s1;
 3723|  5.96k|    const unsigned char *u2 = (const unsigned char *)s2;
 3724|  8.05k|    while (n--) {
  ------------------
  |  Branch (3724:12): [True: 7.89k, False: 158]
  ------------------
 3725|  7.89k|        const int c2 = ucharmap[*u2++];
 3726|  7.89k|        const int cmp = (int)ucharmap[*u1++] - c2;
 3727|       |        /* Not necessary to test for !c1, this is caught by cmp */
 3728|  7.89k|        if (cmp || !c2)
  ------------------
  |  Branch (3728:13): [True: 5.80k, False: 2.08k]
  |  Branch (3728:20): [True: 0, False: 2.08k]
  ------------------
 3729|  5.80k|            return cmp;
 3730|  7.89k|    }
 3731|    158|    return 0;
 3732|  5.96k|}
util.c:substring_conf:
  809|  1.21k|{
  810|  1.21k|    char *result = apr_palloc(p, len + 1);
  ------------------
  |  |  425|  1.21k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.21k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.21k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  1.21k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  811|  1.21k|    char *resp = result;
  812|  1.21k|    int i;
  813|       |
  814|  34.4k|    for (i = 0; i < len; ++i) {
  ------------------
  |  Branch (814:17): [True: 33.2k, False: 1.21k]
  ------------------
  815|  33.2k|        if (start[i] == '\\' && (start[i + 1] == '\\'
  ------------------
  |  Branch (815:13): [True: 1.72k, False: 31.5k]
  |  Branch (815:34): [True: 674, False: 1.04k]
  ------------------
  816|  1.04k|                                 || (quote && start[i + 1] == quote)))
  ------------------
  |  Branch (816:38): [True: 468, False: 581]
  |  Branch (816:47): [True: 111, False: 357]
  ------------------
  817|    785|            *resp++ = start[++i];
  818|  32.4k|        else
  819|  32.4k|            *resp++ = start[i];
  820|  33.2k|    }
  821|       |
  822|  1.21k|    *resp++ = '\0';
  823|       |#if RESOLVE_ENV_PER_TOKEN
  824|       |    return (char *)ap_resolve_env(p,result);
  825|       |#else
  826|  1.21k|    return result;
  827|  1.21k|#endif
  828|  1.21k|}
util.c:cfg_getch:
  949|  8.56k|{
  950|  8.56k|    return apr_file_getc(ch, param);
  951|  8.56k|}
util.c:cfg_getstr:
  954|   754k|{
  955|   754k|    return apr_file_gets(buf, bufsiz, param);
  956|   754k|}
util.c:ap_cfg_getline_core:
 1083|  1.23k|{
 1084|  1.23k|    apr_status_t rc;
 1085|       |    /* If a "get string" function is defined, use it */
 1086|  1.23k|    if (cfp->getstr != NULL) {
  ------------------
  |  Branch (1086:9): [True: 1.11k, False: 113]
  ------------------
 1087|  1.11k|        char *cp;
 1088|  1.11k|        char *cbuf = buf + offset;
 1089|  1.11k|        apr_size_t cbufsize = bufsize - offset;
 1090|       |
 1091|   754k|        while (1) {
  ------------------
  |  Branch (1091:16): [True: 754k, Folded]
  ------------------
 1092|   754k|            ++cfp->line_number;
 1093|   754k|            rc = cfp->getstr(cbuf, cbufsize, cfp->param);
 1094|   754k|            if (rc == APR_EOF) {
  ------------------
  |  |  467|   754k|#define APR_EOF            (APR_OS_START_STATUS + 14)
  |  |  ------------------
  |  |  |  |  136|   754k|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|   754k|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|   754k|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1094:17): [True: 12, False: 754k]
  ------------------
 1095|     12|                if (cbuf != buf + offset) {
  ------------------
  |  Branch (1095:21): [True: 9, False: 3]
  ------------------
 1096|      9|                    *cbuf = '\0';
 1097|      9|                    break;
 1098|      9|                }
 1099|      3|                else {
 1100|      3|                    return APR_EOF;
  ------------------
  |  |  467|      3|#define APR_EOF            (APR_OS_START_STATUS + 14)
  |  |  ------------------
  |  |  |  |  136|      3|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|      3|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      3|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1101|      3|                }
 1102|     12|            }
 1103|   754k|            if (rc != APR_SUCCESS) {
  ------------------
  |  |  225|   754k|#define APR_SUCCESS 0
  ------------------
  |  Branch (1103:17): [True: 0, False: 754k]
  ------------------
 1104|      0|                return rc;
 1105|      0|            }
 1106|       |
 1107|       |            /*
 1108|       |             *  check for line continuation,
 1109|       |             *  i.e. match [^\\]\\[\r]\n only
 1110|       |             */
 1111|   754k|            cp = cbuf;
 1112|   754k|            cp += strlen(cp);
 1113|   754k|            if (cp > buf && cp[-1] == LF) {
  ------------------
  |  |  738|   754k|#define LF 10
  ------------------
  |  Branch (1113:17): [True: 754k, False: 9]
  |  Branch (1113:29): [True: 753k, False: 884]
  ------------------
 1114|   753k|                cp--;
 1115|   753k|                if (cp > buf && cp[-1] == CR)
  ------------------
  |  |  740|   753k|#define CR 13
  ------------------
  |  Branch (1115:21): [True: 753k, False: 31]
  |  Branch (1115:33): [True: 267, False: 752k]
  ------------------
 1116|    267|                    cp--;
 1117|   753k|                if (cp > buf && cp[-1] == '\\') {
  ------------------
  |  Branch (1117:21): [True: 753k, False: 32]
  |  Branch (1117:33): [True: 753k, False: 181]
  ------------------
 1118|   753k|                    cp--;
 1119|       |                    /*
 1120|       |                     * line continuation requested -
 1121|       |                     * then remove backslash and continue
 1122|       |                     */
 1123|   753k|                    cbufsize -= (cp-cbuf);
 1124|   753k|                    cbuf = cp;
 1125|   753k|                    continue;
 1126|   753k|                }
 1127|   753k|            }
 1128|    893|            else if (cp - buf >= bufsize - 1) {
  ------------------
  |  Branch (1128:22): [True: 132, False: 761]
  ------------------
 1129|    132|                return APR_ENOSPC;
  ------------------
  |  |  680|    132|#define APR_ENOSPC ENOSPC
  ------------------
 1130|    132|            }
 1131|    974|            break;
 1132|   754k|        }
 1133|  1.11k|    } else {
 1134|       |        /* No "get string" function defined; read character by character */
 1135|    113|        apr_size_t i = offset;
 1136|       |
 1137|    113|        if (bufsize < 2) {
  ------------------
  |  Branch (1137:13): [True: 0, False: 113]
  ------------------
 1138|       |            /* too small, assume caller is crazy */
 1139|      0|            return APR_EINVAL;
  ------------------
  |  |  715|      0|#define APR_EINVAL EINVAL
  ------------------
 1140|      0|        }
 1141|    113|        buf[offset] = '\0';
 1142|       |
 1143|  8.56k|        while (1) {
  ------------------
  |  Branch (1143:16): [True: 8.56k, Folded]
  ------------------
 1144|  8.56k|            char c;
 1145|  8.56k|            rc = cfp->getch(&c, cfp->param);
 1146|  8.56k|            if (rc == APR_EOF) {
  ------------------
  |  |  467|  8.56k|#define APR_EOF            (APR_OS_START_STATUS + 14)
  |  |  ------------------
  |  |  |  |  136|  8.56k|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|  8.56k|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|  8.56k|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1146:17): [True: 6, False: 8.56k]
  ------------------
 1147|      6|                if (i > offset)
  ------------------
  |  Branch (1147:21): [True: 6, False: 0]
  ------------------
 1148|      6|                    break;
 1149|      0|                else
 1150|      0|                    return APR_EOF;
  ------------------
  |  |  467|      0|#define APR_EOF            (APR_OS_START_STATUS + 14)
  |  |  ------------------
  |  |  |  |  136|      0|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|      0|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1151|      6|            }
 1152|  8.56k|            if (rc != APR_SUCCESS)
  ------------------
  |  |  225|  8.56k|#define APR_SUCCESS 0
  ------------------
  |  Branch (1152:17): [True: 0, False: 8.56k]
  ------------------
 1153|      0|                return rc;
 1154|  8.56k|            if (c == LF) {
  ------------------
  |  |  738|  8.56k|#define LF 10
  ------------------
  |  Branch (1154:17): [True: 510, False: 8.05k]
  ------------------
 1155|    510|                ++cfp->line_number;
 1156|       |                /* check for line continuation */
 1157|    510|                if (i > 0 && buf[i-1] == '\\') {
  ------------------
  |  Branch (1157:21): [True: 508, False: 2]
  |  Branch (1157:30): [True: 460, False: 48]
  ------------------
 1158|    460|                    i--;
 1159|    460|                    continue;
 1160|    460|                }
 1161|     50|                else {
 1162|     50|                    break;
 1163|     50|                }
 1164|    510|            }
 1165|  8.05k|            buf[i] = c;
 1166|  8.05k|            ++i;
 1167|  8.05k|            if (i >= bufsize - 1) {
  ------------------
  |  Branch (1167:17): [True: 57, False: 7.99k]
  ------------------
 1168|     57|                return APR_ENOSPC;
  ------------------
  |  |  680|     57|#define APR_ENOSPC ENOSPC
  ------------------
 1169|     57|            }
 1170|  8.05k|        }
 1171|     56|        buf[i] = '\0';
 1172|     56|    }
 1173|  1.03k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.03k|#define APR_SUCCESS 0
  ------------------
 1174|  1.23k|}
util.c:cfg_trim_line:
 1177|  1.03k|{
 1178|  1.03k|    char *start, *end;
 1179|       |    /*
 1180|       |     * Leading and trailing white space is eliminated completely
 1181|       |     */
 1182|  1.03k|    start = buf;
 1183|  2.05k|    while (apr_isspace(*start))
  ------------------
  |  |  228|  2.05k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (228:24): [True: 1.01k, False: 1.03k]
  |  |  ------------------
  ------------------
 1184|  1.01k|        ++start;
 1185|       |    /* blast trailing whitespace */
 1186|  1.03k|    end = &start[strlen(start)];
 1187|  1.48k|    while (--end >= start && apr_isspace(*end))
  ------------------
  |  |  228|  1.42k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (228:24): [True: 448, False: 974]
  |  |  ------------------
  ------------------
  |  Branch (1187:12): [True: 1.42k, False: 65]
  ------------------
 1188|    448|        *end = '\0';
 1189|       |    /* Zap leading whitespace by shifting */
 1190|  1.03k|    if (start != buf)
  ------------------
  |  Branch (1190:9): [True: 236, False: 803]
  ------------------
 1191|    236|        memmove(buf, start, end - start + 2);
 1192|       |#ifdef DEBUG_CFG_LINES
 1193|       |    ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, NULL, APLOGNO(00555) "Read config: '%s'", buf);
 1194|       |#endif
 1195|  1.03k|    return end - start + 1;
 1196|  1.03k|}
util.c:find_list_item:
 1413|  1.23k|{
 1414|  1.23k|    const unsigned char *pos;
 1415|  1.23k|    const unsigned char *ptr = (const unsigned char *)line;
 1416|  1.23k|    int good = 0, addspace = 0, in_qpair = 0, in_qstr = 0, in_com = 0;
 1417|       |
 1418|  1.23k|    if (!line || !tok) {
  ------------------
  |  Branch (1418:9): [True: 0, False: 1.23k]
  |  Branch (1418:18): [True: 0, False: 1.23k]
  ------------------
 1419|      0|        return 0;
 1420|      0|    }
 1421|  1.23k|    if (type == AP_ETAG_STRONG && *tok != '\"') {
  ------------------
  |  Branch (1421:9): [True: 0, False: 1.23k]
  |  Branch (1421:35): [True: 0, False: 0]
  ------------------
 1422|      0|        return 0;
 1423|      0|    }
 1424|  1.23k|    if (type == AP_ETAG_WEAK) {
  ------------------
  |  Branch (1424:9): [True: 0, False: 1.23k]
  ------------------
 1425|      0|        if (*tok == 'W' && (*(tok+1)) == '/' && (*(tok+2)) == '\"') {
  ------------------
  |  Branch (1425:13): [True: 0, False: 0]
  |  Branch (1425:28): [True: 0, False: 0]
  |  Branch (1425:49): [True: 0, False: 0]
  ------------------
 1426|      0|            tok += 2;
 1427|      0|        }
 1428|      0|        else if (*tok != '\"') {
  ------------------
  |  Branch (1428:18): [True: 0, False: 0]
  ------------------
 1429|      0|            return 0;
 1430|      0|        }
 1431|      0|    }
 1432|       |
 1433|  3.16k|    do {  /* loop for each item in line's list */
 1434|       |
 1435|       |        /* Find first non-comma, non-whitespace byte */
 1436|  7.70k|        while (*ptr == ',' || apr_isspace(*ptr)) {
  ------------------
  |  |  228|  4.82k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (228:24): [True: 1.66k, False: 3.16k]
  |  |  ------------------
  ------------------
  |  Branch (1436:16): [True: 2.87k, False: 4.82k]
  ------------------
 1437|  4.54k|            ++ptr;
 1438|  4.54k|        }
 1439|       |
 1440|       |        /* Account for strong or weak Etags, depending on our search */
 1441|  3.16k|        if (type == AP_ETAG_STRONG && *ptr != '\"') {
  ------------------
  |  Branch (1441:13): [True: 0, False: 3.16k]
  |  Branch (1441:39): [True: 0, False: 0]
  ------------------
 1442|      0|            break;
 1443|      0|        }
 1444|  3.16k|        if (type == AP_ETAG_WEAK) {
  ------------------
  |  Branch (1444:13): [True: 0, False: 3.16k]
  ------------------
 1445|      0|            if (*ptr == 'W' && (*(ptr+1)) == '/' && (*(ptr+2)) == '\"') {
  ------------------
  |  Branch (1445:17): [True: 0, False: 0]
  |  Branch (1445:32): [True: 0, False: 0]
  |  Branch (1445:53): [True: 0, False: 0]
  ------------------
 1446|      0|                ptr += 2;
 1447|      0|            }
 1448|      0|            else if (*ptr != '\"') {
  ------------------
  |  Branch (1448:22): [True: 0, False: 0]
  ------------------
 1449|      0|                break;
 1450|      0|            }
 1451|      0|        }
 1452|       |
 1453|  3.16k|        if (*ptr)
  ------------------
  |  Branch (1453:13): [True: 3.10k, False: 54]
  ------------------
 1454|  3.10k|            good = 1;  /* until proven otherwise for this item */
 1455|     54|        else
 1456|     54|            break;     /* no items left and nothing good found */
 1457|       |
 1458|       |        /* We skip extra whitespace and any whitespace around a '=', '/',
 1459|       |         * or ';' and lowercase normal characters not within a comment,
 1460|       |         * quoted-string or quoted-pair.
 1461|       |         */
 1462|  3.10k|        for (pos = (const unsigned char *)tok;
 1463|  53.1k|             *ptr && (in_qpair || in_qstr || in_com || *ptr != ',');
  ------------------
  |  Branch (1463:14): [True: 51.9k, False: 1.17k]
  |  Branch (1463:23): [True: 3.05k, False: 48.9k]
  |  Branch (1463:35): [True: 5.01k, False: 43.9k]
  |  Branch (1463:46): [True: 6.22k, False: 37.6k]
  |  Branch (1463:56): [True: 35.7k, False: 1.93k]
  ------------------
 1464|  50.0k|             ++ptr) {
 1465|       |
 1466|  50.0k|            if (in_qpair) {
  ------------------
  |  Branch (1466:17): [True: 3.05k, False: 47.0k]
  ------------------
 1467|  3.05k|                in_qpair = 0;
 1468|  3.05k|                if (good)
  ------------------
  |  Branch (1468:21): [True: 0, False: 3.05k]
  ------------------
 1469|      0|                    good = (*pos++ == *ptr);
 1470|  3.05k|            }
 1471|  47.0k|            else {
 1472|  47.0k|                switch (*ptr) {
 1473|  3.09k|                    case '\\': in_qpair = 1;
  ------------------
  |  Branch (1473:21): [True: 3.09k, False: 43.9k]
  ------------------
 1474|  3.09k|                               if (addspace == 1)
  ------------------
  |  Branch (1474:36): [True: 37, False: 3.06k]
  ------------------
 1475|     37|                                   good = good && (*pos++ == ' ');
  ------------------
  |  Branch (1475:43): [True: 37, False: 0]
  |  Branch (1475:51): [True: 0, False: 37]
  ------------------
 1476|  3.09k|                               good = good && (*pos++ == *ptr);
  ------------------
  |  Branch (1476:39): [True: 108, False: 2.98k]
  |  Branch (1476:47): [True: 0, False: 108]
  ------------------
 1477|  3.09k|                               addspace = 0;
 1478|  3.09k|                               break;
 1479|  1.48k|                    case '"' : if (!in_com)
  ------------------
  |  Branch (1479:21): [True: 1.48k, False: 45.5k]
  |  Branch (1479:36): [True: 1.21k, False: 278]
  ------------------
 1480|  1.21k|                                   in_qstr = !in_qstr;
 1481|  1.48k|                               if (addspace == 1)
  ------------------
  |  Branch (1481:36): [True: 45, False: 1.44k]
  ------------------
 1482|     45|                                   good = good && (*pos++ == ' ');
  ------------------
  |  Branch (1482:43): [True: 45, False: 0]
  |  Branch (1482:51): [True: 0, False: 45]
  ------------------
 1483|  1.48k|                               good = good && (*pos++ == *ptr);
  ------------------
  |  Branch (1483:39): [True: 122, False: 1.36k]
  |  Branch (1483:47): [True: 0, False: 122]
  ------------------
 1484|  1.48k|                               addspace = 0;
 1485|  1.48k|                               break;
 1486|  1.77k|                    case '(' : if (!in_qstr)
  ------------------
  |  Branch (1486:21): [True: 1.77k, False: 45.2k]
  |  Branch (1486:36): [True: 1.60k, False: 175]
  ------------------
 1487|  1.60k|                                   ++in_com;
 1488|  1.77k|                               if (addspace == 1)
  ------------------
  |  Branch (1488:36): [True: 30, False: 1.74k]
  ------------------
 1489|     30|                                   good = good && (*pos++ == ' ');
  ------------------
  |  Branch (1489:43): [True: 30, False: 0]
  |  Branch (1489:51): [True: 0, False: 30]
  ------------------
 1490|  1.77k|                               good = good && (*pos++ == *ptr);
  ------------------
  |  Branch (1490:39): [True: 73, False: 1.70k]
  |  Branch (1490:47): [True: 0, False: 73]
  ------------------
 1491|  1.77k|                               addspace = 0;
 1492|  1.77k|                               break;
 1493|    882|                    case ')' : if (in_com)
  ------------------
  |  Branch (1493:21): [True: 882, False: 46.1k]
  |  Branch (1493:36): [True: 333, False: 549]
  ------------------
 1494|    333|                                   --in_com;
 1495|    882|                               good = good && (*pos++ == *ptr);
  ------------------
  |  Branch (1495:39): [True: 138, False: 744]
  |  Branch (1495:47): [True: 0, False: 138]
  ------------------
 1496|    882|                               addspace = 0;
 1497|    882|                               break;
 1498|  2.25k|                    case ' ' :
  ------------------
  |  Branch (1498:21): [True: 2.25k, False: 44.7k]
  ------------------
 1499|  3.55k|                    case '\t': if (addspace || !good)
  ------------------
  |  Branch (1499:21): [True: 1.29k, False: 45.7k]
  |  Branch (1499:36): [True: 316, False: 3.23k]
  |  Branch (1499:48): [True: 3.04k, False: 190]
  ------------------
 1500|  3.36k|                                   break;
 1501|    190|                               if (in_com || in_qstr)
  ------------------
  |  Branch (1501:36): [True: 0, False: 190]
  |  Branch (1501:46): [True: 0, False: 190]
  ------------------
 1502|      0|                                   good = (*pos++ == *ptr);
 1503|    190|                               else
 1504|    190|                                   addspace = 1;
 1505|    190|                               break;
 1506|    351|                    case '=' :
  ------------------
  |  Branch (1506:21): [True: 351, False: 46.6k]
  ------------------
 1507|  1.29k|                    case '/' :
  ------------------
  |  Branch (1507:21): [True: 941, False: 46.0k]
  ------------------
 1508|  1.66k|                    case ';' : if (!(in_com || in_qstr))
  ------------------
  |  Branch (1508:21): [True: 370, False: 46.6k]
  |  Branch (1508:38): [True: 252, False: 1.41k]
  |  Branch (1508:48): [True: 272, False: 1.13k]
  ------------------
 1509|  1.13k|                                   addspace = -1;
 1510|  1.66k|                               good = good && (*pos++ == *ptr);
  ------------------
  |  Branch (1510:39): [True: 141, False: 1.52k]
  |  Branch (1510:47): [True: 0, False: 141]
  ------------------
 1511|  1.66k|                               break;
 1512|  34.5k|                    default  : if (!good)
  ------------------
  |  Branch (1512:21): [True: 34.5k, False: 12.4k]
  |  Branch (1512:36): [True: 31.7k, False: 2.79k]
  ------------------
 1513|  31.7k|                                   break;
 1514|  2.79k|                               if (addspace == 1)
  ------------------
  |  Branch (1514:36): [True: 64, False: 2.72k]
  ------------------
 1515|     64|                                   good = (*pos++ == ' ');
 1516|  2.79k|                               if (in_com || in_qstr)
  ------------------
  |  Branch (1516:36): [True: 0, False: 2.79k]
  |  Branch (1516:46): [True: 0, False: 2.79k]
  ------------------
 1517|      0|                                   good = good && (*pos++ == *ptr);
  ------------------
  |  Branch (1517:43): [True: 0, False: 0]
  |  Branch (1517:51): [True: 0, False: 0]
  ------------------
 1518|  2.79k|                               else
 1519|  2.79k|                                   good = good
  ------------------
  |  Branch (1519:43): [True: 2.72k, False: 64]
  ------------------
 1520|  2.72k|                                       && (apr_tolower(*pos++) == apr_tolower(*ptr));
  ------------------
  |  |  234|  2.72k|#define apr_tolower(c) (tolower(((unsigned char)(c))))
  ------------------
                                                     && (apr_tolower(*pos++) == apr_tolower(*ptr));
  ------------------
  |  |  234|  2.72k|#define apr_tolower(c) (tolower(((unsigned char)(c))))
  ------------------
  |  Branch (1520:43): [True: 648, False: 2.07k]
  |  Branch (1520:44): [True: 0, False: 0]
  |  Branch (1520:44): [Folded, False: 0]
  |  Branch (1520:44): [Folded, False: 2.72k]
  |  Branch (1520:67): [True: 0, False: 0]
  |  Branch (1520:67): [True: 0, False: 0]
  |  Branch (1520:67): [Folded, False: 2.72k]
  ------------------
 1521|  2.79k|                               addspace = 0;
 1522|  2.79k|                               break;
 1523|  47.0k|                }
 1524|  47.0k|            }
 1525|  50.0k|        }
 1526|  3.10k|        if (good && *pos)
  ------------------
  |  Branch (1526:13): [True: 272, False: 2.83k]
  |  Branch (1526:21): [True: 271, False: 1]
  ------------------
 1527|    271|            good = 0;          /* not good if only a prefix was matched */
 1528|       |
 1529|  3.10k|    } while (*ptr && !good);
  ------------------
  |  Branch (1529:14): [True: 1.93k, False: 1.17k]
  |  Branch (1529:22): [True: 1.93k, False: 0]
  ------------------
 1530|       |
 1531|  1.23k|    return good;
 1532|  1.23k|}
util.c:find_last_token:
 1762|  2.45k|{
 1763|  2.45k|    int llen, tlen, lidx;
 1764|       |
 1765|  2.45k|    if (!line)
  ------------------
  |  Branch (1765:9): [True: 0, False: 2.45k]
  ------------------
 1766|      0|        return NULL;
 1767|       |
 1768|  2.45k|    llen = strlen(line);
 1769|  2.45k|    tlen = strlen(tok);
 1770|  2.45k|    lidx = llen - tlen;
 1771|       |
 1772|  2.45k|    if (lidx < 0 ||
  ------------------
  |  Branch (1772:9): [True: 158, False: 2.29k]
  ------------------
 1773|  2.29k|        (lidx > 0 && !(apr_isspace(line[lidx - 1]) || line[lidx - 1] == ',')))
  ------------------
  |  |  228|  4.50k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (228:24): [True: 324, False: 1.92k]
  |  |  ------------------
  ------------------
  |  Branch (1773:10): [True: 2.25k, False: 44]
  |  Branch (1773:55): [True: 124, False: 1.80k]
  ------------------
 1774|  1.96k|        return NULL;
 1775|       |
 1776|    492|    if (ap_cstr_casecmpn(&line[lidx], tok, tlen) == 0) { 
  ------------------
  |  Branch (1776:9): [True: 24, False: 468]
  ------------------
 1777|     24|        return &line[lidx];
 1778|     24|    }
 1779|    468|   return NULL;
 1780|    492|}
util.c:x2c:
 1850|    464|{
 1851|    464|    char digit;
 1852|       |
 1853|    464|#if !APR_CHARSET_EBCDIC
 1854|    464|    digit = ((what[0] >= 'A') ? ((what[0] & 0xdf) - 'A') + 10
  ------------------
  |  Branch (1854:14): [True: 139, False: 325]
  ------------------
 1855|    464|             : (what[0] - '0'));
 1856|    464|    digit *= 16;
 1857|    464|    digit += (what[1] >= 'A' ? ((what[1] & 0xdf) - 'A') + 10
  ------------------
  |  Branch (1857:15): [True: 232, False: 232]
  ------------------
 1858|    464|              : (what[1] - '0'));
 1859|       |#else /*APR_CHARSET_EBCDIC*/
 1860|       |    char xstr[5];
 1861|       |    xstr[0]='0';
 1862|       |    xstr[1]='x';
 1863|       |    xstr[2]=what[0];
 1864|       |    xstr[3]=what[1];
 1865|       |    xstr[4]='\0';
 1866|       |    digit = apr_xlate_conv_byte(ap_hdrs_from_ascii,
 1867|       |                                0xFF & strtol(xstr, NULL, 16));
 1868|       |#endif /*APR_CHARSET_EBCDIC*/
 1869|    464|    return (digit);
 1870|    464|}
util.c:unescape_url:
 1883|    566|{
 1884|    566|    const int keep_slashes = (flags & AP_UNESCAPE_URL_KEEP_SLASHES) != 0,
  ------------------
  |  | 1839|    566|#define AP_UNESCAPE_URL_KEEP_SLASHES    (1u << 2)
  ------------------
 1885|    566|              forbid_slashes = (flags & AP_UNESCAPE_URL_FORBID_SLASHES) != 0,
  ------------------
  |  | 1838|    566|#define AP_UNESCAPE_URL_FORBID_SLASHES  (1u << 1)
  ------------------
 1886|    566|              keep_unreserved = (flags & AP_UNESCAPE_URL_KEEP_UNRESERVED) != 0;
  ------------------
  |  | 1837|    566|#define AP_UNESCAPE_URL_KEEP_UNRESERVED (1u << 0)
  ------------------
 1887|    566|    int badesc, badpath;
 1888|    566|    char *x, *y;
 1889|       |
 1890|    566|    badesc = 0;
 1891|    566|    badpath = 0;
 1892|       |
 1893|    566|    if (url == NULL) {
  ------------------
  |  Branch (1893:9): [True: 0, False: 566]
  ------------------
 1894|      0|        return OK;
  ------------------
  |  |  461|      0|#define OK           0  /**< Module has handled this stage. */
  ------------------
 1895|      0|    }
 1896|       |    /* Initial scan for first '%'. Don't bother writing values before
 1897|       |     * seeing a '%' */
 1898|    566|    y = strchr(url, '%');
 1899|    566|    if (y == NULL) {
  ------------------
  |  Branch (1899:9): [True: 451, False: 115]
  ------------------
 1900|    451|        return OK;
  ------------------
  |  |  461|    451|#define OK           0  /**< Module has handled this stage. */
  ------------------
 1901|    451|    }
 1902|  4.10k|    for (x = y; *y; ++x, ++y) {
  ------------------
  |  Branch (1902:17): [True: 3.99k, False: 115]
  ------------------
 1903|  3.99k|        if (*y != '%') {
  ------------------
  |  Branch (1903:13): [True: 2.81k, False: 1.17k]
  ------------------
 1904|  2.81k|            *x = *y;
 1905|  2.81k|        }
 1906|  1.17k|        else {
 1907|  1.17k|            if (!apr_isxdigit(*(y + 1)) || !apr_isxdigit(*(y + 2))) {
  ------------------
  |  |  232|  2.35k|#define apr_isxdigit(c) (isxdigit(((unsigned char)(c))))
  ------------------
                          if (!apr_isxdigit(*(y + 1)) || !apr_isxdigit(*(y + 2))) {
  ------------------
  |  |  232|    669|#define apr_isxdigit(c) (isxdigit(((unsigned char)(c))))
  ------------------
  |  Branch (1907:17): [True: 509, False: 669]
  |  Branch (1907:44): [True: 205, False: 464]
  ------------------
 1908|    714|                badesc = 1;
 1909|    714|                *x = '%';
 1910|    714|            }
 1911|    464|            else {
 1912|    464|                char decoded;
 1913|    464|                decoded = x2c(y + 1);
 1914|    464|                if ((decoded == '\0')
  ------------------
  |  Branch (1914:21): [True: 134, False: 330]
  ------------------
 1915|    330|                    || (forbid_slashes && AP_IS_SLASH(decoded))
  ------------------
  |  | 2938|      0|#define AP_IS_SLASH(s) (s == '/')
  |  |  ------------------
  |  |  |  Branch (2938:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1915:25): [True: 0, False: 330]
  ------------------
 1916|    330|                    || (forbid && ap_strchr_c(forbid, decoded))) {
  ------------------
  |  | 2575|    238|# define ap_strchr_c(s, c)   strchr(s, c)
  |  |  ------------------
  |  |  |  Branch (2575:30): [True: 88, False: 150]
  |  |  ------------------
  ------------------
  |  Branch (1916:25): [True: 238, False: 92]
  ------------------
 1917|    222|                    badpath = 1;
 1918|    222|                    *x = decoded;
 1919|    222|                    y += 2;
 1920|    222|                }
 1921|    242|                else if ((keep_unreserved && TEST_CHAR(decoded,
  ------------------
  |  |   53|      0|#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))
  |  |  ------------------
  |  |  |  Branch (53:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1921:27): [True: 0, False: 242]
  ------------------
 1922|    242|                                                       T_URI_UNRESERVED))
 1923|    242|                         || (keep_slashes && AP_IS_SLASH(decoded))
  ------------------
  |  | 2938|      0|#define AP_IS_SLASH(s) (s == '/')
  |  |  ------------------
  |  |  |  Branch (2938:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1923:30): [True: 0, False: 242]
  ------------------
 1924|    242|                         || (reserved && ap_strchr_c(reserved, decoded))) {
  ------------------
  |  | 2575|      0|# define ap_strchr_c(s, c)   strchr(s, c)
  |  |  ------------------
  |  |  |  Branch (2575:30): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1924:30): [True: 0, False: 242]
  ------------------
 1925|      0|                    *x++ = *y++;
 1926|      0|                    *x++ = *y++;
 1927|      0|                    *x = *y;
 1928|      0|                }
 1929|    242|                else {
 1930|    242|                    *x = decoded;
 1931|    242|                    y += 2;
 1932|    242|                }
 1933|    464|            }
 1934|  1.17k|        }
 1935|  3.99k|    }
 1936|    115|    *x = '\0';
 1937|    115|    if (badesc) {
  ------------------
  |  Branch (1937:9): [True: 95, False: 20]
  ------------------
 1938|     95|        return HTTP_BAD_REQUEST;
  ------------------
  |  |  514|     95|#define HTTP_BAD_REQUEST                     400
  ------------------
 1939|     95|    }
 1940|     20|    else if (badpath) {
  ------------------
  |  Branch (1940:14): [True: 5, False: 15]
  ------------------
 1941|      5|        return HTTP_NOT_FOUND;
  ------------------
  |  |  518|      5|#define HTTP_NOT_FOUND                       404
  ------------------
 1942|      5|    }
 1943|     15|    else {
 1944|     15|        return OK;
  ------------------
  |  |  461|     15|#define OK           0  /**< Module has handled this stage. */
  ------------------
 1945|     15|    }
 1946|    115|}
util.c:c2x:
 2032|   110k|{
 2033|       |#if APR_CHARSET_EBCDIC
 2034|       |    what = apr_xlate_conv_byte(ap_hdrs_to_ascii, (unsigned char)what);
 2035|       |#endif /*APR_CHARSET_EBCDIC*/
 2036|   110k|    *where++ = prefix;
 2037|   110k|    *where++ = c2x_table[what >> 4];
 2038|   110k|    *where++ = c2x_table[what & 0xf];
 2039|   110k|    return where;
 2040|   110k|}

apr_atomic_init:
   29|  1.23k|{
   30|       |#if defined (USE_ATOMICS_GENERIC64)
   31|       |    return apr__atomic_generic64_init(p);
   32|       |#else
   33|  1.23k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.23k|#define APR_SUCCESS 0
  ------------------
   34|  1.23k|#endif
   35|  1.23k|}

apr_base64_decode_len:
  133|  1.27k|{
  134|  1.27k|    register const unsigned char *bufin;
  135|  1.27k|    register apr_size_t nprbytes;
  136|       |
  137|  1.27k|    bufin = (const unsigned char *) bufcoded;
  138|  8.15k|    while (pr2six[*(bufin++)] <= 63);
  ------------------
  |  Branch (138:12): [True: 6.88k, False: 1.27k]
  ------------------
  139|  1.27k|    nprbytes = (bufin - (const unsigned char *) bufcoded) - 1;
  140|  1.27k|    APR__ASSERT(nprbytes <= APR_BASE64_DECODE_MAX);
  ------------------
  |  |   31|  1.27k|#define APR__ASSERT(cond) assert(cond)
  ------------------
  |  Branch (140:5): [True: 0, False: 1.27k]
  |  Branch (140:5): [True: 1.27k, False: 0]
  ------------------
  141|       |
  142|  1.27k|    return (int)(((nprbytes + 3u) / 4u) * 3u + 1u);
  143|  1.27k|}
apr_base64_decode:
  146|  1.27k|{
  147|       |#if APR_CHARSET_EBCDIC
  148|       |    apr_size_t inbytes_left, outbytes_left;
  149|       |#endif /* APR_CHARSET_EBCDIC */
  150|  1.27k|    int len;
  151|       |
  152|  1.27k|    len = apr_base64_decode_binary((unsigned char *) bufplain, bufcoded);
  153|       |#if APR_CHARSET_EBCDIC
  154|       |    inbytes_left = outbytes_left = len;
  155|       |    apr_xlate_conv_buffer(xlate_to_ebcdic, bufplain, &inbytes_left,
  156|       |                          bufplain, &outbytes_left);
  157|       |#endif                /* APR_CHARSET_EBCDIC */
  158|  1.27k|    bufplain[len] = '\0';
  159|  1.27k|    return len;
  160|  1.27k|}
apr_base64_decode_binary:
  168|  1.27k|{
  169|  1.27k|    int nbytesdecoded;
  170|  1.27k|    register const unsigned char *bufin;
  171|  1.27k|    register unsigned char *bufout;
  172|  1.27k|    register apr_size_t nprbytes;
  173|       |
  174|  1.27k|    bufin = (const unsigned char *) bufcoded;
  175|  8.15k|    while (pr2six[*(bufin++)] <= 63);
  ------------------
  |  Branch (175:12): [True: 6.88k, False: 1.27k]
  ------------------
  176|  1.27k|    nprbytes = (bufin - (const unsigned char *) bufcoded) - 1;
  177|  1.27k|    APR__ASSERT(nprbytes <= APR_BASE64_DECODE_MAX);
  ------------------
  |  |   31|  1.27k|#define APR__ASSERT(cond) assert(cond)
  ------------------
  |  Branch (177:5): [True: 0, False: 1.27k]
  |  Branch (177:5): [True: 1.27k, False: 0]
  ------------------
  178|  1.27k|    nbytesdecoded = (int)(((nprbytes + 3u) / 4u) * 3u);
  179|       |
  180|  1.27k|    bufout = (unsigned char *) bufplain;
  181|  1.27k|    bufin = (const unsigned char *) bufcoded;
  182|       |
  183|  2.81k|    while (nprbytes >= 4) {
  ------------------
  |  Branch (183:12): [True: 1.54k, False: 1.27k]
  ------------------
  184|  1.54k|        *(bufout++) =
  185|  1.54k|            (unsigned char) (pr2six[*bufin] << 2 | pr2six[bufin[1]] >> 4);
  186|  1.54k|        *(bufout++) =
  187|  1.54k|            (unsigned char) (pr2six[bufin[1]] << 4 | pr2six[bufin[2]] >> 2);
  188|  1.54k|        *(bufout++) =
  189|  1.54k|            (unsigned char) (pr2six[bufin[2]] << 6 | pr2six[bufin[3]]);
  190|  1.54k|        bufin += 4;
  191|  1.54k|        nprbytes -= 4;
  192|  1.54k|    }
  193|       |
  194|       |    /* Note: (nprbytes == 1) would be an error, so just ignore that case */
  195|  1.27k|    if (nprbytes > 1) {
  ------------------
  |  Branch (195:9): [True: 221, False: 1.05k]
  ------------------
  196|    221|        *(bufout++) =
  197|    221|            (unsigned char) (pr2six[*bufin] << 2 | pr2six[bufin[1]] >> 4);
  198|    221|    }
  199|  1.27k|    if (nprbytes > 2) {
  ------------------
  |  Branch (199:9): [True: 120, False: 1.15k]
  ------------------
  200|    120|        *(bufout++) =
  201|    120|            (unsigned char) (pr2six[bufin[1]] << 4 | pr2six[bufin[2]] >> 2);
  202|    120|    }
  203|       |
  204|  1.27k|    return nbytesdecoded - (int)((4u - nprbytes) & 3u);
  205|  1.27k|}
apr_base64_encode_len:
  221|  1.23k|{
  222|  1.23k|    APR__ASSERT(len >= 0 && len <= APR_BASE64_ENCODE_MAX);
  ------------------
  |  |   31|  1.23k|#define APR__ASSERT(cond) assert(cond)
  ------------------
  |  Branch (222:5): [True: 0, False: 1.23k]
  |  Branch (222:5): [True: 0, False: 0]
  |  Branch (222:5): [True: 1.23k, False: 0]
  |  Branch (222:5): [True: 1.23k, False: 0]
  ------------------
  223|       |
  224|  1.23k|    return ((len + 2) / 3 * 4) + 1;
  225|  1.23k|}
apr_base64_encode:
  228|  1.23k|{
  229|  1.23k|#if !APR_CHARSET_EBCDIC
  230|  1.23k|    return apr_base64_encode_binary(encoded, (const unsigned char *) string, len);
  231|       |#else /* APR_CHARSET_EBCDIC */
  232|       |    int i;
  233|       |    char *p;
  234|       |
  235|       |    APR__ASSERT(len >= 0 && len <= APR_BASE64_ENCODE_MAX);
  236|       |
  237|       |    p = encoded;
  238|       |    for (i = 0; i < len - 2; i += 3) {
  239|       |        *p++ = basis_64[(os_toascii[string[i]] >> 2) & 0x3F];
  240|       |        *p++ = basis_64[((os_toascii[string[i]] & 0x3) << 4) |
  241|       |            ((int) (os_toascii[string[i + 1]] & 0xF0) >> 4)];
  242|       |        *p++ = basis_64[((os_toascii[string[i + 1]] & 0xF) << 2) |
  243|       |            ((int) (os_toascii[string[i + 2]] & 0xC0) >> 6)];
  244|       |        *p++ = basis_64[os_toascii[string[i + 2]] & 0x3F];
  245|       |    }
  246|       |    if (i < len) {
  247|       |        *p++ = basis_64[(os_toascii[string[i]] >> 2) & 0x3F];
  248|       |        if (i == (len - 1)) {
  249|       |            *p++ = basis_64[((os_toascii[string[i]] & 0x3) << 4)];
  250|       |            *p++ = '=';
  251|       |        }
  252|       |        else {
  253|       |            *p++ = basis_64[((os_toascii[string[i]] & 0x3) << 4) |
  254|       |                ((int) (os_toascii[string[i + 1]] & 0xF0) >> 4)];
  255|       |            *p++ = basis_64[((os_toascii[string[i + 1]] & 0xF) << 2)];
  256|       |        }
  257|       |        *p++ = '=';
  258|       |    }
  259|       |
  260|       |    *p++ = '\0';
  261|       |    return (unsigned int)(p - encoded);
  262|       |#endif                /* APR_CHARSET_EBCDIC */
  263|  1.23k|}
apr_base64_encode_binary:
  270|  1.23k|{
  271|  1.23k|    int i;
  272|  1.23k|    char *p;
  273|       |
  274|  1.23k|    APR__ASSERT(len >= 0 && len <= APR_BASE64_ENCODE_MAX);
  ------------------
  |  |   31|  1.23k|#define APR__ASSERT(cond) assert(cond)
  ------------------
  |  Branch (274:5): [True: 0, False: 1.23k]
  |  Branch (274:5): [True: 0, False: 0]
  |  Branch (274:5): [True: 1.23k, False: 0]
  |  Branch (274:5): [True: 1.23k, False: 0]
  ------------------
  275|       |
  276|  1.23k|    p = encoded;
  277|  19.1k|    for (i = 0; i < len - 2; i += 3) {
  ------------------
  |  Branch (277:17): [True: 17.8k, False: 1.23k]
  ------------------
  278|  17.8k|        *p++ = basis_64[(string[i] >> 2) & 0x3F];
  279|  17.8k|        *p++ = basis_64[((string[i] & 0x3) << 4) |
  280|  17.8k|            ((int) (string[i + 1] & 0xF0) >> 4)];
  281|  17.8k|        *p++ = basis_64[((string[i + 1] & 0xF) << 2) |
  282|  17.8k|            ((int) (string[i + 2] & 0xC0) >> 6)];
  283|  17.8k|        *p++ = basis_64[string[i + 2] & 0x3F];
  284|  17.8k|    }
  285|  1.23k|    if (i < len) {
  ------------------
  |  Branch (285:9): [True: 614, False: 617]
  ------------------
  286|    614|        *p++ = basis_64[(string[i] >> 2) & 0x3F];
  287|    614|        if (i == (len - 1)) {
  ------------------
  |  Branch (287:13): [True: 329, False: 285]
  ------------------
  288|    329|            *p++ = basis_64[((string[i] & 0x3) << 4)];
  289|    329|            *p++ = '=';
  290|    329|        }
  291|    285|        else {
  292|    285|            *p++ = basis_64[((string[i] & 0x3) << 4) |
  293|    285|                ((int) (string[i + 1] & 0xF0) >> 4)];
  294|    285|            *p++ = basis_64[((string[i + 1] & 0xF) << 2)];
  295|    285|        }
  296|    614|        *p++ = '=';
  297|    614|    }
  298|       |
  299|  1.23k|    *p++ = '\0';
  300|  1.23k|    return (unsigned int)(p - encoded);
  301|  1.23k|}

apr_unix_mode2perms:
   72|  1.23k|{
   73|  1.23k|    apr_fileperms_t perms = 0;
   74|       |
   75|  1.23k|    if (mode & S_ISUID)
  ------------------
  |  Branch (75:9): [True: 0, False: 1.23k]
  ------------------
   76|      0|        perms |= APR_FPROT_USETID;
  ------------------
  |  |   79|      0|#define APR_FPROT_USETID      0x8000 /**< Set user id */
  ------------------
   77|  1.23k|    if (mode & S_IRUSR)
  ------------------
  |  Branch (77:9): [True: 1.23k, False: 0]
  ------------------
   78|  1.23k|        perms |= APR_FPROT_UREAD;
  ------------------
  |  |   80|  1.23k|#define APR_FPROT_UREAD       0x0400 /**< Read by user */
  ------------------
   79|  1.23k|    if (mode & S_IWUSR)
  ------------------
  |  Branch (79:9): [True: 1.23k, False: 0]
  ------------------
   80|  1.23k|        perms |= APR_FPROT_UWRITE;
  ------------------
  |  |   81|  1.23k|#define APR_FPROT_UWRITE      0x0200 /**< Write by user */
  ------------------
   81|  1.23k|    if (mode & S_IXUSR)
  ------------------
  |  Branch (81:9): [True: 0, False: 1.23k]
  ------------------
   82|      0|        perms |= APR_FPROT_UEXECUTE;
  ------------------
  |  |   82|      0|#define APR_FPROT_UEXECUTE    0x0100 /**< Execute by user */
  ------------------
   83|       |
   84|  1.23k|    if (mode & S_ISGID)
  ------------------
  |  Branch (84:9): [True: 0, False: 1.23k]
  ------------------
   85|      0|        perms |= APR_FPROT_GSETID;
  ------------------
  |  |   84|      0|#define APR_FPROT_GSETID      0x4000 /**< Set group id */
  ------------------
   86|  1.23k|    if (mode & S_IRGRP)
  ------------------
  |  Branch (86:9): [True: 1.23k, False: 0]
  ------------------
   87|  1.23k|        perms |= APR_FPROT_GREAD;
  ------------------
  |  |   85|  1.23k|#define APR_FPROT_GREAD       0x0040 /**< Read by group */
  ------------------
   88|  1.23k|    if (mode & S_IWGRP)
  ------------------
  |  Branch (88:9): [True: 0, False: 1.23k]
  ------------------
   89|      0|        perms |= APR_FPROT_GWRITE;
  ------------------
  |  |   86|      0|#define APR_FPROT_GWRITE      0x0020 /**< Write by group */
  ------------------
   90|  1.23k|    if (mode & S_IXGRP)
  ------------------
  |  Branch (90:9): [True: 0, False: 1.23k]
  ------------------
   91|      0|        perms |= APR_FPROT_GEXECUTE;
  ------------------
  |  |   87|      0|#define APR_FPROT_GEXECUTE    0x0010 /**< Execute by group */
  ------------------
   92|       |
   93|  1.23k|#ifdef S_ISVTX
   94|  1.23k|    if (mode & S_ISVTX)
  ------------------
  |  Branch (94:9): [True: 0, False: 1.23k]
  ------------------
   95|      0|        perms |= APR_FPROT_WSTICKY;
  ------------------
  |  |   89|      0|#define APR_FPROT_WSTICKY     0x2000 /**< Sticky bit */
  ------------------
   96|  1.23k|#endif
   97|  1.23k|    if (mode & S_IROTH)
  ------------------
  |  Branch (97:9): [True: 1.23k, False: 0]
  ------------------
   98|  1.23k|        perms |= APR_FPROT_WREAD;
  ------------------
  |  |   90|  1.23k|#define APR_FPROT_WREAD       0x0004 /**< Read by others */
  ------------------
   99|  1.23k|    if (mode & S_IWOTH)
  ------------------
  |  Branch (99:9): [True: 0, False: 1.23k]
  ------------------
  100|      0|        perms |= APR_FPROT_WWRITE;
  ------------------
  |  |   91|      0|#define APR_FPROT_WWRITE      0x0002 /**< Write by others */
  ------------------
  101|  1.23k|    if (mode & S_IXOTH)
  ------------------
  |  Branch (101:9): [True: 0, False: 1.23k]
  ------------------
  102|      0|        perms |= APR_FPROT_WEXECUTE;
  ------------------
  |  |   92|      0|#define APR_FPROT_WEXECUTE    0x0001 /**< Execute by others */
  ------------------
  103|       |
  104|  1.23k|    return perms;
  105|  1.23k|}

apr_file_info_get:
  154|  1.23k|{
  155|  1.23k|    struct_stat info;
  156|       |
  157|  1.23k|    if (thefile->buffered) {
  ------------------
  |  Branch (157:9): [True: 1.23k, False: 0]
  ------------------
  158|  1.23k|        apr_status_t rv = apr_file_flush(thefile);
  159|  1.23k|        if (rv != APR_SUCCESS)
  ------------------
  |  |  225|  1.23k|#define APR_SUCCESS 0
  ------------------
  |  Branch (159:13): [True: 0, False: 1.23k]
  ------------------
  160|      0|            return rv;
  161|  1.23k|    }
  162|       |
  163|  1.23k|    if (fstat(thefile->filedes, &info) == 0) {
  ------------------
  |  Branch (163:9): [True: 1.23k, False: 0]
  ------------------
  164|  1.23k|        finfo->pool = thefile->pool;
  165|  1.23k|        finfo->fname = thefile->fname;
  166|  1.23k|        fill_out_finfo(finfo, &info, wanted);
  167|  1.23k|        return (wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS;
  ------------------
  |  |  458|      0|#define APR_INCOMPLETE     (APR_OS_START_STATUS + 8)
  |  |  ------------------
  |  |  |  |  136|      0|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|      0|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      return (wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS;
  ------------------
  |  |  225|  1.23k|#define APR_SUCCESS 0
  ------------------
  |  Branch (167:16): [True: 0, False: 1.23k]
  ------------------
  168|  1.23k|    }
  169|      0|    else {
  170|       |        return errno;
  171|      0|    }
  172|  1.23k|}
filestat.c:fill_out_finfo:
   72|  1.23k|{
   73|  1.23k|    finfo->valid = APR_FINFO_MIN | APR_FINFO_IDENT | APR_FINFO_NLINK
  ------------------
  |  |  163|  1.23k|#define APR_FINFO_MIN    0x00008170 /**< type, mtime, ctime, atime, size */
  ------------------
                  finfo->valid = APR_FINFO_MIN | APR_FINFO_IDENT | APR_FINFO_NLINK
  ------------------
  |  |  164|  1.23k|#define APR_FINFO_IDENT  0x00003000 /**< dev and inode */
  ------------------
                  finfo->valid = APR_FINFO_MIN | APR_FINFO_IDENT | APR_FINFO_NLINK
  ------------------
  |  |  153|  1.23k|#define APR_FINFO_NLINK  0x00004000 /**< Number of links */
  ------------------
   74|  1.23k|                 | APR_FINFO_OWNER | APR_FINFO_PROT;
  ------------------
  |  |  165|  1.23k|#define APR_FINFO_OWNER  0x00030000 /**< user and group */
  ------------------
                               | APR_FINFO_OWNER | APR_FINFO_PROT;
  ------------------
  |  |  166|  1.23k|#define APR_FINFO_PROT   0x00700000 /**<  all protections */
  ------------------
   75|  1.23k|    finfo->protection = apr_unix_mode2perms(info->st_mode);
   76|  1.23k|    finfo->filetype = filetype_from_mode(info->st_mode);
   77|  1.23k|    finfo->user = info->st_uid;
   78|  1.23k|    finfo->group = info->st_gid;
   79|  1.23k|    finfo->size = info->st_size;
   80|  1.23k|    finfo->device = info->st_dev;
   81|  1.23k|    finfo->nlink = info->st_nlink;
   82|       |
   83|       |    /* Check for overflow if storing a 64-bit st_ino in a 32-bit
   84|       |     * apr_ino_t for LFS builds: */
   85|  1.23k|    if (sizeof(apr_ino_t) >= sizeof(info->st_ino)
  ------------------
  |  Branch (85:9): [True: 1.23k, Folded]
  ------------------
   86|  1.23k|        || (apr_ino_t)info->st_ino == info->st_ino) {
  ------------------
  |  Branch (86:12): [True: 0, False: 0]
  ------------------
   87|  1.23k|        finfo->inode = info->st_ino;
   88|  1.23k|    } else {
   89|      0|        finfo->valid &= ~APR_FINFO_INODE;
  ------------------
  |  |  152|      0|#define APR_FINFO_INODE  0x00002000 /**< Inode */
  ------------------
   90|      0|    }
   91|       |
   92|  1.23k|    apr_time_ansi_put(&finfo->atime, info->st_atime);
   93|  1.23k|#ifdef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC
   94|  1.23k|    finfo->atime += info->st_atim.tv_nsec / APR_TIME_C(1000);
  ------------------
  |  |   49|  1.23k|#define APR_TIME_C(val) APR_INT64_C(val)
  |  |  ------------------
  |  |  |  |  394|  1.23k| #define APR_INT64_C(val) INT64_C(val)
  |  |  ------------------
  ------------------
   95|       |#elif defined(HAVE_STRUCT_STAT_ST_ATIMENSEC)
   96|       |    finfo->atime += info->st_atimensec / APR_TIME_C(1000);
   97|       |#elif defined(HAVE_STRUCT_STAT_ST_ATIME_N)
   98|       |    finfo->atime += info->st_atime_n / APR_TIME_C(1000);
   99|       |#endif
  100|       |
  101|  1.23k|    apr_time_ansi_put(&finfo->mtime, info->st_mtime);
  102|  1.23k|#ifdef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
  103|  1.23k|    finfo->mtime += info->st_mtim.tv_nsec / APR_TIME_C(1000);
  ------------------
  |  |   49|  1.23k|#define APR_TIME_C(val) APR_INT64_C(val)
  |  |  ------------------
  |  |  |  |  394|  1.23k| #define APR_INT64_C(val) INT64_C(val)
  |  |  ------------------
  ------------------
  104|       |#elif defined(HAVE_STRUCT_STAT_ST_MTIMENSEC)
  105|       |    finfo->mtime += info->st_mtimensec / APR_TIME_C(1000);
  106|       |#elif defined(HAVE_STRUCT_STAT_ST_MTIME_N)
  107|       |    finfo->mtime += info->st_mtime_n / APR_TIME_C(1000);
  108|       |#endif
  109|       |
  110|  1.23k|    apr_time_ansi_put(&finfo->ctime, info->st_ctime);
  111|  1.23k|#ifdef HAVE_STRUCT_STAT_ST_CTIM_TV_NSEC
  112|  1.23k|    finfo->ctime += info->st_ctim.tv_nsec / APR_TIME_C(1000);
  ------------------
  |  |   49|  1.23k|#define APR_TIME_C(val) APR_INT64_C(val)
  |  |  ------------------
  |  |  |  |  394|  1.23k| #define APR_INT64_C(val) INT64_C(val)
  |  |  ------------------
  ------------------
  113|       |#elif defined(HAVE_STRUCT_STAT_ST_CTIMENSEC)
  114|       |    finfo->ctime += info->st_ctimensec / APR_TIME_C(1000);
  115|       |#elif defined(HAVE_STRUCT_STAT_ST_CTIME_N)
  116|       |    finfo->ctime += info->st_ctime_n / APR_TIME_C(1000);
  117|       |#endif
  118|       |
  119|  1.23k|#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
  120|  1.23k|#ifdef DEV_BSIZE
  121|  1.23k|    finfo->csize = (apr_off_t)info->st_blocks * (apr_off_t)DEV_BSIZE;
  122|       |#else
  123|       |    finfo->csize = (apr_off_t)info->st_blocks * (apr_off_t)512;
  124|       |#endif
  125|  1.23k|    finfo->valid |= APR_FINFO_CSIZE;
  ------------------
  |  |  150|  1.23k|#define APR_FINFO_CSIZE  0x00000200 /**< Storage size consumed by the file */
  ------------------
  126|  1.23k|#endif
  127|  1.23k|}
filestat.c:filetype_from_mode:
   28|  1.23k|{
   29|  1.23k|    apr_filetype_e type;
   30|       |
   31|  1.23k|    switch (mode & S_IFMT) {
   32|  1.23k|    case S_IFREG:
  ------------------
  |  Branch (32:5): [True: 1.23k, False: 0]
  ------------------
   33|  1.23k|        type = APR_REG;  break;
   34|      0|    case S_IFDIR:
  ------------------
  |  Branch (34:5): [True: 0, False: 1.23k]
  ------------------
   35|      0|        type = APR_DIR;  break;
   36|      0|    case S_IFLNK:
  ------------------
  |  Branch (36:5): [True: 0, False: 1.23k]
  ------------------
   37|      0|        type = APR_LNK;  break;
   38|      0|    case S_IFCHR:
  ------------------
  |  Branch (38:5): [True: 0, False: 1.23k]
  ------------------
   39|      0|        type = APR_CHR;  break;
   40|      0|    case S_IFBLK:
  ------------------
  |  Branch (40:5): [True: 0, False: 1.23k]
  ------------------
   41|      0|        type = APR_BLK;  break;
   42|       |#if defined(S_IFFIFO)
   43|       |    case S_IFFIFO:
   44|       |        type = APR_PIPE; break;
   45|       |#endif
   46|      0|#if defined(S_IFSOCK)
   47|      0|    case S_IFSOCK:
  ------------------
  |  Branch (47:5): [True: 0, False: 1.23k]
  ------------------
   48|      0|        type = APR_SOCK; break;
   49|      0|#endif
   50|       |
   51|      0|    default:
  ------------------
  |  Branch (51:5): [True: 0, False: 1.23k]
  ------------------
   52|       |	/* Work around missing S_IFxxx values above
   53|       |         * for Linux et al.
   54|       |         */
   55|      0|#if !defined(S_IFFIFO) && defined(S_ISFIFO)
   56|      0|    	if (S_ISFIFO(mode)) {
  ------------------
  |  Branch (56:10): [True: 0, False: 0]
  ------------------
   57|      0|            type = APR_PIPE;
   58|      0|	} else
   59|      0|#endif
   60|       |#if !defined(S_IFSOCK) && defined(S_ISSOCK)
   61|       |    	if (S_ISSOCK(mode)) {
   62|       |            type = APR_SOCK;
   63|       |	} else
   64|       |#endif
   65|      0|        type = APR_UNKFILE;
   66|  1.23k|    }
   67|  1.23k|    return type;
   68|  1.23k|}

apr_unix_file_cleanup:
   67|  1.23k|{
   68|  1.23k|    apr_file_t *file = thefile;
   69|  1.23k|    apr_status_t flush_rv = APR_SUCCESS, rv = APR_SUCCESS;
  ------------------
  |  |  225|  1.23k|#define APR_SUCCESS 0
  ------------------
                  apr_status_t flush_rv = APR_SUCCESS, rv = APR_SUCCESS;
  ------------------
  |  |  225|  1.23k|#define APR_SUCCESS 0
  ------------------
   70|       |
   71|  1.23k|    if (file->buffered) {
  ------------------
  |  Branch (71:9): [True: 1.23k, False: 0]
  ------------------
   72|  1.23k|        flush_rv = apr_file_flush(file);
   73|  1.23k|    }
   74|       |
   75|  1.23k|    rv = file_cleanup(file, 0);
   76|       |
   77|  1.23k|    return rv != APR_SUCCESS ? rv : flush_rv;
  ------------------
  |  |  225|  1.23k|#define APR_SUCCESS 0
  ------------------
  |  Branch (77:12): [True: 0, False: 1.23k]
  ------------------
   78|  1.23k|}
apr_file_open:
   90|  1.23k|{
   91|  1.23k|    apr_os_file_t fd;
   92|  1.23k|    int oflags = 0;
   93|  1.23k|#if APR_HAS_THREADS
   94|  1.23k|    apr_thread_mutex_t *thlock = NULL;
   95|  1.23k|#endif
   96|  1.23k|    apr_status_t rv;
   97|       |
   98|  1.23k|    if ((flag & APR_FOPEN_READ) && (flag & APR_FOPEN_WRITE)) {
  ------------------
  |  |   54|  1.23k|#define APR_FOPEN_READ       0x00001  /**< Open the file for reading */
  ------------------
                  if ((flag & APR_FOPEN_READ) && (flag & APR_FOPEN_WRITE)) {
  ------------------
  |  |   55|  1.23k|#define APR_FOPEN_WRITE      0x00002  /**< Open the file for writing */
  ------------------
  |  Branch (98:9): [True: 1.23k, False: 0]
  |  Branch (98:36): [True: 0, False: 1.23k]
  ------------------
   99|      0|        oflags = O_RDWR;
  100|      0|    }
  101|  1.23k|    else if (flag & APR_FOPEN_READ) {
  ------------------
  |  |   54|  1.23k|#define APR_FOPEN_READ       0x00001  /**< Open the file for reading */
  ------------------
  |  Branch (101:14): [True: 1.23k, False: 0]
  ------------------
  102|  1.23k|        oflags = O_RDONLY;
  103|  1.23k|    }
  104|      0|    else if (flag & APR_FOPEN_WRITE) {
  ------------------
  |  |   55|      0|#define APR_FOPEN_WRITE      0x00002  /**< Open the file for writing */
  ------------------
  |  Branch (104:14): [True: 0, False: 0]
  ------------------
  105|      0|        oflags = O_WRONLY;
  106|      0|    }
  107|      0|    else {
  108|      0|        return APR_EACCES;
  ------------------
  |  |  645|      0|#define APR_EACCES EACCES
  ------------------
  109|      0|    }
  110|       |
  111|  1.23k|    if (flag & APR_FOPEN_CREATE) {
  ------------------
  |  |   56|  1.23k|#define APR_FOPEN_CREATE     0x00004  /**< Create the file if not there */
  ------------------
  |  Branch (111:9): [True: 0, False: 1.23k]
  ------------------
  112|      0|        oflags |= O_CREAT;
  113|      0|        if (flag & APR_FOPEN_EXCL) {
  ------------------
  |  |   63|      0|#define APR_FOPEN_EXCL       0x00040  /**< Open should fail if #APR_FOPEN_CREATE
  ------------------
  |  Branch (113:13): [True: 0, False: 0]
  ------------------
  114|      0|            oflags |= O_EXCL;
  115|      0|        }
  116|      0|    }
  117|  1.23k|    if ((flag & APR_FOPEN_EXCL) && !(flag & APR_FOPEN_CREATE)) {
  ------------------
  |  |   63|  1.23k|#define APR_FOPEN_EXCL       0x00040  /**< Open should fail if #APR_FOPEN_CREATE
  ------------------
                  if ((flag & APR_FOPEN_EXCL) && !(flag & APR_FOPEN_CREATE)) {
  ------------------
  |  |   56|      0|#define APR_FOPEN_CREATE     0x00004  /**< Create the file if not there */
  ------------------
  |  Branch (117:9): [True: 0, False: 1.23k]
  |  Branch (117:36): [True: 0, False: 0]
  ------------------
  118|      0|        return APR_EACCES;
  ------------------
  |  |  645|      0|#define APR_EACCES EACCES
  ------------------
  119|      0|    }
  120|       |
  121|  1.23k|    if (flag & APR_FOPEN_APPEND) {
  ------------------
  |  |   57|  1.23k|#define APR_FOPEN_APPEND     0x00008  /**< Append to the end of the file */
  ------------------
  |  Branch (121:9): [True: 0, False: 1.23k]
  ------------------
  122|      0|        oflags |= O_APPEND;
  123|      0|    }
  124|  1.23k|    if (flag & APR_FOPEN_TRUNCATE) {
  ------------------
  |  |   58|  1.23k|#define APR_FOPEN_TRUNCATE   0x00010  /**< Open the file and truncate
  ------------------
  |  Branch (124:9): [True: 0, False: 1.23k]
  ------------------
  125|      0|        oflags |= O_TRUNC;
  126|      0|    }
  127|       |#ifdef O_BINARY
  128|       |    if (flag & APR_FOPEN_BINARY) {
  129|       |        oflags |= O_BINARY;
  130|       |    }
  131|       |#endif
  132|       |
  133|  1.23k|    if (flag & APR_FOPEN_NONBLOCK) {
  ------------------
  |  |   94|  1.23k|#define APR_FOPEN_NONBLOCK    0x40000 /**< Platform dependent flag to enable
  ------------------
  |  Branch (133:9): [True: 0, False: 1.23k]
  ------------------
  134|      0|#ifdef O_NONBLOCK
  135|      0|        oflags |= O_NONBLOCK;
  136|       |#else
  137|       |        return APR_ENOTIMPL;
  138|       |#endif
  139|      0|    }
  140|       |
  141|  1.23k|#ifdef O_CLOEXEC
  142|       |    /* Introduced in Linux 2.6.23. Silently ignored on earlier Linux kernels.
  143|       |     */
  144|  1.23k|    if (!(flag & APR_FOPEN_NOCLEANUP)) {
  ------------------
  |  |   74|  1.23k|#define APR_FOPEN_NOCLEANUP  0x00800  /**< Do not register a cleanup
  ------------------
  |  Branch (144:9): [True: 1.23k, False: 0]
  ------------------
  145|  1.23k|        oflags |= O_CLOEXEC;
  146|  1.23k|}
  147|  1.23k|#endif
  148|       |
  149|       |#if APR_HAS_LARGE_FILES && defined(_LARGEFILE64_SOURCE)
  150|       |    oflags |= O_LARGEFILE;
  151|       |#elif defined(O_LARGEFILE)
  152|  1.23k|    if (flag & APR_FOPEN_LARGEFILE) {
  ------------------
  |  |   82|  1.23k|#define APR_FOPEN_LARGEFILE   0x04000 /**< Platform dependent flag to enable
  ------------------
  |  Branch (152:9): [True: 0, False: 1.23k]
  ------------------
  153|      0|        oflags |= O_LARGEFILE;
  154|      0|    }
  155|  1.23k|#endif
  156|       |
  157|  1.23k|#if APR_HAS_THREADS
  158|  1.23k|    if ((flag & APR_FOPEN_BUFFERED) && (flag & APR_FOPEN_XTHREAD)) {
  ------------------
  |  |   65|  1.23k|#define APR_FOPEN_BUFFERED   0x00080  /**< Open the file for buffered I/O */
  ------------------
                  if ((flag & APR_FOPEN_BUFFERED) && (flag & APR_FOPEN_XTHREAD)) {
  ------------------
  |  |   67|  1.23k|#define APR_FOPEN_XTHREAD    0x00200  /**< Platform dependent tag to open
  ------------------
  |  Branch (158:9): [True: 1.23k, False: 0]
  |  Branch (158:40): [True: 0, False: 1.23k]
  ------------------
  159|      0|        rv = apr_thread_mutex_create(&thlock,
  160|      0|                                     APR_THREAD_MUTEX_DEFAULT, pool);
  ------------------
  |  |   43|      0|#define APR_THREAD_MUTEX_DEFAULT  0x0   /**< platform-optimal lock behavior */
  ------------------
  161|      0|        if (rv) {
  ------------------
  |  Branch (161:13): [True: 0, False: 0]
  ------------------
  162|      0|            return rv;
  163|      0|        }
  164|      0|    }
  165|  1.23k|#endif
  166|       |
  167|  1.23k|    if (perm == APR_FPROT_OS_DEFAULT) {
  ------------------
  |  |   94|  1.23k|#define APR_FPROT_OS_DEFAULT  0x0FFF /**< use OS's default permissions */
  ------------------
  |  Branch (167:9): [True: 1.23k, False: 0]
  ------------------
  168|  1.23k|        fd = open(fname, oflags, 0666);
  169|  1.23k|    }
  170|      0|    else {
  171|      0|        fd = open(fname, oflags, apr_unix_perms2mode(perm));
  172|      0|    }
  173|  1.23k|    if (fd < 0) {
  ------------------
  |  Branch (173:9): [True: 0, False: 1.23k]
  ------------------
  174|      0|       return errno;
  175|      0|    }
  176|  1.23k|    if (!(flag & APR_FOPEN_NOCLEANUP)) {
  ------------------
  |  |   74|  1.23k|#define APR_FOPEN_NOCLEANUP  0x00800  /**< Do not register a cleanup
  ------------------
  |  Branch (176:9): [True: 1.23k, False: 0]
  ------------------
  177|  1.23k|#ifdef O_CLOEXEC
  178|  1.23k|        static int has_o_cloexec = 0;
  179|  1.23k|        if (!has_o_cloexec)
  ------------------
  |  Branch (179:13): [True: 1, False: 1.23k]
  ------------------
  180|      1|#endif
  181|      1|        {
  182|      1|            int flags;
  183|       |
  184|      1|            if ((flags = fcntl(fd, F_GETFD)) == -1) {
  ------------------
  |  Branch (184:17): [True: 0, False: 1]
  ------------------
  185|      0|                close(fd);
  186|      0|                return errno;
  187|      0|            }
  188|      1|            if ((flags & FD_CLOEXEC) == 0) {
  ------------------
  |  Branch (188:17): [True: 0, False: 1]
  ------------------
  189|      0|                flags |= FD_CLOEXEC;
  190|      0|                if (fcntl(fd, F_SETFD, flags) == -1) {
  ------------------
  |  Branch (190:21): [True: 0, False: 0]
  ------------------
  191|      0|                    close(fd);
  192|      0|                    return errno;
  193|      0|                }
  194|      0|            }
  195|      1|#ifdef O_CLOEXEC
  196|      1|            else {
  197|      1|                has_o_cloexec = 1;
  198|      1|            }
  199|      1|#endif
  200|      1|        }
  201|  1.23k|    }
  202|       |
  203|  1.23k|    (*new) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t));
  ------------------
  |  |  454|  1.23k|    apr_pcalloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.23k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.23k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  1.23k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  204|  1.23k|    (*new)->pool = pool;
  205|  1.23k|    (*new)->flags = flag;
  206|  1.23k|    (*new)->filedes = fd;
  207|       |
  208|  1.23k|    (*new)->fname = apr_pstrdup(pool, fname);
  209|       |
  210|  1.23k|    (*new)->blocking = BLK_ON;
  211|  1.23k|    (*new)->buffered = (flag & APR_FOPEN_BUFFERED) > 0;
  ------------------
  |  |   65|  1.23k|#define APR_FOPEN_BUFFERED   0x00080  /**< Open the file for buffered I/O */
  ------------------
  212|       |
  213|  1.23k|    if ((*new)->buffered) {
  ------------------
  |  Branch (213:9): [True: 1.23k, False: 0]
  ------------------
  214|  1.23k|        (*new)->buffer = apr_palloc(pool, APR_FILE_DEFAULT_BUFSIZE);
  ------------------
  |  |  425|  1.23k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.23k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.23k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  1.23k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  215|  1.23k|        (*new)->bufsize = APR_FILE_DEFAULT_BUFSIZE;
  ------------------
  |  |   82|  1.23k|#define APR_FILE_DEFAULT_BUFSIZE 4096
  ------------------
  216|  1.23k|    }
  217|      0|    else {
  218|      0|        (*new)->buffer = NULL;
  219|      0|    }
  220|       |
  221|  1.23k|#if APR_HAS_THREADS
  222|  1.23k|    (*new)->thlock = thlock;
  223|  1.23k|#endif
  224|       |
  225|  1.23k|    (*new)->is_pipe = 0;
  226|  1.23k|    (*new)->timeout = -1;
  227|  1.23k|    (*new)->ungetchar = -1;
  228|  1.23k|    (*new)->eof_hit = 0;
  229|  1.23k|    (*new)->filePtr = 0;
  230|  1.23k|    (*new)->bufpos = 0;
  231|  1.23k|    (*new)->dataRead = 0;
  232|  1.23k|    (*new)->direction = 0;
  233|       |#ifndef WAITIO_USES_POLL
  234|       |    /* Start out with no pollset.  apr_wait_for_io_or_timeout() will
  235|       |     * initialize the pollset if needed.
  236|       |     */
  237|       |    (*new)->pollset = NULL;
  238|       |#endif
  239|  1.23k|    if (!(flag & APR_FOPEN_NOCLEANUP)) {
  ------------------
  |  |   74|  1.23k|#define APR_FOPEN_NOCLEANUP  0x00800  /**< Do not register a cleanup
  ------------------
  |  Branch (239:9): [True: 1.23k, False: 0]
  ------------------
  240|  1.23k|        apr_pool_cleanup_register((*new)->pool, (void *)(*new),
  241|  1.23k|                                  apr_unix_file_cleanup,
  242|  1.23k|                                  apr_unix_child_file_cleanup);
  243|  1.23k|    }
  244|       |
  245|  1.23k|    if ((flag & APR_FOPEN_ROTATING) || (flag & APR_FOPEN_MANUAL_ROTATE)) {
  ------------------
  |  |   90|  1.23k|#define APR_FOPEN_ROTATING  0x10000 /**< Do file file rotation checking */
  ------------------
                  if ((flag & APR_FOPEN_ROTATING) || (flag & APR_FOPEN_MANUAL_ROTATE)) {
  ------------------
  |  |   92|  1.23k|#define APR_FOPEN_MANUAL_ROTATE  0x20000 /**< Enable Manual rotation */
  ------------------
  |  Branch (245:9): [True: 0, False: 1.23k]
  |  Branch (245:40): [True: 0, False: 1.23k]
  ------------------
  246|      0|        (*new)->rotating = (apr_rotating_info_t *)apr_pcalloc(pool,
  ------------------
  |  |  454|      0|    apr_pcalloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|      0|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|      0|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|      0|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  247|      0|                                                              sizeof(apr_rotating_info_t));
  248|       |
  249|      0|        rv =  apr_file_info_get(&(*new)->rotating->finfo,
  250|      0|                                APR_FINFO_DEV|APR_FINFO_INODE, *new);
  ------------------
  |  |  151|      0|#define APR_FINFO_DEV    0x00001000 /**< Device */
  ------------------
                                              APR_FINFO_DEV|APR_FINFO_INODE, *new);
  ------------------
  |  |  152|      0|#define APR_FINFO_INODE  0x00002000 /**< Inode */
  ------------------
  251|      0|        if (rv != APR_SUCCESS) {
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
  |  Branch (251:13): [True: 0, False: 0]
  ------------------
  252|      0|            return rv;
  253|      0|        }
  254|       |
  255|      0|        if (flag & APR_FOPEN_MANUAL_ROTATE) {
  ------------------
  |  |   92|      0|#define APR_FOPEN_MANUAL_ROTATE  0x20000 /**< Enable Manual rotation */
  ------------------
  |  Branch (255:13): [True: 0, False: 0]
  ------------------
  256|      0|            (*new)->rotating->manual = 1;
  257|      0|        }
  258|      0|        else {
  259|      0|            (*new)->rotating->manual = 0;
  260|      0|        }
  261|      0|        (*new)->rotating->timeout = 60;
  262|      0|        (*new)->rotating->lastcheck = apr_time_sec(apr_time_now());
  ------------------
  |  |   63|      0|#define apr_time_sec(time) ((time) / APR_USEC_PER_SEC)
  |  |  ------------------
  |  |  |  |   60|      0|#define APR_USEC_PER_SEC APR_TIME_C(1000000)
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|      0|#define APR_TIME_C(val) APR_INT64_C(val)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  394|      0| #define APR_INT64_C(val) INT64_C(val)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  263|      0|        (*new)->rotating->oflags = oflags;
  264|      0|        (*new)->rotating->perm = perm;
  265|      0|    }
  266|  1.23k|    else {
  267|  1.23k|        (*new)->rotating = NULL;
  268|  1.23k|    }
  269|       |
  270|  1.23k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.23k|#define APR_SUCCESS 0
  ------------------
  271|  1.23k|}
open.c:file_cleanup:
   25|  1.23k|{
   26|  1.23k|    apr_status_t rv = APR_SUCCESS;
  ------------------
  |  |  225|  1.23k|#define APR_SUCCESS 0
  ------------------
   27|  1.23k|    int fd = file->filedes;
   28|       |
   29|       |    /* Set file descriptor to -1 before close(), so that there is no
   30|       |     * chance of returning an already closed FD from apr_os_file_get().
   31|       |     */
   32|  1.23k|    file->filedes = -1;
   33|       |
   34|  1.23k|    if (close(fd) == 0) {
  ------------------
  |  Branch (34:9): [True: 1.23k, False: 0]
  ------------------
   35|       |        /* Only the parent process should delete the file! */
   36|  1.23k|        if (!is_child && (file->flags & APR_FOPEN_DELONCLOSE)) {
  ------------------
  |  |   66|  1.23k|#define APR_FOPEN_DELONCLOSE 0x00100  /**< Delete the file after close */
  ------------------
  |  Branch (36:13): [True: 1.23k, False: 0]
  |  Branch (36:26): [True: 0, False: 1.23k]
  ------------------
   37|      0|            unlink(file->fname);
   38|      0|        }
   39|  1.23k|#if APR_HAS_THREADS
   40|  1.23k|        if (file->thlock) {
  ------------------
  |  Branch (40:13): [True: 0, False: 1.23k]
  ------------------
   41|      0|            rv = apr_thread_mutex_destroy(file->thlock);
   42|      0|        }
   43|  1.23k|#endif
   44|  1.23k|    }
   45|      0|    else {
   46|       |        /* Restore, close() was not successful. */
   47|      0|        file->filedes = fd;
   48|       |
   49|       |        /* Are there any error conditions other than EINTR or EBADF? */
   50|      0|        rv = errno;
   51|      0|    }
   52|       |#ifndef WAITIO_USES_POLL
   53|       |    if (file->pollset != NULL) {
   54|       |        apr_status_t pollset_rv = apr_pollset_destroy(file->pollset);
   55|       |        /* If the file close failed, return its error value,
   56|       |         * not apr_pollset_destroy()'s.
   57|       |         */
   58|       |        if (rv == APR_SUCCESS) {
   59|       |            rv = pollset_rv;
   60|       |        }
   61|       |    }
   62|       |#endif /* !WAITIO_USES_POLL */
   63|  1.23k|    return rv;
   64|  1.23k|}

apr_file_read:
   88|  8.56k|{
   89|  8.56k|    apr_ssize_t rv;
   90|  8.56k|    apr_size_t bytes_read;
   91|       |
   92|  8.56k|    if (*nbytes <= 0) {
  ------------------
  |  Branch (92:9): [True: 0, False: 8.56k]
  ------------------
   93|      0|        *nbytes = 0;
   94|      0|        return APR_SUCCESS;
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
   95|      0|    }
   96|       |
   97|  8.56k|    if (thefile->buffered) {
  ------------------
  |  Branch (97:9): [True: 8.56k, False: 0]
  ------------------
   98|  8.56k|        file_lock(thefile);
  ------------------
  |  |  124|  8.56k|#define file_lock(f)   do { \
  |  |  125|  8.56k|                           if ((f)->thlock) \
  |  |  ------------------
  |  |  |  Branch (125:32): [True: 0, False: 8.56k]
  |  |  ------------------
  |  |  126|  8.56k|                               apr_thread_mutex_lock((f)->thlock); \
  |  |  127|  8.56k|                       } while (0)
  |  |  ------------------
  |  |  |  Branch (127:33): [Folded, False: 8.56k]
  |  |  ------------------
  ------------------
   99|  8.56k|        rv = file_read_buffered(thefile, buf, nbytes);
  100|  8.56k|        file_unlock(thefile);
  ------------------
  |  |  128|  8.56k|#define file_unlock(f) do { \
  |  |  129|  8.56k|                           if ((f)->thlock) \
  |  |  ------------------
  |  |  |  Branch (129:32): [True: 0, False: 8.56k]
  |  |  ------------------
  |  |  130|  8.56k|                               apr_thread_mutex_unlock((f)->thlock); \
  |  |  131|  8.56k|                       } while (0)
  |  |  ------------------
  |  |  |  Branch (131:33): [Folded, False: 8.56k]
  |  |  ------------------
  ------------------
  101|  8.56k|        return rv;
  102|  8.56k|    }
  103|      0|    else {
  104|      0|        bytes_read = 0;
  105|      0|        if (thefile->ungetchar != -1) {
  ------------------
  |  Branch (105:13): [True: 0, False: 0]
  ------------------
  106|      0|            bytes_read = 1;
  107|      0|            *(char *)buf = (char)thefile->ungetchar;
  108|      0|            buf = (char *)buf + 1;
  109|      0|            (*nbytes)--;
  110|      0|            thefile->ungetchar = -1;
  111|      0|            if (*nbytes == 0) {
  ------------------
  |  Branch (111:17): [True: 0, False: 0]
  ------------------
  112|      0|                *nbytes = bytes_read;
  113|      0|                return APR_SUCCESS;
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
  114|      0|            }
  115|      0|        }
  116|       |
  117|      0|        do {
  118|      0|            rv = read(thefile->filedes, buf, *nbytes);
  119|      0|        } while (rv == -1 && errno == EINTR);
  ------------------
  |  Branch (119:18): [True: 0, False: 0]
  |  Branch (119:30): [True: 0, False: 0]
  ------------------
  120|      0|#ifdef USE_WAIT_FOR_IO
  121|      0|        if (rv == -1 &&
  ------------------
  |  Branch (121:13): [True: 0, False: 0]
  ------------------
  122|      0|            (errno == EAGAIN || errno == EWOULDBLOCK) &&
  ------------------
  |  Branch (122:14): [True: 0, False: 0]
  |  Branch (122:33): [True: 0, False: 0]
  ------------------
  123|      0|            thefile->timeout != 0) {
  ------------------
  |  Branch (123:13): [True: 0, False: 0]
  ------------------
  124|      0|            apr_status_t arv = apr_wait_for_io_or_timeout(thefile, NULL, 1);
  125|      0|            if (arv != APR_SUCCESS) {
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
  |  Branch (125:17): [True: 0, False: 0]
  ------------------
  126|      0|                *nbytes = bytes_read;
  127|      0|                return arv;
  128|      0|            }
  129|      0|            else {
  130|      0|                do {
  131|      0|                    rv = read(thefile->filedes, buf, *nbytes);
  132|      0|                } while (rv == -1 && errno == EINTR);
  ------------------
  |  Branch (132:26): [True: 0, False: 0]
  |  Branch (132:38): [True: 0, False: 0]
  ------------------
  133|      0|            }
  134|      0|        }
  135|      0|#endif
  136|      0|        *nbytes = bytes_read;
  137|      0|        if (rv == 0) {
  ------------------
  |  Branch (137:13): [True: 0, False: 0]
  ------------------
  138|      0|            thefile->eof_hit = TRUE;
  ------------------
  |  |   55|      0|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   51|      0|#define FALSE 0
  |  |  ------------------
  ------------------
  139|      0|            return APR_EOF;
  ------------------
  |  |  467|      0|#define APR_EOF            (APR_OS_START_STATUS + 14)
  |  |  ------------------
  |  |  |  |  136|      0|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|      0|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  140|      0|        }
  141|      0|        if (rv > 0) {
  ------------------
  |  Branch (141:13): [True: 0, False: 0]
  ------------------
  142|      0|            *nbytes += rv;
  143|      0|            return APR_SUCCESS;
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
  144|      0|        }
  145|      0|        return errno;
  146|      0|    }
  147|  8.56k|}
apr_file_getc:
  391|  8.56k|{
  392|  8.56k|    apr_size_t nbytes = 1;
  393|       |
  394|  8.56k|    return apr_file_read(thefile, ch, &nbytes);
  395|  8.56k|}
apr_file_flush_locked:
  403|  2.46k|{
  404|  2.46k|    apr_status_t rv = APR_SUCCESS;
  ------------------
  |  |  225|  2.46k|#define APR_SUCCESS 0
  ------------------
  405|       |
  406|  2.46k|    if (thefile->direction == 1 && thefile->bufpos) {
  ------------------
  |  Branch (406:9): [True: 0, False: 2.46k]
  |  Branch (406:36): [True: 0, False: 0]
  ------------------
  407|      0|        apr_ssize_t written = 0, ret;
  408|       |
  409|      0|        do {
  410|      0|            ret = write(thefile->filedes, thefile->buffer + written,
  411|      0|                        thefile->bufpos - written);
  412|      0|            if (ret > 0)
  ------------------
  |  Branch (412:17): [True: 0, False: 0]
  ------------------
  413|      0|                written += ret;
  414|      0|        } while (written < thefile->bufpos &&
  ------------------
  |  Branch (414:18): [True: 0, False: 0]
  ------------------
  415|      0|                 (ret > 0 || (ret == -1 && errno == EINTR)));
  ------------------
  |  Branch (415:19): [True: 0, False: 0]
  |  Branch (415:31): [True: 0, False: 0]
  |  Branch (415:44): [True: 0, False: 0]
  ------------------
  416|      0|        if (ret == -1) {
  ------------------
  |  Branch (416:13): [True: 0, False: 0]
  ------------------
  417|      0|            rv = errno;
  418|      0|        } else {
  419|      0|            thefile->filePtr += written;
  420|      0|            thefile->bufpos = 0;
  421|      0|        }
  422|      0|    }
  423|       |
  424|  2.46k|    return rv;
  425|  2.46k|}
apr_file_flush:
  428|  2.46k|{
  429|  2.46k|    apr_status_t rv = APR_SUCCESS;
  ------------------
  |  |  225|  2.46k|#define APR_SUCCESS 0
  ------------------
  430|       |
  431|  2.46k|    if (thefile->buffered) {
  ------------------
  |  Branch (431:9): [True: 2.46k, False: 0]
  ------------------
  432|  2.46k|        file_lock(thefile);
  ------------------
  |  |  124|  2.46k|#define file_lock(f)   do { \
  |  |  125|  2.46k|                           if ((f)->thlock) \
  |  |  ------------------
  |  |  |  Branch (125:32): [True: 0, False: 2.46k]
  |  |  ------------------
  |  |  126|  2.46k|                               apr_thread_mutex_lock((f)->thlock); \
  |  |  127|  2.46k|                       } while (0)
  |  |  ------------------
  |  |  |  Branch (127:33): [Folded, False: 2.46k]
  |  |  ------------------
  ------------------
  433|  2.46k|        rv = apr_file_flush_locked(thefile);
  434|  2.46k|        file_unlock(thefile);
  ------------------
  |  |  128|  2.46k|#define file_unlock(f) do { \
  |  |  129|  2.46k|                           if ((f)->thlock) \
  |  |  ------------------
  |  |  |  Branch (129:32): [True: 0, False: 2.46k]
  |  |  ------------------
  |  |  130|  2.46k|                               apr_thread_mutex_unlock((f)->thlock); \
  |  |  131|  2.46k|                       } while (0)
  |  |  ------------------
  |  |  |  Branch (131:33): [Folded, False: 2.46k]
  |  |  ------------------
  ------------------
  435|  2.46k|    }
  436|       |    /* There isn't anything to do if we aren't buffering the output
  437|       |     * so just return success.
  438|       |     */
  439|  2.46k|    return rv;
  440|  2.46k|}
apr_file_gets:
  503|   754k|{
  504|   754k|    apr_status_t rv = APR_SUCCESS; /* get rid of gcc warning */
  ------------------
  |  |  225|   754k|#define APR_SUCCESS 0
  ------------------
  505|   754k|    apr_size_t nbytes;
  506|   754k|    const char *str_start = str;
  507|   754k|    char *final = str + len - 1;
  508|       |
  509|   754k|    if (len <= 1) {
  ------------------
  |  Branch (509:9): [True: 0, False: 754k]
  ------------------
  510|       |        /* sort of like fgets(), which returns NULL and stores no bytes
  511|       |         */
  512|      0|        return APR_SUCCESS;
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
  513|      0|    }
  514|       |
  515|       |    /* If we have an underlying buffer, we can be *much* more efficient
  516|       |     * and skip over the apr_file_read calls.
  517|       |     */
  518|   754k|    if (thefile->buffered) {
  ------------------
  |  Branch (518:9): [True: 754k, False: 0]
  ------------------
  519|   754k|        file_lock(thefile);
  ------------------
  |  |  124|   754k|#define file_lock(f)   do { \
  |  |  125|   754k|                           if ((f)->thlock) \
  |  |  ------------------
  |  |  |  Branch (125:32): [True: 0, False: 754k]
  |  |  ------------------
  |  |  126|   754k|                               apr_thread_mutex_lock((f)->thlock); \
  |  |  127|   754k|                       } while (0)
  |  |  ------------------
  |  |  |  Branch (127:33): [Folded, False: 754k]
  |  |  ------------------
  ------------------
  520|       |
  521|   754k|        if (thefile->direction == 1) {
  ------------------
  |  Branch (521:13): [True: 0, False: 754k]
  ------------------
  522|      0|            rv = apr_file_flush_locked(thefile);
  523|      0|            if (rv) {
  ------------------
  |  Branch (523:17): [True: 0, False: 0]
  ------------------
  524|      0|                file_unlock(thefile);
  ------------------
  |  |  128|      0|#define file_unlock(f) do { \
  |  |  129|      0|                           if ((f)->thlock) \
  |  |  ------------------
  |  |  |  Branch (129:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  130|      0|                               apr_thread_mutex_unlock((f)->thlock); \
  |  |  131|      0|                       } while (0)
  |  |  ------------------
  |  |  |  Branch (131:33): [Folded, False: 0]
  |  |  ------------------
  ------------------
  525|      0|                return rv;
  526|      0|            }
  527|       |
  528|      0|            thefile->direction = 0;
  529|      0|            thefile->bufpos = 0;
  530|      0|            thefile->dataRead = 0;
  531|      0|        }
  532|       |
  533|  1.59M|        while (str < final) { /* leave room for trailing '\0' */
  ------------------
  |  Branch (533:16): [True: 1.59M, False: 718]
  ------------------
  534|       |            /* Force ungetc leftover to call apr_file_read. */
  535|  1.59M|            if (thefile->bufpos < thefile->dataRead &&
  ------------------
  |  Branch (535:17): [True: 1.59M, False: 1.50k]
  ------------------
  536|  1.59M|                thefile->ungetchar == -1) {
  ------------------
  |  Branch (536:17): [True: 1.59M, False: 0]
  ------------------
  537|  1.59M|                *str = thefile->buffer[thefile->bufpos++];
  538|  1.59M|            }
  539|  1.50k|            else {
  540|  1.50k|                nbytes = 1;
  541|  1.50k|                rv = file_read_buffered(thefile, str, &nbytes);
  542|  1.50k|                if (rv != APR_SUCCESS) {
  ------------------
  |  |  225|  1.50k|#define APR_SUCCESS 0
  ------------------
  |  Branch (542:21): [True: 26, False: 1.48k]
  ------------------
  543|     26|                    break;
  544|     26|                }
  545|  1.50k|            }
  546|  1.59M|            if (*str == '\n') {
  ------------------
  |  Branch (546:17): [True: 753k, False: 839k]
  ------------------
  547|   753k|                ++str;
  548|   753k|                break;
  549|   753k|            }
  550|   839k|            ++str;
  551|   839k|        }
  552|   754k|        file_unlock(thefile);
  ------------------
  |  |  128|   754k|#define file_unlock(f) do { \
  |  |  129|   754k|                           if ((f)->thlock) \
  |  |  ------------------
  |  |  |  Branch (129:32): [True: 0, False: 754k]
  |  |  ------------------
  |  |  130|   754k|                               apr_thread_mutex_unlock((f)->thlock); \
  |  |  131|   754k|                       } while (0)
  |  |  ------------------
  |  |  |  Branch (131:33): [Folded, False: 754k]
  |  |  ------------------
  ------------------
  553|   754k|    }
  554|      0|    else {
  555|      0|        while (str < final) { /* leave room for trailing '\0' */
  ------------------
  |  Branch (555:16): [True: 0, False: 0]
  ------------------
  556|      0|            nbytes = 1;
  557|      0|            rv = apr_file_read(thefile, str, &nbytes);
  558|      0|            if (rv != APR_SUCCESS) {
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
  |  Branch (558:17): [True: 0, False: 0]
  ------------------
  559|      0|                break;
  560|      0|            }
  561|      0|            if (*str == '\n') {
  ------------------
  |  Branch (561:17): [True: 0, False: 0]
  ------------------
  562|      0|                ++str;
  563|      0|                break;
  564|      0|            }
  565|      0|            ++str;
  566|      0|        }
  567|      0|    }
  568|       |
  569|       |    /* We must store a terminating '\0' if we've stored any chars. We can
  570|       |     * get away with storing it if we hit an error first.
  571|       |     */
  572|   754k|    *str = '\0';
  573|   754k|    if (str > str_start) {
  ------------------
  |  Branch (573:9): [True: 754k, False: 12]
  ------------------
  574|       |        /* we stored chars; don't report EOF or any other errors;
  575|       |         * the app will find out about that on the next call
  576|       |         */
  577|   754k|        return APR_SUCCESS;
  ------------------
  |  |  225|   754k|#define APR_SUCCESS 0
  ------------------
  578|   754k|    }
  579|     12|    return rv;
  580|   754k|}
readwrite.c:file_read_buffered:
   32|  10.0k|{
   33|  10.0k|    apr_ssize_t rv;
   34|  10.0k|    char *pos = (char *)buf;
   35|  10.0k|    apr_uint64_t blocksize;
   36|  10.0k|    apr_uint64_t size = *nbytes;
   37|       |
   38|  10.0k|    if (thefile->direction == 1) {
  ------------------
  |  Branch (38:9): [True: 0, False: 10.0k]
  ------------------
   39|      0|        rv = apr_file_flush_locked(thefile);
   40|      0|        if (rv) {
  ------------------
  |  Branch (40:13): [True: 0, False: 0]
  ------------------
   41|      0|            return rv;
   42|      0|        }
   43|      0|        thefile->bufpos = 0;
   44|      0|        thefile->direction = 0;
   45|      0|        thefile->dataRead = 0;
   46|      0|    }
   47|       |
   48|  10.0k|    rv = 0;
   49|  10.0k|    if (thefile->ungetchar != -1) {
  ------------------
  |  Branch (49:9): [True: 0, False: 10.0k]
  ------------------
   50|      0|        *pos = (char)thefile->ungetchar;
   51|      0|        ++pos;
   52|      0|        --size;
   53|      0|        thefile->ungetchar = -1;
   54|      0|    }
   55|  20.1k|    while (rv == 0 && size > 0) {
  ------------------
  |  Branch (55:12): [True: 20.1k, False: 0]
  |  Branch (55:23): [True: 10.0k, False: 10.0k]
  ------------------
   56|  10.0k|        if (thefile->bufpos >= thefile->dataRead) {
  ------------------
  |  Branch (56:13): [True: 1.62k, False: 8.45k]
  ------------------
   57|  1.62k|            int bytesread = read(thefile->filedes, thefile->buffer,
   58|  1.62k|                                 thefile->bufsize);
   59|  1.62k|            if (bytesread == 0) {
  ------------------
  |  Branch (59:17): [True: 32, False: 1.59k]
  ------------------
   60|     32|                thefile->eof_hit = TRUE;
  ------------------
  |  |   55|     32|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   51|     32|#define FALSE 0
  |  |  ------------------
  ------------------
   61|     32|                rv = APR_EOF;
  ------------------
  |  |  467|     32|#define APR_EOF            (APR_OS_START_STATUS + 14)
  |  |  ------------------
  |  |  |  |  136|     32|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|     32|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|     32|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   62|     32|                break;
   63|     32|            }
   64|  1.59k|            else if (bytesread == -1) {
  ------------------
  |  Branch (64:22): [True: 0, False: 1.59k]
  ------------------
   65|      0|                rv = errno;
   66|      0|                break;
   67|      0|            }
   68|  1.59k|            thefile->dataRead = bytesread;
   69|  1.59k|            thefile->filePtr += thefile->dataRead;
   70|  1.59k|            thefile->bufpos = 0;
   71|  1.59k|        }
   72|       |
   73|  10.0k|        blocksize = size > thefile->dataRead - thefile->bufpos ? thefile->dataRead - thefile->bufpos : size;
  ------------------
  |  Branch (73:21): [True: 0, False: 10.0k]
  ------------------
   74|  10.0k|        memcpy(pos, thefile->buffer + thefile->bufpos, blocksize);
   75|  10.0k|        thefile->bufpos += blocksize;
   76|  10.0k|        pos += blocksize;
   77|  10.0k|        size -= blocksize;
   78|  10.0k|    }
   79|       |
   80|  10.0k|    *nbytes = pos - (char *)buf;
   81|  10.0k|    if (*nbytes) {
  ------------------
  |  Branch (81:9): [True: 10.0k, False: 32]
  ------------------
   82|  10.0k|        rv = 0;
   83|  10.0k|    }
   84|  10.0k|    return rv;
   85|  10.0k|}

apr_thread_mutex_create:
   40|  1.23k|{
   41|  1.23k|    apr_thread_mutex_t *new_mutex;
   42|  1.23k|    apr_status_t rv;
   43|       |
   44|       |#ifndef HAVE_PTHREAD_MUTEX_RECURSIVE
   45|       |    if (flags & APR_THREAD_MUTEX_NESTED) {
   46|       |        return APR_ENOTIMPL;
   47|       |    }
   48|       |#endif
   49|       |
   50|  1.23k|    new_mutex = apr_pcalloc(pool, sizeof(apr_thread_mutex_t));
  ------------------
  |  |  454|  1.23k|    apr_pcalloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.23k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.23k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  1.23k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   51|  1.23k|    new_mutex->pool = pool;
   52|       |
   53|  1.23k|#ifdef HAVE_PTHREAD_MUTEX_RECURSIVE
   54|  1.23k|    if (flags & APR_THREAD_MUTEX_NESTED) {
  ------------------
  |  |   44|  1.23k|#define APR_THREAD_MUTEX_NESTED   0x1   /**< enable nested (recursive) locks */
  ------------------
  |  Branch (54:9): [True: 1.23k, False: 0]
  ------------------
   55|  1.23k|        pthread_mutexattr_t mattr;
   56|       |
   57|  1.23k|        rv = pthread_mutexattr_init(&mattr);
   58|  1.23k|        if (rv) return rv;
  ------------------
  |  Branch (58:13): [True: 0, False: 1.23k]
  ------------------
   59|       |
   60|  1.23k|        rv = pthread_mutexattr_settype(&mattr, PTHREAD_MUTEX_RECURSIVE);
   61|  1.23k|        if (rv) {
  ------------------
  |  Branch (61:13): [True: 0, False: 1.23k]
  ------------------
   62|      0|            pthread_mutexattr_destroy(&mattr);
   63|      0|            return rv;
   64|      0|        }
   65|       |
   66|  1.23k|        rv = pthread_mutex_init(&new_mutex->mutex, &mattr);
   67|       |
   68|  1.23k|        pthread_mutexattr_destroy(&mattr);
   69|  1.23k|    } else
   70|      0|#endif
   71|      0|    {
   72|       |#if defined(APR_THREAD_DEBUG)
   73|       |        pthread_mutexattr_t mattr;
   74|       |
   75|       |        rv = pthread_mutexattr_init(&mattr);
   76|       |        if (rv) return rv;
   77|       |
   78|       |        rv = pthread_mutexattr_settype(&mattr, PTHREAD_MUTEX_ERRORCHECK);
   79|       |        if (rv) {
   80|       |            pthread_mutexattr_destroy(&mattr);
   81|       |            return rv;
   82|       |        }
   83|       |
   84|       |        rv = pthread_mutex_init(&new_mutex->mutex, &mattr);
   85|       |
   86|       |        pthread_mutexattr_destroy(&mattr);
   87|       |#else
   88|      0|        rv = pthread_mutex_init(&new_mutex->mutex, NULL);
   89|      0|#endif
   90|      0|    }
   91|       |
   92|  1.23k|    if (rv) {
  ------------------
  |  Branch (92:9): [True: 0, False: 1.23k]
  ------------------
   93|       |#ifdef HAVE_ZOS_PTHREADS
   94|       |        rv = errno;
   95|       |#endif
   96|      0|        return rv;
   97|      0|    }
   98|       |
   99|       |#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK
  100|       |    if (flags & APR_THREAD_MUTEX_TIMED) {
  101|       |        rv = apr_thread_cond_create(&new_mutex->cond, pool);
  102|       |        if (rv) {
  103|       |#ifdef HAVE_ZOS_PTHREADS
  104|       |            rv = errno;
  105|       |#endif
  106|       |            pthread_mutex_destroy(&new_mutex->mutex);
  107|       |            return rv;
  108|       |        }
  109|       |    }
  110|       |#endif
  111|       |
  112|  1.23k|    apr_pool_cleanup_register(new_mutex->pool,
  113|  1.23k|                              new_mutex, thread_mutex_cleanup,
  114|  1.23k|                              apr_pool_cleanup_null);
  115|       |
  116|  1.23k|    *mutex = new_mutex;
  117|  1.23k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.23k|#define APR_SUCCESS 0
  ------------------
  118|  1.23k|}
apr_thread_mutex_lock:
  121|  1.23k|{
  122|  1.23k|    apr_status_t rv;
  123|       |
  124|       |#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK
  125|       |    if (mutex->cond) {
  126|       |        apr_status_t rv2;
  127|       |
  128|       |        rv = pthread_mutex_lock(&mutex->mutex);
  129|       |        if (rv) {
  130|       |#ifdef HAVE_ZOS_PTHREADS
  131|       |            rv = errno;
  132|       |#endif
  133|       |            return rv;
  134|       |        }
  135|       |
  136|       |        if (mutex->locked) {
  137|       |            mutex->num_waiters++;
  138|       |            rv = apr_thread_cond_wait(mutex->cond, mutex);
  139|       |            mutex->num_waiters--;
  140|       |        }
  141|       |        else {
  142|       |            mutex->locked = 1;
  143|       |        }
  144|       |
  145|       |        rv2 = pthread_mutex_unlock(&mutex->mutex);
  146|       |        if (rv2 && !rv) {
  147|       |#ifdef HAVE_ZOS_PTHREADS
  148|       |            rv = errno;
  149|       |#else
  150|       |            rv = rv2;
  151|       |#endif
  152|       |        }
  153|       |
  154|       |        return rv;
  155|       |    }
  156|       |#endif
  157|       |
  158|  1.23k|    rv = pthread_mutex_lock(&mutex->mutex);
  159|       |#ifdef HAVE_ZOS_PTHREADS
  160|       |    if (rv) {
  161|       |        rv = errno;
  162|       |    }
  163|       |#endif
  164|       |
  165|  1.23k|    return rv;
  166|  1.23k|}
apr_thread_mutex_unlock:
  302|  1.23k|{
  303|  1.23k|    apr_status_t status;
  304|       |
  305|       |#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK
  306|       |    if (mutex->cond) {
  307|       |        status = pthread_mutex_lock(&mutex->mutex);
  308|       |        if (status) {
  309|       |#ifdef HAVE_ZOS_PTHREADS
  310|       |            status = errno;
  311|       |#endif
  312|       |            return status;
  313|       |        }
  314|       |
  315|       |        if (!mutex->locked) {
  316|       |            status = APR_EINVAL;
  317|       |        }
  318|       |        else if (mutex->num_waiters) {
  319|       |            status = apr_thread_cond_signal(mutex->cond);
  320|       |        }
  321|       |        if (status) {
  322|       |            pthread_mutex_unlock(&mutex->mutex);
  323|       |            return status;
  324|       |        }
  325|       |
  326|       |        mutex->locked = 0;
  327|       |    }
  328|       |#endif
  329|       |
  330|  1.23k|    status = pthread_mutex_unlock(&mutex->mutex);
  331|       |#ifdef HAVE_ZOS_PTHREADS
  332|       |    if (status) {
  333|       |        status = errno;
  334|       |    }
  335|       |#endif
  336|       |
  337|  1.23k|    return status;
  338|  1.23k|}
thread_mutex.c:thread_mutex_cleanup:
   24|  1.23k|{
   25|  1.23k|    apr_thread_mutex_t *mutex = data;
   26|  1.23k|    apr_status_t rv;
   27|       |
   28|  1.23k|    rv = pthread_mutex_destroy(&mutex->mutex);
   29|       |#ifdef HAVE_ZOS_PTHREADS
   30|       |    if (rv) {
   31|       |        rv = errno;
   32|       |    }
   33|       |#endif
   34|  1.23k|    return rv;
   35|  1.23k|}

apr_pool_initialize:
 1662|  1.23k|{
 1663|  1.23k|    apr_status_t rv;
 1664|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL)
 1665|       |    char *logpath;
 1666|       |    apr_file_t *debug_log = NULL;
 1667|       |#endif
 1668|       |
 1669|  1.23k|    if (apr_pools_initialized++)
  ------------------
  |  Branch (1669:9): [True: 0, False: 1.23k]
  ------------------
 1670|      0|        return APR_SUCCESS;
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
 1671|       |
 1672|  1.23k|#if defined(_SC_PAGESIZE)
 1673|  1.23k|    boundary_size = sysconf(_SC_PAGESIZE);
 1674|       |#elif defined(WIN32)
 1675|       |    {
 1676|       |        SYSTEM_INFO si;
 1677|       |        GetSystemInfo(&si);
 1678|       |        boundary_size = si.dwPageSize;
 1679|       |    }
 1680|       |#endif
 1681|  1.23k|    boundary_index = 12;
 1682|  1.23k|    while ( (1 << boundary_index) < boundary_size)
  ------------------
  |  Branch (1682:13): [True: 0, False: 1.23k]
  ------------------
 1683|      0|        boundary_index++;
 1684|  1.23k|    boundary_size = (1 << boundary_index);
 1685|       |
 1686|       |    /* Since the debug code works a bit differently then the
 1687|       |     * regular pools code, we ask for a lock here.  The regular
 1688|       |     * pools code has got this lock embedded in the global
 1689|       |     * allocator, a concept unknown to debug mode.
 1690|       |     */
 1691|  1.23k|    if ((rv = apr_pool_create_ex(&global_pool, NULL, NULL,
  ------------------
  |  |  247|  1.23k|    apr_pool_create_ex_debug(newpool, parent, abort_fn, allocator, \
  |  |  248|  1.23k|                             APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.23k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.23k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  1.23k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1691:9): [True: 0, False: 1.23k]
  ------------------
 1692|  1.23k|                                 NULL)) != APR_SUCCESS) {
  ------------------
  |  |  225|  1.23k|#define APR_SUCCESS 0
  ------------------
 1693|      0|        return rv;
 1694|      0|    }
 1695|       |
 1696|  1.23k|    apr_pool_tag(global_pool, "APR global pool");
 1697|       |
 1698|  1.23k|    apr_pools_initialized = 1;
 1699|       |
 1700|       |    /* This has to happen here because mutexes might be backed by
 1701|       |     * atomics.  It used to be snug and safe in apr_initialize().
 1702|       |     */
 1703|  1.23k|    if ((rv = apr_atomic_init(global_pool)) != APR_SUCCESS) {
  ------------------
  |  |  225|  1.23k|#define APR_SUCCESS 0
  ------------------
  |  Branch (1703:9): [True: 0, False: 1.23k]
  ------------------
 1704|      0|        return rv;
 1705|      0|    }
 1706|       |
 1707|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL)
 1708|       |    rv = apr_env_get(&logpath, "APR_POOL_DEBUG_LOG", global_pool);
 1709|       |
 1710|       |    /* Don't pass file_stderr directly to apr_file_open() here, since
 1711|       |     * apr_file_open() can call back to apr_pool_log_event() and that
 1712|       |     * may attempt to use then then non-NULL but partially set up file
 1713|       |     * object. */
 1714|       |    if (rv == APR_SUCCESS) {
 1715|       |        apr_file_open(&debug_log, logpath,
 1716|       |                      APR_FOPEN_APPEND|APR_FOPEN_WRITE|APR_FOPEN_CREATE,
 1717|       |                      APR_FPROT_OS_DEFAULT, global_pool);
 1718|       |    }
 1719|       |    else {
 1720|       |        apr_file_open_stderr(&debug_log, global_pool);
 1721|       |    }
 1722|       |
 1723|       |    /* debug_log is now a file handle. */
 1724|       |    file_stderr = debug_log;
 1725|       |
 1726|       |    if (file_stderr) {
 1727|       |        apr_file_printf(file_stderr,
 1728|       |            "POOL DEBUG: [PID"
 1729|       |#if APR_HAS_THREADS
 1730|       |            "/TID"
 1731|       |#endif /* APR_HAS_THREADS */
 1732|       |            "] ACTION  (SIZE      /POOL SIZE /TOTAL SIZE) "
 1733|       |            "POOL       \"TAG\" <__FILE__:__LINE__> PARENT     (ALLOCS/TOTAL ALLOCS/CLEARS)\n");
 1734|       |
 1735|       |        apr_pool_log_event(global_pool, "GLOBAL", __FILE__ ":apr_pool_initialize", 0);
 1736|       |
 1737|       |        /* Add a cleanup handler that sets the debug log file handle
 1738|       |         * to NULL, otherwise we'll try to log the global pool
 1739|       |         * destruction event with predictably disastrous results. */
 1740|       |        apr_pool_cleanup_register(global_pool, NULL,
 1741|       |                                  apr_pool_cleanup_file_stderr,
 1742|       |                                  apr_pool_cleanup_null);
 1743|       |    }
 1744|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */
 1745|       |
 1746|  1.23k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.23k|#define APR_SUCCESS 0
  ------------------
 1747|  1.23k|}
apr_pool_terminate:
 1750|  1.23k|{
 1751|  1.23k|    if (!apr_pools_initialized)
  ------------------
  |  Branch (1751:9): [True: 0, False: 1.23k]
  ------------------
 1752|      0|        return;
 1753|       |
 1754|  1.23k|    if (--apr_pools_initialized)
  ------------------
  |  Branch (1754:9): [True: 0, False: 1.23k]
  ------------------
 1755|      0|        return;
 1756|       |
 1757|  1.23k|    apr_pool_destroy(global_pool); /* This will also destroy the mutex */
  ------------------
  |  |  388|  1.23k|    apr_pool_destroy_debug(p, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.23k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.23k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  1.23k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1758|  1.23k|    global_pool = NULL;
 1759|       |
 1760|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL)
 1761|       |    file_stderr = NULL;
 1762|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */
 1763|  1.23k|}
apr_palloc_debug:
 1811|  26.2k|{
 1812|  26.2k|    void *mem;
 1813|       |
 1814|  26.2k|    apr_pool_check_integrity(pool);
 1815|       |
 1816|  26.2k|    mem = pool_alloc(pool, size);
 1817|       |
 1818|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALLOC)
 1819|       |    apr_pool_log_event(pool, "PALLOC", file_line, 1);
 1820|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALLOC) */
 1821|       |
 1822|  26.2k|    return mem;
 1823|  26.2k|}
apr_pcalloc_debug:
 1827|  2.73k|{
 1828|  2.73k|    void *mem;
 1829|       |
 1830|  2.73k|    apr_pool_check_integrity(pool);
 1831|       |
 1832|  2.73k|    mem = pool_alloc(pool, size);
 1833|  2.73k|    memset(mem, 0, size);
 1834|       |
 1835|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALLOC)
 1836|       |    apr_pool_log_event(pool, "PCALLOC", file_line, 1);
 1837|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALLOC) */
 1838|       |
 1839|  2.73k|    return mem;
 1840|  2.73k|}
apr_pool_destroy_debug:
 1973|  1.23k|{
 1974|  1.23k|#if APR_HAS_THREADS
 1975|  1.23k|    apr_thread_mutex_t *mutex;
 1976|  1.23k|#endif
 1977|       |
 1978|  1.23k|    apr_pool_check_lifetime(pool);
 1979|       |
 1980|  1.23k|    if (pool->joined) {
  ------------------
  |  Branch (1980:9): [True: 0, False: 1.23k]
  ------------------
 1981|       |        /* Joined pools must not be explicitly destroyed; the caller
 1982|       |         * has broken the guarantee. */
 1983|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL)
 1984|       |        apr_pool_log_event(pool, "LIFE",
 1985|       |                           __FILE__ ":apr_pool_destroy abort on joined", 0);
 1986|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */
 1987|       |
 1988|      0|        abort();
 1989|      0|    }
 1990|       |
 1991|  1.23k|#if APR_HAS_THREADS
 1992|       |    /* Lock the parent mutex before destroying so that it's not accessed
 1993|       |     * concurrently by apr_pool_walk_tree.
 1994|       |     */
 1995|  1.23k|    mutex = parent_lock(pool);
 1996|  1.23k|#endif
 1997|       |
 1998|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE)
 1999|       |    apr_pool_log_event(pool, "DESTROY", file_line, 1);
 2000|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) */
 2001|       |
 2002|  1.23k|    pool_destroy_debug(pool, file_line);
 2003|       |
 2004|  1.23k|#if APR_HAS_THREADS
 2005|       |    /* Unlock the mutex we obtained above */
 2006|  1.23k|    parent_unlock(mutex);
 2007|  1.23k|#endif /* APR_HAS_THREADS */
 2008|  1.23k|}
apr_pool_create_ex_debug:
 2015|  2.46k|{
 2016|  2.46k|    apr_pool_t *pool;
 2017|       |
 2018|  2.46k|    *newpool = NULL;
 2019|       |
 2020|  2.46k|    if (!parent) {
  ------------------
  |  Branch (2020:9): [True: 2.46k, False: 0]
  ------------------
 2021|  2.46k|        parent = global_pool;
 2022|  2.46k|    }
 2023|      0|    else {
 2024|      0|       apr_pool_check_lifetime(parent);
 2025|       |
 2026|      0|       if (!allocator)
  ------------------
  |  Branch (2026:12): [True: 0, False: 0]
  ------------------
 2027|      0|           allocator = parent->allocator;
 2028|      0|    }
 2029|       |
 2030|  2.46k|    if (!abort_fn && parent)
  ------------------
  |  Branch (2030:9): [True: 2.46k, False: 0]
  |  Branch (2030:22): [True: 1.23k, False: 1.23k]
  ------------------
 2031|  1.23k|        abort_fn = parent->abort_fn;
 2032|       |
 2033|  2.46k|    if ((pool = malloc(SIZEOF_POOL_T)) == NULL) {
  ------------------
  |  |  615|  2.46k|#define SIZEOF_POOL_T       APR_ALIGN_DEFAULT(sizeof(apr_pool_t))
  |  |  ------------------
  |  |  |  |  150|  2.46k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  2.46k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2033:9): [True: 0, False: 2.46k]
  ------------------
 2034|      0|        if (abort_fn)
  ------------------
  |  Branch (2034:13): [True: 0, False: 0]
  ------------------
 2035|      0|            abort_fn(APR_ENOMEM);
  ------------------
  |  |  687|      0|#define APR_ENOMEM ENOMEM
  ------------------
 2036|       |
 2037|      0|         return APR_ENOMEM;
  ------------------
  |  |  687|      0|#define APR_ENOMEM ENOMEM
  ------------------
 2038|      0|    }
 2039|       |
 2040|  2.46k|    memset(pool, 0, SIZEOF_POOL_T);
  ------------------
  |  |  615|  2.46k|#define SIZEOF_POOL_T       APR_ALIGN_DEFAULT(sizeof(apr_pool_t))
  |  |  ------------------
  |  |  |  |  150|  2.46k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  2.46k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2041|       |
 2042|  2.46k|    pool->allocator = allocator;
 2043|  2.46k|    pool->abort_fn = abort_fn;
 2044|  2.46k|    pool->tag = file_line;
 2045|  2.46k|    pool->file_line = file_line;
 2046|       |
 2047|  2.46k|#if APR_HAS_THREADS
 2048|  2.46k|    pool->owner = apr_os_thread_current();
 2049|  2.46k|#endif /* APR_HAS_THREADS */
 2050|       |
 2051|  2.46k|#if APR_HAS_THREADS
 2052|  2.46k|    if (parent == NULL || parent->allocator != allocator) {
  ------------------
  |  Branch (2052:9): [True: 1.23k, False: 1.23k]
  |  Branch (2052:27): [True: 0, False: 1.23k]
  ------------------
 2053|  1.23k|        apr_status_t rv;
 2054|       |
 2055|       |        /* No matter what the creation flags say, always create
 2056|       |         * a lock.  Without it integrity_check and apr_pool_num_bytes
 2057|       |         * blow up (because they traverse pools child lists that
 2058|       |         * possibly belong to another thread, in combination with
 2059|       |         * the pool having no lock).  However, this might actually
 2060|       |         * hide problems like creating a child pool of a pool
 2061|       |         * belonging to another thread.
 2062|       |         */
 2063|  1.23k|        if ((rv = apr_thread_mutex_create(&pool->mutex,
  ------------------
  |  Branch (2063:13): [True: 0, False: 1.23k]
  ------------------
 2064|  1.23k|                APR_THREAD_MUTEX_NESTED, pool)) != APR_SUCCESS) {
  ------------------
  |  |   44|  1.23k|#define APR_THREAD_MUTEX_NESTED   0x1   /**< enable nested (recursive) locks */
  ------------------
                              APR_THREAD_MUTEX_NESTED, pool)) != APR_SUCCESS) {
  ------------------
  |  |  225|  1.23k|#define APR_SUCCESS 0
  ------------------
 2065|      0|            if (abort_fn)
  ------------------
  |  Branch (2065:17): [True: 0, False: 0]
  ------------------
 2066|      0|                abort_fn(rv);
 2067|      0|            free(pool);
 2068|      0|            return rv;
 2069|      0|        }
 2070|  1.23k|    }
 2071|  1.23k|    else {
 2072|  1.23k|        pool->mutex = parent->mutex;
 2073|  1.23k|    }
 2074|  2.46k|#endif /* APR_HAS_THREADS */
 2075|       |
 2076|  2.46k|    if ((pool->parent = parent) != NULL) {
  ------------------
  |  Branch (2076:9): [True: 1.23k, False: 1.23k]
  ------------------
 2077|  1.23k|        pool_lock(parent);
 2078|       |
 2079|  1.23k|        if ((pool->sibling = parent->child) != NULL)
  ------------------
  |  Branch (2079:13): [True: 0, False: 1.23k]
  ------------------
 2080|      0|            pool->sibling->ref = &pool->sibling;
 2081|       |
 2082|  1.23k|        parent->child = pool;
 2083|  1.23k|        pool->ref = &parent->child;
 2084|       |
 2085|  1.23k|        pool_unlock(parent);
 2086|  1.23k|    }
 2087|  1.23k|    else {
 2088|  1.23k|        pool->sibling = NULL;
 2089|  1.23k|        pool->ref = NULL;
 2090|  1.23k|    }
 2091|       |
 2092|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE)
 2093|       |    apr_pool_log_event(pool, "CREATE", file_line, 1);
 2094|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) */
 2095|       |
 2096|  2.46k|    *newpool = pool;
 2097|       |
 2098|  2.46k|    return APR_SUCCESS;
  ------------------
  |  |  225|  2.46k|#define APR_SUCCESS 0
  ------------------
 2099|  2.46k|}
apr_pvsprintf:
 2201|    991|{
 2202|    991|    struct psprintf_data ps;
 2203|    991|    debug_node_t *node;
 2204|       |
 2205|    991|    apr_pool_check_integrity(pool);
 2206|       |
 2207|    991|    ps.size = 64;
 2208|    991|    ps.mem = malloc(ps.size);
 2209|    991|    ps.vbuff.curpos  = ps.mem;
 2210|       |
 2211|       |    /* Save a byte for the NUL terminator */
 2212|    991|    ps.vbuff.endpos = ps.mem + ps.size - 1;
 2213|       |
 2214|    991|    if (apr_vformatter(psprintf_flush, &ps.vbuff, fmt, ap) == -1) {
  ------------------
  |  Branch (2214:9): [True: 0, False: 991]
  ------------------
 2215|      0|        if (pool->abort_fn)
  ------------------
  |  Branch (2215:13): [True: 0, False: 0]
  ------------------
 2216|      0|            pool->abort_fn(APR_ENOMEM);
  ------------------
  |  |  687|      0|#define APR_ENOMEM ENOMEM
  ------------------
 2217|       |
 2218|      0|        return NULL;
 2219|      0|    }
 2220|       |
 2221|    991|    *ps.vbuff.curpos++ = '\0';
 2222|       |
 2223|       |    /*
 2224|       |     * Link the node in
 2225|       |     */
 2226|    991|    node = pool->nodes;
 2227|    991|    if (node == NULL || node->index == 64) {
  ------------------
  |  Branch (2227:9): [True: 0, False: 991]
  |  Branch (2227:25): [True: 0, False: 991]
  ------------------
 2228|      0|        if ((node = malloc(SIZEOF_DEBUG_NODE_T)) == NULL) {
  ------------------
  |  |  562|      0|#define SIZEOF_DEBUG_NODE_T APR_ALIGN_DEFAULT(sizeof(debug_node_t))
  |  |  ------------------
  |  |  |  |  150|      0|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|      0|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2228:13): [True: 0, False: 0]
  ------------------
 2229|      0|            if (pool->abort_fn)
  ------------------
  |  Branch (2229:17): [True: 0, False: 0]
  ------------------
 2230|      0|                pool->abort_fn(APR_ENOMEM);
  ------------------
  |  |  687|      0|#define APR_ENOMEM ENOMEM
  ------------------
 2231|       |
 2232|      0|            return NULL;
 2233|      0|        }
 2234|       |
 2235|      0|        node->next = pool->nodes;
 2236|      0|        pool->nodes = node;
 2237|      0|        node->index = 0;
 2238|      0|    }
 2239|       |
 2240|    991|    node->beginp[node->index] = ps.mem;
 2241|    991|    node->endp[node->index] = ps.mem + ps.size;
 2242|    991|    node->index++;
 2243|       |
 2244|    991|    return ps.mem;
 2245|    991|}
apr_psprintf:
 2341|    991|{
 2342|    991|    va_list ap;
 2343|    991|    char *res;
 2344|       |
 2345|    991|    va_start(ap, fmt);
 2346|    991|    res = apr_pvsprintf(p, fmt, ap);
 2347|       |    va_end(ap);
 2348|    991|    return res;
 2349|    991|}
apr_pool_tag:
 2403|  1.23k|{
 2404|  1.23k|    pool->tag = tag;
 2405|  1.23k|}
apr_pool_cleanup_register:
 2493|  2.46k|{
 2494|  2.46k|    cleanup_t *c = NULL;
 2495|       |
 2496|  2.46k|#if APR_POOL_DEBUG
 2497|  2.46k|    apr_pool_check_integrity(p);
 2498|  2.46k|#endif /* APR_POOL_DEBUG */
 2499|       |
 2500|  2.46k|    if (p != NULL) {
  ------------------
  |  Branch (2500:9): [True: 2.46k, False: 0]
  ------------------
 2501|  2.46k|        if (p->free_cleanups) {
  ------------------
  |  Branch (2501:13): [True: 0, False: 2.46k]
  ------------------
 2502|       |            /* reuse a cleanup structure */
 2503|      0|            c = p->free_cleanups;
 2504|      0|            p->free_cleanups = c->next;
 2505|  2.46k|        } else {
 2506|  2.46k|            c = apr_palloc(p, sizeof(cleanup_t));
  ------------------
  |  |  425|  2.46k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  2.46k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  2.46k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  2.46k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2507|  2.46k|        }
 2508|  2.46k|        c->data = data;
 2509|  2.46k|        c->plain_cleanup_fn = plain_cleanup_fn;
 2510|  2.46k|        c->child_cleanup_fn = child_cleanup_fn;
 2511|  2.46k|        c->next = p->cleanups;
 2512|  2.46k|        p->cleanups = c;
 2513|  2.46k|    }
 2514|       |
 2515|  2.46k|#if APR_POOL_DEBUG
 2516|  2.46k|    if (!c || !c->plain_cleanup_fn || !c->child_cleanup_fn) {
  ------------------
  |  Branch (2516:9): [True: 0, False: 2.46k]
  |  Branch (2516:15): [True: 0, False: 2.46k]
  |  Branch (2516:39): [True: 0, False: 2.46k]
  ------------------
 2517|      0|        abort();
 2518|      0|    }
 2519|  2.46k|#endif /* APR_POOL_DEBUG */
 2520|  2.46k|}
apr_pool_create_ex:
 2942|  1.23k|{
 2943|  1.23k|    return apr_pool_create_ex_debug(newpool, parent,
 2944|  1.23k|                                    abort_fn, allocator,
 2945|  1.23k|                                    "undefined");
 2946|  1.23k|}
apr_pools.c:apr_pool_check_integrity:
 1645|  32.4k|{
 1646|  32.4k|    apr_pool_check_lifetime(pool);
 1647|  32.4k|    apr_pool_check_owner(pool);
 1648|  32.4k|}
apr_pools.c:apr_pool_check_owner:
 1630|  34.8k|{
 1631|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_OWNER)
 1632|       |#if APR_HAS_THREADS
 1633|       |    if (!apr_os_thread_equal(pool->owner, apr_os_thread_current())) {
 1634|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL)
 1635|       |        apr_pool_log_event(pool, "THREAD",
 1636|       |                           __FILE__ ":apr_pool_integrity check [owner]", 0);
 1637|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */
 1638|       |        abort();
 1639|       |    }
 1640|       |#endif /* APR_HAS_THREADS */
 1641|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_OWNER) */
 1642|  34.8k|}
apr_pools.c:pool_alloc:
 1771|  28.9k|{
 1772|  28.9k|    debug_node_t *node;
 1773|  28.9k|    void *mem;
 1774|       |
 1775|  28.9k|    if ((mem = malloc(size)) == NULL) {
  ------------------
  |  Branch (1775:9): [True: 0, False: 28.9k]
  ------------------
 1776|      0|        if (pool->abort_fn)
  ------------------
  |  Branch (1776:13): [True: 0, False: 0]
  ------------------
 1777|      0|            pool->abort_fn(APR_ENOMEM);
  ------------------
  |  |  687|      0|#define APR_ENOMEM ENOMEM
  ------------------
 1778|       |
 1779|      0|        return NULL;
 1780|      0|    }
 1781|       |
 1782|  28.9k|    node = pool->nodes;
 1783|  28.9k|    if (node == NULL || node->index == 64) {
  ------------------
  |  Branch (1783:9): [True: 2.46k, False: 26.4k]
  |  Branch (1783:25): [True: 4, False: 26.4k]
  ------------------
 1784|  2.46k|        if ((node = malloc(SIZEOF_DEBUG_NODE_T)) == NULL) {
  ------------------
  |  |  562|  2.46k|#define SIZEOF_DEBUG_NODE_T APR_ALIGN_DEFAULT(sizeof(debug_node_t))
  |  |  ------------------
  |  |  |  |  150|  2.46k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  2.46k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1784:13): [True: 0, False: 2.46k]
  ------------------
 1785|      0|            free(mem);
 1786|      0|            if (pool->abort_fn)
  ------------------
  |  Branch (1786:17): [True: 0, False: 0]
  ------------------
 1787|      0|                pool->abort_fn(APR_ENOMEM);
  ------------------
  |  |  687|      0|#define APR_ENOMEM ENOMEM
  ------------------
 1788|       |
 1789|      0|            return NULL;
 1790|      0|        }
 1791|       |
 1792|  2.46k|        memset(node, 0, SIZEOF_DEBUG_NODE_T);
  ------------------
  |  |  562|  2.46k|#define SIZEOF_DEBUG_NODE_T APR_ALIGN_DEFAULT(sizeof(debug_node_t))
  |  |  ------------------
  |  |  |  |  150|  2.46k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  2.46k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1793|       |
 1794|  2.46k|        node->next = pool->nodes;
 1795|  2.46k|        pool->nodes = node;
 1796|  2.46k|        node->index = 0;
 1797|  2.46k|    }
 1798|       |
 1799|  28.9k|    node->beginp[node->index] = mem;
 1800|  28.9k|    node->endp[node->index] = (char *)mem + size;
 1801|  28.9k|    node->index++;
 1802|       |
 1803|  28.9k|    pool->stat_alloc++;
 1804|  28.9k|    pool->stat_total_alloc++;
 1805|       |
 1806|  28.9k|    return mem;
 1807|  28.9k|}
apr_pools.c:apr_pool_check_lifetime:
 1598|  33.6k|{
 1599|       |    /* Rule of thumb: use of the global pool is always
 1600|       |     * ok, since the only user is apr_pools.c.  Unless
 1601|       |     * people have searched for the top level parent and
 1602|       |     * started to use that...
 1603|       |     * Like the global pool, unmanaged pools have their
 1604|       |     * own lifetime and no ->parent, ignore both here.
 1605|       |     * Last (internal) case is from apr_pool_create_ex_debug()
 1606|       |     * where pool->mutex is created before attaching to the
 1607|       |     * parent, hence an allocation happens with no ->parent
 1608|       |     * nor lifetime to be checked here.
 1609|       |     */
 1610|  33.6k|    if (pool->parent == NULL)
  ------------------
  |  Branch (1610:9): [True: 4.92k, False: 28.7k]
  ------------------
 1611|  4.92k|        return;
 1612|       |
 1613|       |    /* Lifetime
 1614|       |     * This basically checks to see if the pool being used is still
 1615|       |     * a relative to the global pool.  If not it was previously
 1616|       |     * destroyed, in which case we abort().
 1617|       |     */
 1618|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_LIFETIME)
 1619|       |    if (!apr_pool_is_child_of(pool, global_pool)) {
 1620|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL)
 1621|       |        apr_pool_log_event(pool, "LIFE",
 1622|       |                           __FILE__ ":apr_pool_integrity check [lifetime]", 0);
 1623|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */
 1624|       |        abort();
 1625|       |    }
 1626|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_LIFETIME) */
 1627|  33.6k|}
apr_pools.c:parent_lock:
 1473|  1.23k|{
 1474|  1.23k|    if (pool->parent) {
  ------------------
  |  Branch (1474:9): [True: 0, False: 1.23k]
  ------------------
 1475|      0|        apr_thread_mutex_lock(pool->parent->mutex);
 1476|      0|        return pool->parent->mutex;
 1477|      0|    }
 1478|  1.23k|    return NULL;
 1479|  1.23k|}
apr_pools.c:pool_clear_debug:
 1850|  2.46k|{
 1851|  2.46k|    debug_node_t *node;
 1852|  2.46k|    apr_size_t index;
 1853|       |
 1854|       |    /* Run pre destroy cleanups */
 1855|  2.46k|    run_cleanups(&pool->pre_cleanups);
 1856|  2.46k|    pool->pre_cleanups = NULL;
 1857|       |
 1858|       |    /*
 1859|       |     * Now that we have given the pre cleanups the chance to kill of any
 1860|       |     * threads using the pool, the owner must be correct.
 1861|       |     */
 1862|  2.46k|    apr_pool_check_owner(pool);
 1863|       |
 1864|       |    /* Destroy the subpools.  The subpools will detach themselves from
 1865|       |     * this pool thus this loop is safe and easy.
 1866|       |     */
 1867|  3.69k|    while (pool->child)
  ------------------
  |  Branch (1867:12): [True: 1.23k, False: 2.46k]
  ------------------
 1868|  1.23k|        pool_destroy_debug(pool->child, file_line);
 1869|       |
 1870|       |    /* Run cleanups */
 1871|  2.46k|    run_cleanups(&pool->cleanups);
 1872|  2.46k|    pool->free_cleanups = NULL;
 1873|  2.46k|    pool->cleanups = NULL;
 1874|       |
 1875|       |    /* If new child pools showed up, this is a reason to raise a flag */
 1876|  2.46k|    if (pool->child)
  ------------------
  |  Branch (1876:9): [True: 0, False: 2.46k]
  ------------------
 1877|      0|        abort();
 1878|       |
 1879|       |    /* Free subprocesses */
 1880|  2.46k|    free_proc_chain(pool->subprocesses);
 1881|  2.46k|    pool->subprocesses = NULL;
 1882|       |
 1883|       |    /* Clear the user data. */
 1884|  2.46k|    pool->user_data = NULL;
 1885|       |
 1886|       |    /* Free the blocks, scribbling over them first to help highlight
 1887|       |     * use-after-free issues. */
 1888|  4.92k|    while ((node = pool->nodes) != NULL) {
  ------------------
  |  Branch (1888:12): [True: 2.46k, False: 2.46k]
  ------------------
 1889|  2.46k|        pool->nodes = node->next;
 1890|       |
 1891|  32.4k|        for (index = 0; index < node->index; index++) {
  ------------------
  |  Branch (1891:25): [True: 29.9k, False: 2.46k]
  ------------------
 1892|  29.9k|            memset(node->beginp[index], POOL_POISON_BYTE,
  ------------------
  |  | 1847|  29.9k|#define POOL_POISON_BYTE 'A'
  ------------------
 1893|  29.9k|                   (char *)node->endp[index] - (char *)node->beginp[index]);
 1894|  29.9k|            free(node->beginp[index]);
 1895|  29.9k|        }
 1896|       |
 1897|  2.46k|        memset(node, POOL_POISON_BYTE, SIZEOF_DEBUG_NODE_T);
  ------------------
  |  | 1847|  2.46k|#define POOL_POISON_BYTE 'A'
  ------------------
                      memset(node, POOL_POISON_BYTE, SIZEOF_DEBUG_NODE_T);
  ------------------
  |  |  562|  2.46k|#define SIZEOF_DEBUG_NODE_T APR_ALIGN_DEFAULT(sizeof(debug_node_t))
  |  |  ------------------
  |  |  |  |  150|  2.46k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  2.46k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1898|  2.46k|        free(node);
 1899|  2.46k|    }
 1900|       |
 1901|  2.46k|    pool->stat_alloc = 0;
 1902|  2.46k|    pool->stat_clear++;
 1903|       |
 1904|       |#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE)
 1905|       |    apr_pool_log_event(pool, "CLEARED", file_line, 1);
 1906|       |#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) */
 1907|  2.46k|}
apr_pools.c:run_cleanups:
 2647|  4.92k|{
 2648|  4.92k|    cleanup_t *c = *cref;
 2649|       |
 2650|  7.38k|    while (c) {
  ------------------
  |  Branch (2650:12): [True: 2.46k, False: 4.92k]
  ------------------
 2651|  2.46k|        *cref = c->next;
 2652|  2.46k|        (*c->plain_cleanup_fn)((void *)c->data);
 2653|  2.46k|        c = *cref;
 2654|  2.46k|    }
 2655|  4.92k|}
apr_pools.c:free_proc_chain:
 2727|  2.46k|{
 2728|       |    /* Dispose of the subprocesses we've spawned off in the course of
 2729|       |     * whatever it was we're cleaning up now.  This may involve killing
 2730|       |     * some of them off...
 2731|       |     */
 2732|  2.46k|    struct process_chain *pc;
 2733|  2.46k|    int need_timeout = 0;
 2734|  2.46k|    apr_time_t timeout_interval;
 2735|       |
 2736|  2.46k|    if (!procs)
  ------------------
  |  Branch (2736:9): [True: 2.46k, False: 0]
  ------------------
 2737|  2.46k|        return; /* No work.  Whew! */
 2738|       |
 2739|       |    /* First, check to see if we need to do the SIGTERM, sleep, SIGKILL
 2740|       |     * dance with any of the processes we're cleaning up.  If we've got
 2741|       |     * any kill-on-sight subprocesses, ditch them now as well, so they
 2742|       |     * don't waste any more cycles doing whatever it is that they shouldn't
 2743|       |     * be doing anymore.
 2744|       |     */
 2745|       |
 2746|      0|#ifndef NEED_WAITPID
 2747|       |    /* Pick up all defunct processes */
 2748|      0|    for (pc = procs; pc; pc = pc->next) {
  ------------------
  |  Branch (2748:22): [True: 0, False: 0]
  ------------------
 2749|      0|        if (apr_proc_wait(pc->proc, NULL, NULL, APR_NOWAIT) != APR_CHILD_NOTDONE)
  ------------------
  |  |  454|      0|#define APR_CHILD_NOTDONE  (APR_OS_START_STATUS + 6)
  |  |  ------------------
  |  |  |  |  136|      0|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|      0|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2749:13): [True: 0, False: 0]
  ------------------
 2750|      0|            pc->kill_how = APR_KILL_NEVER;
 2751|      0|    }
 2752|      0|#endif /* !defined(NEED_WAITPID) */
 2753|       |
 2754|      0|    for (pc = procs; pc; pc = pc->next) {
  ------------------
  |  Branch (2754:22): [True: 0, False: 0]
  ------------------
 2755|      0|#ifndef WIN32
 2756|      0|        if ((pc->kill_how == APR_KILL_AFTER_TIMEOUT)
  ------------------
  |  Branch (2756:13): [True: 0, False: 0]
  ------------------
 2757|      0|            || (pc->kill_how == APR_KILL_ONLY_ONCE)) {
  ------------------
  |  Branch (2757:16): [True: 0, False: 0]
  ------------------
 2758|       |            /*
 2759|       |             * Subprocess may be dead already.  Only need the timeout if not.
 2760|       |             * Note: apr_proc_kill on Windows is TerminateProcess(), which is
 2761|       |             * similar to a SIGKILL, so always give the process a timeout
 2762|       |             * under Windows before killing it.
 2763|       |             */
 2764|      0|            if (apr_proc_kill(pc->proc, SIGTERM) == APR_SUCCESS)
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
  |  Branch (2764:17): [True: 0, False: 0]
  ------------------
 2765|      0|                need_timeout = 1;
 2766|      0|        }
 2767|      0|        else if (pc->kill_how == APR_KILL_ALWAYS) {
  ------------------
  |  Branch (2767:18): [True: 0, False: 0]
  ------------------
 2768|       |#else /* WIN32 knows only one fast, clean method of killing processes today */
 2769|       |        if (pc->kill_how != APR_KILL_NEVER) {
 2770|       |            need_timeout = 1;
 2771|       |            pc->kill_how = APR_KILL_ALWAYS;
 2772|       |#endif
 2773|      0|            apr_proc_kill(pc->proc, SIGKILL);
 2774|      0|        }
 2775|      0|    }
 2776|       |
 2777|       |    /* Sleep only if we have to. The sleep algorithm grows
 2778|       |     * by a factor of two on each iteration. TIMEOUT_INTERVAL
 2779|       |     * is equal to TIMEOUT_USECS / 64.
 2780|       |     */
 2781|      0|    if (need_timeout) {
  ------------------
  |  Branch (2781:9): [True: 0, False: 0]
  ------------------
 2782|      0|        timeout_interval = TIMEOUT_INTERVAL;
  ------------------
  |  |  106|      0|#define TIMEOUT_INTERVAL   46875
  ------------------
 2783|      0|        apr_sleep(timeout_interval);
 2784|       |
 2785|      0|        do {
 2786|       |            /* check the status of the subprocesses */
 2787|      0|            need_timeout = 0;
 2788|      0|            for (pc = procs; pc; pc = pc->next) {
  ------------------
  |  Branch (2788:30): [True: 0, False: 0]
  ------------------
 2789|      0|                if (pc->kill_how == APR_KILL_AFTER_TIMEOUT) {
  ------------------
  |  Branch (2789:21): [True: 0, False: 0]
  ------------------
 2790|      0|                    if (apr_proc_wait(pc->proc, NULL, NULL, APR_NOWAIT)
  ------------------
  |  Branch (2790:25): [True: 0, False: 0]
  ------------------
 2791|      0|                            == APR_CHILD_NOTDONE)
  ------------------
  |  |  454|      0|#define APR_CHILD_NOTDONE  (APR_OS_START_STATUS + 6)
  |  |  ------------------
  |  |  |  |  136|      0|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|      0|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2792|      0|                        need_timeout = 1;		/* subprocess is still active */
 2793|      0|                    else
 2794|      0|                        pc->kill_how = APR_KILL_NEVER;	/* subprocess has exited */
 2795|      0|                }
 2796|      0|            }
 2797|      0|            if (need_timeout) {
  ------------------
  |  Branch (2797:17): [True: 0, False: 0]
  ------------------
 2798|      0|                if (timeout_interval >= TIMEOUT_USECS) {
  ------------------
  |  |  105|      0|#define TIMEOUT_USECS    3000000
  ------------------
  |  Branch (2798:21): [True: 0, False: 0]
  ------------------
 2799|      0|                    break;
 2800|      0|                }
 2801|      0|                apr_sleep(timeout_interval);
 2802|      0|                timeout_interval *= 2;
 2803|      0|            }
 2804|      0|        } while (need_timeout);
  ------------------
  |  Branch (2804:18): [True: 0, False: 0]
  ------------------
 2805|      0|    }
 2806|       |
 2807|       |    /* OK, the scripts we just timed out for have had a chance to clean up
 2808|       |     * --- now, just get rid of them, and also clean up the system accounting
 2809|       |     * goop...
 2810|       |     */
 2811|      0|    for (pc = procs; pc; pc = pc->next) {
  ------------------
  |  Branch (2811:22): [True: 0, False: 0]
  ------------------
 2812|      0|        if (pc->kill_how == APR_KILL_AFTER_TIMEOUT)
  ------------------
  |  Branch (2812:13): [True: 0, False: 0]
  ------------------
 2813|      0|            apr_proc_kill(pc->proc, SIGKILL);
 2814|      0|    }
 2815|       |
 2816|       |    /* Now wait for all the signaled processes to die */
 2817|      0|    for (pc = procs; pc; pc = pc->next) {
  ------------------
  |  Branch (2817:22): [True: 0, False: 0]
  ------------------
 2818|      0|        if (pc->kill_how != APR_KILL_NEVER)
  ------------------
  |  Branch (2818:13): [True: 0, False: 0]
  ------------------
 2819|      0|            (void)apr_proc_wait(pc->proc, NULL, NULL, APR_WAIT);
 2820|      0|    }
 2821|      0|}
apr_pools.c:parent_unlock:
 1483|  1.23k|{
 1484|  1.23k|    if (mutex) {
  ------------------
  |  Branch (1484:9): [True: 0, False: 1.23k]
  ------------------
 1485|      0|        apr_thread_mutex_unlock(mutex);
 1486|      0|    }
 1487|  1.23k|}
apr_pools.c:pool_destroy_debug:
 1952|  2.46k|{
 1953|  2.46k|    pool_clear_debug(pool, file_line);
 1954|       |
 1955|       |    /* Remove the pool from the parent's child list */
 1956|  2.46k|    if (pool->parent != NULL
  ------------------
  |  Branch (1956:9): [True: 1.23k, False: 1.23k]
  ------------------
 1957|  1.23k|        && (*pool->ref = pool->sibling) != NULL) {
  ------------------
  |  Branch (1957:12): [True: 0, False: 1.23k]
  ------------------
 1958|      0|        pool->sibling->ref = pool->ref;
 1959|      0|    }
 1960|       |
 1961|       |    /* Destroy the allocator if the pool owns it */
 1962|  2.46k|    if (pool->allocator != NULL
  ------------------
  |  Branch (1962:9): [True: 0, False: 2.46k]
  ------------------
 1963|      0|        && apr_allocator_owner_get(pool->allocator) == pool) {
  ------------------
  |  Branch (1963:12): [True: 0, False: 0]
  ------------------
 1964|      0|        apr_allocator_destroy(pool->allocator);
 1965|      0|    }
 1966|       |
 1967|       |    /* Free the pool itself */
 1968|  2.46k|    free(pool);
 1969|  2.46k|}
apr_pools.c:pool_lock:
 1456|  1.23k|{
 1457|  1.23k|#if APR_HAS_THREADS
 1458|  1.23k|    apr_thread_mutex_lock(pool->mutex);
 1459|  1.23k|#endif /* APR_HAS_THREADS */
 1460|  1.23k|}
apr_pools.c:pool_unlock:
 1464|  1.23k|{
 1465|  1.23k|#if APR_HAS_THREADS
 1466|  1.23k|    apr_thread_mutex_unlock(pool->mutex);
 1467|  1.23k|#endif /* APR_HAS_THREADS */
 1468|  1.23k|}

apr_vformatter:
  684|    991|{
  685|    991|    register char *sp;
  686|    991|    register char *bep;
  687|    991|    register int cc = 0;
  688|    991|    register apr_size_t i;
  689|       |
  690|    991|    register char *s = NULL;
  691|    991|    char *q;
  692|    991|    apr_size_t s_len = 0;
  693|       |
  694|    991|    register apr_size_t min_width = 0;
  695|    991|    apr_size_t precision = 0;
  696|    991|    enum {
  697|    991|        LEFT, RIGHT
  698|    991|    } adjust;
  699|    991|    char pad_char;
  700|    991|    char prefix_char;
  701|       |
  702|    991|    double fp_num;
  703|    991|    apr_int64_t i_quad = 0;
  704|    991|    apr_uint64_t ui_quad;
  705|    991|    apr_int32_t i_num = 0;
  706|    991|    apr_uint32_t ui_num = 0;
  707|       |
  708|    991|    char num_buf[NUM_BUF_SIZE];
  709|    991|    char char_buf[2];                /* for printing %% and %<unknown> */
  710|       |
  711|    991|    enum var_type_enum {
  712|    991|            IS_QUAD, IS_LONG, IS_SHORT, IS_INT
  713|    991|    };
  714|    991|    enum var_type_enum var_type = IS_INT;
  715|       |
  716|       |    /*
  717|       |     * Flag variables
  718|       |     */
  719|    991|    boolean_e alternate_form;
  720|    991|    boolean_e print_sign;
  721|    991|    boolean_e print_blank;
  722|    991|    boolean_e adjust_precision;
  723|    991|    boolean_e adjust_width;
  724|    991|    int is_negative;
  725|       |
  726|    991|    sp = vbuff->curpos;
  727|    991|    bep = vbuff->endpos;
  728|       |
  729|  35.6k|    while (*fmt) {
  ------------------
  |  Branch (729:12): [True: 34.6k, False: 991]
  ------------------
  730|  34.6k|        if (*fmt != '%') {
  ------------------
  |  Branch (730:13): [True: 33.6k, False: 991]
  ------------------
  731|  33.6k|            INS_CHAR(*fmt, sp, bep, cc);
  ------------------
  |  |  244|  33.6k|#define INS_CHAR(c, sp, bep, cc)                    \
  |  |  245|  33.6k|{                                                   \
  |  |  246|  33.6k|    if (sp) {                                       \
  |  |  ------------------
  |  |  |  Branch (246:9): [True: 33.6k, False: 0]
  |  |  ------------------
  |  |  247|  33.6k|        if (sp >= bep) {                            \
  |  |  ------------------
  |  |  |  Branch (247:13): [True: 0, False: 33.6k]
  |  |  ------------------
  |  |  248|      0|            vbuff->curpos = sp;                     \
  |  |  249|      0|            if (flush_func(vbuff))                  \
  |  |  ------------------
  |  |  |  Branch (249:17): [True: 0, False: 0]
  |  |  ------------------
  |  |  250|      0|                return -1;                          \
  |  |  251|      0|            sp = vbuff->curpos;                     \
  |  |  252|      0|            bep = vbuff->endpos;                    \
  |  |  253|      0|        }                                           \
  |  |  254|  33.6k|        *sp++ = (c);                                \
  |  |  255|  33.6k|    }                                               \
  |  |  256|  33.6k|    cc++;                                           \
  |  |  257|  33.6k|}
  ------------------
  732|  33.6k|        }
  733|    991|        else {
  734|       |            /*
  735|       |             * Default variable settings
  736|       |             */
  737|    991|            boolean_e print_something = YES;
  738|    991|            adjust = RIGHT;
  739|    991|            alternate_form = print_sign = print_blank = NO;
  740|    991|            pad_char = ' ';
  741|    991|            prefix_char = NUL;
  ------------------
  |  |   55|    991|#define NUL '\0'
  ------------------
  742|       |
  743|    991|            fmt++;
  744|       |
  745|       |            /*
  746|       |             * Try to avoid checking for flags, width or precision
  747|       |             */
  748|    991|            if (!apr_islower(*fmt)) {
  ------------------
  |  |  216|    991|#define apr_islower(c) (islower(((unsigned char)(c))))
  ------------------
  |  Branch (748:17): [True: 991, False: 0]
  ------------------
  749|       |                /*
  750|       |                 * Recognize flags: -, #, BLANK, +
  751|       |                 */
  752|    991|                for (;; fmt++) {
  753|    991|                    if (*fmt == '-')
  ------------------
  |  Branch (753:25): [True: 0, False: 991]
  ------------------
  754|      0|                        adjust = LEFT;
  755|    991|                    else if (*fmt == '+')
  ------------------
  |  Branch (755:30): [True: 0, False: 991]
  ------------------
  756|      0|                        print_sign = YES;
  757|    991|                    else if (*fmt == '#')
  ------------------
  |  Branch (757:30): [True: 0, False: 991]
  ------------------
  758|      0|                        alternate_form = YES;
  759|    991|                    else if (*fmt == ' ')
  ------------------
  |  Branch (759:30): [True: 0, False: 991]
  ------------------
  760|      0|                        print_blank = YES;
  761|    991|                    else if (*fmt == '0')
  ------------------
  |  Branch (761:30): [True: 0, False: 991]
  ------------------
  762|      0|                        pad_char = '0';
  763|    991|                    else
  764|    991|                        break;
  765|    991|                }
  766|       |
  767|       |                /*
  768|       |                 * Check if a width was specified
  769|       |                 */
  770|    991|                if (apr_isdigit(*fmt)) {
  ------------------
  |  |  212|    991|#define apr_isdigit(c) (isdigit(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (212:24): [True: 0, False: 991]
  |  |  ------------------
  ------------------
  771|      0|                    STR_TO_DEC(fmt, min_width);
  ------------------
  |  |  262|      0|    num = NUM(*str++);                              \
  |  |  ------------------
  |  |  |  |  259|      0|#define NUM(c) (c - '0')
  |  |  ------------------
  |  |  263|      0|    while (apr_isdigit(*str))                       \
  |  |  ------------------
  |  |  |  |  212|      0|#define apr_isdigit(c) (isdigit(((unsigned char)(c))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (212:24): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  264|      0|    {                                               \
  |  |  265|      0|        num *= 10 ;                                 \
  |  |  266|      0|        num += NUM(*str++);                         \
  |  |  ------------------
  |  |  |  |  259|      0|#define NUM(c) (c - '0')
  |  |  ------------------
  |  |  267|      0|    }
  ------------------
  772|      0|                    adjust_width = YES;
  773|      0|                }
  774|    991|                else if (*fmt == '*') {
  ------------------
  |  Branch (774:26): [True: 0, False: 991]
  ------------------
  775|      0|                    int v = va_arg(ap, int);
  776|      0|                    fmt++;
  777|      0|                    adjust_width = YES;
  778|      0|                    if (v < 0) {
  ------------------
  |  Branch (778:25): [True: 0, False: 0]
  ------------------
  779|      0|                        adjust = LEFT;
  780|      0|                        min_width = (apr_size_t)(-v);
  781|      0|                    }
  782|      0|                    else
  783|      0|                        min_width = (apr_size_t)v;
  784|      0|                }
  785|    991|                else
  786|    991|                    adjust_width = NO;
  787|       |
  788|       |                /*
  789|       |                 * Check if a precision was specified
  790|       |                 */
  791|    991|                if (*fmt == '.') {
  ------------------
  |  Branch (791:21): [True: 991, False: 0]
  ------------------
  792|    991|                    adjust_precision = YES;
  793|    991|                    fmt++;
  794|    991|                    if (apr_isdigit(*fmt)) {
  ------------------
  |  |  212|    991|#define apr_isdigit(c) (isdigit(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (212:24): [True: 991, False: 0]
  |  |  ------------------
  ------------------
  795|    991|                        STR_TO_DEC(fmt, precision);
  ------------------
  |  |  262|    991|    num = NUM(*str++);                              \
  |  |  ------------------
  |  |  |  |  259|    991|#define NUM(c) (c - '0')
  |  |  ------------------
  |  |  263|    991|    while (apr_isdigit(*str))                       \
  |  |  ------------------
  |  |  |  |  212|    991|#define apr_isdigit(c) (isdigit(((unsigned char)(c))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (212:24): [True: 0, False: 991]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  264|    991|    {                                               \
  |  |  265|      0|        num *= 10 ;                                 \
  |  |  266|      0|        num += NUM(*str++);                         \
  |  |  ------------------
  |  |  |  |  259|      0|#define NUM(c) (c - '0')
  |  |  ------------------
  |  |  267|      0|    }
  ------------------
  796|    991|                    }
  797|      0|                    else if (*fmt == '*') {
  ------------------
  |  Branch (797:30): [True: 0, False: 0]
  ------------------
  798|      0|                        int v = va_arg(ap, int);
  799|      0|                        fmt++;
  800|      0|                        precision = (v < 0) ? 0 : (apr_size_t)v;
  ------------------
  |  Branch (800:37): [True: 0, False: 0]
  ------------------
  801|      0|                    }
  802|      0|                    else
  803|      0|                        precision = 0;
  804|    991|                }
  805|      0|                else
  806|      0|                    adjust_precision = NO;
  807|    991|            }
  808|      0|            else
  809|      0|                adjust_precision = adjust_width = NO;
  810|       |
  811|       |            /*
  812|       |             * Modifier check.  In same cases, APR_OFF_T_FMT can be
  813|       |             * "lld" and APR_INT64_T_FMT can be "ld" (that is, off_t is
  814|       |             * "larger" than int64). Check that case 1st.
  815|       |             * Note that if APR_OFF_T_FMT is "d",
  816|       |             * the first if condition is never true. If APR_INT64_T_FMT
  817|       |             * is "d' then the second if condition is never true.
  818|       |             */
  819|    991|            if ((sizeof(APR_OFF_T_FMT) > sizeof(APR_INT64_T_FMT)) &&
  ------------------
  |  |  600|    991|#define APR_OFF_T_FMT "ld"
  ------------------
                          if ((sizeof(APR_OFF_T_FMT) > sizeof(APR_INT64_T_FMT)) &&
  ------------------
  |  |  606|    991|#define APR_INT64_T_FMT PRId64
  ------------------
  |  Branch (819:17): [Folded, False: 991]
  ------------------
  820|      0|                ((sizeof(APR_OFF_T_FMT) == 4 &&
  ------------------
  |  |  600|      0|#define APR_OFF_T_FMT "ld"
  ------------------
  |  Branch (820:19): [Folded, False: 0]
  ------------------
  821|      0|                 fmt[0] == APR_OFF_T_FMT[0] &&
  ------------------
  |  |  600|      0|#define APR_OFF_T_FMT "ld"
  ------------------
  |  Branch (821:18): [True: 0, False: 0]
  ------------------
  822|      0|                 fmt[1] == APR_OFF_T_FMT[1]) ||
  ------------------
  |  |  600|      0|#define APR_OFF_T_FMT "ld"
  ------------------
  |  Branch (822:18): [True: 0, False: 0]
  ------------------
  823|      0|                (sizeof(APR_OFF_T_FMT) == 3 &&
  ------------------
  |  |  600|      0|#define APR_OFF_T_FMT "ld"
  ------------------
  |  Branch (823:18): [True: 0, Folded]
  ------------------
  824|      0|                 fmt[0] == APR_OFF_T_FMT[0]) ||
  ------------------
  |  |  600|      0|#define APR_OFF_T_FMT "ld"
  ------------------
  |  Branch (824:18): [True: 0, False: 0]
  ------------------
  825|      0|                (sizeof(APR_OFF_T_FMT) > 4 &&
  ------------------
  |  |  600|      0|#define APR_OFF_T_FMT "ld"
  ------------------
  |  Branch (825:18): [Folded, False: 0]
  ------------------
  826|      0|                 strncmp(fmt, APR_OFF_T_FMT,
  ------------------
  |  |  600|      0|#define APR_OFF_T_FMT "ld"
  ------------------
  |  Branch (826:18): [True: 0, False: 0]
  ------------------
  827|      0|                         sizeof(APR_OFF_T_FMT) - 2) == 0))) {
  ------------------
  |  |  600|      0|#define APR_OFF_T_FMT "ld"
  ------------------
  828|       |                /* Need to account for trailing 'd' and null in sizeof() */
  829|      0|                var_type = IS_QUAD;
  830|      0|                fmt += (sizeof(APR_OFF_T_FMT) - 2);
  ------------------
  |  |  600|      0|#define APR_OFF_T_FMT "ld"
  ------------------
  831|      0|            }
  832|    991|            else if ((sizeof(APR_INT64_T_FMT) == 4 &&
  ------------------
  |  |  606|    991|#define APR_INT64_T_FMT PRId64
  ------------------
  |  Branch (832:23): [Folded, False: 991]
  ------------------
  833|      0|                 fmt[0] == APR_INT64_T_FMT[0] &&
  ------------------
  |  |  606|      0|#define APR_INT64_T_FMT PRId64
  ------------------
  |  Branch (833:18): [True: 0, False: 0]
  ------------------
  834|      0|                 fmt[1] == APR_INT64_T_FMT[1]) ||
  ------------------
  |  |  606|      0|#define APR_INT64_T_FMT PRId64
  ------------------
  |  Branch (834:18): [True: 0, False: 0]
  ------------------
  835|    991|                (sizeof(APR_INT64_T_FMT) == 3 &&
  ------------------
  |  |  606|    991|#define APR_INT64_T_FMT PRId64
  ------------------
  |  Branch (835:18): [True: 991, Folded]
  ------------------
  836|    991|                 fmt[0] == APR_INT64_T_FMT[0]) ||
  ------------------
  |  |  606|    991|#define APR_INT64_T_FMT PRId64
  ------------------
  |  Branch (836:18): [True: 0, False: 991]
  ------------------
  837|      0|                (sizeof(APR_INT64_T_FMT) > 4 &&
  ------------------
  |  |  606|      0|#define APR_INT64_T_FMT PRId64
  ------------------
  |  Branch (837:18): [Folded, False: 0]
  ------------------
  838|      0|                 strncmp(fmt, APR_INT64_T_FMT,
  ------------------
  |  |  606|      0|#define APR_INT64_T_FMT PRId64
  ------------------
  |  Branch (838:18): [True: 0, False: 0]
  ------------------
  839|      0|                         sizeof(APR_INT64_T_FMT) - 2) == 0)) {
  ------------------
  |  |  606|      0|#define APR_INT64_T_FMT PRId64
  ------------------
  840|       |                /* Need to account for trailing 'd' and null in sizeof() */
  841|      0|                var_type = IS_QUAD;
  842|      0|                fmt += (sizeof(APR_INT64_T_FMT) - 2);
  ------------------
  |  |  606|      0|#define APR_INT64_T_FMT PRId64
  ------------------
  843|      0|            }
  844|    991|            else if (*fmt == 'q') {
  ------------------
  |  Branch (844:22): [True: 0, False: 991]
  ------------------
  845|      0|                var_type = IS_QUAD;
  846|      0|                fmt++;
  847|      0|            }
  848|    991|            else if (*fmt == 'l') {
  ------------------
  |  Branch (848:22): [True: 0, False: 991]
  ------------------
  849|      0|                var_type = IS_LONG;
  850|      0|                fmt++;
  851|      0|            }
  852|    991|            else if (*fmt == 'h') {
  ------------------
  |  Branch (852:22): [True: 0, False: 991]
  ------------------
  853|      0|                var_type = IS_SHORT;
  854|      0|                fmt++;
  855|      0|            }
  856|    991|            else {
  857|    991|                var_type = IS_INT;
  858|    991|            }
  859|       |
  860|       |            /*
  861|       |             * Argument extraction and printing.
  862|       |             * First we determine the argument type.
  863|       |             * Then, we convert the argument to a string.
  864|       |             * On exit from the switch, s points to the string that
  865|       |             * must be printed, s_len has the length of the string
  866|       |             * The precision requirements, if any, are reflected in s_len.
  867|       |             *
  868|       |             * NOTE: pad_char may be set to '0' because of the 0 flag.
  869|       |             *   It is reset to ' ' by non-numeric formats
  870|       |             */
  871|    991|            switch (*fmt) {
  872|      0|            case 'u':
  ------------------
  |  Branch (872:13): [True: 0, False: 991]
  ------------------
  873|      0|                if (var_type == IS_QUAD) {
  ------------------
  |  Branch (873:21): [True: 0, False: 0]
  ------------------
  874|      0|                    i_quad = va_arg(ap, apr_uint64_t);
  875|      0|                    s = conv_10_quad(i_quad, 1, &is_negative,
  876|      0|                            &num_buf[NUM_BUF_SIZE], &s_len);
  ------------------
  |  |   69|      0|#define NUM_BUF_SIZE 512
  ------------------
  877|      0|                }
  878|      0|                else {
  879|      0|                    if (var_type == IS_LONG)
  ------------------
  |  Branch (879:25): [True: 0, False: 0]
  ------------------
  880|      0|                        i_num = (apr_int32_t) va_arg(ap, apr_uint32_t);
  881|      0|                    else if (var_type == IS_SHORT)
  ------------------
  |  Branch (881:30): [True: 0, False: 0]
  ------------------
  882|      0|                        i_num = (apr_int32_t) (unsigned short) va_arg(ap, unsigned int);
  883|      0|                    else
  884|      0|                        i_num = (apr_int32_t) va_arg(ap, unsigned int);
  885|      0|                    s = conv_10(i_num, 1, &is_negative,
  886|      0|                            &num_buf[NUM_BUF_SIZE], &s_len);
  ------------------
  |  |   69|      0|#define NUM_BUF_SIZE 512
  ------------------
  887|      0|                }
  888|      0|                FIX_PRECISION(adjust_precision, precision, s, s_len);
  ------------------
  |  |  280|      0|    if (adjust) {                                   \
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  281|      0|        apr_size_t p = (precision + 1 < NUM_BUF_SIZE) \
  |  |  ------------------
  |  |  |  |   69|      0|#define NUM_BUF_SIZE 512
  |  |  ------------------
  |  |  |  Branch (281:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  282|      0|                     ? precision : NUM_BUF_SIZE - 1;  \
  |  |  ------------------
  |  |  |  |   69|      0|#define NUM_BUF_SIZE 512
  |  |  ------------------
  |  |  283|      0|        while (s_len < p)                           \
  |  |  ------------------
  |  |  |  Branch (283:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  284|      0|        {                                           \
  |  |  285|      0|            *--s = '0';                             \
  |  |  286|      0|            s_len++;                                \
  |  |  287|      0|        }                                           \
  |  |  288|      0|    }
  ------------------
  889|      0|                break;
  890|       |
  891|      0|            case 'd':
  ------------------
  |  Branch (891:13): [True: 0, False: 991]
  ------------------
  892|      0|            case 'i':
  ------------------
  |  Branch (892:13): [True: 0, False: 991]
  ------------------
  893|      0|                if (var_type == IS_QUAD) {
  ------------------
  |  Branch (893:21): [True: 0, False: 0]
  ------------------
  894|      0|                    i_quad = va_arg(ap, apr_int64_t);
  895|      0|                    s = conv_10_quad(i_quad, 0, &is_negative,
  896|      0|                            &num_buf[NUM_BUF_SIZE], &s_len);
  ------------------
  |  |   69|      0|#define NUM_BUF_SIZE 512
  ------------------
  897|      0|                }
  898|      0|                else {
  899|      0|                    if (var_type == IS_LONG)
  ------------------
  |  Branch (899:25): [True: 0, False: 0]
  ------------------
  900|      0|                        i_num = va_arg(ap, apr_int32_t);
  901|      0|                    else if (var_type == IS_SHORT)
  ------------------
  |  Branch (901:30): [True: 0, False: 0]
  ------------------
  902|      0|                        i_num = (short) va_arg(ap, int);
  903|      0|                    else
  904|      0|                        i_num = va_arg(ap, int);
  905|      0|                    s = conv_10(i_num, 0, &is_negative,
  906|      0|                            &num_buf[NUM_BUF_SIZE], &s_len);
  ------------------
  |  |   69|      0|#define NUM_BUF_SIZE 512
  ------------------
  907|      0|                }
  908|      0|                FIX_PRECISION(adjust_precision, precision, s, s_len);
  ------------------
  |  |  280|      0|    if (adjust) {                                   \
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  281|      0|        apr_size_t p = (precision + 1 < NUM_BUF_SIZE) \
  |  |  ------------------
  |  |  |  |   69|      0|#define NUM_BUF_SIZE 512
  |  |  ------------------
  |  |  |  Branch (281:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  282|      0|                     ? precision : NUM_BUF_SIZE - 1;  \
  |  |  ------------------
  |  |  |  |   69|      0|#define NUM_BUF_SIZE 512
  |  |  ------------------
  |  |  283|      0|        while (s_len < p)                           \
  |  |  ------------------
  |  |  |  Branch (283:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  284|      0|        {                                           \
  |  |  285|      0|            *--s = '0';                             \
  |  |  286|      0|            s_len++;                                \
  |  |  287|      0|        }                                           \
  |  |  288|      0|    }
  ------------------
  909|       |
  910|      0|                if (is_negative)
  ------------------
  |  Branch (910:21): [True: 0, False: 0]
  ------------------
  911|      0|                    prefix_char = '-';
  912|      0|                else if (print_sign)
  ------------------
  |  Branch (912:26): [True: 0, False: 0]
  ------------------
  913|      0|                    prefix_char = '+';
  914|      0|                else if (print_blank)
  ------------------
  |  Branch (914:26): [True: 0, False: 0]
  ------------------
  915|      0|                    prefix_char = ' ';
  916|      0|                break;
  917|       |
  918|       |
  919|      0|            case 'o':
  ------------------
  |  Branch (919:13): [True: 0, False: 991]
  ------------------
  920|      0|                if (var_type == IS_QUAD) {
  ------------------
  |  Branch (920:21): [True: 0, False: 0]
  ------------------
  921|      0|                    ui_quad = va_arg(ap, apr_uint64_t);
  922|      0|                    s = conv_p2_quad(ui_quad, 3, *fmt,
  923|      0|                            &num_buf[NUM_BUF_SIZE], &s_len);
  ------------------
  |  |   69|      0|#define NUM_BUF_SIZE 512
  ------------------
  924|      0|                }
  925|      0|                else {
  926|      0|                    if (var_type == IS_LONG)
  ------------------
  |  Branch (926:25): [True: 0, False: 0]
  ------------------
  927|      0|                        ui_num = va_arg(ap, apr_uint32_t);
  928|      0|                    else if (var_type == IS_SHORT)
  ------------------
  |  Branch (928:30): [True: 0, False: 0]
  ------------------
  929|      0|                        ui_num = (unsigned short) va_arg(ap, unsigned int);
  930|      0|                    else
  931|      0|                        ui_num = va_arg(ap, unsigned int);
  932|      0|                    s = conv_p2(ui_num, 3, *fmt,
  933|      0|                            &num_buf[NUM_BUF_SIZE], &s_len);
  ------------------
  |  |   69|      0|#define NUM_BUF_SIZE 512
  ------------------
  934|      0|                }
  935|      0|                FIX_PRECISION(adjust_precision, precision, s, s_len);
  ------------------
  |  |  280|      0|    if (adjust) {                                   \
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  281|      0|        apr_size_t p = (precision + 1 < NUM_BUF_SIZE) \
  |  |  ------------------
  |  |  |  |   69|      0|#define NUM_BUF_SIZE 512
  |  |  ------------------
  |  |  |  Branch (281:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  282|      0|                     ? precision : NUM_BUF_SIZE - 1;  \
  |  |  ------------------
  |  |  |  |   69|      0|#define NUM_BUF_SIZE 512
  |  |  ------------------
  |  |  283|      0|        while (s_len < p)                           \
  |  |  ------------------
  |  |  |  Branch (283:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  284|      0|        {                                           \
  |  |  285|      0|            *--s = '0';                             \
  |  |  286|      0|            s_len++;                                \
  |  |  287|      0|        }                                           \
  |  |  288|      0|    }
  ------------------
  936|      0|                if (alternate_form && *s != '0') {
  ------------------
  |  Branch (936:21): [True: 0, False: 0]
  |  Branch (936:39): [True: 0, False: 0]
  ------------------
  937|      0|                    *--s = '0';
  938|      0|                    s_len++;
  939|      0|                }
  940|      0|                break;
  941|       |
  942|       |
  943|    991|            case 'x':
  ------------------
  |  Branch (943:13): [True: 991, False: 0]
  ------------------
  944|    991|            case 'X':
  ------------------
  |  Branch (944:13): [True: 0, False: 991]
  ------------------
  945|    991|                if (var_type == IS_QUAD) {
  ------------------
  |  Branch (945:21): [True: 0, False: 991]
  ------------------
  946|      0|                    ui_quad = va_arg(ap, apr_uint64_t);
  947|      0|                    s = conv_p2_quad(ui_quad, 4, *fmt,
  948|      0|                            &num_buf[NUM_BUF_SIZE], &s_len);
  ------------------
  |  |   69|      0|#define NUM_BUF_SIZE 512
  ------------------
  949|      0|                }
  950|    991|                else {
  951|    991|                    if (var_type == IS_LONG)
  ------------------
  |  Branch (951:25): [True: 0, False: 991]
  ------------------
  952|      0|                        ui_num = va_arg(ap, apr_uint32_t);
  953|    991|                    else if (var_type == IS_SHORT)
  ------------------
  |  Branch (953:30): [True: 0, False: 991]
  ------------------
  954|      0|                        ui_num = (unsigned short) va_arg(ap, unsigned int);
  955|    991|                    else
  956|    991|                        ui_num = va_arg(ap, unsigned int);
  957|    991|                    s = conv_p2(ui_num, 4, *fmt,
  958|    991|                            &num_buf[NUM_BUF_SIZE], &s_len);
  ------------------
  |  |   69|    991|#define NUM_BUF_SIZE 512
  ------------------
  959|    991|                }
  960|    991|                FIX_PRECISION(adjust_precision, precision, s, s_len);
  ------------------
  |  |  280|    991|    if (adjust) {                                   \
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 991, False: 0]
  |  |  ------------------
  |  |  281|    991|        apr_size_t p = (precision + 1 < NUM_BUF_SIZE) \
  |  |  ------------------
  |  |  |  |   69|    991|#define NUM_BUF_SIZE 512
  |  |  ------------------
  |  |  |  Branch (281:24): [True: 991, False: 0]
  |  |  ------------------
  |  |  282|    991|                     ? precision : NUM_BUF_SIZE - 1;  \
  |  |  ------------------
  |  |  |  |   69|      0|#define NUM_BUF_SIZE 512
  |  |  ------------------
  |  |  283|  1.16k|        while (s_len < p)                           \
  |  |  ------------------
  |  |  |  Branch (283:16): [True: 172, False: 991]
  |  |  ------------------
  |  |  284|    991|        {                                           \
  |  |  285|    172|            *--s = '0';                             \
  |  |  286|    172|            s_len++;                                \
  |  |  287|    172|        }                                           \
  |  |  288|    991|    }
  ------------------
  961|    991|                if (alternate_form && ui_num != 0) {
  ------------------
  |  Branch (961:21): [True: 0, False: 991]
  |  Branch (961:39): [True: 0, False: 0]
  ------------------
  962|      0|                    *--s = *fmt;        /* 'x' or 'X' */
  963|      0|                    *--s = '0';
  964|      0|                    s_len += 2;
  965|      0|                }
  966|    991|                break;
  967|       |
  968|       |
  969|      0|            case 's':
  ------------------
  |  Branch (969:13): [True: 0, False: 991]
  ------------------
  970|      0|                s = va_arg(ap, char *);
  971|      0|                if (s != NULL) {
  ------------------
  |  Branch (971:21): [True: 0, False: 0]
  ------------------
  972|      0|                    if (!adjust_precision) {
  ------------------
  |  Branch (972:25): [True: 0, False: 0]
  ------------------
  973|      0|                        s_len = strlen(s);
  974|      0|                    }
  975|      0|                    else {
  976|       |                        /* From the C library standard in section 7.9.6.1:
  977|       |                         * ...if the precision is specified, no more then
  978|       |                         * that many characters are written.  If the
  979|       |                         * precision is not specified or is greater
  980|       |                         * than the size of the array, the array shall
  981|       |                         * contain a null character.
  982|       |                         *
  983|       |                         * My reading is is precision is specified and
  984|       |                         * is less then or equal to the size of the
  985|       |                         * array, no null character is required.  So
  986|       |                         * we can't do a strlen.
  987|       |                         *
  988|       |                         * This figures out the length of the string
  989|       |                         * up to the precision.  Once it's long enough
  990|       |                         * for the specified precision, we don't care
  991|       |                         * anymore.
  992|       |                         *
  993|       |                         * NOTE: you must do the length comparison
  994|       |                         * before the check for the null character.
  995|       |                         * Otherwise, you'll check one beyond the
  996|       |                         * last valid character.
  997|       |                         */
  998|      0|                        const char *walk;
  999|       |
 1000|      0|                        for (walk = s, s_len = 0;
 1001|      0|                             (s_len < precision) && (*walk != '\0');
  ------------------
  |  Branch (1001:30): [True: 0, False: 0]
  |  Branch (1001:53): [True: 0, False: 0]
  ------------------
 1002|      0|                             ++walk, ++s_len);
 1003|      0|                    }
 1004|      0|                }
 1005|      0|                else {
 1006|      0|                    s = S_NULL;
  ------------------
  |  |   58|      0|#define S_NULL ((char *)null_string)
  ------------------
 1007|      0|                    s_len = S_NULL_LEN;
  ------------------
  |  |   59|      0|#define S_NULL_LEN 6
  ------------------
 1008|      0|                }
 1009|      0|                pad_char = ' ';
 1010|      0|                break;
 1011|       |
 1012|       |
 1013|      0|            case 'f':
  ------------------
  |  Branch (1013:13): [True: 0, False: 991]
  ------------------
 1014|      0|            case 'e':
  ------------------
  |  Branch (1014:13): [True: 0, False: 991]
  ------------------
 1015|      0|            case 'E':
  ------------------
  |  Branch (1015:13): [True: 0, False: 991]
  ------------------
 1016|      0|                fp_num = va_arg(ap, double);
 1017|       |                /*
 1018|       |                 * We use &num_buf[ 1 ], so that we have room for the sign
 1019|       |                 */
 1020|      0|                s = NULL;
 1021|      0|#ifdef HAVE_ISNAN
 1022|      0|                if (isnan(fp_num)) {
  ------------------
  |  Branch (1022:21): [True: 0, False: 0]
  ------------------
 1023|      0|                    s = "nan";
 1024|      0|                    s_len = 3;
 1025|      0|                }
 1026|      0|#endif
 1027|      0|#ifdef HAVE_ISINF
 1028|      0|                if (!s && isinf(fp_num)) {
  ------------------
  |  Branch (1028:21): [True: 0, False: 0]
  |  Branch (1028:27): [True: 0, False: 0]
  ------------------
 1029|      0|                    s = "inf";
 1030|      0|                    s_len = 3;
 1031|      0|                }
 1032|      0|#endif
 1033|      0|                if (!s) {
  ------------------
  |  Branch (1033:21): [True: 0, False: 0]
  ------------------
 1034|      0|                    s = conv_fp(*fmt, fp_num, alternate_form,
 1035|      0|                                (int)((adjust_precision == NO) ? FLOAT_DIGITS : precision),
  ------------------
  |  |   61|      0|#define FLOAT_DIGITS 6
  ------------------
  |  Branch (1035:39): [True: 0, False: 0]
  ------------------
 1036|      0|                                &is_negative, &num_buf[1], &s_len);
 1037|      0|                    if (is_negative)
  ------------------
  |  Branch (1037:25): [True: 0, False: 0]
  ------------------
 1038|      0|                        prefix_char = '-';
 1039|      0|                    else if (print_sign)
  ------------------
  |  Branch (1039:30): [True: 0, False: 0]
  ------------------
 1040|      0|                        prefix_char = '+';
 1041|      0|                    else if (print_blank)
  ------------------
  |  Branch (1041:30): [True: 0, False: 0]
  ------------------
 1042|      0|                        prefix_char = ' ';
 1043|      0|                }
 1044|      0|                break;
 1045|       |
 1046|       |
 1047|      0|            case 'g':
  ------------------
  |  Branch (1047:13): [True: 0, False: 991]
  ------------------
 1048|      0|            case 'G':
  ------------------
  |  Branch (1048:13): [True: 0, False: 991]
  ------------------
 1049|      0|                if (adjust_precision == NO)
  ------------------
  |  Branch (1049:21): [True: 0, False: 0]
  ------------------
 1050|      0|                    precision = FLOAT_DIGITS;
  ------------------
  |  |   61|      0|#define FLOAT_DIGITS 6
  ------------------
 1051|      0|                else if (precision == 0)
  ------------------
  |  Branch (1051:26): [True: 0, False: 0]
  ------------------
 1052|      0|                    precision = 1;
 1053|       |                /*
 1054|       |                 * * We use &num_buf[ 1 ], so that we have room for the sign
 1055|       |                 */
 1056|      0|                s = apr_gcvt(va_arg(ap, double), (int) precision, &num_buf[1],
 1057|      0|                            alternate_form);
 1058|      0|                if (*s == '-')
  ------------------
  |  Branch (1058:21): [True: 0, False: 0]
  ------------------
 1059|      0|                    prefix_char = *s++;
 1060|      0|                else if (print_sign)
  ------------------
  |  Branch (1060:26): [True: 0, False: 0]
  ------------------
 1061|      0|                    prefix_char = '+';
 1062|      0|                else if (print_blank)
  ------------------
  |  Branch (1062:26): [True: 0, False: 0]
  ------------------
 1063|      0|                    prefix_char = ' ';
 1064|       |
 1065|      0|                s_len = strlen(s);
 1066|       |
 1067|      0|                if (alternate_form && (q = strchr(s, '.')) == NULL) {
  ------------------
  |  Branch (1067:21): [True: 0, False: 0]
  |  Branch (1067:39): [True: 0, False: 0]
  ------------------
 1068|      0|                    s[s_len++] = '.';
 1069|      0|                    s[s_len] = '\0'; /* delimit for following strchr() */
 1070|      0|                }
 1071|      0|                if (*fmt == 'G' && (q = strchr(s, 'e')) != NULL)
  ------------------
  |  Branch (1071:21): [True: 0, False: 0]
  |  Branch (1071:36): [True: 0, False: 0]
  ------------------
 1072|      0|                    *q = 'E';
 1073|      0|                break;
 1074|       |
 1075|       |
 1076|      0|            case 'c':
  ------------------
  |  Branch (1076:13): [True: 0, False: 991]
  ------------------
 1077|      0|                char_buf[0] = (char) (va_arg(ap, int));
 1078|      0|                s = &char_buf[0];
 1079|      0|                s_len = 1;
 1080|      0|                pad_char = ' ';
 1081|      0|                break;
 1082|       |
 1083|       |
 1084|      0|            case '%':
  ------------------
  |  Branch (1084:13): [True: 0, False: 991]
  ------------------
 1085|      0|                char_buf[0] = '%';
 1086|      0|                s = &char_buf[0];
 1087|      0|                s_len = 1;
 1088|      0|                pad_char = ' ';
 1089|      0|                break;
 1090|       |
 1091|       |
 1092|      0|            case 'n':
  ------------------
  |  Branch (1092:13): [True: 0, False: 991]
  ------------------
 1093|      0|                if (var_type == IS_QUAD)
  ------------------
  |  Branch (1093:21): [True: 0, False: 0]
  ------------------
 1094|      0|                    *(va_arg(ap, apr_int64_t *)) = cc;
 1095|      0|                else if (var_type == IS_LONG)
  ------------------
  |  Branch (1095:26): [True: 0, False: 0]
  ------------------
 1096|      0|                    *(va_arg(ap, long *)) = cc;
 1097|      0|                else if (var_type == IS_SHORT)
  ------------------
  |  Branch (1097:26): [True: 0, False: 0]
  ------------------
 1098|      0|                    *(va_arg(ap, short *)) = cc;
 1099|      0|                else
 1100|      0|                    *(va_arg(ap, int *)) = cc;
 1101|      0|                print_something = NO;
 1102|      0|                break;
 1103|       |
 1104|       |                /*
 1105|       |                 * This is where we extend the printf format, with a second
 1106|       |                 * type specifier
 1107|       |                 */
 1108|      0|            case 'p':
  ------------------
  |  Branch (1108:13): [True: 0, False: 991]
  ------------------
 1109|      0|                switch(*++fmt) {
 1110|       |                /*
 1111|       |                 * If the pointer size is equal to or smaller than the size
 1112|       |                 * of the largest unsigned int, we convert the pointer to a
 1113|       |                 * hex number, otherwise we print "%p" to indicate that we
 1114|       |                 * don't handle "%p".
 1115|       |                 */
 1116|      0|                case 'p':
  ------------------
  |  Branch (1116:17): [True: 0, False: 0]
  ------------------
 1117|      0|#if APR_SIZEOF_VOIDP == 8
 1118|      0|                    if (sizeof(void *) <= sizeof(apr_uint64_t)) {
  ------------------
  |  Branch (1118:25): [True: 0, Folded]
  ------------------
 1119|      0|                        ui_quad = (apr_uint64_t) va_arg(ap, void *);
 1120|      0|                        s = conv_p2_quad(ui_quad, 4, 'x',
 1121|      0|                                &num_buf[NUM_BUF_SIZE], &s_len);
  ------------------
  |  |   69|      0|#define NUM_BUF_SIZE 512
  ------------------
 1122|      0|                    }
 1123|       |#else
 1124|       |                    if (sizeof(void *) <= sizeof(apr_uint32_t)) {
 1125|       |                        ui_num = (apr_uint32_t) va_arg(ap, void *);
 1126|       |                        s = conv_p2(ui_num, 4, 'x',
 1127|       |                                &num_buf[NUM_BUF_SIZE], &s_len);
 1128|       |                    }
 1129|       |#endif
 1130|      0|                    else {
 1131|      0|                        s = "%p";
 1132|      0|                        s_len = 2;
 1133|      0|                        prefix_char = NUL;
  ------------------
  |  |   55|      0|#define NUL '\0'
  ------------------
 1134|      0|                    }
 1135|      0|                    pad_char = ' ';
 1136|      0|                    break;
 1137|       |
 1138|       |                /* print an apr_sockaddr_t as a.b.c.d:port */
 1139|      0|                case 'I':
  ------------------
  |  Branch (1139:17): [True: 0, False: 0]
  ------------------
 1140|      0|                {
 1141|      0|                    apr_sockaddr_t *sa;
 1142|       |
 1143|      0|                    sa = va_arg(ap, apr_sockaddr_t *);
 1144|      0|                    if (sa != NULL) {
  ------------------
  |  Branch (1144:25): [True: 0, False: 0]
  ------------------
 1145|      0|                        s = conv_apr_sockaddr(sa, &num_buf[NUM_BUF_SIZE], &s_len);
  ------------------
  |  |   69|      0|#define NUM_BUF_SIZE 512
  ------------------
 1146|      0|                        if (adjust_precision && precision < s_len)
  ------------------
  |  Branch (1146:29): [True: 0, False: 0]
  |  Branch (1146:49): [True: 0, False: 0]
  ------------------
 1147|      0|                            s_len = precision;
 1148|      0|                    }
 1149|      0|                    else {
 1150|      0|                        s = S_NULL;
  ------------------
  |  |   58|      0|#define S_NULL ((char *)null_string)
  ------------------
 1151|      0|                        s_len = S_NULL_LEN;
  ------------------
  |  |   59|      0|#define S_NULL_LEN 6
  ------------------
 1152|      0|                    }
 1153|      0|                    pad_char = ' ';
 1154|      0|                }
 1155|      0|                break;
 1156|       |
 1157|       |                /* print a struct in_addr as a.b.c.d */
 1158|      0|                case 'A':
  ------------------
  |  Branch (1158:17): [True: 0, False: 0]
  ------------------
 1159|      0|                {
 1160|      0|                    struct in_addr *ia;
 1161|       |
 1162|      0|                    ia = va_arg(ap, struct in_addr *);
 1163|      0|                    if (ia != NULL) {
  ------------------
  |  Branch (1163:25): [True: 0, False: 0]
  ------------------
 1164|      0|                        s = conv_in_addr(ia, &num_buf[NUM_BUF_SIZE], &s_len);
  ------------------
  |  |   69|      0|#define NUM_BUF_SIZE 512
  ------------------
 1165|      0|                        if (adjust_precision && precision < s_len)
  ------------------
  |  Branch (1165:29): [True: 0, False: 0]
  |  Branch (1165:49): [True: 0, False: 0]
  ------------------
 1166|      0|                            s_len = precision;
 1167|      0|                    }
 1168|      0|                    else {
 1169|      0|                        s = S_NULL;
  ------------------
  |  |   58|      0|#define S_NULL ((char *)null_string)
  ------------------
 1170|      0|                        s_len = S_NULL_LEN;
  ------------------
  |  |   59|      0|#define S_NULL_LEN 6
  ------------------
 1171|      0|                    }
 1172|      0|                    pad_char = ' ';
 1173|      0|                }
 1174|      0|                break;
 1175|       |
 1176|       |                /* print the error for an apr_status_t */
 1177|      0|                case 'm':
  ------------------
  |  Branch (1177:17): [True: 0, False: 0]
  ------------------
 1178|      0|                {
 1179|      0|                    apr_status_t *mrv;
 1180|       |
 1181|      0|                    mrv = va_arg(ap, apr_status_t *);
 1182|      0|                    if (mrv != NULL) {
  ------------------
  |  Branch (1182:25): [True: 0, False: 0]
  ------------------
 1183|      0|                        s = apr_strerror(*mrv, num_buf, NUM_BUF_SIZE-1);
  ------------------
  |  |   69|      0|#define NUM_BUF_SIZE 512
  ------------------
 1184|      0|                        s_len = strlen(s);
 1185|      0|                    }
 1186|      0|                    else {
 1187|      0|                        s = S_NULL;
  ------------------
  |  |   58|      0|#define S_NULL ((char *)null_string)
  ------------------
 1188|      0|                        s_len = S_NULL_LEN;
  ------------------
  |  |   59|      0|#define S_NULL_LEN 6
  ------------------
 1189|      0|                    }
 1190|      0|                    pad_char = ' ';
 1191|      0|                }
 1192|      0|                break;
 1193|       |
 1194|       |                /* print the tag for an apr_pool_t */
 1195|      0|                case 'g':
  ------------------
  |  Branch (1195:17): [True: 0, False: 0]
  ------------------
 1196|      0|                {
 1197|      0|                    apr_pool_t *prv;
 1198|       |
 1199|      0|                    prv = va_arg(ap, apr_pool_t *);
 1200|      0|                    if (prv != NULL) {
  ------------------
  |  Branch (1200:25): [True: 0, False: 0]
  ------------------
 1201|      0|                        s = (char *)apr_pool_get_tag(prv);
 1202|      0|                        if (!s) s = "(untagged)";
  ------------------
  |  Branch (1202:29): [True: 0, False: 0]
  ------------------
 1203|      0|                        s_len = strlen(s);
 1204|      0|                    }
 1205|      0|                    else {
 1206|      0|                        s = S_NULL;
  ------------------
  |  |   58|      0|#define S_NULL ((char *)null_string)
  ------------------
 1207|      0|                        s_len = S_NULL_LEN;
  ------------------
  |  |   59|      0|#define S_NULL_LEN 6
  ------------------
 1208|      0|                    }
 1209|      0|                    pad_char = ' ';
 1210|      0|                }
 1211|      0|                break;
 1212|       |
 1213|      0|                case 'T':
  ------------------
  |  Branch (1213:17): [True: 0, False: 0]
  ------------------
 1214|      0|#if APR_HAS_THREADS
 1215|      0|                {
 1216|      0|                    apr_os_thread_t *tid;
 1217|       |
 1218|      0|                    tid = va_arg(ap, apr_os_thread_t *);
 1219|      0|                    if (tid != NULL) {
  ------------------
  |  Branch (1219:25): [True: 0, False: 0]
  ------------------
 1220|      0|                        s = conv_os_thread_t(tid, &num_buf[NUM_BUF_SIZE], &s_len);
  ------------------
  |  |   69|      0|#define NUM_BUF_SIZE 512
  ------------------
 1221|      0|                        if (adjust_precision && precision < s_len)
  ------------------
  |  Branch (1221:29): [True: 0, False: 0]
  |  Branch (1221:49): [True: 0, False: 0]
  ------------------
 1222|      0|                            s_len = precision;
 1223|      0|                    }
 1224|      0|                    else {
 1225|      0|                        s = S_NULL;
  ------------------
  |  |   58|      0|#define S_NULL ((char *)null_string)
  ------------------
 1226|      0|                        s_len = S_NULL_LEN;
  ------------------
  |  |   59|      0|#define S_NULL_LEN 6
  ------------------
 1227|      0|                    }
 1228|      0|                    pad_char = ' ';
 1229|      0|                }
 1230|       |#else
 1231|       |                    char_buf[0] = '0';
 1232|       |                    s = &char_buf[0];
 1233|       |                    s_len = 1;
 1234|       |                    pad_char = ' ';
 1235|       |#endif
 1236|      0|                    break;
 1237|       |
 1238|      0|                case 't':
  ------------------
  |  Branch (1238:17): [True: 0, False: 0]
  ------------------
 1239|      0|#if APR_HAS_THREADS
 1240|      0|                {
 1241|      0|                    apr_os_thread_t *tid;
 1242|       |
 1243|      0|                    tid = va_arg(ap, apr_os_thread_t *);
 1244|      0|                    if (tid != NULL) {
  ------------------
  |  Branch (1244:25): [True: 0, False: 0]
  ------------------
 1245|      0|                        s = conv_os_thread_t_hex(tid, &num_buf[NUM_BUF_SIZE], &s_len);
  ------------------
  |  |   69|      0|#define NUM_BUF_SIZE 512
  ------------------
 1246|      0|                        if (adjust_precision && precision < s_len)
  ------------------
  |  Branch (1246:29): [True: 0, False: 0]
  |  Branch (1246:49): [True: 0, False: 0]
  ------------------
 1247|      0|                            s_len = precision;
 1248|      0|                    }
 1249|      0|                    else {
 1250|      0|                        s = S_NULL;
  ------------------
  |  |   58|      0|#define S_NULL ((char *)null_string)
  ------------------
 1251|      0|                        s_len = S_NULL_LEN;
  ------------------
  |  |   59|      0|#define S_NULL_LEN 6
  ------------------
 1252|      0|                    }
 1253|      0|                    pad_char = ' ';
 1254|      0|                }
 1255|       |#else
 1256|       |                    char_buf[0] = '0';
 1257|       |                    s = &char_buf[0];
 1258|       |                    s_len = 1;
 1259|       |                    pad_char = ' ';
 1260|       |#endif
 1261|      0|                    break;
 1262|       |
 1263|      0|                case 'B':
  ------------------
  |  Branch (1263:17): [True: 0, False: 0]
  ------------------
 1264|      0|                case 'F':
  ------------------
  |  Branch (1264:17): [True: 0, False: 0]
  ------------------
 1265|      0|                case 'S':
  ------------------
  |  Branch (1265:17): [True: 0, False: 0]
  ------------------
 1266|      0|                {
 1267|      0|                    char buf[5];
 1268|      0|                    apr_off_t size = 0;
 1269|       |
 1270|      0|                    if (*fmt == 'B') {
  ------------------
  |  Branch (1270:25): [True: 0, False: 0]
  ------------------
 1271|      0|                        apr_uint32_t *arg = va_arg(ap, apr_uint32_t *);
 1272|      0|                        size = (arg) ? *arg : 0;
  ------------------
  |  Branch (1272:32): [True: 0, False: 0]
  ------------------
 1273|      0|                    }
 1274|      0|                    else if (*fmt == 'F') {
  ------------------
  |  Branch (1274:30): [True: 0, False: 0]
  ------------------
 1275|      0|                        apr_off_t *arg = va_arg(ap, apr_off_t *);
 1276|      0|                        size = (arg) ? *arg : 0;
  ------------------
  |  Branch (1276:32): [True: 0, False: 0]
  ------------------
 1277|      0|                    }
 1278|      0|                    else {
 1279|      0|                        apr_size_t *arg = va_arg(ap, apr_size_t *);
 1280|      0|                        size = (arg) ? *arg : 0;
  ------------------
  |  Branch (1280:32): [True: 0, False: 0]
  ------------------
 1281|      0|                    }
 1282|       |
 1283|      0|                    s = apr_strfsize(size, buf);
 1284|      0|                    s_len = strlen(s);
 1285|      0|                    pad_char = ' ';
 1286|      0|                }
 1287|      0|                break;
 1288|       |
 1289|      0|                case NUL:
  ------------------
  |  |   55|      0|#define NUL '\0'
  ------------------
  |  Branch (1289:17): [True: 0, False: 0]
  ------------------
 1290|       |                    /* if %p ends the string, oh well ignore it */
 1291|      0|                    continue;
 1292|       |
 1293|      0|                default:
  ------------------
  |  Branch (1293:17): [True: 0, False: 0]
  ------------------
 1294|      0|                    s = "bogus %p";
 1295|      0|                    s_len = 8;
 1296|      0|                    prefix_char = NUL;
  ------------------
  |  |   55|      0|#define NUL '\0'
  ------------------
 1297|      0|                    (void)va_arg(ap, void *); /* skip the bogus argument on the stack */
 1298|      0|                    break;
 1299|      0|                }
 1300|      0|                break;
 1301|       |
 1302|      0|            case NUL:
  ------------------
  |  |   55|      0|#define NUL '\0'
  ------------------
  |  Branch (1302:13): [True: 0, False: 991]
  ------------------
 1303|       |                /*
 1304|       |                 * The last character of the format string was %.
 1305|       |                 * We ignore it.
 1306|       |                 */
 1307|      0|                continue;
 1308|       |
 1309|       |
 1310|       |                /*
 1311|       |                 * The default case is for unrecognized %'s.
 1312|       |                 * We print %<char> to help the user identify what
 1313|       |                 * option is not understood.
 1314|       |                 * This is also useful in case the user wants to pass
 1315|       |                 * the output of format_converter to another function
 1316|       |                 * that understands some other %<char> (like syslog).
 1317|       |                 * Note that we can't point s inside fmt because the
 1318|       |                 * unknown <char> could be preceded by width etc.
 1319|       |                 */
 1320|      0|            default:
  ------------------
  |  Branch (1320:13): [True: 0, False: 991]
  ------------------
 1321|      0|                char_buf[0] = '%';
 1322|      0|                char_buf[1] = *fmt;
 1323|      0|                s = char_buf;
 1324|      0|                s_len = 2;
 1325|      0|                pad_char = ' ';
 1326|      0|                break;
 1327|    991|            }
 1328|       |
 1329|    991|            if (prefix_char != NUL && s != S_NULL && s != char_buf) {
  ------------------
  |  |   55|  1.98k|#define NUL '\0'
  ------------------
                          if (prefix_char != NUL && s != S_NULL && s != char_buf) {
  ------------------
  |  |   58|    991|#define S_NULL ((char *)null_string)
  ------------------
  |  Branch (1329:17): [True: 0, False: 991]
  |  Branch (1329:39): [True: 0, False: 0]
  |  Branch (1329:54): [True: 0, False: 0]
  ------------------
 1330|      0|                *--s = prefix_char;
 1331|      0|                s_len++;
 1332|      0|            }
 1333|       |
 1334|    991|            if (adjust_width && adjust == RIGHT && min_width > s_len) {
  ------------------
  |  Branch (1334:17): [True: 0, False: 991]
  |  Branch (1334:33): [True: 0, False: 0]
  |  Branch (1334:52): [True: 0, False: 0]
  ------------------
 1335|      0|                if (pad_char == '0' && prefix_char != NUL) {
  ------------------
  |  |   55|      0|#define NUL '\0'
  ------------------
  |  Branch (1335:21): [True: 0, False: 0]
  |  Branch (1335:40): [True: 0, False: 0]
  ------------------
 1336|      0|                    INS_CHAR(*s, sp, bep, cc);
  ------------------
  |  |  244|      0|#define INS_CHAR(c, sp, bep, cc)                    \
  |  |  245|      0|{                                                   \
  |  |  246|      0|    if (sp) {                                       \
  |  |  ------------------
  |  |  |  Branch (246:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  247|      0|        if (sp >= bep) {                            \
  |  |  ------------------
  |  |  |  Branch (247:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  248|      0|            vbuff->curpos = sp;                     \
  |  |  249|      0|            if (flush_func(vbuff))                  \
  |  |  ------------------
  |  |  |  Branch (249:17): [True: 0, False: 0]
  |  |  ------------------
  |  |  250|      0|                return -1;                          \
  |  |  251|      0|            sp = vbuff->curpos;                     \
  |  |  252|      0|            bep = vbuff->endpos;                    \
  |  |  253|      0|        }                                           \
  |  |  254|      0|        *sp++ = (c);                                \
  |  |  255|      0|    }                                               \
  |  |  256|      0|    cc++;                                           \
  |  |  257|      0|}
  ------------------
 1337|      0|                    s++;
 1338|      0|                    s_len--;
 1339|      0|                    min_width--;
 1340|      0|                }
 1341|      0|                PAD(min_width, s_len, pad_char);
  ------------------
  |  |  294|      0|#define PAD(width, len, ch)                         \
  |  |  295|      0|do                                                  \
  |  |  296|      0|{                                                   \
  |  |  297|      0|    INS_CHAR(ch, sp, bep, cc);                      \
  |  |  ------------------
  |  |  |  |  244|      0|#define INS_CHAR(c, sp, bep, cc)                    \
  |  |  |  |  245|      0|{                                                   \
  |  |  |  |  246|      0|    if (sp) {                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (246:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  247|      0|        if (sp >= bep) {                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (247:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  248|      0|            vbuff->curpos = sp;                     \
  |  |  |  |  249|      0|            if (flush_func(vbuff))                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (249:17): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  250|      0|                return -1;                          \
  |  |  |  |  251|      0|            sp = vbuff->curpos;                     \
  |  |  |  |  252|      0|            bep = vbuff->endpos;                    \
  |  |  |  |  253|      0|        }                                           \
  |  |  |  |  254|      0|        *sp++ = (c);                                \
  |  |  |  |  255|      0|    }                                               \
  |  |  |  |  256|      0|    cc++;                                           \
  |  |  |  |  257|      0|}
  |  |  ------------------
  |  |  298|      0|    width--;                                        \
  |  |  299|      0|}                                                   \
  |  |  300|      0|while (width > len)
  |  |  ------------------
  |  |  |  Branch (300:8): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1342|      0|            }
 1343|       |
 1344|       |            /*
 1345|       |             * Print the string s.
 1346|       |             */
 1347|    991|            if (print_something == YES) {
  ------------------
  |  Branch (1347:17): [True: 991, False: 0]
  ------------------
 1348|  2.97k|                for (i = s_len; i != 0; i--) {
  ------------------
  |  Branch (1348:33): [True: 1.98k, False: 991]
  ------------------
 1349|  1.98k|                    INS_CHAR(*s, sp, bep, cc);
  ------------------
  |  |  244|  1.98k|#define INS_CHAR(c, sp, bep, cc)                    \
  |  |  245|  1.98k|{                                                   \
  |  |  246|  1.98k|    if (sp) {                                       \
  |  |  ------------------
  |  |  |  Branch (246:9): [True: 1.98k, False: 0]
  |  |  ------------------
  |  |  247|  1.98k|        if (sp >= bep) {                            \
  |  |  ------------------
  |  |  |  Branch (247:13): [True: 0, False: 1.98k]
  |  |  ------------------
  |  |  248|      0|            vbuff->curpos = sp;                     \
  |  |  249|      0|            if (flush_func(vbuff))                  \
  |  |  ------------------
  |  |  |  Branch (249:17): [True: 0, False: 0]
  |  |  ------------------
  |  |  250|      0|                return -1;                          \
  |  |  251|      0|            sp = vbuff->curpos;                     \
  |  |  252|      0|            bep = vbuff->endpos;                    \
  |  |  253|      0|        }                                           \
  |  |  254|  1.98k|        *sp++ = (c);                                \
  |  |  255|  1.98k|    }                                               \
  |  |  256|  1.98k|    cc++;                                           \
  |  |  257|  1.98k|}
  ------------------
 1350|  1.98k|                    s++;
 1351|  1.98k|                }
 1352|    991|            }
 1353|       |
 1354|    991|            if (adjust_width && adjust == LEFT && min_width > s_len)
  ------------------
  |  Branch (1354:17): [True: 0, False: 991]
  |  Branch (1354:33): [True: 0, False: 0]
  |  Branch (1354:51): [True: 0, False: 0]
  ------------------
 1355|      0|                PAD(min_width, s_len, pad_char);
  ------------------
  |  |  294|      0|#define PAD(width, len, ch)                         \
  |  |  295|      0|do                                                  \
  |  |  296|      0|{                                                   \
  |  |  297|      0|    INS_CHAR(ch, sp, bep, cc);                      \
  |  |  ------------------
  |  |  |  |  244|      0|#define INS_CHAR(c, sp, bep, cc)                    \
  |  |  |  |  245|      0|{                                                   \
  |  |  |  |  246|      0|    if (sp) {                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (246:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  247|      0|        if (sp >= bep) {                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (247:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  248|      0|            vbuff->curpos = sp;                     \
  |  |  |  |  249|      0|            if (flush_func(vbuff))                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (249:17): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  250|      0|                return -1;                          \
  |  |  |  |  251|      0|            sp = vbuff->curpos;                     \
  |  |  |  |  252|      0|            bep = vbuff->endpos;                    \
  |  |  |  |  253|      0|        }                                           \
  |  |  |  |  254|      0|        *sp++ = (c);                                \
  |  |  |  |  255|      0|    }                                               \
  |  |  |  |  256|      0|    cc++;                                           \
  |  |  |  |  257|      0|}
  |  |  ------------------
  |  |  298|      0|    width--;                                        \
  |  |  299|      0|}                                                   \
  |  |  300|      0|while (width > len)
  |  |  ------------------
  |  |  |  Branch (300:8): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1356|    991|        }
 1357|  34.6k|        fmt++;
 1358|  34.6k|    }
 1359|    991|    vbuff->curpos = sp;
 1360|       |
 1361|    991|    return cc;
 1362|    991|}
apr_snprintf.c:conv_p2:
  617|    991|{
  618|    991|    register int mask = (1 << nbits) - 1;
  619|    991|    register char *p = buf_end;
  620|    991|    static const char low_digits[] = "0123456789abcdef";
  621|    991|    static const char upper_digits[] = "0123456789ABCDEF";
  622|    991|    register const char *digits = (format == 'X') ? upper_digits : low_digits;
  ------------------
  |  Branch (622:35): [True: 0, False: 991]
  ------------------
  623|       |
  624|  1.81k|    do {
  625|  1.81k|        *--p = digits[num & mask];
  626|  1.81k|        num >>= nbits;
  627|  1.81k|    }
  628|  1.81k|    while (num);
  ------------------
  |  Branch (628:12): [True: 819, False: 991]
  ------------------
  629|       |
  630|    991|    *len = buf_end - p;
  631|    991|    return (p);
  632|    991|}

apr_pstrdup:
   73|  4.73k|{
   74|  4.73k|    char *res;
   75|  4.73k|    apr_size_t len;
   76|       |
   77|  4.73k|    if (s == NULL) {
  ------------------
  |  Branch (77:9): [True: 0, False: 4.73k]
  ------------------
   78|      0|        return NULL;
   79|      0|    }
   80|  4.73k|    len = strlen(s) + 1;
   81|  4.73k|    res = apr_pmemdup(a, s, len);
   82|  4.73k|    return res;
   83|  4.73k|}
apr_pstrmemdup:
  103|  4.47k|{
  104|  4.47k|    char *res;
  105|       |
  106|  4.47k|    if (s == NULL) {
  ------------------
  |  Branch (106:9): [True: 0, False: 4.47k]
  ------------------
  107|      0|        return NULL;
  108|      0|    }
  109|  4.47k|    res = apr_palloc(a, n + 1);
  ------------------
  |  |  425|  4.47k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  4.47k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  4.47k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  4.47k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  110|  4.47k|    memcpy(res, s, n);
  111|  4.47k|    res[n] = '\0';
  112|  4.47k|    return res;
  113|  4.47k|}
apr_pmemdup:
  116|  4.95k|{
  117|  4.95k|    void *res;
  118|       |
  119|  4.95k|    if (m == NULL)
  ------------------
  |  Branch (119:9): [True: 0, False: 4.95k]
  ------------------
  120|      0|	return NULL;
  121|  4.95k|    res = apr_palloc(a, n);
  ------------------
  |  |  425|  4.95k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  4.95k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  4.95k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  4.95k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  122|  4.95k|    memcpy(res, m, n);
  123|  4.95k|    return res;
  124|  4.95k|}
apr_strtoi64:
  395|  1.23k|{
  396|  1.23k|#ifdef APR_INT64_STRFN
  397|  1.23k|    errno = 0;
  398|  1.23k|    return APR_INT64_STRFN(nptr, endptr, base);
  ------------------
  |  |   31|  1.23k|#define APR_INT64_STRFN strtol
  ------------------
  399|       |#else
  400|       |    const char *s;
  401|       |    apr_int64_t acc;
  402|       |    apr_int64_t val;
  403|       |    int neg, any;
  404|       |    char c;
  405|       |
  406|       |    errno = 0;
  407|       |    /*
  408|       |     * Skip white space and pick up leading +/- sign if any.
  409|       |     * If base is 0, allow 0x for hex and 0 for octal, else
  410|       |     * assume decimal; if base is already 16, allow 0x.
  411|       |     */
  412|       |    s = nptr;
  413|       |    do {
  414|       |	c = *s++;
  415|       |    } while (apr_isspace(c));
  416|       |    if (c == '-') {
  417|       |	neg = 1;
  418|       |	c = *s++;
  419|       |    } else {
  420|       |	neg = 0;
  421|       |	if (c == '+')
  422|       |	    c = *s++;
  423|       |    }
  424|       |    if ((base == 0 || base == 16) &&
  425|       |	c == '0' && (*s == 'x' || *s == 'X')) {
  426|       |	    c = s[1];
  427|       |	    s += 2;
  428|       |	    base = 16;
  429|       |    }
  430|       |    if (base == 0)
  431|       |	base = c == '0' ? 8 : 10;
  432|       |    acc = any = 0;
  433|       |    if (base < 2 || base > 36) {
  434|       |	errno = EINVAL;
  435|       |        if (endptr != NULL)
  436|       |	    *endptr = (char *)(any ? s - 1 : nptr);
  437|       |        return acc;
  438|       |    }
  439|       |
  440|       |    /* The classic bsd implementation requires div/mod operators
  441|       |     * to compute a cutoff.  Benchmarking proves that is very, very
  442|       |     * evil to some 32 bit processors.  Instead, look for underflow
  443|       |     * in both the mult and add/sub operation.  Unlike the bsd impl,
  444|       |     * we also work strictly in a signed int64 word as we haven't
  445|       |     * implemented the unsigned type in win32.
  446|       |     *
  447|       |     * Set 'any' if any `digits' consumed; make it negative to indicate
  448|       |     * overflow.
  449|       |     */
  450|       |    val = 0;
  451|       |    for ( ; ; c = *s++) {
  452|       |        if (c >= '0' && c <= '9')
  453|       |	    c -= '0';
  454|       |#if (('Z' - 'A') == 25)
  455|       |	else if (c >= 'A' && c <= 'Z')
  456|       |	    c -= 'A' - 10;
  457|       |	else if (c >= 'a' && c <= 'z')
  458|       |	    c -= 'a' - 10;
  459|       |#elif APR_CHARSET_EBCDIC
  460|       |	else if (c >= 'A' && c <= 'I')
  461|       |	    c -= 'A' - 10;
  462|       |	else if (c >= 'J' && c <= 'R')
  463|       |	    c -= 'J' - 19;
  464|       |	else if (c >= 'S' && c <= 'Z')
  465|       |	    c -= 'S' - 28;
  466|       |	else if (c >= 'a' && c <= 'i')
  467|       |	    c -= 'a' - 10;
  468|       |	else if (c >= 'j' && c <= 'r')
  469|       |	    c -= 'j' - 19;
  470|       |	else if (c >= 's' && c <= 'z')
  471|       |	    c -= 'z' - 28;
  472|       |#else
  473|       |#error "CANNOT COMPILE apr_strtoi64(), only ASCII and EBCDIC supported"
  474|       |#endif
  475|       |	else
  476|       |	    break;
  477|       |	if (c >= base)
  478|       |	    break;
  479|       |	val *= base;
  480|       |        if ( (any < 0)	/* already noted an over/under flow - short circuit */
  481|       |           || (neg && (val > acc || (val -= c) > acc)) /* underflow */
  482|       |           || (!neg && (val < acc || (val += c) < acc))) {       /* overflow */
  483|       |            any = -1;	/* once noted, over/underflows never go away */
  484|       |#ifdef APR_STRTOI64_OVERFLOW_IS_BAD_CHAR
  485|       |            break;
  486|       |#endif
  487|       |        } else {
  488|       |            acc = val;
  489|       |	    any = 1;
  490|       |        }
  491|       |    }
  492|       |
  493|       |    if (any < 0) {
  494|       |	acc = neg ? INT64_MIN : INT64_MAX;
  495|       |	errno = ERANGE;
  496|       |    } else if (!any) {
  497|       |	errno = EINVAL;
  498|       |    }
  499|       |    if (endptr != NULL)
  500|       |	*endptr = (char *)(any ? s - 1 : nptr);
  501|       |    return (acc);
  502|       |#endif
  503|  1.23k|}

apr_array_make:
   89|    270|{
   90|    270|    apr_array_header_t *res;
   91|       |
   92|    270|    res = (apr_array_header_t *) apr_palloc(p, sizeof(apr_array_header_t));
  ------------------
  |  |  425|    270|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|    270|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|    270|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|    270|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   93|    270|    make_array_core(res, p, nelts, elt_size, 1);
   94|    270|    return res;
   95|    270|}
apr_array_push:
  112|    872|{
  113|    872|    if (arr->nelts == arr->nalloc) {
  ------------------
  |  Branch (113:9): [True: 74, False: 798]
  ------------------
  114|     74|        int new_size = (arr->nalloc <= 0) ? 1 : arr->nalloc * 2;
  ------------------
  |  Branch (114:24): [True: 0, False: 74]
  ------------------
  115|     74|        char *new_data;
  116|       |
  117|     74|        new_data = apr_palloc(arr->pool, arr->elt_size * new_size);
  ------------------
  |  |  425|     74|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|     74|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|     74|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|     74|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  118|       |
  119|     74|        memcpy(new_data, arr->elts, arr->nalloc * arr->elt_size);
  120|     74|        memset(new_data + arr->nalloc * arr->elt_size, 0,
  121|     74|               arr->elt_size * (new_size - arr->nalloc));
  122|     74|        arr->elts = new_data;
  123|     74|        arr->nalloc = new_size;
  124|     74|    }
  125|       |
  126|    872|    ++arr->nelts;
  127|    872|    return arr->elts + (arr->elt_size * (arr->nelts - 1));
  128|    872|}
apr_tables.c:make_array_core:
   60|    270|{
   61|       |    /*
   62|       |     * Assure sanity if someone asks for
   63|       |     * array of zero elts.
   64|       |     */
   65|    270|    if (nelts < 1) {
  ------------------
  |  Branch (65:9): [True: 0, False: 270]
  ------------------
   66|      0|        nelts = 1;
   67|      0|    }
   68|       |
   69|    270|    if (clear) {
  ------------------
  |  Branch (69:9): [True: 270, False: 0]
  ------------------
   70|    270|        res->elts = apr_pcalloc(p, nelts * elt_size);
  ------------------
  |  |  454|    270|    apr_pcalloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|    270|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|    270|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|    270|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   71|    270|    }
   72|      0|    else {
   73|      0|        res->elts = apr_palloc(p, nelts * elt_size);
  ------------------
  |  |  425|      0|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|      0|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|      0|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|      0|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   74|      0|    }
   75|       |
   76|    270|    res->pool = p;
   77|    270|    res->elt_size = elt_size;
   78|    270|    res->nelts = 0;		/* No active elements yet... */
   79|    270|    res->nalloc = nelts;	/* ...but this many allocated */
   80|    270|}

apr_os_thread_current:
  340|  2.46k|{
  341|  2.46k|    return pthread_self();
  342|  2.46k|}

apr_time_ansi_put:
   58|  3.69k|{
   59|  3.69k|    *result = (apr_time_t)input * APR_USEC_PER_SEC;
  ------------------
  |  |   60|  3.69k|#define APR_USEC_PER_SEC APR_TIME_C(1000000)
  |  |  ------------------
  |  |  |  |   49|  3.69k|#define APR_TIME_C(val) APR_INT64_C(val)
  |  |  |  |  ------------------
  |  |  |  |  |  |  394|  3.69k| #define APR_INT64_C(val) INT64_C(val)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   60|  3.69k|    return APR_SUCCESS;
  ------------------
  |  |  225|  3.69k|#define APR_SUCCESS 0
  ------------------
   61|  3.69k|}

