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

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

ap_field_noparam:
   94|  1.11k|{
   95|  1.11k|    const char *semi;
   96|       |
   97|  1.11k|    if (intype == NULL) return NULL;
  ------------------
  |  Branch (97:9): [True: 0, False: 1.11k]
  ------------------
   98|       |
   99|  1.11k|    semi = ap_strchr_c(intype, ';');
  ------------------
  |  | 2587|  1.11k|# define ap_strchr_c(s, c)   strchr(s, c)
  ------------------
  100|  1.11k|    if (semi == NULL) {
  ------------------
  |  Branch (100:9): [True: 1.02k, False: 92]
  ------------------
  101|  1.02k|        return apr_pstrdup(p, intype);
  102|  1.02k|    }
  103|     92|    else {
  104|    238|        while ((semi > intype) && apr_isspace(semi[-1])) {
  ------------------
  |  |  228|    230|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (228:24): [True: 146, False: 84]
  |  |  ------------------
  ------------------
  |  Branch (104:16): [True: 230, False: 8]
  ------------------
  105|    146|            semi--;
  106|    146|        }
  107|     92|        return apr_pstrmemdup(p, intype, semi - intype);
  108|     92|    }
  109|  1.11k|}
ap_strcmp_match:
  178|  4.69k|{
  179|  4.69k|    apr_size_t x, y;
  180|       |
  181|  6.73k|    for (x = 0, y = 0; expected[y]; ++y, ++x) {
  ------------------
  |  Branch (181:24): [True: 6.37k, False: 357]
  ------------------
  182|  6.37k|        if (expected[y] == '*') {
  ------------------
  |  Branch (182:13): [True: 459, False: 5.91k]
  ------------------
  183|    624|            while (expected[++y] == '*');
  ------------------
  |  Branch (183:20): [True: 165, False: 459]
  ------------------
  184|    459|            if (!expected[y])
  ------------------
  |  Branch (184:17): [True: 3, False: 456]
  ------------------
  185|      3|                return 0;
  186|  3.63k|            while (str[x]) {
  ------------------
  |  Branch (186:20): [True: 3.57k, False: 53]
  ------------------
  187|  3.57k|                int ret;
  188|  3.57k|                if ((ret = ap_strcmp_match(&str[x++], &expected[y])) != 1)
  ------------------
  |  Branch (188:21): [True: 403, False: 3.17k]
  ------------------
  189|    403|                    return ret;
  190|  3.57k|            }
  191|     53|            return -1;
  192|    456|        }
  193|  5.91k|        else if (!str[x])
  ------------------
  |  Branch (193:18): [True: 18, False: 5.89k]
  ------------------
  194|     18|            return -1;
  195|  5.89k|        else if ((expected[y] != '?') && (str[x] != expected[y]))
  ------------------
  |  Branch (195:18): [True: 5.40k, False: 495]
  |  Branch (195:42): [True: 3.85k, False: 1.54k]
  ------------------
  196|  3.85k|            return 1;
  197|  6.37k|    }
  198|    357|    return (str[x] != '\0');
  199|  4.69k|}
ap_strcasecmp_match:
  202|  4.69k|{
  203|  4.69k|    apr_size_t x, y;
  204|       |
  205|  6.73k|    for (x = 0, y = 0; expected[y]; ++y, ++x) {
  ------------------
  |  Branch (205:24): [True: 6.37k, False: 357]
  ------------------
  206|  6.37k|        if (!str[x] && expected[y] != '*')
  ------------------
  |  Branch (206:13): [True: 23, False: 6.35k]
  |  Branch (206:24): [True: 18, False: 5]
  ------------------
  207|     18|            return -1;
  208|  6.35k|        if (expected[y] == '*') {
  ------------------
  |  Branch (208:13): [True: 459, False: 5.89k]
  ------------------
  209|    624|            while (expected[++y] == '*');
  ------------------
  |  Branch (209:20): [True: 165, False: 459]
  ------------------
  210|    459|            if (!expected[y])
  ------------------
  |  Branch (210:17): [True: 3, False: 456]
  ------------------
  211|      3|                return 0;
  212|  3.63k|            while (str[x]) {
  ------------------
  |  Branch (212:20): [True: 3.57k, False: 53]
  ------------------
  213|  3.57k|                int ret;
  214|  3.57k|                if ((ret = ap_strcasecmp_match(&str[x++], &expected[y])) != 1)
  ------------------
  |  Branch (214:21): [True: 403, False: 3.17k]
  ------------------
  215|    403|                    return ret;
  216|  3.57k|            }
  217|     53|            return -1;
  218|    456|        }
  219|  5.89k|        else if (expected[y] != '?'
  ------------------
  |  Branch (219:18): [True: 5.40k, False: 495]
  ------------------
  220|  5.40k|                 && apr_tolower(str[x]) != apr_tolower(expected[y]))
  ------------------
  |  |  234|  5.40k|#define apr_tolower(c) (tolower(((unsigned char)(c))))
  ------------------
                               && apr_tolower(str[x]) != apr_tolower(expected[y]))
  ------------------
  |  |  234|  5.40k|#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.40k]
  |  Branch (220:21): [True: 3.85k, False: 1.54k]
  |  Branch (220:44): [True: 0, False: 0]
  |  Branch (220:44): [True: 0, False: 0]
  |  Branch (220:44): [Folded, False: 5.40k]
  ------------------
  221|  3.85k|            return 1;
  222|  6.35k|    }
  223|    357|    return (str[x] != '\0');
  224|  4.69k|}
ap_strcasestr:
  292|  1.11k|{
  293|  1.11k|    char *p1, *p2;
  294|  1.11k|    if (*s2 == '\0') {
  ------------------
  |  Branch (294:9): [True: 156, False: 959]
  ------------------
  295|       |        /* an empty s2 */
  296|    156|        return((char *)s1);
  297|    156|    }
  298|  8.91k|    while(1) {
  ------------------
  |  Branch (298:11): [True: 8.91k, Folded]
  ------------------
  299|  44.4k|        for ( ; (*s1 != '\0') && (apr_tolower(*s1) != apr_tolower(*s2)); s1++);
  ------------------
  |  |  234|  43.5k|#define apr_tolower(c) (tolower(((unsigned char)(c))))
  ------------------
                      for ( ; (*s1 != '\0') && (apr_tolower(*s1) != apr_tolower(*s2)); s1++);
  ------------------
  |  |  234|  43.5k|#define apr_tolower(c) (tolower(((unsigned char)(c))))
  ------------------
  |  Branch (299:17): [True: 43.5k, False: 925]
  |  Branch (299:34): [True: 35.5k, False: 7.98k]
  |  Branch (299:35): [True: 0, False: 0]
  |  Branch (299:35): [True: 0, False: 0]
  |  Branch (299:35): [Folded, False: 43.5k]
  |  Branch (299:55): [True: 0, False: 0]
  |  Branch (299:55): [True: 0, False: 0]
  |  Branch (299:55): [Folded, False: 43.5k]
  ------------------
  300|  8.91k|        if (*s1 == '\0') {
  ------------------
  |  Branch (300:13): [True: 925, False: 7.98k]
  ------------------
  301|    925|            return(NULL);
  302|    925|        }
  303|       |        /* found first character of s2, see if the rest matches */
  304|  7.98k|        p1 = (char *)s1;
  305|  7.98k|        p2 = (char *)s2;
  306|  43.5k|        for (++p1, ++p2; apr_tolower(*p1) == apr_tolower(*p2); ++p1, ++p2) {
  ------------------
  |  |  234|  43.5k|#define apr_tolower(c) (tolower(((unsigned char)(c))))
  ------------------
                      for (++p1, ++p2; apr_tolower(*p1) == apr_tolower(*p2); ++p1, ++p2) {
  ------------------
  |  |  234|  43.5k|#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: 43.5k]
  |  Branch (306:26): [True: 35.6k, False: 7.97k]
  |  Branch (306:46): [True: 0, False: 0]
  |  Branch (306:46): [True: 0, False: 0]
  |  Branch (306:46): [Folded, False: 43.5k]
  ------------------
  307|  35.6k|            if (*p1 == '\0') {
  ------------------
  |  Branch (307:17): [True: 11, False: 35.6k]
  ------------------
  308|       |                /* both strings ended together */
  309|     11|                return((char *)s1);
  310|     11|            }
  311|  35.6k|        }
  312|  7.97k|        if (*p2 == '\0') {
  ------------------
  |  Branch (312:13): [True: 23, False: 7.95k]
  ------------------
  313|       |            /* second string ended, a match */
  314|     23|            break;
  315|     23|        }
  316|       |        /* didn't find a match here, try starting at next character in s1 */
  317|  7.95k|        s1++;
  318|  7.95k|    }
  319|     23|    return((char *)s1);
  320|    959|}
ap_normalize_path:
  492|    388|{
  493|    388|    int ret = 1;
  494|    388|    apr_size_t l = 1, w = 1, n;
  495|    388|    int decode_unreserved = (flags & AP_NORMALIZE_DECODE_UNRESERVED) != 0;
  ------------------
  |  | 1876|    388|#define AP_NORMALIZE_DECODE_UNRESERVED  (1u <<  2)
  ------------------
  496|    388|    int merge_slashes = (flags & AP_NORMALIZE_MERGE_SLASHES) != 0;
  ------------------
  |  | 1877|    388|#define AP_NORMALIZE_MERGE_SLASHES      (1u <<  3)
  ------------------
  497|       |
  498|    388|    if (!AP_IS_SLASH(path[0])) {
  ------------------
  |  | 2957|    388|#define AP_IS_SLASH(s) (s == '/')
  ------------------
  |  Branch (498:9): [True: 373, False: 15]
  ------------------
  499|       |        /* Besides "OPTIONS *", a request-target should start with '/'
  500|       |         * per RFC 7230 section 5.3, so anything else is invalid.
  501|       |         */
  502|    373|        if (path[0] == '*' && path[1] == '\0') {
  ------------------
  |  Branch (502:13): [True: 14, False: 359]
  |  Branch (502:31): [True: 1, False: 13]
  ------------------
  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|    372|        if (!(flags & AP_NORMALIZE_ALLOW_RELATIVE) || path[0] == '\0') {
  ------------------
  |  | 1874|    372|#define AP_NORMALIZE_ALLOW_RELATIVE     (1u <<  0)
  ------------------
  |  Branch (508:13): [True: 0, False: 372]
  |  Branch (508:55): [True: 58, False: 314]
  ------------------
  509|     58|            return 0;
  510|     58|        }
  511|       |
  512|    314|        l = w = 0;
  513|    314|    }
  514|       |
  515|  14.7k|    while (path[l] != '\0') {
  ------------------
  |  Branch (515:12): [True: 14.4k, False: 329]
  ------------------
  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|  14.4k|        if (decode_unreserved && path[l] == '%') {
  ------------------
  |  Branch (523:13): [True: 0, False: 14.4k]
  |  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|  14.4k|        if (w == 0 || AP_IS_SLASH(path[w - 1])) {
  ------------------
  |  | 2957|  13.9k|#define AP_IS_SLASH(s) (s == '/')
  |  |  ------------------
  |  |  |  Branch (2957:24): [True: 621, False: 13.3k]
  |  |  ------------------
  ------------------
  |  Branch (539:13): [True: 483, False: 13.9k]
  ------------------
  540|       |            /* Collapse ///// sequences to / */
  541|  1.10k|            if (merge_slashes && AP_IS_SLASH(path[l])) {
  ------------------
  |  | 2957|      0|#define AP_IS_SLASH(s) (s == '/')
  |  |  ------------------
  |  |  |  Branch (2957:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (541:17): [True: 0, False: 1.10k]
  ------------------
  542|      0|                do {
  543|      0|                    l++;
  544|      0|                } while (AP_IS_SLASH(path[l]));
  ------------------
  |  | 2957|      0|#define AP_IS_SLASH(s) (s == '/')
  |  |  ------------------
  |  |  |  Branch (2957:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  545|      0|                continue;
  546|      0|            }
  547|       |
  548|  1.10k|            if (path[l] == '.') {
  ------------------
  |  Branch (548:17): [True: 447, False: 657]
  ------------------
  549|       |                /* Remove /./ segments */
  550|    447|                if (IS_SLASH_OR_NUL(path[l + 1])) {
  ------------------
  |  |  486|    447|#define IS_SLASH_OR_NUL(s) (s == '\0' || AP_IS_SLASH(s))
  |  |  ------------------
  |  |  |  | 2957|    442|#define AP_IS_SLASH(s) (s == '/')
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2957:24): [True: 132, False: 310]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (486:29): [True: 5, False: 442]
  |  |  ------------------
  ------------------
  551|    137|                    l++;
  552|    137|                    if (path[l]) {
  ------------------
  |  Branch (552:25): [True: 132, False: 5]
  ------------------
  553|    132|                        l++;
  554|    132|                    }
  555|    137|                    continue;
  556|    137|                }
  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|    310|                n = l + 1;
  563|    310|                if ((path[n] == '.' || (decode_unreserved
  ------------------
  |  Branch (563:22): [True: 229, False: 81]
  |  Branch (563:41): [True: 0, False: 81]
  ------------------
  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|    229|                        && IS_SLASH_OR_NUL(path[n + 1])) {
  ------------------
  |  |  486|    229|#define IS_SLASH_OR_NUL(s) (s == '\0' || AP_IS_SLASH(s))
  |  |  ------------------
  |  |  |  | 2957|    226|#define AP_IS_SLASH(s) (s == '/')
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2957:24): [True: 165, False: 61]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (486:29): [True: 3, False: 226]
  |  |  ------------------
  ------------------
  569|       |                    /* Wind w back to remove the previous segment */
  570|    168|                    if (w > 1) {
  ------------------
  |  Branch (570:25): [True: 86, False: 82]
  ------------------
  571|    616|                        do {
  572|    616|                            w--;
  573|    616|                        } while (w && !AP_IS_SLASH(path[w - 1]));
  ------------------
  |  | 2957|    576|#define AP_IS_SLASH(s) (s == '/')
  ------------------
  |  Branch (573:34): [True: 576, False: 40]
  |  Branch (573:39): [True: 530, False: 46]
  ------------------
  574|     86|                    }
  575|     82|                    else {
  576|       |                        /* Already at root, ignore and return a failure
  577|       |                         * if asked to.
  578|       |                         */
  579|     82|                        if (flags & AP_NORMALIZE_NOT_ABOVE_ROOT) {
  ------------------
  |  | 1875|     82|#define AP_NORMALIZE_NOT_ABOVE_ROOT     (1u <<  1)
  ------------------
  |  Branch (579:29): [True: 82, False: 0]
  ------------------
  580|     82|                            ret = 0;
  581|     82|                        }
  582|     82|                    }
  583|       |
  584|       |                    /* Move l forward to the next segment */
  585|    168|                    l = n + 1;
  586|    168|                    if (path[l]) {
  ------------------
  |  Branch (586:25): [True: 165, False: 3]
  ------------------
  587|    165|                        l++;
  588|    165|                    }
  589|    168|                    continue;
  590|    168|                }
  591|    310|            }
  592|  1.10k|        }
  593|       |
  594|  14.1k|        path[w++] = path[l++];
  595|  14.1k|    }
  596|    329|    path[w] = '\0';
  597|       |
  598|    329|    return ret;
  599|    388|}
ap_getparents:
  605|    388|{
  606|    388|    if (!ap_normalize_path(name, AP_NORMALIZE_NOT_ABOVE_ROOT |
  ------------------
  |  | 1875|    388|#define AP_NORMALIZE_NOT_ABOVE_ROOT     (1u <<  1)
  ------------------
  |  Branch (606:9): [True: 75, False: 313]
  ------------------
  607|    388|                                 AP_NORMALIZE_ALLOW_RELATIVE)) {
  ------------------
  |  | 1874|    388|#define AP_NORMALIZE_ALLOW_RELATIVE     (1u <<  0)
  ------------------
  608|     75|        name[0] = '\0';
  609|     75|    }
  610|    388|}
ap_no2slash_ex:
  613|    318|{
  614|       |
  615|    318|    char *d, *s;
  616|       |
  617|    318|    if (!*name) {
  ------------------
  |  Branch (617:9): [True: 44, False: 274]
  ------------------
  618|     44|        return;
  619|     44|    }
  620|       |
  621|    274|    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|  11.7k|    while (*s) {
  ------------------
  |  Branch (629:12): [True: 11.4k, False: 274]
  ------------------
  630|  11.4k|        if ((*d++ = *s) == '/') {
  ------------------
  |  Branch (630:13): [True: 168, False: 11.3k]
  ------------------
  631|    393|            do {
  632|    393|                ++s;
  633|    393|            } while (*s == '/');
  ------------------
  |  Branch (633:22): [True: 225, False: 168]
  ------------------
  634|    168|        }
  635|  11.3k|        else {
  636|  11.3k|            ++s;
  637|  11.3k|        }
  638|  11.4k|    }
  639|    274|    *d = '\0';
  640|    274|}
ap_no2slash:
  643|    318|{
  644|    318|    ap_no2slash_ex(name, 1);
  645|    318|}
ap_make_dirstr_parent:
  695|    213|{
  696|    213|    const char *last_slash = ap_strrchr_c(s, '/');
  ------------------
  |  | 2591|    213|# define ap_strrchr_c(s, c)  strrchr(s, c)
  ------------------
  697|    213|    char *d;
  698|    213|    int l;
  699|       |
  700|    213|    if (last_slash == NULL) {
  ------------------
  |  Branch (700:9): [True: 191, False: 22]
  ------------------
  701|    191|        return apr_pstrdup(p, "");
  702|    191|    }
  703|     22|    l = (last_slash - s) + 1;
  704|     22|    d = apr_pstrmemdup(p, s, l);
  705|       |
  706|     22|    return (d);
  707|    213|}
ap_getword:
  726|  1.11k|{
  727|  1.11k|    const char *pos = *line;
  728|  1.11k|    int len;
  729|  1.11k|    char *res;
  730|       |
  731|  50.5k|    while ((*pos != stop) && *pos) {
  ------------------
  |  Branch (731:12): [True: 49.4k, False: 1.11k]
  |  Branch (731:30): [True: 49.4k, False: 0]
  ------------------
  732|  49.4k|        ++pos;
  733|  49.4k|    }
  734|       |
  735|  1.11k|    len = pos - *line;
  736|  1.11k|    res = apr_pstrmemdup(atrans, *line, len);
  737|       |
  738|  1.11k|    if (stop) {
  ------------------
  |  Branch (738:9): [True: 0, False: 1.11k]
  ------------------
  739|      0|        while (*pos == stop) {
  ------------------
  |  Branch (739:16): [True: 0, False: 0]
  ------------------
  740|      0|            ++pos;
  741|      0|        }
  742|      0|    }
  743|  1.11k|    *line = pos;
  744|       |
  745|  1.11k|    return res;
  746|  1.11k|}
ap_getword_white_nc:
  749|    172|{
  750|    172|    return ap_getword_white(atrans, (const char **) line);
  751|    172|}
ap_getword_white:
  754|    172|{
  755|    172|    const char *pos = *line;
  756|    172|    int len;
  757|    172|    char *res;
  758|       |
  759|  2.59k|    while (!apr_isspace(*pos) && *pos) {
  ------------------
  |  |  228|  5.19k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  ------------------
  |  Branch (759:12): [True: 2.52k, False: 76]
  |  Branch (759:34): [True: 2.42k, False: 96]
  ------------------
  760|  2.42k|        ++pos;
  761|  2.42k|    }
  762|       |
  763|    172|    len = pos - *line;
  764|    172|    res = apr_pstrmemdup(atrans, *line, len);
  765|       |
  766|    434|    while (apr_isspace(*pos)) {
  ------------------
  |  |  228|    434|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (228:24): [True: 262, False: 172]
  |  |  ------------------
  ------------------
  767|    262|        ++pos;
  768|    262|    }
  769|       |
  770|    172|    *line = pos;
  771|       |
  772|    172|    return res;
  773|    172|}
ap_getword_conf:
  836|     96|{
  837|     96|    const char *str = *line, *strend;
  838|     96|    char *res;
  839|     96|    char quote;
  840|       |
  841|    273|    while (apr_isspace(*str))
  ------------------
  |  |  228|    273|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (228:24): [True: 177, False: 96]
  |  |  ------------------
  ------------------
  842|    177|        ++str;
  843|       |
  844|     96|    if (!*str) {
  ------------------
  |  Branch (844:9): [True: 0, False: 96]
  ------------------
  845|      0|        *line = str;
  846|      0|        return "";
  847|      0|    }
  848|       |
  849|     96|    if ((quote = *str) == '"' || quote == '\'') {
  ------------------
  |  Branch (849:9): [True: 72, False: 24]
  |  Branch (849:34): [True: 24, False: 0]
  ------------------
  850|     96|        strend = str + 1;
  851|  2.79k|        while (*strend && *strend != quote) {
  ------------------
  |  Branch (851:16): [True: 2.73k, False: 62]
  |  Branch (851:27): [True: 2.70k, False: 34]
  ------------------
  852|  2.70k|            if (*strend == '\\' && strend[1] &&
  ------------------
  |  Branch (852:17): [True: 484, False: 2.21k]
  |  Branch (852:36): [True: 478, False: 6]
  ------------------
  853|    478|                (strend[1] == quote || strend[1] == '\\')) {
  ------------------
  |  Branch (853:18): [True: 75, False: 403]
  |  Branch (853:40): [True: 170, False: 233]
  ------------------
  854|    245|                strend += 2;
  855|    245|            }
  856|  2.45k|            else {
  857|  2.45k|                ++strend;
  858|  2.45k|            }
  859|  2.70k|        }
  860|     96|        res = substring_conf(p, str + 1, strend - str - 1, quote);
  861|       |
  862|     96|        if (*strend == quote)
  ------------------
  |  Branch (862:13): [True: 34, False: 62]
  ------------------
  863|     34|            ++strend;
  864|     96|    }
  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|    241|    while (apr_isspace(*strend))
  ------------------
  |  |  228|    241|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (228:24): [True: 145, False: 96]
  |  |  ------------------
  ------------------
  874|    145|        ++strend;
  875|     96|    *line = strend;
  876|     96|    return res;
  877|     96|}
ap_getword_conf2:
  885|  1.11k|{
  886|  1.11k|    const char *str = *line, *strend;
  887|  1.11k|    char *res;
  888|  1.11k|    char quote;
  889|  1.11k|    int count = 1;
  890|       |
  891|  2.26k|    while (apr_isspace(*str))
  ------------------
  |  |  228|  2.26k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (228:24): [True: 1.14k, False: 1.11k]
  |  |  ------------------
  ------------------
  892|  1.14k|        ++str;
  893|       |
  894|  1.11k|    if (!*str) {
  ------------------
  |  Branch (894:9): [True: 16, False: 1.09k]
  ------------------
  895|     16|        *line = str;
  896|     16|        return "";
  897|     16|    }
  898|       |
  899|  1.09k|    if ((quote = *str) == '"' || quote == '\'')
  ------------------
  |  Branch (899:9): [True: 72, False: 1.02k]
  |  Branch (899:34): [True: 24, False: 1.00k]
  ------------------
  900|     96|        return ap_getword_conf(p, line);
  901|       |
  902|  1.00k|    if (quote == '{') {
  ------------------
  |  Branch (902:9): [True: 68, False: 935]
  ------------------
  903|     68|        strend = str + 1;
  904|  3.44k|        while (*strend) {
  ------------------
  |  Branch (904:16): [True: 3.37k, False: 62]
  ------------------
  905|  3.37k|            if (*strend == '}' && !--count)
  ------------------
  |  Branch (905:17): [True: 129, False: 3.25k]
  |  Branch (905:35): [True: 6, False: 123]
  ------------------
  906|      6|                break;
  907|  3.37k|            if (*strend == '{')
  ------------------
  |  Branch (907:17): [True: 412, False: 2.96k]
  ------------------
  908|    412|                ++count;
  909|  3.37k|            if (*strend == '\\' && strend[1] == '\\') {
  ------------------
  |  Branch (909:17): [True: 500, False: 2.87k]
  |  Branch (909:36): [True: 186, False: 314]
  ------------------
  910|    186|                ++strend;
  911|    186|            }
  912|  3.37k|            ++strend;
  913|  3.37k|        }
  914|     68|        res = substring_conf(p, str + 1, strend - str - 1, 0);
  915|       |
  916|     68|        if (*strend == '}')
  ------------------
  |  Branch (916:13): [True: 6, False: 62]
  ------------------
  917|      6|            ++strend;
  918|     68|    }
  919|    935|    else {
  920|    935|        strend = str;
  921|  22.7k|        while (*strend && !apr_isspace(*strend))
  ------------------
  |  |  228|  22.3k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  ------------------
  |  Branch (921:16): [True: 22.3k, False: 458]
  |  Branch (921:27): [True: 21.8k, False: 477]
  ------------------
  922|  21.8k|            ++strend;
  923|       |
  924|    935|        res = substring_conf(p, str, strend - str, 0);
  925|    935|    }
  926|       |
  927|  2.36k|    while (apr_isspace(*strend))
  ------------------
  |  |  228|  2.36k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (228:24): [True: 1.36k, False: 1.00k]
  |  |  ------------------
  ------------------
  928|  1.36k|        ++strend;
  929|  1.00k|    *line = strend;
  930|  1.00k|    return res;
  931|  1.09k|}
ap_pcfg_openfile:
  961|  1.11k|{
  962|  1.11k|    ap_configfile_t *new_cfg;
  963|  1.11k|    apr_file_t *file = NULL;
  964|  1.11k|    apr_finfo_t finfo;
  965|  1.11k|    apr_status_t status;
  966|       |#ifdef DEBUG
  967|       |    char buf[120];
  968|       |#endif
  969|       |
  970|  1.11k|    if (name == NULL) {
  ------------------
  |  Branch (970:9): [True: 0, False: 1.11k]
  ------------------
  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.11k|    status = apr_file_open(&file, name, APR_READ | APR_BUFFERED,
  ------------------
  |  |  100|  1.11k|#define APR_READ             APR_FOPEN_READ       /**< @deprecated @see APR_FOPEN_READ */
  |  |  ------------------
  |  |  |  |   54|  1.11k|#define APR_FOPEN_READ       0x00001  /**< Open the file for reading */
  |  |  ------------------
  ------------------
                  status = apr_file_open(&file, name, APR_READ | APR_BUFFERED,
  ------------------
  |  |  107|  1.11k|#define APR_BUFFERED         APR_FOPEN_BUFFERED   /**< @deprecated @see APR_FOPEN_BUFFERED */
  |  |  ------------------
  |  |  |  |   65|  1.11k|#define APR_FOPEN_BUFFERED   0x00080  /**< Open the file for buffered I/O */
  |  |  ------------------
  ------------------
  977|  1.11k|                           APR_OS_DEFAULT, p);
  ------------------
  |  |  112|  1.11k|#define APR_OS_DEFAULT APR_FPROT_OS_DEFAULT /**< @deprecated @see APR_FPROT_OS_DEFAULT */
  |  |  ------------------
  |  |  |  |   94|  1.11k|#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.11k|    if (status != APR_SUCCESS)
  ------------------
  |  |  225|  1.11k|#define APR_SUCCESS 0
  ------------------
  |  Branch (984:9): [True: 0, False: 1.11k]
  ------------------
  985|      0|        return status;
  986|       |
  987|  1.11k|    status = apr_file_info_get(&finfo, APR_FINFO_TYPE, file);
  ------------------
  |  |  154|  1.11k|#define APR_FINFO_TYPE   0x00008000 /**< Type */
  ------------------
  988|  1.11k|    if (status != APR_SUCCESS)
  ------------------
  |  |  225|  1.11k|#define APR_SUCCESS 0
  ------------------
  |  Branch (988:9): [True: 0, False: 1.11k]
  ------------------
  989|      0|        return status;
  990|       |
  991|  1.11k|    if (finfo.filetype != APR_REG &&
  ------------------
  |  Branch (991:9): [True: 0, False: 1.11k]
  ------------------
  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.11k|    new_cfg = apr_palloc(p, sizeof(*new_cfg));
  ------------------
  |  |  425|  1.11k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.11k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.11k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  1.11k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1028|  1.11k|    new_cfg->param = file;
 1029|  1.11k|    new_cfg->name = apr_pstrdup(p, name);
 1030|  1.11k|    new_cfg->getch = cfg_getch;
 1031|  1.11k|    new_cfg->getstr = cfg_getstr;
 1032|  1.11k|    new_cfg->close = cfg_close;
 1033|  1.11k|    new_cfg->line_number = 0;
 1034|  1.11k|    *ret_cfg = new_cfg;
 1035|  1.11k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.11k|#define APR_SUCCESS 0
  ------------------
 1036|  1.11k|}
ap_cfg_getline:
 1200|  1.11k|{
 1201|  1.11k|    apr_status_t rc = ap_cfg_getline_core(buf, bufsize, 0, cfp);
 1202|  1.11k|    if (rc == APR_SUCCESS)
  ------------------
  |  |  225|  1.11k|#define APR_SUCCESS 0
  ------------------
  |  Branch (1202:9): [True: 943, False: 172]
  ------------------
 1203|    943|        cfg_trim_line(buf);
 1204|  1.11k|    return rc;
 1205|  1.11k|}
ap_size_list_item:
 1255|  1.11k|{
 1256|  1.11k|    const unsigned char *ptr = (const unsigned char *)*field;
 1257|  1.11k|    const unsigned char *token;
 1258|  1.11k|    int in_qpair, in_qstr, in_com;
 1259|       |
 1260|       |    /* Find first non-comma, non-whitespace byte */
 1261|       |
 1262|  2.44k|    while (*ptr == ',' || apr_isspace(*ptr))
  ------------------
  |  |  228|  2.29k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (228:24): [True: 1.18k, False: 1.11k]
  |  |  ------------------
  ------------------
  |  Branch (1262:12): [True: 146, False: 2.29k]
  ------------------
 1263|  1.32k|        ++ptr;
 1264|       |
 1265|  1.11k|    token = ptr;
 1266|       |
 1267|       |    /* Find the end of this item, skipping over dead bits */
 1268|       |
 1269|  1.11k|    for (in_qpair = in_qstr = in_com = 0;
 1270|  38.6k|         *ptr && (in_qpair || in_qstr || in_com || *ptr != ',');
  ------------------
  |  Branch (1270:10): [True: 37.7k, False: 868]
  |  Branch (1270:19): [True: 2.91k, False: 34.8k]
  |  Branch (1270:31): [True: 4.44k, False: 30.4k]
  |  Branch (1270:42): [True: 3.14k, False: 27.2k]
  |  Branch (1270:52): [True: 27.0k, False: 247]
  ------------------
 1271|  37.5k|         ++ptr) {
 1272|       |
 1273|  37.5k|        if (in_qpair) {
  ------------------
  |  Branch (1273:13): [True: 2.91k, False: 34.6k]
  ------------------
 1274|  2.91k|            in_qpair = 0;
 1275|  2.91k|        }
 1276|  34.6k|        else {
 1277|  34.6k|            switch (*ptr) {
 1278|  2.95k|                case '\\': in_qpair = 1;      /* quoted-pair         */
  ------------------
  |  Branch (1278:17): [True: 2.95k, False: 31.6k]
  ------------------
 1279|  2.95k|                           break;
 1280|    992|                case '"' : if (!in_com)       /* quoted string delim */
  ------------------
  |  Branch (1280:17): [True: 992, False: 33.6k]
  |  Branch (1280:32): [True: 814, False: 178]
  ------------------
 1281|    814|                               in_qstr = !in_qstr;
 1282|    992|                           break;
 1283|    807|                case '(' : if (!in_qstr)      /* comment (may nest)  */
  ------------------
  |  Branch (1283:17): [True: 807, False: 33.8k]
  |  Branch (1283:32): [True: 682, False: 125]
  ------------------
 1284|    682|                               ++in_com;
 1285|    807|                           break;
 1286|    545|                case ')' : if (in_com)        /* end comment         */
  ------------------
  |  Branch (1286:17): [True: 545, False: 34.0k]
  |  Branch (1286:32): [True: 189, False: 356]
  ------------------
 1287|    189|                               --in_com;
 1288|    545|                           break;
 1289|  29.3k|                default  : break;
  ------------------
  |  Branch (1289:17): [True: 29.3k, False: 5.29k]
  ------------------
 1290|  34.6k|            }
 1291|  34.6k|        }
 1292|  37.5k|    }
 1293|       |
 1294|  1.11k|    if ((*len = (ptr - token)) == 0) {
  ------------------
  |  Branch (1294:9): [True: 20, False: 1.09k]
  ------------------
 1295|     20|        *field = (const char *)ptr;
 1296|     20|        return NULL;
 1297|     20|    }
 1298|       |
 1299|       |    /* Advance field pointer to the next non-comma, non-white byte */
 1300|       |
 1301|  1.74k|    while (*ptr == ',' || apr_isspace(*ptr))
  ------------------
  |  |  228|  1.32k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (228:24): [True: 230, False: 1.09k]
  |  |  ------------------
  ------------------
  |  Branch (1301:12): [True: 420, False: 1.32k]
  ------------------
 1302|    650|        ++ptr;
 1303|       |
 1304|  1.09k|    *field = (const char *)ptr;
 1305|  1.09k|    return (const char *)token;
 1306|  1.11k|}
ap_get_list_item:
 1315|  1.11k|{
 1316|  1.11k|    const char *tok_start;
 1317|  1.11k|    const unsigned char *ptr;
 1318|  1.11k|    unsigned char *pos;
 1319|  1.11k|    char *token;
 1320|  1.11k|    int addspace = 0, in_qpair = 0, in_qstr = 0, in_com = 0, tok_len = 0;
 1321|       |
 1322|       |    /* Find the beginning and maximum length of the list item so that
 1323|       |     * we can allocate a buffer for the new string and reset the field.
 1324|       |     */
 1325|  1.11k|    if ((tok_start = ap_size_list_item(field, &tok_len)) == NULL) {
  ------------------
  |  Branch (1325:9): [True: 20, False: 1.09k]
  ------------------
 1326|     20|        return NULL;
 1327|     20|    }
 1328|  1.09k|    token = apr_palloc(p, tok_len + 1);
  ------------------
  |  |  425|  1.09k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.09k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.09k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  1.09k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1329|       |
 1330|       |    /* Scan the token again, but this time copy only the good bytes.
 1331|       |     * We skip extra whitespace and any whitespace around a '=', '/',
 1332|       |     * or ';' and lowercase normal characters not within a comment,
 1333|       |     * quoted-string or quoted-pair.
 1334|       |     */
 1335|  1.09k|    for (ptr = (const unsigned char *)tok_start, pos = (unsigned char *)token;
 1336|  38.6k|         *ptr && (in_qpair || in_qstr || in_com || *ptr != ',');
  ------------------
  |  Branch (1336:10): [True: 37.7k, False: 848]
  |  Branch (1336:19): [True: 2.91k, False: 34.8k]
  |  Branch (1336:31): [True: 4.44k, False: 30.4k]
  |  Branch (1336:42): [True: 3.14k, False: 27.2k]
  |  Branch (1336:52): [True: 27.0k, False: 247]
  ------------------
 1337|  37.5k|         ++ptr) {
 1338|       |
 1339|  37.5k|        if (in_qpair) {
  ------------------
  |  Branch (1339:13): [True: 2.91k, False: 34.6k]
  ------------------
 1340|  2.91k|            in_qpair = 0;
 1341|  2.91k|            *pos++ = *ptr;
 1342|  2.91k|        }
 1343|  34.6k|        else {
 1344|  34.6k|            switch (*ptr) {
 1345|  2.95k|                case '\\': in_qpair = 1;
  ------------------
  |  Branch (1345:17): [True: 2.95k, False: 31.6k]
  ------------------
 1346|  2.95k|                           if (addspace == 1)
  ------------------
  |  Branch (1346:32): [True: 53, False: 2.90k]
  ------------------
 1347|     53|                               *pos++ = ' ';
 1348|  2.95k|                           *pos++ = *ptr;
 1349|  2.95k|                           addspace = 0;
 1350|  2.95k|                           break;
 1351|    992|                case '"' : if (!in_com)
  ------------------
  |  Branch (1351:17): [True: 992, False: 33.6k]
  |  Branch (1351:32): [True: 814, False: 178]
  ------------------
 1352|    814|                               in_qstr = !in_qstr;
 1353|    992|                           if (addspace == 1)
  ------------------
  |  Branch (1353:32): [True: 101, False: 891]
  ------------------
 1354|    101|                               *pos++ = ' ';
 1355|    992|                           *pos++ = *ptr;
 1356|    992|                           addspace = 0;
 1357|    992|                           break;
 1358|    807|                case '(' : if (!in_qstr)
  ------------------
  |  Branch (1358:17): [True: 807, False: 33.8k]
  |  Branch (1358:32): [True: 682, False: 125]
  ------------------
 1359|    682|                               ++in_com;
 1360|    807|                           if (addspace == 1)
  ------------------
  |  Branch (1360:32): [True: 59, False: 748]
  ------------------
 1361|     59|                               *pos++ = ' ';
 1362|    807|                           *pos++ = *ptr;
 1363|    807|                           addspace = 0;
 1364|    807|                           break;
 1365|    545|                case ')' : if (in_com)
  ------------------
  |  Branch (1365:17): [True: 545, False: 34.0k]
  |  Branch (1365:32): [True: 189, False: 356]
  ------------------
 1366|    189|                               --in_com;
 1367|    545|                           *pos++ = *ptr;
 1368|    545|                           addspace = 0;
 1369|    545|                           break;
 1370|  1.38k|                case ' ' :
  ------------------
  |  Branch (1370:17): [True: 1.38k, False: 33.2k]
  ------------------
 1371|  2.34k|                case '\t': if (addspace)
  ------------------
  |  Branch (1371:17): [True: 959, False: 33.6k]
  |  Branch (1371:32): [True: 1.03k, False: 1.30k]
  ------------------
 1372|  1.03k|                               break;
 1373|  1.30k|                           if (in_com || in_qstr)
  ------------------
  |  Branch (1373:32): [True: 348, False: 959]
  |  Branch (1373:42): [True: 348, False: 611]
  ------------------
 1374|    696|                               *pos++ = *ptr;
 1375|    611|                           else
 1376|    611|                               addspace = 1;
 1377|  1.30k|                           break;
 1378|    323|                case '=' :
  ------------------
  |  Branch (1378:17): [True: 323, False: 34.3k]
  ------------------
 1379|    974|                case '/' :
  ------------------
  |  Branch (1379:17): [True: 651, False: 33.9k]
  ------------------
 1380|  1.26k|                case ';' : if (!(in_com || in_qstr))
  ------------------
  |  Branch (1380:17): [True: 292, False: 34.3k]
  |  Branch (1380:34): [True: 172, False: 1.09k]
  |  Branch (1380:44): [True: 187, False: 907]
  ------------------
 1381|    907|                               addspace = -1;
 1382|  1.26k|                           *pos++ = *ptr;
 1383|  1.26k|                           break;
 1384|  25.7k|                default  : if (addspace == 1)
  ------------------
  |  Branch (1384:17): [True: 25.7k, False: 8.91k]
  |  Branch (1384:32): [True: 329, False: 25.3k]
  ------------------
 1385|    329|                               *pos++ = ' ';
 1386|  25.7k|                           *pos++ = (in_com || in_qstr) ? *ptr
  ------------------
  |  Branch (1386:38): [True: 1.63k, False: 24.0k]
  |  Branch (1386:48): [True: 2.87k, False: 21.2k]
  ------------------
 1387|  25.7k|                                                        : apr_tolower(*ptr);
  ------------------
  |  |  234|  46.9k|#define apr_tolower(c) (tolower(((unsigned char)(c))))
  ------------------
  |  Branch (1387:59): [True: 0, False: 0]
  |  Branch (1387:59): [True: 0, False: 0]
  |  Branch (1387:59): [Folded, False: 21.2k]
  ------------------
 1388|  25.7k|                           addspace = 0;
 1389|  25.7k|                           break;
 1390|  34.6k|            }
 1391|  34.6k|        }
 1392|  37.5k|    }
 1393|  1.09k|    *pos = '\0';
 1394|       |
 1395|  1.09k|    return token;
 1396|  1.09k|}
ap_find_list_item:
 1539|  1.11k|{
 1540|  1.11k|    return find_list_item(p, line, tok, AP_ETAG_NONE);
 1541|  1.11k|}
ap_parse_token_list_strict:
 1566|  1.11k|{
 1567|  1.11k|    int in_leading_space = 1;
 1568|  1.11k|    int in_trailing_space = 0;
 1569|  1.11k|    int string_end = 0;
 1570|  1.11k|    const char *tok_begin;
 1571|  1.11k|    const char *cur;
 1572|       |
 1573|  1.11k|    if (!str_in) {
  ------------------
  |  Branch (1573:9): [True: 0, False: 1.11k]
  ------------------
 1574|      0|        return NULL;
 1575|      0|    }
 1576|       |
 1577|  1.11k|    tok_begin = cur = str_in;
 1578|       |
 1579|  11.7k|    while (!string_end) {
  ------------------
  |  Branch (1579:12): [True: 11.5k, False: 159]
  ------------------
 1580|  11.5k|        const unsigned char c = (unsigned char)*cur;
 1581|       |
 1582|  11.5k|        if (!TEST_CHAR(c, T_HTTP_TOKEN_STOP)) {
  ------------------
  |  |   53|  11.5k|#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))
  ------------------
  |  Branch (1582:13): [True: 8.28k, False: 3.26k]
  ------------------
 1583|       |            /* Non-separator character; we are finished with leading
 1584|       |             * whitespace. We must never have encountered any trailing
 1585|       |             * whitespace before the delimiter (comma) */
 1586|  8.28k|            in_leading_space = 0;
 1587|  8.28k|            if (in_trailing_space) {
  ------------------
  |  Branch (1587:17): [True: 30, False: 8.25k]
  ------------------
 1588|     30|                return "Encountered illegal whitespace in token";
 1589|     30|            }
 1590|  8.28k|        }
 1591|  3.26k|        else if (c == ' ' || c == '\t') {
  ------------------
  |  Branch (1591:18): [True: 643, False: 2.61k]
  |  Branch (1591:30): [True: 654, False: 1.96k]
  ------------------
 1592|       |            /* "Linear whitespace" only includes ASCII CRLF, space, and tab;
 1593|       |             * we can't get a CRLF since headers are split on them already,
 1594|       |             * so only look for a space or a tab */
 1595|  1.29k|            if (in_leading_space) {
  ------------------
  |  Branch (1595:17): [True: 828, False: 469]
  ------------------
 1596|       |                /* We're still in leading whitespace */
 1597|    828|                ++tok_begin;
 1598|    828|            }
 1599|    469|            else {
 1600|       |                /* We must be in trailing whitespace */
 1601|    469|                ++in_trailing_space;
 1602|    469|            }
 1603|  1.29k|        }
 1604|  1.96k|        else if (c == ',' || c == '\0') {
  ------------------
  |  Branch (1604:18): [True: 880, False: 1.08k]
  |  Branch (1604:30): [True: 159, False: 926]
  ------------------
 1605|  1.03k|            if (!in_leading_space) {
  ------------------
  |  Branch (1605:17): [True: 809, False: 230]
  ------------------
 1606|       |                /* If we're out of the leading space, we know we've read some
 1607|       |                 * characters of a token */
 1608|    809|                if (*tokens == NULL) {
  ------------------
  |  Branch (1608:21): [True: 203, False: 606]
  ------------------
 1609|    203|                    *tokens = apr_array_make(p, 4, sizeof(char *));
 1610|    203|                }
 1611|    809|                APR_ARRAY_PUSH(*tokens, char *) =
  ------------------
  |  |  150|    809|#define APR_ARRAY_PUSH(ary,type) (*((type *)apr_array_push(ary)))
  ------------------
 1612|    809|                    apr_pstrmemdup((*tokens)->pool, tok_begin,
 1613|    809|                                   (cur - tok_begin) - in_trailing_space);
 1614|    809|            }
 1615|       |            /* We're allowed to have null elements, just don't add them to the
 1616|       |             * array */
 1617|       |
 1618|  1.03k|            tok_begin = cur + 1;
 1619|  1.03k|            in_leading_space = 1;
 1620|  1.03k|            in_trailing_space = 0;
 1621|  1.03k|            string_end = (c == '\0');
 1622|  1.03k|        }
 1623|    926|        else {
 1624|       |            /* Encountered illegal separator char */
 1625|    926|            if (skip_invalid) {
  ------------------
  |  Branch (1625:17): [True: 0, False: 926]
  ------------------
 1626|       |                /* Skip to the next separator */
 1627|      0|                const char *temp;
 1628|      0|                temp = ap_strchr_c(cur, ',');
  ------------------
  |  | 2587|      0|# define ap_strchr_c(s, c)   strchr(s, c)
  ------------------
 1629|      0|                if(!temp) {
  ------------------
  |  Branch (1629:20): [True: 0, False: 0]
  ------------------
 1630|      0|                    temp = ap_strchr_c(cur, '\0');
  ------------------
  |  | 2587|      0|# define ap_strchr_c(s, c)   strchr(s, c)
  ------------------
 1631|      0|                }
 1632|       |
 1633|       |                /* Act like we haven't seen a token so we reset */
 1634|      0|                cur = temp - 1;
 1635|      0|                in_leading_space = 1;
 1636|      0|                in_trailing_space = 0;
 1637|      0|            }
 1638|    926|            else {
 1639|    926|                return apr_psprintf(p, "Encountered illegal separator "
 1640|    926|                                    "'\\x%.2x'", (unsigned int)c);
 1641|    926|            }
 1642|    926|        }
 1643|       |
 1644|  10.5k|        ++cur;
 1645|  10.5k|    }
 1646|       |
 1647|    159|    return NULL;
 1648|  1.11k|}
ap_get_token:
 1689|  1.11k|{
 1690|  1.11k|    const char *ptr = *accept_line;
 1691|  1.11k|    const char *tok_start;
 1692|  1.11k|    char *token;
 1693|       |
 1694|       |    /* Find first non-white byte */
 1695|       |
 1696|  2.26k|    while (apr_isspace(*ptr))
  ------------------
  |  |  228|  2.26k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (228:24): [True: 1.14k, False: 1.11k]
  |  |  ------------------
  ------------------
 1697|  1.14k|        ++ptr;
 1698|       |
 1699|  1.11k|    tok_start = ptr;
 1700|       |
 1701|       |    /* find token end, skipping over quoted strings.
 1702|       |     * (comments are already gone).
 1703|       |     */
 1704|       |
 1705|  30.7k|    while (*ptr && (accept_white || !apr_isspace(*ptr))
  ------------------
  |  |  228|      0|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  ------------------
  |  Branch (1705:12): [True: 29.9k, False: 781]
  |  Branch (1705:21): [True: 29.9k, False: 0]
  |  Branch (1705:37): [True: 0, False: 0]
  ------------------
 1706|  29.9k|           && *ptr != ';' && *ptr != ',') {
  ------------------
  |  Branch (1706:15): [True: 29.8k, False: 70]
  |  Branch (1706:30): [True: 29.5k, False: 264]
  ------------------
 1707|  29.5k|        if (*ptr++ == '"')
  ------------------
  |  Branch (1707:13): [True: 608, False: 28.9k]
  ------------------
 1708|  5.38k|            while (*ptr)
  ------------------
  |  Branch (1708:20): [True: 5.24k, False: 133]
  ------------------
 1709|  5.24k|                if (*ptr++ == '"')
  ------------------
  |  Branch (1709:21): [True: 475, False: 4.77k]
  ------------------
 1710|    475|                    break;
 1711|  29.5k|    }
 1712|       |
 1713|  1.11k|    token = apr_pstrmemdup(p, tok_start, ptr - tok_start);
 1714|       |
 1715|       |    /* Advance accept_line pointer to the next non-white byte */
 1716|       |
 1717|  1.11k|    while (apr_isspace(*ptr))
  ------------------
  |  |  228|  1.11k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (228:24): [True: 0, False: 1.11k]
  |  |  ------------------
  ------------------
 1718|      0|        ++ptr;
 1719|       |
 1720|  1.11k|    *accept_line = ptr;
 1721|  1.11k|    return token;
 1722|  1.11k|}
ap_find_token:
 1727|  1.11k|{
 1728|  1.11k|    const unsigned char *start_token;
 1729|  1.11k|    const unsigned char *s;
 1730|       |
 1731|  1.11k|    if (!line)
  ------------------
  |  Branch (1731:9): [True: 0, False: 1.11k]
  ------------------
 1732|      0|        return 0;
 1733|       |
 1734|  1.11k|    s = (const unsigned char *)line;
 1735|  4.74k|    for (;;) {
 1736|       |        /* find start of token, skip all stop characters */
 1737|  33.6k|        while (*s && TEST_CHAR(*s, T_HTTP_TOKEN_STOP)) {
  ------------------
  |  |   53|  32.9k|#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))
  |  |  ------------------
  |  |  |  Branch (53:25): [True: 28.9k, False: 4.07k]
  |  |  ------------------
  ------------------
  |  Branch (1737:16): [True: 32.9k, False: 667]
  ------------------
 1738|  28.9k|            ++s;
 1739|  28.9k|        }
 1740|  4.74k|        if (!*s) {
  ------------------
  |  Branch (1740:13): [True: 667, False: 4.07k]
  ------------------
 1741|    667|            return 0;
 1742|    667|        }
 1743|  4.07k|        start_token = s;
 1744|       |        /* find end of the token */
 1745|  20.7k|        while (*s && !TEST_CHAR(*s, T_HTTP_TOKEN_STOP)) {
  ------------------
  |  |   53|  20.4k|#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))
  ------------------
  |  Branch (1745:16): [True: 20.4k, False: 356]
  |  Branch (1745:22): [True: 16.6k, False: 3.71k]
  ------------------
 1746|  16.6k|            ++s;
 1747|  16.6k|        }
 1748|  4.07k|        if (!ap_cstr_casecmpn((const char *)start_token, (const char *)tok,
  ------------------
  |  Branch (1748:13): [True: 98, False: 3.97k]
  ------------------
 1749|  4.07k|                         s - start_token)) {
 1750|     98|            return 1;
 1751|     98|        }
 1752|  3.97k|        if (!*s) {
  ------------------
  |  Branch (1752:13): [True: 350, False: 3.62k]
  ------------------
 1753|    350|            return 0;
 1754|    350|        }
 1755|  3.97k|    }
 1756|  1.11k|}
ap_find_last_token:
 1782|  1.11k|{
 1783|       |    return find_last_token(p, line, tok) != NULL;
 1784|  1.11k|}
ap_is_chunked:
 1787|  1.11k|{
 1788|  1.11k|    const char *s;
 1789|       |
 1790|  1.11k|    if (!line) 
  ------------------
  |  Branch (1790:9): [True: 0, False: 1.11k]
  ------------------
 1791|      0|        return 0;
 1792|  1.11k|    if (!ap_cstr_casecmp(line, "chunked")) { 
  ------------------
  |  Branch (1792:9): [True: 11, False: 1.10k]
  ------------------
 1793|     11|        return 1;
 1794|     11|    }
 1795|       |
 1796|  1.10k|    s = find_last_token(p, line, "chunked");
 1797|       |
 1798|  1.10k|    if (!s) return 0;
  ------------------
  |  Branch (1798:9): [True: 1.08k, False: 18]
  ------------------
 1799|       | 
 1800|       |    /* eat spaces right-to-left to see what precedes "chunked" */
 1801|    220|    while (--s > line) { 
  ------------------
  |  Branch (1801:12): [True: 219, False: 1]
  ------------------
 1802|    219|        if (*s != ' ') break;
  ------------------
  |  Branch (1802:13): [True: 17, False: 202]
  ------------------
 1803|    219|    }
 1804|       |
 1805|       |    /* found delim, or leading ws (input wasn't parsed by httpd as a header) */
 1806|     18|    if (*s == ',' || *s == ' ') { 
  ------------------
  |  Branch (1806:9): [True: 1, False: 17]
  |  Branch (1806:22): [True: 1, False: 16]
  ------------------
 1807|      2|        return 1;
 1808|      2|    }
 1809|     16|    return 0;
 1810|     18|}
ap_escape_shell_cmd:
 1813|  1.11k|{
 1814|  1.11k|    char *cmd;
 1815|  1.11k|    unsigned char *d;
 1816|  1.11k|    const unsigned char *s;
 1817|  1.11k|    apr_size_t len = strlen(str);
 1818|       |
 1819|  1.11k|    ap_assert(len <= (APR_SIZE_MAX - 1) / 2);
  ------------------
  |  | 2488|  1.11k|#define ap_assert(exp) ((exp) ? (void)0 : ap_log_assert(#exp,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (2488:25): [True: 1.11k, False: 0]
  |  |  ------------------
  ------------------
 1820|  1.11k|    cmd = apr_palloc(p, 2 * len + 1);
  ------------------
  |  |  425|  1.11k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.11k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.11k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  1.11k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1821|  1.11k|    d = (unsigned char *)cmd;
 1822|  1.11k|    s = (const unsigned char *)str;
 1823|  50.5k|    for (; *s; ++s) {
  ------------------
  |  Branch (1823:12): [True: 49.4k, False: 1.11k]
  ------------------
 1824|       |
 1825|       |#if defined(OS2) || defined(WIN32)
 1826|       |        /*
 1827|       |         * Newlines to Win32/OS2 CreateProcess() are ill advised.
 1828|       |         * Convert them to spaces since they are effectively white
 1829|       |         * space to most applications
 1830|       |         */
 1831|       |        if (*s == '\r' || *s == '\n') {
 1832|       |             *d++ = ' ';
 1833|       |             continue;
 1834|       |         }
 1835|       |#endif
 1836|       |
 1837|  49.4k|        if (TEST_CHAR(*s, T_ESCAPE_SHELL_CMD)) {
  ------------------
  |  |   53|  49.4k|#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))
  |  |  ------------------
  |  |  |  Branch (53:25): [True: 15.0k, False: 34.3k]
  |  |  ------------------
  ------------------
 1838|  15.0k|            *d++ = '\\';
 1839|  15.0k|        }
 1840|  49.4k|        *d++ = *s;
 1841|  49.4k|    }
 1842|  1.11k|    *d = '\0';
 1843|       |
 1844|  1.11k|    return cmd;
 1845|  1.11k|}
ap_unescape_url:
 1946|    298|{
 1947|       |    /* Traditional */
 1948|    298|    return unescape_url(url, AP_SLASHES, NULL, 0);
  ------------------
  |  | 2958|    298|#define AP_SLASHES "/"
  ------------------
 1949|    298|}
ap_unescape_urlencoded:
 1984|    257|{
 1985|    257|    char *slider;
 1986|       |
 1987|       |    /* replace plus with a space */
 1988|    257|    if (query) {
  ------------------
  |  Branch (1988:9): [True: 257, False: 0]
  ------------------
 1989|  10.0k|        for (slider = query; *slider; slider++) {
  ------------------
  |  Branch (1989:30): [True: 9.78k, False: 257]
  ------------------
 1990|  9.78k|            if (*slider == '+') {
  ------------------
  |  Branch (1990:17): [True: 152, False: 9.63k]
  ------------------
 1991|    152|                *slider = ' ';
 1992|    152|            }
 1993|  9.78k|        }
 1994|    257|    }
 1995|       |
 1996|       |    /* unescape everything else */
 1997|    257|    return unescape_url(query, NULL, NULL, 0);
 1998|    257|}
ap_escape_path_segment_buffer:
 2056|  1.11k|{
 2057|  1.11k|    const unsigned char *s = (const unsigned char *)segment;
 2058|  1.11k|    unsigned char *d = (unsigned char *)copy;
 2059|  1.11k|    unsigned c;
 2060|       |
 2061|  50.5k|    while ((c = *s)) {
  ------------------
  |  Branch (2061:12): [True: 49.4k, False: 1.11k]
  ------------------
 2062|  49.4k|        if (TEST_CHAR(c, T_ESCAPE_PATH_SEGMENT)) {
  ------------------
  |  |   53|  49.4k|#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))
  |  |  ------------------
  |  |  |  Branch (53:25): [True: 27.0k, False: 22.3k]
  |  |  ------------------
  ------------------
 2063|  27.0k|            d = c2x(c, '%', d);
 2064|  27.0k|        }
 2065|  22.3k|        else {
 2066|  22.3k|            *d++ = c;
 2067|  22.3k|        }
 2068|  49.4k|        ++s;
 2069|  49.4k|    }
 2070|  1.11k|    *d = '\0';
 2071|  1.11k|    return copy;
 2072|  1.11k|}
ap_os_escape_path:
 2082|  1.11k|{
 2083|       |    /* Allocate +3 for potential "./" and trailing NULL.
 2084|       |     * Allocate another +1 to allow the caller to add a trailing '/' (see
 2085|       |     * comment in 'ap_sub_req_lookup_dirent')
 2086|       |     */
 2087|  1.11k|    apr_size_t len = strlen(path);
 2088|  1.11k|    char *copy;
 2089|  1.11k|    const unsigned char *s;
 2090|  1.11k|    unsigned char *d;
 2091|  1.11k|    unsigned c;
 2092|       |
 2093|  1.11k|    ap_assert(len <= (APR_SIZE_MAX - 4) / 3);
  ------------------
  |  | 2488|  1.11k|#define ap_assert(exp) ((exp) ? (void)0 : ap_log_assert(#exp,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (2488:25): [True: 1.11k, False: 0]
  |  |  ------------------
  ------------------
 2094|  1.11k|    copy = apr_palloc(p, 3 * len + 3 + 1);
  ------------------
  |  |  425|  1.11k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.11k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.11k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  1.11k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2095|  1.11k|    s = (const unsigned char *)path;
 2096|  1.11k|    d = (unsigned char *)copy;
 2097|       |
 2098|  1.11k|    if (!partial) {
  ------------------
  |  Branch (2098:9): [True: 1.11k, False: 0]
  ------------------
 2099|  1.11k|        const char *colon = ap_strchr_c(path, ':');
  ------------------
  |  | 2587|  1.11k|# define ap_strchr_c(s, c)   strchr(s, c)
  ------------------
 2100|  1.11k|        const char *slash = ap_strchr_c(path, '/');
  ------------------
  |  | 2587|  1.11k|# define ap_strchr_c(s, c)   strchr(s, c)
  ------------------
 2101|       |
 2102|  1.11k|        if (colon && (!slash || colon < slash)) {
  ------------------
  |  Branch (2102:13): [True: 52, False: 1.06k]
  |  Branch (2102:23): [True: 38, False: 14]
  |  Branch (2102:33): [True: 4, False: 10]
  ------------------
 2103|     42|            *d++ = '.';
 2104|     42|            *d++ = '/';
 2105|     42|        }
 2106|  1.11k|    }
 2107|  50.5k|    while ((c = *s)) {
  ------------------
  |  Branch (2107:12): [True: 49.4k, False: 1.11k]
  ------------------
 2108|  49.4k|        if (TEST_CHAR(c, T_OS_ESCAPE_PATH)) {
  ------------------
  |  |   53|  49.4k|#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))
  |  |  ------------------
  |  |  |  Branch (53:25): [True: 25.8k, False: 23.5k]
  |  |  ------------------
  ------------------
 2109|  25.8k|            d = c2x(c, '%', d);
 2110|  25.8k|        }
 2111|  23.5k|        else {
 2112|  23.5k|            *d++ = c;
 2113|  23.5k|        }
 2114|  49.4k|        ++s;
 2115|  49.4k|    }
 2116|  1.11k|    *d = '\0';
 2117|  1.11k|    return copy;
 2118|  1.11k|}
ap_escape_urlencoded_buffer:
 2121|  1.11k|{
 2122|  1.11k|    const unsigned char *s = (const unsigned char *)buffer;
 2123|  1.11k|    unsigned char *d = (unsigned char *)copy;
 2124|  1.11k|    unsigned c;
 2125|       |
 2126|  50.5k|    while ((c = *s)) {
  ------------------
  |  Branch (2126:12): [True: 49.4k, False: 1.11k]
  ------------------
 2127|  49.4k|        if (TEST_CHAR(c, T_ESCAPE_URLENCODED)) {
  ------------------
  |  |   53|  49.4k|#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))
  |  |  ------------------
  |  |  |  Branch (53:25): [True: 30.8k, False: 18.5k]
  |  |  ------------------
  ------------------
 2128|  30.8k|            d = c2x(c, '%', d);
 2129|  30.8k|        }
 2130|  18.5k|        else if (c == ' ') {
  ------------------
  |  Branch (2130:18): [True: 2.34k, False: 16.2k]
  ------------------
 2131|  2.34k|            *d++ = '+';
 2132|  2.34k|        }
 2133|  16.2k|        else {
 2134|  16.2k|            *d++ = c;
 2135|  16.2k|        }
 2136|  49.4k|        ++s;
 2137|  49.4k|    }
 2138|  1.11k|    *d = '\0';
 2139|  1.11k|    return copy;
 2140|  1.11k|}
ap_escape_urlencoded:
 2143|  1.11k|{
 2144|  1.11k|    apr_size_t len = strlen(buffer);
 2145|  1.11k|    ap_assert(len <= (APR_SIZE_MAX - 1) / 3);
  ------------------
  |  | 2488|  1.11k|#define ap_assert(exp) ((exp) ? (void)0 : ap_log_assert(#exp,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (2488:25): [True: 1.11k, False: 0]
  |  |  ------------------
  ------------------
 2146|  1.11k|    return ap_escape_urlencoded_buffer(apr_palloc(p, 3 * len + 1), buffer);
  ------------------
  |  |  425|  1.11k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.11k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.11k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  1.11k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2147|  1.11k|}
ap_escape_html2:
 2152|  1.11k|{
 2153|  1.11k|    apr_size_t i, j;
 2154|  1.11k|    char *x;
 2155|       |
 2156|       |    /* first, count the number of extra characters */
 2157|  50.5k|    for (i = 0, j = 0; s[i] != '\0'; i++) {
  ------------------
  |  Branch (2157:24): [True: 49.4k, False: 1.11k]
  ------------------
 2158|  49.4k|        if (i + j > APR_SIZE_MAX - 6) {
  ------------------
  |  |  469|  49.4k|#define APR_SIZE_MAX    (~((apr_size_t)0))
  ------------------
  |  Branch (2158:13): [True: 0, False: 49.4k]
  ------------------
 2159|      0|            abort();
 2160|      0|        }
 2161|  49.4k|        if (s[i] == '<' || s[i] == '>')
  ------------------
  |  Branch (2161:13): [True: 194, False: 49.2k]
  |  Branch (2161:28): [True: 243, False: 48.9k]
  ------------------
 2162|    437|            j += 3;
 2163|  48.9k|        else if (s[i] == '&')
  ------------------
  |  Branch (2163:18): [True: 320, False: 48.6k]
  ------------------
 2164|    320|            j += 4;
 2165|  48.6k|        else if (s[i] == '"')
  ------------------
  |  Branch (2165:18): [True: 1.39k, False: 47.2k]
  ------------------
 2166|  1.39k|            j += 5;
 2167|  47.2k|        else if (toasc && !apr_isascii(s[i]))
  ------------------
  |  |  219|      0|#define apr_isascii(c) (isascii(((unsigned char)(c))))
  ------------------
  |  Branch (2167:18): [True: 0, False: 47.2k]
  |  Branch (2167:27): [True: 0, False: 0]
  ------------------
 2168|      0|            j += 5;
 2169|  49.4k|    }
 2170|       |
 2171|  1.11k|    if (j == 0)
  ------------------
  |  Branch (2171:9): [True: 752, False: 363]
  ------------------
 2172|    752|        return apr_pstrmemdup(p, s, i);
 2173|       |
 2174|    363|    x = apr_palloc(p, i + j + 1);
  ------------------
  |  |  425|    363|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|    363|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|    363|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|    363|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2175|  20.6k|    for (i = 0, j = 0; s[i] != '\0'; i++, j++)
  ------------------
  |  Branch (2175:24): [True: 20.3k, False: 363]
  ------------------
 2176|  20.3k|        if (s[i] == '<') {
  ------------------
  |  Branch (2176:13): [True: 194, False: 20.1k]
  ------------------
 2177|    194|            memcpy(&x[j], "&lt;", 4);
 2178|    194|            j += 3;
 2179|    194|        }
 2180|  20.1k|        else if (s[i] == '>') {
  ------------------
  |  Branch (2180:18): [True: 243, False: 19.8k]
  ------------------
 2181|    243|            memcpy(&x[j], "&gt;", 4);
 2182|    243|            j += 3;
 2183|    243|        }
 2184|  19.8k|        else if (s[i] == '&') {
  ------------------
  |  Branch (2184:18): [True: 320, False: 19.5k]
  ------------------
 2185|    320|            memcpy(&x[j], "&amp;", 5);
 2186|    320|            j += 4;
 2187|    320|        }
 2188|  19.5k|        else if (s[i] == '"') {
  ------------------
  |  Branch (2188:18): [True: 1.39k, False: 18.1k]
  ------------------
 2189|  1.39k|            memcpy(&x[j], "&quot;", 6);
 2190|  1.39k|            j += 5;
 2191|  1.39k|        }
 2192|  18.1k|        else if (toasc && !apr_isascii(s[i])) {
  ------------------
  |  |  219|      0|#define apr_isascii(c) (isascii(((unsigned char)(c))))
  ------------------
  |  Branch (2192:18): [True: 0, False: 18.1k]
  |  Branch (2192:27): [True: 0, False: 0]
  ------------------
 2193|      0|            char *esc = apr_psprintf(p, "&#%3.3d;", (unsigned char)s[i]);
 2194|      0|            memcpy(&x[j], esc, 6);
 2195|      0|            j += 5;
 2196|      0|        }
 2197|  18.1k|        else
 2198|  18.1k|            x[j] = s[i];
 2199|       |
 2200|    363|    x[j] = '\0';
 2201|    363|    return x;
 2202|  1.11k|}
ap_escape_logitem:
 2204|  1.11k|{
 2205|  1.11k|    char *ret;
 2206|  1.11k|    unsigned char *d;
 2207|  1.11k|    const unsigned char *s;
 2208|  1.11k|    apr_size_t length, escapes = 0;
 2209|       |
 2210|  1.11k|    if (!str) {
  ------------------
  |  Branch (2210:9): [True: 0, False: 1.11k]
  ------------------
 2211|      0|        return NULL;
 2212|      0|    }
 2213|       |
 2214|       |    /* Compute how many characters need to be escaped */
 2215|  1.11k|    s = (const unsigned char *)str;
 2216|  50.5k|    for (; *s; ++s) {
  ------------------
  |  Branch (2216:12): [True: 49.4k, False: 1.11k]
  ------------------
 2217|  49.4k|        if (TEST_CHAR(*s, T_ESCAPE_LOGITEM)) {
  ------------------
  |  |   53|  49.4k|#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))
  |  |  ------------------
  |  |  |  Branch (53:25): [True: 21.3k, False: 28.0k]
  |  |  ------------------
  ------------------
 2218|  21.3k|            escapes++;
 2219|  21.3k|        }
 2220|  49.4k|    }
 2221|       |    
 2222|       |    /* Compute the length of the input string, including NULL */
 2223|  1.11k|    length = s - (const unsigned char *)str + 1;
 2224|       |    
 2225|       |    /* Fast path: nothing to escape */
 2226|  1.11k|    if (escapes == 0) {
  ------------------
  |  Branch (2226:9): [True: 176, False: 939]
  ------------------
 2227|    176|        return apr_pmemdup(p, str, length);
 2228|    176|    }
 2229|       |    
 2230|       |    /* Each escaped character needs up to 3 extra bytes (0 --> \x00) */
 2231|    939|    ret = apr_palloc(p, length + 3 * escapes);
  ------------------
  |  |  425|    939|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|    939|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|    939|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|    939|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2232|    939|    d = (unsigned char *)ret;
 2233|    939|    s = (const unsigned char *)str;
 2234|  46.3k|    for (; *s; ++s) {
  ------------------
  |  Branch (2234:12): [True: 45.4k, False: 939]
  ------------------
 2235|  45.4k|        if (TEST_CHAR(*s, T_ESCAPE_LOGITEM)) {
  ------------------
  |  |   53|  45.4k|#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))
  |  |  ------------------
  |  |  |  Branch (53:25): [True: 21.3k, False: 24.0k]
  |  |  ------------------
  ------------------
 2236|  21.3k|            *d++ = '\\';
 2237|  21.3k|            switch(*s) {
 2238|    285|            case '\b':
  ------------------
  |  Branch (2238:13): [True: 285, False: 21.0k]
  ------------------
 2239|    285|                *d++ = 'b';
 2240|    285|                break;
 2241|  2.69k|            case '\n':
  ------------------
  |  Branch (2241:13): [True: 2.69k, False: 18.6k]
  ------------------
 2242|  2.69k|                *d++ = 'n';
 2243|  2.69k|                break;
 2244|    500|            case '\r':
  ------------------
  |  Branch (2244:13): [True: 500, False: 20.8k]
  ------------------
 2245|    500|                *d++ = 'r';
 2246|    500|                break;
 2247|  1.71k|            case '\t':
  ------------------
  |  Branch (2247:13): [True: 1.71k, False: 19.6k]
  ------------------
 2248|  1.71k|                *d++ = 't';
 2249|  1.71k|                break;
 2250|    419|            case '\v':
  ------------------
  |  Branch (2250:13): [True: 419, False: 20.9k]
  ------------------
 2251|    419|                *d++ = 'v';
 2252|    419|                break;
 2253|  4.81k|            case '\\':
  ------------------
  |  Branch (2253:13): [True: 4.81k, False: 16.5k]
  ------------------
 2254|  6.21k|            case '"':
  ------------------
  |  Branch (2254:13): [True: 1.39k, False: 19.9k]
  ------------------
 2255|  6.21k|                *d++ = *s;
 2256|  6.21k|                break;
 2257|  9.55k|            default:
  ------------------
  |  Branch (2257:13): [True: 9.55k, False: 11.8k]
  ------------------
 2258|  9.55k|                c2x(*s, 'x', d);
 2259|  9.55k|                d += 3;
 2260|  21.3k|            }
 2261|  21.3k|        }
 2262|  24.0k|        else {
 2263|  24.0k|            *d++ = *s;
 2264|  24.0k|        }
 2265|  45.4k|    }
 2266|    939|    *d = '\0';
 2267|       |
 2268|    939|    return ret;
 2269|    939|}
ap_escape_errorlog_item:
 2273|  1.11k|{
 2274|  1.11k|    unsigned char *d, *ep;
 2275|  1.11k|    const unsigned char *s;
 2276|       |
 2277|  1.11k|    if (!source || !buflen) { /* be safe */
  ------------------
  |  Branch (2277:9): [True: 0, False: 1.11k]
  |  Branch (2277:20): [True: 0, False: 1.11k]
  ------------------
 2278|      0|        return 0;
 2279|      0|    }
 2280|       |
 2281|  1.11k|    d = (unsigned char *)dest;
 2282|  1.11k|    s = (const unsigned char *)source;
 2283|  1.11k|    ep = d + buflen - 1;
 2284|       |
 2285|  50.5k|    for (; d < ep && *s; ++s) {
  ------------------
  |  Branch (2285:12): [True: 50.5k, False: 16]
  |  Branch (2285:22): [True: 49.4k, False: 1.09k]
  ------------------
 2286|       |
 2287|  49.4k|        if (TEST_CHAR(*s, T_ESCAPE_LOGITEM)) {
  ------------------
  |  |   53|  49.4k|#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))
  |  |  ------------------
  |  |  |  Branch (53:25): [True: 21.3k, False: 28.0k]
  |  |  ------------------
  ------------------
 2288|  21.3k|            *d++ = '\\';
 2289|  21.3k|            if (d >= ep) {
  ------------------
  |  Branch (2289:17): [True: 0, False: 21.3k]
  ------------------
 2290|      0|                --d;
 2291|      0|                break;
 2292|      0|            }
 2293|       |
 2294|  21.3k|            switch(*s) {
 2295|    285|            case '\b':
  ------------------
  |  Branch (2295:13): [True: 285, False: 21.0k]
  ------------------
 2296|    285|                *d++ = 'b';
 2297|    285|                break;
 2298|  2.69k|            case '\n':
  ------------------
  |  Branch (2298:13): [True: 2.69k, False: 18.6k]
  ------------------
 2299|  2.69k|                *d++ = 'n';
 2300|  2.69k|                break;
 2301|    500|            case '\r':
  ------------------
  |  Branch (2301:13): [True: 500, False: 20.8k]
  ------------------
 2302|    500|                *d++ = 'r';
 2303|    500|                break;
 2304|  1.71k|            case '\t':
  ------------------
  |  Branch (2304:13): [True: 1.71k, False: 19.6k]
  ------------------
 2305|  1.71k|                *d++ = 't';
 2306|  1.71k|                break;
 2307|    419|            case '\v':
  ------------------
  |  Branch (2307:13): [True: 419, False: 20.9k]
  ------------------
 2308|    419|                *d++ = 'v';
 2309|    419|                break;
 2310|  4.81k|            case '\\':
  ------------------
  |  Branch (2310:13): [True: 4.81k, False: 16.5k]
  ------------------
 2311|  4.81k|                *d++ = *s;
 2312|  4.81k|                break;
 2313|  1.39k|            case '"': /* no need for this in error log */
  ------------------
  |  Branch (2313:13): [True: 1.39k, False: 19.9k]
  ------------------
 2314|  1.39k|                d[-1] = *s;
 2315|  1.39k|                break;
 2316|  9.55k|            default:
  ------------------
  |  Branch (2316:13): [True: 9.55k, False: 11.8k]
  ------------------
 2317|  9.55k|                if (d >= ep - 2) {
  ------------------
  |  Branch (2317:21): [True: 0, False: 9.55k]
  ------------------
 2318|      0|                    ep = --d; /* break the for loop as well */
 2319|      0|                    break;
 2320|      0|                }
 2321|  9.55k|                c2x(*s, 'x', d);
 2322|  9.55k|                d += 3;
 2323|  21.3k|            }
 2324|  21.3k|        }
 2325|  28.0k|        else {
 2326|  28.0k|            *d++ = *s;
 2327|  28.0k|        }
 2328|  49.4k|    }
 2329|  1.11k|    *d = '\0';
 2330|       |
 2331|  1.11k|    return (d - (unsigned char *)dest);
 2332|  1.11k|}
ap_str_tolower:
 2431|    224|{
 2432|  7.60k|    while (*str) {
  ------------------
  |  Branch (2432:12): [True: 7.37k, False: 224]
  ------------------
 2433|       |        *str = apr_tolower(*str);
  ------------------
  |  |  234|  7.37k|#define apr_tolower(c) (tolower(((unsigned char)(c))))
  ------------------
  |  Branch (2433:16): [True: 0, False: 0]
  |  Branch (2433:16): [True: 0, False: 0]
  |  Branch (2433:16): [Folded, False: 7.37k]
  ------------------
 2434|  7.37k|        ++str;
 2435|  7.37k|    }
 2436|    224|}
ap_pbase64decode:
 2498|  1.11k|{
 2499|  1.11k|    char *decoded;
 2500|       |
 2501|  1.11k|    decoded = (char *) apr_palloc(p, apr_base64_decode_len(bufcoded));
  ------------------
  |  |  425|  1.11k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.11k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.11k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  1.11k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2502|  1.11k|    apr_base64_decode(decoded, bufcoded);
 2503|       |
 2504|  1.11k|    return decoded;
 2505|  1.11k|}
ap_pbase64decode_strict:
 2512|    208|{
 2513|    208|    apr_size_t end_index;
 2514|    208|    int last_group_len;
 2515|    208|    const char *end;
 2516|       |
 2517|       |    /* Sanity check.
 2518|       |     * TODO: this would be a lot more efficient if we had access to the lookup
 2519|       |     * table used by APR. If that gets pulled in at any point, make use of it.
 2520|       |     */
 2521|    208|    end_index = strspn(encoded, "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
 2522|    208|                                "abcdefghijklmnopqrstuvwxyz"
 2523|    208|                                "0123456789+/");
 2524|       |
 2525|    208|    last_group_len = end_index % 4;
 2526|    208|    end = encoded + end_index;
 2527|       |
 2528|       |    /* The only non-alphabet character allowed is the padding character '=' at
 2529|       |     * the end of the string. There are two allowable padding cases for the last
 2530|       |     * group of four: "xY==" or "xyZ=". We require the final (non-padding)
 2531|       |     * character to have been zero-padded during encoding, which limits the
 2532|       |     * character choices.
 2533|       |     */
 2534|    208|    if (last_group_len == 1) {
  ------------------
  |  Branch (2534:9): [True: 12, False: 196]
  ------------------
 2535|       |        /* This isn't ever valid. */
 2536|     12|        return APR_EINVAL;
  ------------------
  |  |  715|     12|#define APR_EINVAL EINVAL
  ------------------
 2537|     12|    }
 2538|    196|    else if (last_group_len == 2) {
  ------------------
  |  Branch (2538:14): [True: 28, False: 168]
  ------------------
 2539|       |        /* ...xY== */
 2540|     28|        if (*end != '=' || end[1] != '=') {
  ------------------
  |  Branch (2540:13): [True: 16, False: 12]
  |  Branch (2540:28): [True: 10, False: 2]
  ------------------
 2541|     26|            return APR_EINVAL;
  ------------------
  |  |  715|     26|#define APR_EINVAL EINVAL
  ------------------
 2542|     26|        }
 2543|      2|        else if (!ap_strchr("AQgw", end[-1])) {
  ------------------
  |  | 2585|      2|# define ap_strchr(s, c)     strchr(s, c)
  ------------------
  |  Branch (2543:18): [True: 1, False: 1]
  ------------------
 2544|       |            /* Correctly zero-padded input data will result in a final character
 2545|       |             * that is one of the four above. */
 2546|      1|            return APR_EINVAL;
  ------------------
  |  |  715|      1|#define APR_EINVAL EINVAL
  ------------------
 2547|      1|        }
 2548|       |
 2549|      1|        end += 2;
 2550|      1|    }
 2551|    168|    else if (last_group_len == 3) {
  ------------------
  |  Branch (2551:14): [True: 24, False: 144]
  ------------------
 2552|       |        /* ...xyZ= */
 2553|     24|        if (*end != '=') {
  ------------------
  |  Branch (2553:13): [True: 22, False: 2]
  ------------------
 2554|     22|            return APR_EINVAL;
  ------------------
  |  |  715|     22|#define APR_EINVAL EINVAL
  ------------------
 2555|     22|        }
 2556|      2|        else if (!ap_strchr("AEIMQUYcgkosw048", end[-1])) {
  ------------------
  |  | 2585|      2|# define ap_strchr(s, c)     strchr(s, c)
  ------------------
  |  Branch (2556:18): [True: 1, False: 1]
  ------------------
 2557|       |            /* Correctly zero-padded input data will result in a final character
 2558|       |             * that is one of the sixteen above. */
 2559|      1|            return APR_EINVAL;
  ------------------
  |  |  715|      1|#define APR_EINVAL EINVAL
  ------------------
 2560|      1|        }
 2561|       |
 2562|      1|        end++;
 2563|      1|    }
 2564|       |
 2565|       |    /* At this point, if the encoded buffer is correct, we should be at the end
 2566|       |     * of the string. */
 2567|    146|    if (*end) {
  ------------------
  |  Branch (2567:9): [True: 105, False: 41]
  ------------------
 2568|    105|        return APR_EINVAL;
  ------------------
  |  |  715|    105|#define APR_EINVAL EINVAL
  ------------------
 2569|    105|    }
 2570|       |
 2571|     41|    *decoded = apr_palloc(p, apr_base64_decode_len(encoded));
  ------------------
  |  |  425|     41|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|     41|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|     41|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|     41|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2572|     41|    *len = apr_base64_decode(*decoded, encoded);
 2573|       |
 2574|     41|    return APR_SUCCESS;
  ------------------
  |  |  225|     41|#define APR_SUCCESS 0
  ------------------
 2575|    146|}
ap_pbase64encode:
 2578|  1.11k|{
 2579|  1.11k|    char *encoded;
 2580|  1.11k|    int l = strlen(string);
 2581|       |
 2582|  1.11k|    encoded = (char *) apr_palloc(p, apr_base64_encode_len(l));
  ------------------
  |  |  425|  1.11k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.11k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.11k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  1.11k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2583|  1.11k|    apr_base64_encode(encoded, string, l);
 2584|       |
 2585|  1.11k|    return encoded;
 2586|  1.11k|}
ap_content_type_tolower:
 2596|    224|{
 2597|    224|    char *semi;
 2598|       |
 2599|    224|    semi = strchr(str, ';');
 2600|    224|    if (semi) {
  ------------------
  |  Branch (2600:9): [True: 12, False: 212]
  ------------------
 2601|     12|        *semi = '\0';
 2602|     12|    }
 2603|       |
 2604|    224|    ap_str_tolower(str);
 2605|       |
 2606|    224|    if (semi) {
  ------------------
  |  Branch (2606:9): [True: 12, False: 212]
  ------------------
 2607|     12|        *semi = ';';
 2608|     12|    }
 2609|    224|}
ap_escape_quotes:
 2615|  1.11k|{
 2616|  1.11k|    apr_size_t size, extra = 0;
 2617|  1.11k|    const char *inchr = instring;
 2618|  1.11k|    char *outchr, *outstring;
 2619|       |
 2620|       |    /*
 2621|       |     * Look through the input string, jogging the length of the output
 2622|       |     * string up by an extra byte each time we find an unescaped ".
 2623|       |     */
 2624|  47.2k|    while (*inchr != '\0') {
  ------------------
  |  Branch (2624:12): [True: 46.0k, False: 1.11k]
  ------------------
 2625|  46.0k|        if (*inchr == '"') {
  ------------------
  |  Branch (2625:13): [True: 1.20k, False: 44.8k]
  ------------------
 2626|  1.20k|            extra++;
 2627|  1.20k|        }
 2628|       |        /*
 2629|       |         * If we find a slosh, and it's not the last byte in the string,
 2630|       |         * it's escaping something - advance past both bytes.
 2631|       |         */
 2632|  44.8k|        else if ((*inchr == '\\') && (inchr[1] != '\0')) {
  ------------------
  |  Branch (2632:18): [True: 3.36k, False: 41.5k]
  |  Branch (2632:38): [True: 3.31k, False: 48]
  ------------------
 2633|  3.31k|            inchr++;
 2634|  3.31k|        }
 2635|  46.0k|        inchr++;
 2636|  46.0k|    }
 2637|       |
 2638|  1.11k|    if (!extra) {
  ------------------
  |  Branch (2638:9): [True: 855, False: 260]
  ------------------
 2639|    855|        return apr_pstrdup(p, instring);
 2640|    855|    }
 2641|       |
 2642|       |    /* How large will the string become, once we escaped all the quotes?
 2643|       |     * The tricky cases are
 2644|       |     * - an `instring` that is already longer than `ptrdiff_t`
 2645|       |     *   can hold (which is an undefined case in C, as C defines ptrdiff_t as
 2646|       |     *   a signed difference between pointers into the same array and one index
 2647|       |     *   beyond).
 2648|       |     * - an `instring` that, including the `extra` chars we want to add, becomes
 2649|       |     *   even larger than apr_size_t can handle.
 2650|       |     * Since this function was not designed to ever return NULL for failure, we
 2651|       |     * can only trigger a hard assertion failure. It seems more a programming
 2652|       |     * mistake (or failure to verify the input causing this) that leads to this
 2653|       |     * situation.
 2654|       |     */
 2655|    260|    ap_assert(inchr - instring > 0);
  ------------------
  |  | 2488|    260|#define ap_assert(exp) ((exp) ? (void)0 : ap_log_assert(#exp,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (2488:25): [True: 260, False: 0]
  |  |  ------------------
  ------------------
 2656|    260|    size = ((apr_size_t)(inchr - instring)) + 1;
 2657|    260|    ap_assert(size + extra > size);
  ------------------
  |  | 2488|    260|#define ap_assert(exp) ((exp) ? (void)0 : ap_log_assert(#exp,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (2488:25): [True: 260, False: 0]
  |  |  ------------------
  ------------------
 2658|       |
 2659|    260|    outstring = apr_palloc(p, size + extra);
  ------------------
  |  |  425|    260|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|    260|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|    260|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|    260|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2660|    260|    inchr = instring;
 2661|    260|    outchr = outstring;
 2662|       |    /*
 2663|       |     * Now copy the input string to the output string, inserting a slosh
 2664|       |     * in front of every " that doesn't already have one.
 2665|       |     */
 2666|  13.8k|    while (*inchr != '\0') {
  ------------------
  |  Branch (2666:12): [True: 13.6k, False: 260]
  ------------------
 2667|  13.6k|        if (*inchr == '"') {
  ------------------
  |  Branch (2667:13): [True: 1.20k, False: 12.4k]
  ------------------
 2668|  1.20k|            *outchr++ = '\\';
 2669|  1.20k|        }
 2670|  12.4k|        else if ((*inchr == '\\') && (inchr[1] != '\0')) {
  ------------------
  |  Branch (2670:18): [True: 806, False: 11.6k]
  |  Branch (2670:38): [True: 795, False: 11]
  ------------------
 2671|    795|            *outchr++ = *inchr++;
 2672|    795|        }
 2673|  13.6k|        *outchr++ = *inchr++;
 2674|  13.6k|    }
 2675|    260|    *outchr = '\0';
 2676|    260|    return outstring;
 2677|    260|}
ap_timeout_parameter_parse:
 2716|  1.11k|{
 2717|  1.11k|    char *endp;
 2718|  1.11k|    const char *time_str;
 2719|  1.11k|    apr_int64_t tout;
 2720|  1.11k|    apr_uint64_t check;
 2721|       |
 2722|  1.11k|    tout = apr_strtoi64(timeout_parameter, &endp, 10);
 2723|  1.11k|    if (errno) {
  ------------------
  |  Branch (2723:9): [True: 6, False: 1.10k]
  ------------------
 2724|      6|        return errno;
 2725|      6|    }
 2726|  1.10k|    if (!endp || !*endp) {
  ------------------
  |  Branch (2726:9): [True: 0, False: 1.10k]
  |  Branch (2726:18): [True: 106, False: 1.00k]
  ------------------
 2727|    106|        time_str = default_time_unit;
 2728|    106|    }
 2729|  1.00k|    else {
 2730|  1.00k|        time_str = endp;
 2731|  1.00k|    }
 2732|       |
 2733|  1.10k|    if (tout < 0) { 
  ------------------
  |  Branch (2733:9): [True: 82, False: 1.02k]
  ------------------
 2734|     82|        return APR_EGENERAL;
  ------------------
  |  |  313|     82|#define APR_EGENERAL       (APR_OS_START_ERROR + 14)
  |  |  ------------------
  |  |  |  |  117|     82|#define APR_OS_START_ERROR     20000
  |  |  ------------------
  ------------------
 2735|     82|    }
 2736|       |
 2737|  1.02k|    switch (*time_str) {
 2738|       |        /* Time is in seconds */
 2739|     54|    case 's':
  ------------------
  |  Branch (2739:5): [True: 54, False: 973]
  ------------------
 2740|     94|    case 'S':
  ------------------
  |  Branch (2740:5): [True: 40, False: 987]
  ------------------
 2741|     94|        CHECK_OVERFLOW(tout, apr_time_sec(APR_INT64_MAX));
  ------------------
  |  | 2711|     94|#define CHECK_OVERFLOW(a, b) if (a > b) return APR_EGENERAL
  |  |  ------------------
  |  |  |  |  313|     38|#define APR_EGENERAL       (APR_OS_START_ERROR + 14)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|     38|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2711:34): [True: 38, False: 56]
  |  |  ------------------
  ------------------
 2742|     56|        check = apr_time_from_sec(tout);
  ------------------
  |  |   78|     56|#define apr_time_from_sec(sec) ((apr_time_t)(sec) * APR_USEC_PER_SEC)
  |  |  ------------------
  |  |  |  |   60|     56|#define APR_USEC_PER_SEC APR_TIME_C(1000000)
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|     56|#define APR_TIME_C(val) APR_INT64_C(val)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  394|     56| #define APR_INT64_C(val) INT64_C(val)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2743|     56|        break;
 2744|       |        /* Time is in hours */
 2745|     63|    case 'h':
  ------------------
  |  Branch (2745:5): [True: 63, False: 964]
  ------------------
 2746|     87|    case 'H':
  ------------------
  |  Branch (2746:5): [True: 24, False: 1.00k]
  ------------------
 2747|     87|        CHECK_OVERFLOW(tout, apr_time_sec(APR_INT64_MAX / 3600));
  ------------------
  |  | 2711|     87|#define CHECK_OVERFLOW(a, b) if (a > b) return APR_EGENERAL
  |  |  ------------------
  |  |  |  |  313|     53|#define APR_EGENERAL       (APR_OS_START_ERROR + 14)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|     53|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2711:34): [True: 53, False: 34]
  |  |  ------------------
  ------------------
 2748|     34|        check = apr_time_from_sec(tout * 3600);
  ------------------
  |  |   78|     34|#define apr_time_from_sec(sec) ((apr_time_t)(sec) * APR_USEC_PER_SEC)
  |  |  ------------------
  |  |  |  |   60|     34|#define APR_USEC_PER_SEC APR_TIME_C(1000000)
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|     34|#define APR_TIME_C(val) APR_INT64_C(val)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  394|     34| #define APR_INT64_C(val) INT64_C(val)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2749|     34|        break;
 2750|    128|    case 'm':
  ------------------
  |  Branch (2750:5): [True: 128, False: 899]
  ------------------
 2751|    196|    case 'M':
  ------------------
  |  Branch (2751:5): [True: 68, False: 959]
  ------------------
 2752|    196|        switch (*(++time_str)) {
 2753|       |        /* Time is in milliseconds */
 2754|    102|        case 's':
  ------------------
  |  Branch (2754:9): [True: 102, False: 94]
  ------------------
 2755|    104|        case 'S':
  ------------------
  |  Branch (2755:9): [True: 2, False: 194]
  ------------------
 2756|    104|            CHECK_OVERFLOW(tout, apr_time_as_msec(APR_INT64_MAX));
  ------------------
  |  | 2711|    104|#define CHECK_OVERFLOW(a, b) if (a > b) return APR_EGENERAL
  |  |  ------------------
  |  |  |  |  313|     30|#define APR_EGENERAL       (APR_OS_START_ERROR + 14)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|     30|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2711:34): [True: 30, False: 74]
  |  |  ------------------
  ------------------
 2757|     74|            check = apr_time_from_msec(tout);
  ------------------
  |  |   75|     74|#define apr_time_from_msec(msec) ((apr_time_t)(msec) * 1000)
  ------------------
 2758|     74|            break;
 2759|       |        /* Time is in minutes */
 2760|     60|        case 'i':
  ------------------
  |  Branch (2760:9): [True: 60, False: 136]
  ------------------
 2761|     89|        case 'I':
  ------------------
  |  Branch (2761:9): [True: 29, False: 167]
  ------------------
 2762|     89|            CHECK_OVERFLOW(tout, apr_time_sec(APR_INT64_MAX / 60));
  ------------------
  |  | 2711|     89|#define CHECK_OVERFLOW(a, b) if (a > b) return APR_EGENERAL
  |  |  ------------------
  |  |  |  |  313|     43|#define APR_EGENERAL       (APR_OS_START_ERROR + 14)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|     43|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2711:34): [True: 43, False: 46]
  |  |  ------------------
  ------------------
 2763|     46|            check = apr_time_from_sec(tout * 60);
  ------------------
  |  |   78|     46|#define apr_time_from_sec(sec) ((apr_time_t)(sec) * APR_USEC_PER_SEC)
  |  |  ------------------
  |  |  |  |   60|     46|#define APR_USEC_PER_SEC APR_TIME_C(1000000)
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|     46|#define APR_TIME_C(val) APR_INT64_C(val)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  394|     46| #define APR_INT64_C(val) INT64_C(val)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2764|     46|            break;
 2765|      3|        default:
  ------------------
  |  Branch (2765:9): [True: 3, False: 193]
  ------------------
 2766|      3|            return APR_EGENERAL;
  ------------------
  |  |  313|      3|#define APR_EGENERAL       (APR_OS_START_ERROR + 14)
  |  |  ------------------
  |  |  |  |  117|      3|#define APR_OS_START_ERROR     20000
  |  |  ------------------
  ------------------
 2767|    196|        }
 2768|    120|        break;
 2769|    650|    default:
  ------------------
  |  Branch (2769:5): [True: 650, False: 377]
  ------------------
 2770|    650|        return APR_EGENERAL;
  ------------------
  |  |  313|    650|#define APR_EGENERAL       (APR_OS_START_ERROR + 14)
  |  |  ------------------
  |  |  |  |  117|    650|#define APR_OS_START_ERROR     20000
  |  |  ------------------
  ------------------
 2771|  1.02k|    }
 2772|       |
 2773|    210|    *timeout = (apr_interval_time_t)check;
 2774|    210|    return APR_SUCCESS;
  ------------------
  |  |  225|    210|#define APR_SUCCESS 0
  ------------------
 2775|  1.02k|}
ap_str2_alnum:
 2851|  1.11k|AP_DECLARE(apr_status_t) ap_str2_alnum(const char *src, char *dest) {
 2852|       |
 2853|  50.5k|    for ( ; *src; src++, dest++)
  ------------------
  |  Branch (2853:13): [True: 49.4k, False: 1.11k]
  ------------------
 2854|  49.4k|    {
 2855|  49.4k|        if (!apr_isprint(*src))
  ------------------
  |  |  224|  49.4k|#define apr_isprint(c) (isprint(((unsigned char)(c))))
  ------------------
  |  Branch (2855:13): [True: 15.1k, False: 34.2k]
  ------------------
 2856|  15.1k|            *dest = 'x';
 2857|  34.2k|        else if (!apr_isalnum(*src))
  ------------------
  |  |  206|  34.2k|#define apr_isalnum(c) (isalnum(((unsigned char)(c))))
  ------------------
  |  Branch (2857:18): [True: 20.2k, False: 13.9k]
  ------------------
 2858|  20.2k|            *dest = '_';
 2859|  13.9k|        else
 2860|  13.9k|            *dest = (char)*src;
 2861|  49.4k|    }
 2862|  1.11k|    *dest = '\0';
 2863|  1.11k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.11k|#define APR_SUCCESS 0
  ------------------
 2864|       |
 2865|  1.11k|}
ap_pstr2_alnum:
 2869|  1.11k|{
 2870|  1.11k|    char *new = apr_palloc(p, strlen(src)+1);
  ------------------
  |  |  425|  1.11k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.11k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.11k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  1.11k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2871|  1.11k|    if (!new)
  ------------------
  |  Branch (2871:9): [True: 0, False: 1.11k]
  ------------------
 2872|      0|        return APR_ENOMEM;
  ------------------
  |  |  687|      0|#define APR_ENOMEM ENOMEM
  ------------------
 2873|  1.11k|    *dest = new;
 2874|  1.11k|    return ap_str2_alnum(src, new);
 2875|  1.11k|}
ap_cstr_stripws:
 3730|    943|{
 3731|    943|    char *end = str + strlen(str);
 3732|       |
 3733|  1.30k|    while (end > str && apr_isspace(end[-1])) {
  ------------------
  |  |  228|  1.22k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (228:24): [True: 359, False: 867]
  |  |  ------------------
  ------------------
  |  Branch (3733:12): [True: 1.22k, False: 76]
  ------------------
 3734|    359|        --end;
 3735|    359|    }
 3736|    943|    *end = '\0';
 3737|       |
 3738|    943|    return end;
 3739|    943|}
ap_cstr_casecmp:
 3742|  2.23k|{
 3743|  2.23k|    const unsigned char *u1 = (const unsigned char *)s1;
 3744|  2.23k|    const unsigned char *u2 = (const unsigned char *)s2;
 3745|  2.61k|    for (;;) {
 3746|  2.61k|        const int c2 = ucharmap[*u2++];
 3747|  2.61k|        const int cmp = (int)ucharmap[*u1++] - c2;
 3748|       |        /* Not necessary to test for !c1, this is caught by cmp */
 3749|  2.61k|        if (cmp || !c2)
  ------------------
  |  Branch (3749:13): [True: 2.21k, False: 407]
  |  Branch (3749:20): [True: 18, False: 389]
  ------------------
 3750|  2.23k|            return cmp;
 3751|  2.61k|    }
 3752|  2.23k|}
ap_cstr_casecmpn:
 3755|  5.57k|{
 3756|  5.57k|    const unsigned char *u1 = (const unsigned char *)s1;
 3757|  5.57k|    const unsigned char *u2 = (const unsigned char *)s2;
 3758|  7.59k|    while (n--) {
  ------------------
  |  Branch (3758:12): [True: 7.47k, False: 122]
  ------------------
 3759|  7.47k|        const int c2 = ucharmap[*u2++];
 3760|  7.47k|        const int cmp = (int)ucharmap[*u1++] - c2;
 3761|       |        /* Not necessary to test for !c1, this is caught by cmp */
 3762|  7.47k|        if (cmp || !c2)
  ------------------
  |  Branch (3762:13): [True: 5.44k, False: 2.02k]
  |  Branch (3762:20): [True: 0, False: 2.02k]
  ------------------
 3763|  5.44k|            return cmp;
 3764|  7.47k|    }
 3765|    122|    return 0;
 3766|  5.57k|}
util.c:substring_conf:
  809|  1.09k|{
  810|  1.09k|    char *result = apr_palloc(p, len + 1);
  ------------------
  |  |  425|  1.09k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.09k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.09k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  1.09k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  811|  1.09k|    char *resp = result;
  812|  1.09k|    int i;
  813|       |
  814|  28.6k|    for (i = 0; i < len; ++i) {
  ------------------
  |  Branch (814:17): [True: 27.5k, False: 1.09k]
  ------------------
  815|  27.5k|        if (start[i] == '\\' && (start[i + 1] == '\\'
  ------------------
  |  Branch (815:13): [True: 1.57k, False: 26.0k]
  |  Branch (815:34): [True: 680, False: 892]
  ------------------
  816|    892|                                 || (quote && start[i + 1] == quote)))
  ------------------
  |  Branch (816:38): [True: 314, False: 578]
  |  Branch (816:47): [True: 75, False: 239]
  ------------------
  817|    755|            *resp++ = start[++i];
  818|  26.8k|        else
  819|  26.8k|            *resp++ = start[i];
  820|  27.5k|    }
  821|       |
  822|  1.09k|    *resp++ = '\0';
  823|       |#if RESOLVE_ENV_PER_TOKEN
  824|       |    return (char *)ap_resolve_env(p,result);
  825|       |#else
  826|  1.09k|    return result;
  827|  1.09k|#endif
  828|  1.09k|}
util.c:cfg_getch:
  949|  14.9k|{
  950|  14.9k|    return apr_file_getc(ch, param);
  951|  14.9k|}
util.c:cfg_getstr:
  954|   795k|{
  955|   795k|    return apr_file_gets(buf, bufsiz, param);
  956|   795k|}
util.c:ap_cfg_getline_core:
 1083|  1.11k|{
 1084|  1.11k|    apr_status_t rc;
 1085|       |    /* If a "get string" function is defined, use it */
 1086|  1.11k|    if (cfp->getstr != NULL) {
  ------------------
  |  Branch (1086:9): [True: 1.02k, False: 93]
  ------------------
 1087|  1.02k|        char *cp;
 1088|  1.02k|        char *cbuf = buf + offset;
 1089|  1.02k|        apr_size_t cbufsize = bufsize - offset;
 1090|       |
 1091|   795k|        while (1) {
  ------------------
  |  Branch (1091:16): [True: 795k, Folded]
  ------------------
 1092|   795k|            ++cfp->line_number;
 1093|   795k|            rc = cfp->getstr(cbuf, cbufsize, cfp->param);
 1094|   795k|            if (rc == APR_EOF) {
  ------------------
  |  |  467|   795k|#define APR_EOF            (APR_OS_START_STATUS + 14)
  |  |  ------------------
  |  |  |  |  136|   795k|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|   795k|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|   795k|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1094:17): [True: 14, False: 795k]
  ------------------
 1095|     14|                if (cbuf != buf + offset) {
  ------------------
  |  Branch (1095:21): [True: 11, False: 3]
  ------------------
 1096|     11|                    *cbuf = '\0';
 1097|     11|                    break;
 1098|     11|                }
 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|     14|            }
 1103|   795k|            if (rc != APR_SUCCESS) {
  ------------------
  |  |  225|   795k|#define APR_SUCCESS 0
  ------------------
  |  Branch (1103:17): [True: 0, False: 795k]
  ------------------
 1104|      0|                return rc;
 1105|      0|            }
 1106|       |
 1107|       |            /*
 1108|       |             *  check for line continuation,
 1109|       |             *  i.e. match [^\\]\\[\r]\n only
 1110|       |             */
 1111|   795k|            cp = cbuf;
 1112|   795k|            cp += strlen(cp);
 1113|   795k|            if (cp > buf && cp[-1] == LF) {
  ------------------
  |  |  738|   795k|#define LF 10
  ------------------
  |  Branch (1113:17): [True: 795k, False: 9]
  |  Branch (1113:29): [True: 794k, False: 814]
  ------------------
 1114|   794k|                cp--;
 1115|   794k|                if (cp > buf && cp[-1] == CR)
  ------------------
  |  |  740|   794k|#define CR 13
  ------------------
  |  Branch (1115:21): [True: 794k, False: 45]
  |  Branch (1115:33): [True: 401, False: 793k]
  ------------------
 1116|    401|                    cp--;
 1117|   794k|                if (cp > buf && cp[-1] == '\\') {
  ------------------
  |  Branch (1117:21): [True: 794k, False: 46]
  |  Branch (1117:33): [True: 794k, False: 139]
  ------------------
 1118|   794k|                    cp--;
 1119|       |                    /*
 1120|       |                     * line continuation requested -
 1121|       |                     * then remove backslash and continue
 1122|       |                     */
 1123|   794k|                    cbufsize -= (cp-cbuf);
 1124|   794k|                    cbuf = cp;
 1125|   794k|                    continue;
 1126|   794k|                }
 1127|   794k|            }
 1128|    823|            else if (cp - buf >= bufsize - 1) {
  ------------------
  |  Branch (1128:22): [True: 128, False: 695]
  ------------------
 1129|    128|                return APR_ENOSPC;
  ------------------
  |  |  680|    128|#define APR_ENOSPC ENOSPC
  ------------------
 1130|    128|            }
 1131|    880|            break;
 1132|   795k|        }
 1133|  1.02k|    } else {
 1134|       |        /* No "get string" function defined; read character by character */
 1135|     93|        apr_size_t i = offset;
 1136|       |
 1137|     93|        if (bufsize < 2) {
  ------------------
  |  Branch (1137:13): [True: 0, False: 93]
  ------------------
 1138|       |            /* too small, assume caller is crazy */
 1139|      0|            return APR_EINVAL;
  ------------------
  |  |  715|      0|#define APR_EINVAL EINVAL
  ------------------
 1140|      0|        }
 1141|     93|        buf[offset] = '\0';
 1142|       |
 1143|  14.9k|        while (1) {
  ------------------
  |  Branch (1143:16): [True: 14.9k, Folded]
  ------------------
 1144|  14.9k|            char c;
 1145|  14.9k|            rc = cfp->getch(&c, cfp->param);
 1146|  14.9k|            if (rc == APR_EOF) {
  ------------------
  |  |  467|  14.9k|#define APR_EOF            (APR_OS_START_STATUS + 14)
  |  |  ------------------
  |  |  |  |  136|  14.9k|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|  14.9k|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|  14.9k|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1146:17): [True: 16, False: 14.8k]
  ------------------
 1147|     16|                if (i > offset)
  ------------------
  |  Branch (1147:21): [True: 16, False: 0]
  ------------------
 1148|     16|                    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|     16|            }
 1152|  14.8k|            if (rc != APR_SUCCESS)
  ------------------
  |  |  225|  14.8k|#define APR_SUCCESS 0
  ------------------
  |  Branch (1152:17): [True: 0, False: 14.8k]
  ------------------
 1153|      0|                return rc;
 1154|  14.8k|            if (c == LF) {
  ------------------
  |  |  738|  14.8k|#define LF 10
  ------------------
  |  Branch (1154:17): [True: 4.66k, False: 10.2k]
  ------------------
 1155|  4.66k|                ++cfp->line_number;
 1156|       |                /* check for line continuation */
 1157|  4.66k|                if (i > 0 && buf[i-1] == '\\') {
  ------------------
  |  Branch (1157:21): [True: 4.65k, False: 5]
  |  Branch (1157:30): [True: 4.62k, False: 31]
  ------------------
 1158|  4.62k|                    i--;
 1159|  4.62k|                    continue;
 1160|  4.62k|                }
 1161|     36|                else {
 1162|     36|                    break;
 1163|     36|                }
 1164|  4.66k|            }
 1165|  10.2k|            buf[i] = c;
 1166|  10.2k|            ++i;
 1167|  10.2k|            if (i >= bufsize - 1) {
  ------------------
  |  Branch (1167:17): [True: 41, False: 10.1k]
  ------------------
 1168|     41|                return APR_ENOSPC;
  ------------------
  |  |  680|     41|#define APR_ENOSPC ENOSPC
  ------------------
 1169|     41|            }
 1170|  10.2k|        }
 1171|     52|        buf[i] = '\0';
 1172|     52|    }
 1173|    943|    return APR_SUCCESS;
  ------------------
  |  |  225|    943|#define APR_SUCCESS 0
  ------------------
 1174|  1.11k|}
util.c:cfg_trim_line:
 1177|    943|{
 1178|    943|    char *start, *end;
 1179|       |    /*
 1180|       |     * Leading and trailing white space is eliminated completely
 1181|       |     */
 1182|    943|    start = buf;
 1183|  1.81k|    while (apr_isspace(*start))
  ------------------
  |  |  228|  1.81k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (228:24): [True: 870, False: 943]
  |  |  ------------------
  ------------------
 1184|    870|        ++start;
 1185|       |    /* blast trailing whitespace */
 1186|    943|    end = ap_cstr_stripws(start);
 1187|       |    /* Zap leading whitespace by shifting */
 1188|    943|    if (start != buf)
  ------------------
  |  Branch (1188:9): [True: 254, False: 689]
  ------------------
 1189|    254|        memmove(buf, start, end - start + 1);
 1190|       |#ifdef DEBUG_CFG_LINES
 1191|       |    ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, NULL, APLOGNO(00555) "Read config: '%s'", buf);
 1192|       |#endif
 1193|    943|    return end - start;
 1194|    943|}
util.c:find_list_item:
 1411|  1.11k|{
 1412|  1.11k|    const unsigned char *pos;
 1413|  1.11k|    const unsigned char *ptr = (const unsigned char *)line;
 1414|  1.11k|    int good = 0, addspace = 0, in_qpair = 0, in_qstr = 0, in_com = 0;
 1415|       |
 1416|  1.11k|    if (!line || !tok) {
  ------------------
  |  Branch (1416:9): [True: 0, False: 1.11k]
  |  Branch (1416:18): [True: 0, False: 1.11k]
  ------------------
 1417|      0|        return 0;
 1418|      0|    }
 1419|  1.11k|    if (type == AP_ETAG_STRONG && *tok != '\"') {
  ------------------
  |  Branch (1419:9): [True: 0, False: 1.11k]
  |  Branch (1419:35): [True: 0, False: 0]
  ------------------
 1420|      0|        return 0;
 1421|      0|    }
 1422|  1.11k|    if (type == AP_ETAG_WEAK) {
  ------------------
  |  Branch (1422:9): [True: 0, False: 1.11k]
  ------------------
 1423|      0|        if (*tok == 'W' && (*(tok+1)) == '/' && (*(tok+2)) == '\"') {
  ------------------
  |  Branch (1423:13): [True: 0, False: 0]
  |  Branch (1423:28): [True: 0, False: 0]
  |  Branch (1423:49): [True: 0, False: 0]
  ------------------
 1424|      0|            tok += 2;
 1425|      0|        }
 1426|      0|        else if (*tok != '\"') {
  ------------------
  |  Branch (1426:18): [True: 0, False: 0]
  ------------------
 1427|      0|            return 0;
 1428|      0|        }
 1429|      0|    }
 1430|       |
 1431|  2.97k|    do {  /* loop for each item in line's list */
 1432|       |
 1433|       |        /* Find first non-comma, non-whitespace byte */
 1434|  6.85k|        while (*ptr == ',' || apr_isspace(*ptr)) {
  ------------------
  |  |  228|  4.45k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (228:24): [True: 1.47k, False: 2.97k]
  |  |  ------------------
  ------------------
  |  Branch (1434:16): [True: 2.40k, False: 4.45k]
  ------------------
 1435|  3.87k|            ++ptr;
 1436|  3.87k|        }
 1437|       |
 1438|       |        /* Account for strong or weak Etags, depending on our search */
 1439|  2.97k|        if (type == AP_ETAG_STRONG && *ptr != '\"') {
  ------------------
  |  Branch (1439:13): [True: 0, False: 2.97k]
  |  Branch (1439:39): [True: 0, False: 0]
  ------------------
 1440|      0|            break;
 1441|      0|        }
 1442|  2.97k|        if (type == AP_ETAG_WEAK) {
  ------------------
  |  Branch (1442:13): [True: 0, False: 2.97k]
  ------------------
 1443|      0|            if (*ptr == 'W' && (*(ptr+1)) == '/' && (*(ptr+2)) == '\"') {
  ------------------
  |  Branch (1443:17): [True: 0, False: 0]
  |  Branch (1443:32): [True: 0, False: 0]
  |  Branch (1443:53): [True: 0, False: 0]
  ------------------
 1444|      0|                ptr += 2;
 1445|      0|            }
 1446|      0|            else if (*ptr != '\"') {
  ------------------
  |  Branch (1446:22): [True: 0, False: 0]
  ------------------
 1447|      0|                break;
 1448|      0|            }
 1449|      0|        }
 1450|       |
 1451|  2.97k|        if (*ptr)
  ------------------
  |  Branch (1451:13): [True: 2.92k, False: 49]
  ------------------
 1452|  2.92k|            good = 1;  /* until proven otherwise for this item */
 1453|     49|        else
 1454|     49|            break;     /* no items left and nothing good found */
 1455|       |
 1456|       |        /* We skip extra whitespace and any whitespace around a '=', '/',
 1457|       |         * or ';' and lowercase normal characters not within a comment,
 1458|       |         * quoted-string or quoted-pair.
 1459|       |         */
 1460|  2.92k|        for (pos = (const unsigned char *)tok;
 1461|  48.4k|             *ptr && (in_qpair || in_qstr || in_com || *ptr != ',');
  ------------------
  |  Branch (1461:14): [True: 47.3k, False: 1.06k]
  |  Branch (1461:23): [True: 3.31k, False: 44.0k]
  |  Branch (1461:35): [True: 5.02k, False: 39.0k]
  |  Branch (1461:46): [True: 3.85k, False: 35.1k]
  |  Branch (1461:56): [True: 33.2k, False: 1.85k]
  ------------------
 1462|  45.4k|             ++ptr) {
 1463|       |
 1464|  45.4k|            if (in_qpair) {
  ------------------
  |  Branch (1464:17): [True: 3.31k, False: 42.1k]
  ------------------
 1465|  3.31k|                in_qpair = 0;
 1466|  3.31k|                if (good)
  ------------------
  |  Branch (1466:21): [True: 0, False: 3.31k]
  ------------------
 1467|      0|                    good = (*pos++ == *ptr);
 1468|  3.31k|            }
 1469|  42.1k|            else {
 1470|  42.1k|                switch (*ptr) {
 1471|  3.36k|                    case '\\': in_qpair = 1;
  ------------------
  |  Branch (1471:21): [True: 3.36k, False: 38.8k]
  ------------------
 1472|  3.36k|                               if (addspace == 1)
  ------------------
  |  Branch (1472:36): [True: 33, False: 3.33k]
  ------------------
 1473|     33|                                   good = good && (*pos++ == ' ');
  ------------------
  |  Branch (1473:43): [True: 33, False: 0]
  |  Branch (1473:51): [True: 0, False: 33]
  ------------------
 1474|  3.36k|                               good = good && (*pos++ == *ptr);
  ------------------
  |  Branch (1474:39): [True: 127, False: 3.23k]
  |  Branch (1474:47): [True: 0, False: 127]
  ------------------
 1475|  3.36k|                               addspace = 0;
 1476|  3.36k|                               break;
 1477|  1.20k|                    case '"' : if (!in_com)
  ------------------
  |  Branch (1477:21): [True: 1.20k, False: 40.9k]
  |  Branch (1477:36): [True: 1.01k, False: 193]
  ------------------
 1478|  1.01k|                                   in_qstr = !in_qstr;
 1479|  1.20k|                               if (addspace == 1)
  ------------------
  |  Branch (1479:36): [True: 24, False: 1.17k]
  ------------------
 1480|     24|                                   good = good && (*pos++ == ' ');
  ------------------
  |  Branch (1480:43): [True: 24, False: 0]
  |  Branch (1480:51): [True: 0, False: 24]
  ------------------
 1481|  1.20k|                               good = good && (*pos++ == *ptr);
  ------------------
  |  Branch (1481:39): [True: 111, False: 1.09k]
  |  Branch (1481:47): [True: 0, False: 111]
  ------------------
 1482|  1.20k|                               addspace = 0;
 1483|  1.20k|                               break;
 1484|  1.02k|                    case '(' : if (!in_qstr)
  ------------------
  |  Branch (1484:21): [True: 1.02k, False: 41.1k]
  |  Branch (1484:36): [True: 878, False: 145]
  ------------------
 1485|    878|                                   ++in_com;
 1486|  1.02k|                               if (addspace == 1)
  ------------------
  |  Branch (1486:36): [True: 47, False: 976]
  ------------------
 1487|     47|                                   good = good && (*pos++ == ' ');
  ------------------
  |  Branch (1487:43): [True: 47, False: 0]
  |  Branch (1487:51): [True: 0, False: 47]
  ------------------
 1488|  1.02k|                               good = good && (*pos++ == *ptr);
  ------------------
  |  Branch (1488:39): [True: 63, False: 960]
  |  Branch (1488:47): [True: 0, False: 63]
  ------------------
 1489|  1.02k|                               addspace = 0;
 1490|  1.02k|                               break;
 1491|    854|                    case ')' : if (in_com)
  ------------------
  |  Branch (1491:21): [True: 854, False: 41.3k]
  |  Branch (1491:36): [True: 311, False: 543]
  ------------------
 1492|    311|                                   --in_com;
 1493|    854|                               good = good && (*pos++ == *ptr);
  ------------------
  |  Branch (1493:39): [True: 106, False: 748]
  |  Branch (1493:47): [True: 0, False: 106]
  ------------------
 1494|    854|                               addspace = 0;
 1495|    854|                               break;
 1496|  1.81k|                    case ' ' :
  ------------------
  |  Branch (1496:21): [True: 1.81k, False: 40.3k]
  ------------------
 1497|  2.95k|                    case '\t': if (addspace || !good)
  ------------------
  |  Branch (1497:21): [True: 1.13k, False: 41.0k]
  |  Branch (1497:36): [True: 283, False: 2.67k]
  |  Branch (1497:48): [True: 2.48k, False: 184]
  ------------------
 1498|  2.77k|                                   break;
 1499|    184|                               if (in_com || in_qstr)
  ------------------
  |  Branch (1499:36): [True: 0, False: 184]
  |  Branch (1499:46): [True: 0, False: 184]
  ------------------
 1500|      0|                                   good = (*pos++ == *ptr);
 1501|    184|                               else
 1502|    184|                                   addspace = 1;
 1503|    184|                               break;
 1504|    394|                    case '=' :
  ------------------
  |  Branch (1504:21): [True: 394, False: 41.7k]
  ------------------
 1505|  1.23k|                    case '/' :
  ------------------
  |  Branch (1505:21): [True: 839, False: 41.3k]
  ------------------
 1506|  1.57k|                    case ';' : if (!(in_com || in_qstr))
  ------------------
  |  Branch (1506:21): [True: 342, False: 41.8k]
  |  Branch (1506:38): [True: 188, False: 1.38k]
  |  Branch (1506:48): [True: 190, False: 1.19k]
  ------------------
 1507|  1.19k|                                   addspace = -1;
 1508|  1.57k|                               good = good && (*pos++ == *ptr);
  ------------------
  |  Branch (1508:39): [True: 118, False: 1.45k]
  |  Branch (1508:47): [True: 0, False: 118]
  ------------------
 1509|  1.57k|                               break;
 1510|  31.2k|                    default  : if (!good)
  ------------------
  |  Branch (1510:21): [True: 31.2k, False: 10.9k]
  |  Branch (1510:36): [True: 28.3k, False: 2.84k]
  ------------------
 1511|  28.3k|                                   break;
 1512|  2.84k|                               if (addspace == 1)
  ------------------
  |  Branch (1512:36): [True: 69, False: 2.77k]
  ------------------
 1513|     69|                                   good = (*pos++ == ' ');
 1514|  2.84k|                               if (in_com || in_qstr)
  ------------------
  |  Branch (1514:36): [True: 0, False: 2.84k]
  |  Branch (1514:46): [True: 0, False: 2.84k]
  ------------------
 1515|      0|                                   good = good && (*pos++ == *ptr);
  ------------------
  |  Branch (1515:43): [True: 0, False: 0]
  |  Branch (1515:51): [True: 0, False: 0]
  ------------------
 1516|  2.84k|                               else
 1517|  2.84k|                                   good = good
  ------------------
  |  Branch (1517:43): [True: 2.77k, False: 69]
  ------------------
 1518|  2.77k|                                       && (apr_tolower(*pos++) == apr_tolower(*ptr));
  ------------------
  |  |  234|  2.77k|#define apr_tolower(c) (tolower(((unsigned char)(c))))
  ------------------
                                                     && (apr_tolower(*pos++) == apr_tolower(*ptr));
  ------------------
  |  |  234|  2.77k|#define apr_tolower(c) (tolower(((unsigned char)(c))))
  ------------------
  |  Branch (1518:43): [True: 755, False: 2.01k]
  |  Branch (1518:44): [True: 0, False: 0]
  |  Branch (1518:44): [Folded, False: 0]
  |  Branch (1518:44): [Folded, False: 2.77k]
  |  Branch (1518:67): [True: 0, False: 0]
  |  Branch (1518:67): [True: 0, False: 0]
  |  Branch (1518:67): [Folded, False: 2.77k]
  ------------------
 1519|  2.84k|                               addspace = 0;
 1520|  2.84k|                               break;
 1521|  42.1k|                }
 1522|  42.1k|            }
 1523|  45.4k|        }
 1524|  2.92k|        if (good && *pos)
  ------------------
  |  Branch (1524:13): [True: 209, False: 2.71k]
  |  Branch (1524:21): [True: 207, False: 2]
  ------------------
 1525|    207|            good = 0;          /* not good if only a prefix was matched */
 1526|       |
 1527|  2.92k|    } while (*ptr && !good);
  ------------------
  |  Branch (1527:14): [True: 1.85k, False: 1.06k]
  |  Branch (1527:22): [True: 1.85k, False: 1]
  ------------------
 1528|       |
 1529|  1.11k|    return good;
 1530|  1.11k|}
util.c:find_last_token:
 1760|  2.21k|{
 1761|  2.21k|    int llen, tlen, lidx;
 1762|       |
 1763|  2.21k|    if (!line)
  ------------------
  |  Branch (1763:9): [True: 0, False: 2.21k]
  ------------------
 1764|      0|        return NULL;
 1765|       |
 1766|  2.21k|    llen = strlen(line);
 1767|  2.21k|    tlen = strlen(tok);
 1768|  2.21k|    lidx = llen - tlen;
 1769|       |
 1770|  2.21k|    if (lidx < 0 ||
  ------------------
  |  Branch (1770:9): [True: 145, False: 2.07k]
  ------------------
 1771|  2.07k|        (lidx > 0 && !(apr_isspace(line[lidx - 1]) || line[lidx - 1] == ',')))
  ------------------
  |  |  228|  4.09k|#define apr_isspace(c) (isspace(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (228:24): [True: 280, False: 1.76k]
  |  |  ------------------
  ------------------
  |  Branch (1771:10): [True: 2.04k, False: 28]
  |  Branch (1771:55): [True: 102, False: 1.66k]
  ------------------
 1772|  1.80k|        return NULL;
 1773|       |
 1774|    410|    if (ap_cstr_casecmpn(&line[lidx], tok, tlen) == 0) { 
  ------------------
  |  Branch (1774:9): [True: 19, False: 391]
  ------------------
 1775|     19|        return &line[lidx];
 1776|     19|    }
 1777|    391|   return NULL;
 1778|    410|}
util.c:x2c:
 1848|    596|{
 1849|    596|    char digit;
 1850|       |
 1851|    596|#if !APR_CHARSET_EBCDIC
 1852|    596|    digit = ((what[0] >= 'A') ? ((what[0] & 0xdf) - 'A') + 10
  ------------------
  |  Branch (1852:14): [True: 140, False: 456]
  ------------------
 1853|    596|             : (what[0] - '0'));
 1854|    596|    digit *= 16;
 1855|    596|    digit += (what[1] >= 'A' ? ((what[1] & 0xdf) - 'A') + 10
  ------------------
  |  Branch (1855:15): [True: 258, False: 338]
  ------------------
 1856|    596|              : (what[1] - '0'));
 1857|       |#else /*APR_CHARSET_EBCDIC*/
 1858|       |    char xstr[5];
 1859|       |    xstr[0]='0';
 1860|       |    xstr[1]='x';
 1861|       |    xstr[2]=what[0];
 1862|       |    xstr[3]=what[1];
 1863|       |    xstr[4]='\0';
 1864|       |    digit = apr_xlate_conv_byte(ap_hdrs_from_ascii,
 1865|       |                                0xFF & strtol(xstr, NULL, 16));
 1866|       |#endif /*APR_CHARSET_EBCDIC*/
 1867|    596|    return (digit);
 1868|    596|}
util.c:unescape_url:
 1881|    555|{
 1882|    555|    const int keep_slashes = (flags & AP_UNESCAPE_URL_KEEP_SLASHES) != 0,
  ------------------
  |  | 1839|    555|#define AP_UNESCAPE_URL_KEEP_SLASHES    (1u << 2)
  ------------------
 1883|    555|              forbid_slashes = (flags & AP_UNESCAPE_URL_FORBID_SLASHES) != 0,
  ------------------
  |  | 1838|    555|#define AP_UNESCAPE_URL_FORBID_SLASHES  (1u << 1)
  ------------------
 1884|    555|              keep_unreserved = (flags & AP_UNESCAPE_URL_KEEP_UNRESERVED) != 0;
  ------------------
  |  | 1837|    555|#define AP_UNESCAPE_URL_KEEP_UNRESERVED (1u << 0)
  ------------------
 1885|    555|    int badesc, badpath;
 1886|    555|    char *x, *y;
 1887|       |
 1888|    555|    badesc = 0;
 1889|    555|    badpath = 0;
 1890|       |
 1891|    555|    if (url == NULL) {
  ------------------
  |  Branch (1891:9): [True: 0, False: 555]
  ------------------
 1892|      0|        return OK;
  ------------------
  |  |  461|      0|#define OK           0  /**< Module has handled this stage. */
  ------------------
 1893|      0|    }
 1894|       |    /* Initial scan for first '%'. Don't bother writing values before
 1895|       |     * seeing a '%' */
 1896|    555|    y = strchr(url, '%');
 1897|    555|    if (y == NULL) {
  ------------------
  |  Branch (1897:9): [True: 419, False: 136]
  ------------------
 1898|    419|        return OK;
  ------------------
  |  |  461|    419|#define OK           0  /**< Module has handled this stage. */
  ------------------
 1899|    419|    }
 1900|  4.95k|    for (x = y; *y; ++x, ++y) {
  ------------------
  |  Branch (1900:17): [True: 4.82k, False: 136]
  ------------------
 1901|  4.82k|        if (*y != '%') {
  ------------------
  |  Branch (1901:13): [True: 3.46k, False: 1.36k]
  ------------------
 1902|  3.46k|            *x = *y;
 1903|  3.46k|        }
 1904|  1.36k|        else {
 1905|  1.36k|            if (!apr_isxdigit(*(y + 1)) || !apr_isxdigit(*(y + 2))) {
  ------------------
  |  |  232|  2.72k|#define apr_isxdigit(c) (isxdigit(((unsigned char)(c))))
  ------------------
                          if (!apr_isxdigit(*(y + 1)) || !apr_isxdigit(*(y + 2))) {
  ------------------
  |  |  232|    756|#define apr_isxdigit(c) (isxdigit(((unsigned char)(c))))
  ------------------
  |  Branch (1905:17): [True: 604, False: 756]
  |  Branch (1905:44): [True: 160, False: 596]
  ------------------
 1906|    764|                badesc = 1;
 1907|    764|                *x = '%';
 1908|    764|            }
 1909|    596|            else {
 1910|    596|                char decoded;
 1911|    596|                decoded = x2c(y + 1);
 1912|    596|                if ((decoded == '\0')
  ------------------
  |  Branch (1912:21): [True: 112, False: 484]
  ------------------
 1913|    484|                    || (forbid_slashes && AP_IS_SLASH(decoded))
  ------------------
  |  | 2957|      0|#define AP_IS_SLASH(s) (s == '/')
  |  |  ------------------
  |  |  |  Branch (2957:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1913:25): [True: 0, False: 484]
  ------------------
 1914|    484|                    || (forbid && ap_strchr_c(forbid, decoded))) {
  ------------------
  |  | 2587|    320|# define ap_strchr_c(s, c)   strchr(s, c)
  |  |  ------------------
  |  |  |  Branch (2587:30): [True: 98, False: 222]
  |  |  ------------------
  ------------------
  |  Branch (1914:25): [True: 320, False: 164]
  ------------------
 1915|    210|                    badpath = 1;
 1916|    210|                    *x = decoded;
 1917|    210|                    y += 2;
 1918|    210|                }
 1919|    386|                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 (1919:27): [True: 0, False: 386]
  ------------------
 1920|    386|                                                       T_URI_UNRESERVED))
 1921|    386|                         || (keep_slashes && AP_IS_SLASH(decoded))
  ------------------
  |  | 2957|      0|#define AP_IS_SLASH(s) (s == '/')
  |  |  ------------------
  |  |  |  Branch (2957:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1921:30): [True: 0, False: 386]
  ------------------
 1922|    386|                         || (reserved && ap_strchr_c(reserved, decoded))) {
  ------------------
  |  | 2587|      0|# define ap_strchr_c(s, c)   strchr(s, c)
  |  |  ------------------
  |  |  |  Branch (2587:30): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1922:30): [True: 0, False: 386]
  ------------------
 1923|      0|                    *x++ = *y++;
 1924|      0|                    *x++ = *y++;
 1925|      0|                    *x = *y;
 1926|      0|                }
 1927|    386|                else {
 1928|    386|                    *x = decoded;
 1929|    386|                    y += 2;
 1930|    386|                }
 1931|    596|            }
 1932|  1.36k|        }
 1933|  4.82k|    }
 1934|    136|    *x = '\0';
 1935|    136|    if (badesc) {
  ------------------
  |  Branch (1935:9): [True: 119, False: 17]
  ------------------
 1936|    119|        return HTTP_BAD_REQUEST;
  ------------------
  |  |  514|    119|#define HTTP_BAD_REQUEST                     400
  ------------------
 1937|    119|    }
 1938|     17|    else if (badpath) {
  ------------------
  |  Branch (1938:14): [True: 9, False: 8]
  ------------------
 1939|      9|        return HTTP_NOT_FOUND;
  ------------------
  |  |  518|      9|#define HTTP_NOT_FOUND                       404
  ------------------
 1940|      9|    }
 1941|      8|    else {
 1942|      8|        return OK;
  ------------------
  |  |  461|      8|#define OK           0  /**< Module has handled this stage. */
  ------------------
 1943|      8|    }
 1944|    136|}
util.c:c2x:
 2030|   102k|{
 2031|       |#if APR_CHARSET_EBCDIC
 2032|       |    what = apr_xlate_conv_byte(ap_hdrs_to_ascii, (unsigned char)what);
 2033|       |#endif /*APR_CHARSET_EBCDIC*/
 2034|   102k|    *where++ = prefix;
 2035|   102k|    *where++ = c2x_table[what >> 4];
 2036|   102k|    *where++ = c2x_table[what & 0xf];
 2037|   102k|    return where;
 2038|   102k|}

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

apr_base64_decode_len:
  133|  1.15k|{
  134|  1.15k|    register const unsigned char *bufin;
  135|  1.15k|    register apr_size_t nprbytes;
  136|       |
  137|  1.15k|    bufin = (const unsigned char *) bufcoded;
  138|  6.98k|    while (pr2six[*(bufin++)] <= 63);
  ------------------
  |  Branch (138:12): [True: 5.82k, False: 1.15k]
  ------------------
  139|  1.15k|    nprbytes = (bufin - (const unsigned char *) bufcoded) - 1;
  140|  1.15k|    APR__ASSERT(nprbytes <= APR_BASE64_DECODE_MAX);
  ------------------
  |  |   31|  1.15k|#define APR__ASSERT(cond) assert(cond)
  ------------------
  |  Branch (140:5): [True: 0, False: 1.15k]
  |  Branch (140:5): [True: 1.15k, False: 0]
  ------------------
  141|       |
  142|  1.15k|    return (int)(((nprbytes + 3u) / 4u) * 3u + 1u);
  143|  1.15k|}
apr_base64_decode:
  146|  1.15k|{
  147|       |#if APR_CHARSET_EBCDIC
  148|       |    apr_size_t inbytes_left, outbytes_left;
  149|       |#endif /* APR_CHARSET_EBCDIC */
  150|  1.15k|    int len;
  151|       |
  152|  1.15k|    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.15k|    bufplain[len] = '\0';
  159|  1.15k|    return len;
  160|  1.15k|}
apr_base64_decode_binary:
  168|  1.15k|{
  169|  1.15k|    int nbytesdecoded;
  170|  1.15k|    register const unsigned char *bufin;
  171|  1.15k|    register unsigned char *bufout;
  172|  1.15k|    register apr_size_t nprbytes;
  173|       |
  174|  1.15k|    bufin = (const unsigned char *) bufcoded;
  175|  6.98k|    while (pr2six[*(bufin++)] <= 63);
  ------------------
  |  Branch (175:12): [True: 5.82k, False: 1.15k]
  ------------------
  176|  1.15k|    nprbytes = (bufin - (const unsigned char *) bufcoded) - 1;
  177|  1.15k|    APR__ASSERT(nprbytes <= APR_BASE64_DECODE_MAX);
  ------------------
  |  |   31|  1.15k|#define APR__ASSERT(cond) assert(cond)
  ------------------
  |  Branch (177:5): [True: 0, False: 1.15k]
  |  Branch (177:5): [True: 1.15k, False: 0]
  ------------------
  178|  1.15k|    nbytesdecoded = (int)(((nprbytes + 3u) / 4u) * 3u);
  179|       |
  180|  1.15k|    bufout = (unsigned char *) bufplain;
  181|  1.15k|    bufin = (const unsigned char *) bufcoded;
  182|       |
  183|  2.46k|    while (nprbytes >= 4) {
  ------------------
  |  Branch (183:12): [True: 1.30k, False: 1.15k]
  ------------------
  184|  1.30k|        *(bufout++) =
  185|  1.30k|            (unsigned char) (pr2six[*bufin] << 2 | pr2six[bufin[1]] >> 4);
  186|  1.30k|        *(bufout++) =
  187|  1.30k|            (unsigned char) (pr2six[bufin[1]] << 4 | pr2six[bufin[2]] >> 2);
  188|  1.30k|        *(bufout++) =
  189|  1.30k|            (unsigned char) (pr2six[bufin[2]] << 6 | pr2six[bufin[3]]);
  190|  1.30k|        bufin += 4;
  191|  1.30k|        nprbytes -= 4;
  192|  1.30k|    }
  193|       |
  194|       |    /* Note: (nprbytes == 1) would be an error, so just ignore that case */
  195|  1.15k|    if (nprbytes > 1) {
  ------------------
  |  Branch (195:9): [True: 186, False: 970]
  ------------------
  196|    186|        *(bufout++) =
  197|    186|            (unsigned char) (pr2six[*bufin] << 2 | pr2six[bufin[1]] >> 4);
  198|    186|    }
  199|  1.15k|    if (nprbytes > 2) {
  ------------------
  |  Branch (199:9): [True: 96, False: 1.06k]
  ------------------
  200|     96|        *(bufout++) =
  201|     96|            (unsigned char) (pr2six[bufin[1]] << 4 | pr2six[bufin[2]] >> 2);
  202|     96|    }
  203|       |
  204|  1.15k|    return nbytesdecoded - (int)((4u - nprbytes) & 3u);
  205|  1.15k|}
apr_base64_encode_len:
  221|  1.11k|{
  222|  1.11k|    APR__ASSERT(len >= 0 && len <= APR_BASE64_ENCODE_MAX);
  ------------------
  |  |   31|  1.11k|#define APR__ASSERT(cond) assert(cond)
  ------------------
  |  Branch (222:5): [True: 0, False: 1.11k]
  |  Branch (222:5): [True: 0, False: 0]
  |  Branch (222:5): [True: 1.11k, False: 0]
  |  Branch (222:5): [True: 1.11k, False: 0]
  ------------------
  223|       |
  224|  1.11k|    return ((len + 2) / 3 * 4) + 1;
  225|  1.11k|}
apr_base64_encode:
  228|  1.11k|{
  229|  1.11k|#if !APR_CHARSET_EBCDIC
  230|  1.11k|    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.11k|}
apr_base64_encode_binary:
  270|  1.11k|{
  271|  1.11k|    int i;
  272|  1.11k|    char *p;
  273|       |
  274|  1.11k|    APR__ASSERT(len >= 0 && len <= APR_BASE64_ENCODE_MAX);
  ------------------
  |  |   31|  1.11k|#define APR__ASSERT(cond) assert(cond)
  ------------------
  |  Branch (274:5): [True: 0, False: 1.11k]
  |  Branch (274:5): [True: 0, False: 0]
  |  Branch (274:5): [True: 1.11k, False: 0]
  |  Branch (274:5): [True: 1.11k, False: 0]
  ------------------
  275|       |
  276|  1.11k|    p = encoded;
  277|  17.3k|    for (i = 0; i < len - 2; i += 3) {
  ------------------
  |  Branch (277:17): [True: 16.2k, False: 1.11k]
  ------------------
  278|  16.2k|        *p++ = basis_64[(string[i] >> 2) & 0x3F];
  279|  16.2k|        *p++ = basis_64[((string[i] & 0x3) << 4) |
  280|  16.2k|            ((int) (string[i + 1] & 0xF0) >> 4)];
  281|  16.2k|        *p++ = basis_64[((string[i + 1] & 0xF) << 2) |
  282|  16.2k|            ((int) (string[i + 2] & 0xC0) >> 6)];
  283|  16.2k|        *p++ = basis_64[string[i + 2] & 0x3F];
  284|  16.2k|    }
  285|  1.11k|    if (i < len) {
  ------------------
  |  Branch (285:9): [True: 528, False: 587]
  ------------------
  286|    528|        *p++ = basis_64[(string[i] >> 2) & 0x3F];
  287|    528|        if (i == (len - 1)) {
  ------------------
  |  Branch (287:13): [True: 303, False: 225]
  ------------------
  288|    303|            *p++ = basis_64[((string[i] & 0x3) << 4)];
  289|    303|            *p++ = '=';
  290|    303|        }
  291|    225|        else {
  292|    225|            *p++ = basis_64[((string[i] & 0x3) << 4) |
  293|    225|                ((int) (string[i + 1] & 0xF0) >> 4)];
  294|    225|            *p++ = basis_64[((string[i + 1] & 0xF) << 2)];
  295|    225|        }
  296|    528|        *p++ = '=';
  297|    528|    }
  298|       |
  299|  1.11k|    *p++ = '\0';
  300|  1.11k|    return (unsigned int)(p - encoded);
  301|  1.11k|}

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

apr_file_info_get:
  154|  1.11k|{
  155|  1.11k|    struct_stat info;
  156|       |
  157|  1.11k|    if (thefile->buffered) {
  ------------------
  |  Branch (157:9): [True: 1.11k, False: 0]
  ------------------
  158|  1.11k|        apr_status_t rv = apr_file_flush(thefile);
  159|  1.11k|        if (rv != APR_SUCCESS)
  ------------------
  |  |  225|  1.11k|#define APR_SUCCESS 0
  ------------------
  |  Branch (159:13): [True: 0, False: 1.11k]
  ------------------
  160|      0|            return rv;
  161|  1.11k|    }
  162|       |
  163|  1.11k|    if (fstat(thefile->filedes, &info) == 0) {
  ------------------
  |  Branch (163:9): [True: 1.11k, False: 0]
  ------------------
  164|  1.11k|        finfo->pool = thefile->pool;
  165|  1.11k|        finfo->fname = thefile->fname;
  166|  1.11k|        fill_out_finfo(finfo, &info, wanted);
  167|  1.11k|        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.11k|#define APR_SUCCESS 0
  ------------------
  |  Branch (167:16): [True: 0, False: 1.11k]
  ------------------
  168|  1.11k|    }
  169|      0|    else {
  170|       |        return errno;
  171|      0|    }
  172|  1.11k|}
filestat.c:fill_out_finfo:
   72|  1.11k|{
   73|  1.11k|    finfo->valid = APR_FINFO_MIN | APR_FINFO_IDENT | APR_FINFO_NLINK
  ------------------
  |  |  163|  1.11k|#define APR_FINFO_MIN    0x00008170 /**< type, mtime, ctime, atime, size */
  ------------------
                  finfo->valid = APR_FINFO_MIN | APR_FINFO_IDENT | APR_FINFO_NLINK
  ------------------
  |  |  164|  1.11k|#define APR_FINFO_IDENT  0x00003000 /**< dev and inode */
  ------------------
                  finfo->valid = APR_FINFO_MIN | APR_FINFO_IDENT | APR_FINFO_NLINK
  ------------------
  |  |  153|  1.11k|#define APR_FINFO_NLINK  0x00004000 /**< Number of links */
  ------------------
   74|  1.11k|                 | APR_FINFO_OWNER | APR_FINFO_PROT;
  ------------------
  |  |  165|  1.11k|#define APR_FINFO_OWNER  0x00030000 /**< user and group */
  ------------------
                               | APR_FINFO_OWNER | APR_FINFO_PROT;
  ------------------
  |  |  166|  1.11k|#define APR_FINFO_PROT   0x00700000 /**<  all protections */
  ------------------
   75|  1.11k|    finfo->protection = apr_unix_mode2perms(info->st_mode);
   76|  1.11k|    finfo->filetype = filetype_from_mode(info->st_mode);
   77|  1.11k|    finfo->user = info->st_uid;
   78|  1.11k|    finfo->group = info->st_gid;
   79|  1.11k|    finfo->size = info->st_size;
   80|  1.11k|    finfo->device = info->st_dev;
   81|  1.11k|    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.11k|    if (sizeof(apr_ino_t) >= sizeof(info->st_ino)
  ------------------
  |  Branch (85:9): [True: 1.11k, Folded]
  ------------------
   86|  1.11k|        || (apr_ino_t)info->st_ino == info->st_ino) {
  ------------------
  |  Branch (86:12): [True: 0, False: 0]
  ------------------
   87|  1.11k|        finfo->inode = info->st_ino;
   88|  1.11k|    } else {
   89|      0|        finfo->valid &= ~APR_FINFO_INODE;
  ------------------
  |  |  152|      0|#define APR_FINFO_INODE  0x00002000 /**< Inode */
  ------------------
   90|      0|    }
   91|       |
   92|  1.11k|    apr_time_ansi_put(&finfo->atime, info->st_atime);
   93|  1.11k|#ifdef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC
   94|  1.11k|    finfo->atime += info->st_atim.tv_nsec / APR_TIME_C(1000);
  ------------------
  |  |   49|  1.11k|#define APR_TIME_C(val) APR_INT64_C(val)
  |  |  ------------------
  |  |  |  |  394|  1.11k| #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.11k|    apr_time_ansi_put(&finfo->mtime, info->st_mtime);
  102|  1.11k|#ifdef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
  103|  1.11k|    finfo->mtime += info->st_mtim.tv_nsec / APR_TIME_C(1000);
  ------------------
  |  |   49|  1.11k|#define APR_TIME_C(val) APR_INT64_C(val)
  |  |  ------------------
  |  |  |  |  394|  1.11k| #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.11k|    apr_time_ansi_put(&finfo->ctime, info->st_ctime);
  111|  1.11k|#ifdef HAVE_STRUCT_STAT_ST_CTIM_TV_NSEC
  112|  1.11k|    finfo->ctime += info->st_ctim.tv_nsec / APR_TIME_C(1000);
  ------------------
  |  |   49|  1.11k|#define APR_TIME_C(val) APR_INT64_C(val)
  |  |  ------------------
  |  |  |  |  394|  1.11k| #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.11k|#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
  120|  1.11k|#ifdef DEV_BSIZE
  121|  1.11k|    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.11k|    finfo->valid |= APR_FINFO_CSIZE;
  ------------------
  |  |  150|  1.11k|#define APR_FINFO_CSIZE  0x00000200 /**< Storage size consumed by the file */
  ------------------
  126|  1.11k|#endif
  127|  1.11k|}
filestat.c:filetype_from_mode:
   28|  1.11k|{
   29|  1.11k|    apr_filetype_e type;
   30|       |
   31|  1.11k|    switch (mode & S_IFMT) {
   32|  1.11k|    case S_IFREG:
  ------------------
  |  Branch (32:5): [True: 1.11k, False: 0]
  ------------------
   33|  1.11k|        type = APR_REG;  break;
   34|      0|    case S_IFDIR:
  ------------------
  |  Branch (34:5): [True: 0, False: 1.11k]
  ------------------
   35|      0|        type = APR_DIR;  break;
   36|      0|    case S_IFLNK:
  ------------------
  |  Branch (36:5): [True: 0, False: 1.11k]
  ------------------
   37|      0|        type = APR_LNK;  break;
   38|      0|    case S_IFCHR:
  ------------------
  |  Branch (38:5): [True: 0, False: 1.11k]
  ------------------
   39|      0|        type = APR_CHR;  break;
   40|      0|    case S_IFBLK:
  ------------------
  |  Branch (40:5): [True: 0, False: 1.11k]
  ------------------
   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.11k]
  ------------------
   48|      0|        type = APR_SOCK; break;
   49|      0|#endif
   50|       |
   51|      0|    default:
  ------------------
  |  Branch (51:5): [True: 0, False: 1.11k]
  ------------------
   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.11k|    }
   67|  1.11k|    return type;
   68|  1.11k|}

apr_unix_file_cleanup:
   67|  1.11k|{
   68|  1.11k|    apr_file_t *file = thefile;
   69|  1.11k|    apr_status_t flush_rv = APR_SUCCESS, rv = APR_SUCCESS;
  ------------------
  |  |  225|  1.11k|#define APR_SUCCESS 0
  ------------------
                  apr_status_t flush_rv = APR_SUCCESS, rv = APR_SUCCESS;
  ------------------
  |  |  225|  1.11k|#define APR_SUCCESS 0
  ------------------
   70|       |
   71|  1.11k|    if (file->buffered) {
  ------------------
  |  Branch (71:9): [True: 1.11k, False: 0]
  ------------------
   72|  1.11k|        flush_rv = apr_file_flush(file);
   73|  1.11k|    }
   74|       |
   75|  1.11k|    rv = file_cleanup(file, 0);
   76|       |
   77|  1.11k|    return rv != APR_SUCCESS ? rv : flush_rv;
  ------------------
  |  |  225|  1.11k|#define APR_SUCCESS 0
  ------------------
  |  Branch (77:12): [True: 0, False: 1.11k]
  ------------------
   78|  1.11k|}
apr_file_open:
   90|  1.11k|{
   91|  1.11k|    apr_os_file_t fd;
   92|  1.11k|    int oflags = 0;
   93|  1.11k|#if APR_HAS_THREADS
   94|  1.11k|    apr_thread_mutex_t *thlock = NULL;
   95|  1.11k|#endif
   96|  1.11k|    apr_status_t rv;
   97|       |
   98|  1.11k|    if ((flag & APR_FOPEN_READ) && (flag & APR_FOPEN_WRITE)) {
  ------------------
  |  |   54|  1.11k|#define APR_FOPEN_READ       0x00001  /**< Open the file for reading */
  ------------------
                  if ((flag & APR_FOPEN_READ) && (flag & APR_FOPEN_WRITE)) {
  ------------------
  |  |   55|  1.11k|#define APR_FOPEN_WRITE      0x00002  /**< Open the file for writing */
  ------------------
  |  Branch (98:9): [True: 1.11k, False: 0]
  |  Branch (98:36): [True: 0, False: 1.11k]
  ------------------
   99|      0|        oflags = O_RDWR;
  100|      0|    }
  101|  1.11k|    else if (flag & APR_FOPEN_READ) {
  ------------------
  |  |   54|  1.11k|#define APR_FOPEN_READ       0x00001  /**< Open the file for reading */
  ------------------
  |  Branch (101:14): [True: 1.11k, False: 0]
  ------------------
  102|  1.11k|        oflags = O_RDONLY;
  103|  1.11k|    }
  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.11k|    if (flag & APR_FOPEN_CREATE) {
  ------------------
  |  |   56|  1.11k|#define APR_FOPEN_CREATE     0x00004  /**< Create the file if not there */
  ------------------
  |  Branch (111:9): [True: 0, False: 1.11k]
  ------------------
  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.11k|    if ((flag & APR_FOPEN_EXCL) && !(flag & APR_FOPEN_CREATE)) {
  ------------------
  |  |   63|  1.11k|#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.11k]
  |  Branch (117:36): [True: 0, False: 0]
  ------------------
  118|      0|        return APR_EACCES;
  ------------------
  |  |  645|      0|#define APR_EACCES EACCES
  ------------------
  119|      0|    }
  120|       |
  121|  1.11k|    if (flag & APR_FOPEN_APPEND) {
  ------------------
  |  |   57|  1.11k|#define APR_FOPEN_APPEND     0x00008  /**< Append to the end of the file */
  ------------------
  |  Branch (121:9): [True: 0, False: 1.11k]
  ------------------
  122|      0|        oflags |= O_APPEND;
  123|      0|    }
  124|  1.11k|    if (flag & APR_FOPEN_TRUNCATE) {
  ------------------
  |  |   58|  1.11k|#define APR_FOPEN_TRUNCATE   0x00010  /**< Open the file and truncate
  ------------------
  |  Branch (124:9): [True: 0, False: 1.11k]
  ------------------
  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.11k|    if (flag & APR_FOPEN_NONBLOCK) {
  ------------------
  |  |   94|  1.11k|#define APR_FOPEN_NONBLOCK    0x40000 /**< Platform dependent flag to enable
  ------------------
  |  Branch (133:9): [True: 0, False: 1.11k]
  ------------------
  134|      0|#ifdef O_NONBLOCK
  135|      0|        oflags |= O_NONBLOCK;
  136|       |#else
  137|       |        return APR_ENOTIMPL;
  138|       |#endif
  139|      0|    }
  140|       |
  141|  1.11k|#ifdef O_CLOEXEC
  142|       |    /* Introduced in Linux 2.6.23. Silently ignored on earlier Linux kernels.
  143|       |     */
  144|  1.11k|    if (!(flag & APR_FOPEN_NOCLEANUP)) {
  ------------------
  |  |   74|  1.11k|#define APR_FOPEN_NOCLEANUP  0x00800  /**< Do not register a cleanup
  ------------------
  |  Branch (144:9): [True: 1.11k, False: 0]
  ------------------
  145|  1.11k|        oflags |= O_CLOEXEC;
  146|  1.11k|}
  147|  1.11k|#endif
  148|       |
  149|       |#if APR_HAS_LARGE_FILES && defined(_LARGEFILE64_SOURCE)
  150|       |    oflags |= O_LARGEFILE;
  151|       |#elif defined(O_LARGEFILE)
  152|  1.11k|    if (flag & APR_FOPEN_LARGEFILE) {
  ------------------
  |  |   82|  1.11k|#define APR_FOPEN_LARGEFILE   0x04000 /**< Platform dependent flag to enable
  ------------------
  |  Branch (152:9): [True: 0, False: 1.11k]
  ------------------
  153|      0|        oflags |= O_LARGEFILE;
  154|      0|    }
  155|  1.11k|#endif
  156|       |
  157|  1.11k|#if APR_HAS_THREADS
  158|  1.11k|    if ((flag & APR_FOPEN_BUFFERED) && (flag & APR_FOPEN_XTHREAD)) {
  ------------------
  |  |   65|  1.11k|#define APR_FOPEN_BUFFERED   0x00080  /**< Open the file for buffered I/O */
  ------------------
                  if ((flag & APR_FOPEN_BUFFERED) && (flag & APR_FOPEN_XTHREAD)) {
  ------------------
  |  |   67|  1.11k|#define APR_FOPEN_XTHREAD    0x00200  /**< Platform dependent tag to open
  ------------------
  |  Branch (158:9): [True: 1.11k, False: 0]
  |  Branch (158:40): [True: 0, False: 1.11k]
  ------------------
  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.11k|#endif
  166|       |
  167|  1.11k|    if (perm == APR_FPROT_OS_DEFAULT) {
  ------------------
  |  |   94|  1.11k|#define APR_FPROT_OS_DEFAULT  0x0FFF /**< use OS's default permissions */
  ------------------
  |  Branch (167:9): [True: 1.11k, False: 0]
  ------------------
  168|  1.11k|        fd = open(fname, oflags, 0666);
  169|  1.11k|    }
  170|      0|    else {
  171|      0|        fd = open(fname, oflags, apr_unix_perms2mode(perm));
  172|      0|    }
  173|  1.11k|    if (fd < 0) {
  ------------------
  |  Branch (173:9): [True: 0, False: 1.11k]
  ------------------
  174|      0|       return errno;
  175|      0|    }
  176|  1.11k|    if (!(flag & APR_FOPEN_NOCLEANUP)) {
  ------------------
  |  |   74|  1.11k|#define APR_FOPEN_NOCLEANUP  0x00800  /**< Do not register a cleanup
  ------------------
  |  Branch (176:9): [True: 1.11k, False: 0]
  ------------------
  177|  1.11k|#ifdef O_CLOEXEC
  178|  1.11k|        static int has_o_cloexec = 0;
  179|  1.11k|        if (!has_o_cloexec)
  ------------------
  |  Branch (179:13): [True: 1, False: 1.11k]
  ------------------
  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.11k|    }
  202|       |
  203|  1.11k|    (*new) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t));
  ------------------
  |  |  454|  1.11k|    apr_pcalloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.11k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.11k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  1.11k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  204|  1.11k|    (*new)->pool = pool;
  205|  1.11k|    (*new)->flags = flag;
  206|  1.11k|    (*new)->filedes = fd;
  207|       |
  208|  1.11k|    (*new)->fname = apr_pstrdup(pool, fname);
  209|       |
  210|  1.11k|    (*new)->blocking = BLK_ON;
  211|  1.11k|    (*new)->buffered = (flag & APR_FOPEN_BUFFERED) > 0;
  ------------------
  |  |   65|  1.11k|#define APR_FOPEN_BUFFERED   0x00080  /**< Open the file for buffered I/O */
  ------------------
  212|       |
  213|  1.11k|    if ((*new)->buffered) {
  ------------------
  |  Branch (213:9): [True: 1.11k, False: 0]
  ------------------
  214|  1.11k|        (*new)->buffer = apr_palloc(pool, APR_FILE_DEFAULT_BUFSIZE);
  ------------------
  |  |  425|  1.11k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.11k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.11k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  1.11k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  215|  1.11k|        (*new)->bufsize = APR_FILE_DEFAULT_BUFSIZE;
  ------------------
  |  |   82|  1.11k|#define APR_FILE_DEFAULT_BUFSIZE 4096
  ------------------
  216|  1.11k|    }
  217|      0|    else {
  218|      0|        (*new)->buffer = NULL;
  219|      0|    }
  220|       |
  221|  1.11k|#if APR_HAS_THREADS
  222|  1.11k|    (*new)->thlock = thlock;
  223|  1.11k|#endif
  224|       |
  225|  1.11k|    (*new)->is_pipe = 0;
  226|  1.11k|    (*new)->timeout = -1;
  227|  1.11k|    (*new)->ungetchar = -1;
  228|  1.11k|    (*new)->eof_hit = 0;
  229|  1.11k|    (*new)->filePtr = 0;
  230|  1.11k|    (*new)->bufpos = 0;
  231|  1.11k|    (*new)->dataRead = 0;
  232|  1.11k|    (*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.11k|    if (!(flag & APR_FOPEN_NOCLEANUP)) {
  ------------------
  |  |   74|  1.11k|#define APR_FOPEN_NOCLEANUP  0x00800  /**< Do not register a cleanup
  ------------------
  |  Branch (239:9): [True: 1.11k, False: 0]
  ------------------
  240|  1.11k|        apr_pool_cleanup_register((*new)->pool, (void *)(*new),
  241|  1.11k|                                  apr_unix_file_cleanup,
  242|  1.11k|                                  apr_unix_child_file_cleanup);
  243|  1.11k|    }
  244|       |
  245|  1.11k|    if ((flag & APR_FOPEN_ROTATING) || (flag & APR_FOPEN_MANUAL_ROTATE)) {
  ------------------
  |  |   90|  1.11k|#define APR_FOPEN_ROTATING  0x10000 /**< Do file file rotation checking */
  ------------------
                  if ((flag & APR_FOPEN_ROTATING) || (flag & APR_FOPEN_MANUAL_ROTATE)) {
  ------------------
  |  |   92|  1.11k|#define APR_FOPEN_MANUAL_ROTATE  0x20000 /**< Enable Manual rotation */
  ------------------
  |  Branch (245:9): [True: 0, False: 1.11k]
  |  Branch (245:40): [True: 0, False: 1.11k]
  ------------------
  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.11k|    else {
  267|  1.11k|        (*new)->rotating = NULL;
  268|  1.11k|    }
  269|       |
  270|  1.11k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.11k|#define APR_SUCCESS 0
  ------------------
  271|  1.11k|}
open.c:file_cleanup:
   25|  1.11k|{
   26|  1.11k|    apr_status_t rv = APR_SUCCESS;
  ------------------
  |  |  225|  1.11k|#define APR_SUCCESS 0
  ------------------
   27|  1.11k|    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.11k|    file->filedes = -1;
   33|       |
   34|  1.11k|    if (close(fd) == 0) {
  ------------------
  |  Branch (34:9): [True: 1.11k, False: 0]
  ------------------
   35|       |        /* Only the parent process should delete the file! */
   36|  1.11k|        if (!is_child && (file->flags & APR_FOPEN_DELONCLOSE)) {
  ------------------
  |  |   66|  1.11k|#define APR_FOPEN_DELONCLOSE 0x00100  /**< Delete the file after close */
  ------------------
  |  Branch (36:13): [True: 1.11k, False: 0]
  |  Branch (36:26): [True: 0, False: 1.11k]
  ------------------
   37|      0|            unlink(file->fname);
   38|      0|        }
   39|  1.11k|#if APR_HAS_THREADS
   40|  1.11k|        if (file->thlock) {
  ------------------
  |  Branch (40:13): [True: 0, False: 1.11k]
  ------------------
   41|      0|            rv = apr_thread_mutex_destroy(file->thlock);
   42|      0|        }
   43|  1.11k|#endif
   44|  1.11k|    }
   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.11k|    return rv;
   64|  1.11k|}

apr_file_read:
   88|  14.9k|{
   89|  14.9k|    apr_ssize_t rv;
   90|  14.9k|    apr_size_t bytes_read;
   91|       |
   92|  14.9k|    if (*nbytes <= 0) {
  ------------------
  |  Branch (92:9): [True: 0, False: 14.9k]
  ------------------
   93|      0|        *nbytes = 0;
   94|      0|        return APR_SUCCESS;
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
   95|      0|    }
   96|       |
   97|  14.9k|    if (thefile->buffered) {
  ------------------
  |  Branch (97:9): [True: 14.9k, False: 0]
  ------------------
   98|  14.9k|        file_lock(thefile);
  ------------------
  |  |  124|  14.9k|#define file_lock(f)   do { \
  |  |  125|  14.9k|                           if ((f)->thlock) \
  |  |  ------------------
  |  |  |  Branch (125:32): [True: 0, False: 14.9k]
  |  |  ------------------
  |  |  126|  14.9k|                               apr_thread_mutex_lock((f)->thlock); \
  |  |  127|  14.9k|                       } while (0)
  |  |  ------------------
  |  |  |  Branch (127:33): [Folded, False: 14.9k]
  |  |  ------------------
  ------------------
   99|  14.9k|        rv = file_read_buffered(thefile, buf, nbytes);
  100|  14.9k|        file_unlock(thefile);
  ------------------
  |  |  128|  14.9k|#define file_unlock(f) do { \
  |  |  129|  14.9k|                           if ((f)->thlock) \
  |  |  ------------------
  |  |  |  Branch (129:32): [True: 0, False: 14.9k]
  |  |  ------------------
  |  |  130|  14.9k|                               apr_thread_mutex_unlock((f)->thlock); \
  |  |  131|  14.9k|                       } while (0)
  |  |  ------------------
  |  |  |  Branch (131:33): [Folded, False: 14.9k]
  |  |  ------------------
  ------------------
  101|  14.9k|        return rv;
  102|  14.9k|    }
  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|  14.9k|}
apr_file_getc:
  391|  14.9k|{
  392|  14.9k|    apr_size_t nbytes = 1;
  393|       |
  394|  14.9k|    return apr_file_read(thefile, ch, &nbytes);
  395|  14.9k|}
apr_file_flush_locked:
  403|  2.23k|{
  404|  2.23k|    apr_status_t rv = APR_SUCCESS;
  ------------------
  |  |  225|  2.23k|#define APR_SUCCESS 0
  ------------------
  405|       |
  406|  2.23k|    if (thefile->direction == 1 && thefile->bufpos) {
  ------------------
  |  Branch (406:9): [True: 0, False: 2.23k]
  |  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.23k|    return rv;
  425|  2.23k|}
apr_file_flush:
  428|  2.23k|{
  429|  2.23k|    apr_status_t rv = APR_SUCCESS;
  ------------------
  |  |  225|  2.23k|#define APR_SUCCESS 0
  ------------------
  430|       |
  431|  2.23k|    if (thefile->buffered) {
  ------------------
  |  Branch (431:9): [True: 2.23k, False: 0]
  ------------------
  432|  2.23k|        file_lock(thefile);
  ------------------
  |  |  124|  2.23k|#define file_lock(f)   do { \
  |  |  125|  2.23k|                           if ((f)->thlock) \
  |  |  ------------------
  |  |  |  Branch (125:32): [True: 0, False: 2.23k]
  |  |  ------------------
  |  |  126|  2.23k|                               apr_thread_mutex_lock((f)->thlock); \
  |  |  127|  2.23k|                       } while (0)
  |  |  ------------------
  |  |  |  Branch (127:33): [Folded, False: 2.23k]
  |  |  ------------------
  ------------------
  433|  2.23k|        rv = apr_file_flush_locked(thefile);
  434|  2.23k|        file_unlock(thefile);
  ------------------
  |  |  128|  2.23k|#define file_unlock(f) do { \
  |  |  129|  2.23k|                           if ((f)->thlock) \
  |  |  ------------------
  |  |  |  Branch (129:32): [True: 0, False: 2.23k]
  |  |  ------------------
  |  |  130|  2.23k|                               apr_thread_mutex_unlock((f)->thlock); \
  |  |  131|  2.23k|                       } while (0)
  |  |  ------------------
  |  |  |  Branch (131:33): [Folded, False: 2.23k]
  |  |  ------------------
  ------------------
  435|  2.23k|    }
  436|       |    /* There isn't anything to do if we aren't buffering the output
  437|       |     * so just return success.
  438|       |     */
  439|  2.23k|    return rv;
  440|  2.23k|}
apr_file_gets:
  503|   795k|{
  504|   795k|    apr_status_t rv = APR_SUCCESS; /* get rid of gcc warning */
  ------------------
  |  |  225|   795k|#define APR_SUCCESS 0
  ------------------
  505|   795k|    apr_size_t nbytes;
  506|   795k|    const char *str_start = str;
  507|   795k|    char *final = str + len - 1;
  508|       |
  509|   795k|    if (len <= 1) {
  ------------------
  |  Branch (509:9): [True: 0, False: 795k]
  ------------------
  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|   795k|    if (thefile->buffered) {
  ------------------
  |  Branch (518:9): [True: 795k, False: 0]
  ------------------
  519|   795k|        file_lock(thefile);
  ------------------
  |  |  124|   795k|#define file_lock(f)   do { \
  |  |  125|   795k|                           if ((f)->thlock) \
  |  |  ------------------
  |  |  |  Branch (125:32): [True: 0, False: 795k]
  |  |  ------------------
  |  |  126|   795k|                               apr_thread_mutex_lock((f)->thlock); \
  |  |  127|   795k|                       } while (0)
  |  |  ------------------
  |  |  |  Branch (127:33): [Folded, False: 795k]
  |  |  ------------------
  ------------------
  520|       |
  521|   795k|        if (thefile->direction == 1) {
  ------------------
  |  Branch (521:13): [True: 0, False: 795k]
  ------------------
  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.66M|        while (str < final) { /* leave room for trailing '\0' */
  ------------------
  |  Branch (533:16): [True: 1.66M, False: 692]
  ------------------
  534|       |            /* Force ungetc leftover to call apr_file_read. */
  535|  1.66M|            if (thefile->bufpos < thefile->dataRead &&
  ------------------
  |  Branch (535:17): [True: 1.66M, False: 1.42k]
  ------------------
  536|  1.66M|                thefile->ungetchar == -1) {
  ------------------
  |  Branch (536:17): [True: 1.66M, False: 0]
  ------------------
  537|  1.66M|                *str = thefile->buffer[thefile->bufpos++];
  538|  1.66M|            }
  539|  1.42k|            else {
  540|  1.42k|                nbytes = 1;
  541|  1.42k|                rv = file_read_buffered(thefile, str, &nbytes);
  542|  1.42k|                if (rv != APR_SUCCESS) {
  ------------------
  |  |  225|  1.42k|#define APR_SUCCESS 0
  ------------------
  |  Branch (542:21): [True: 22, False: 1.40k]
  ------------------
  543|     22|                    break;
  544|     22|                }
  545|  1.42k|            }
  546|  1.66M|            if (*str == '\n') {
  ------------------
  |  Branch (546:17): [True: 794k, False: 874k]
  ------------------
  547|   794k|                ++str;
  548|   794k|                break;
  549|   794k|            }
  550|   874k|            ++str;
  551|   874k|        }
  552|   795k|        file_unlock(thefile);
  ------------------
  |  |  128|   795k|#define file_unlock(f) do { \
  |  |  129|   795k|                           if ((f)->thlock) \
  |  |  ------------------
  |  |  |  Branch (129:32): [True: 0, False: 795k]
  |  |  ------------------
  |  |  130|   795k|                               apr_thread_mutex_unlock((f)->thlock); \
  |  |  131|   795k|                       } while (0)
  |  |  ------------------
  |  |  |  Branch (131:33): [Folded, False: 795k]
  |  |  ------------------
  ------------------
  553|   795k|    }
  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|   795k|    *str = '\0';
  573|   795k|    if (str > str_start) {
  ------------------
  |  Branch (573:9): [True: 795k, False: 14]
  ------------------
  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|   795k|        return APR_SUCCESS;
  ------------------
  |  |  225|   795k|#define APR_SUCCESS 0
  ------------------
  578|   795k|    }
  579|     14|    return rv;
  580|   795k|}
readwrite.c:file_read_buffered:
   32|  16.3k|{
   33|  16.3k|    apr_ssize_t rv;
   34|  16.3k|    char *pos = (char *)buf;
   35|  16.3k|    apr_uint64_t blocksize;
   36|  16.3k|    apr_uint64_t size = *nbytes;
   37|       |
   38|  16.3k|    if (thefile->direction == 1) {
  ------------------
  |  Branch (38:9): [True: 0, False: 16.3k]
  ------------------
   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|  16.3k|    rv = 0;
   49|  16.3k|    if (thefile->ungetchar != -1) {
  ------------------
  |  Branch (49:9): [True: 0, False: 16.3k]
  ------------------
   50|      0|        *pos = (char)thefile->ungetchar;
   51|      0|        ++pos;
   52|      0|        --size;
   53|      0|        thefile->ungetchar = -1;
   54|      0|    }
   55|  32.6k|    while (rv == 0 && size > 0) {
  ------------------
  |  Branch (55:12): [True: 32.6k, False: 0]
  |  Branch (55:23): [True: 16.3k, False: 16.3k]
  ------------------
   56|  16.3k|        if (thefile->bufpos >= thefile->dataRead) {
  ------------------
  |  Branch (56:13): [True: 1.53k, False: 14.8k]
  ------------------
   57|  1.53k|            int bytesread = read(thefile->filedes, thefile->buffer,
   58|  1.53k|                                 thefile->bufsize);
   59|  1.53k|            if (bytesread == 0) {
  ------------------
  |  Branch (59:17): [True: 38, False: 1.50k]
  ------------------
   60|     38|                thefile->eof_hit = TRUE;
  ------------------
  |  |   55|     38|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   51|     38|#define FALSE 0
  |  |  ------------------
  ------------------
   61|     38|                rv = APR_EOF;
  ------------------
  |  |  467|     38|#define APR_EOF            (APR_OS_START_STATUS + 14)
  |  |  ------------------
  |  |  |  |  136|     38|#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|     38|#define APR_OS_START_ERROR     20000
  |  |  |  |  ------------------
  |  |  |  |               #define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|     38|#define APR_OS_ERRSPACE_SIZE 50000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   62|     38|                break;
   63|     38|            }
   64|  1.50k|            else if (bytesread == -1) {
  ------------------
  |  Branch (64:22): [True: 0, False: 1.50k]
  ------------------
   65|      0|                rv = errno;
   66|      0|                break;
   67|      0|            }
   68|  1.50k|            thefile->dataRead = bytesread;
   69|  1.50k|            thefile->filePtr += thefile->dataRead;
   70|  1.50k|            thefile->bufpos = 0;
   71|  1.50k|        }
   72|       |
   73|  16.3k|        blocksize = size > thefile->dataRead - thefile->bufpos ? thefile->dataRead - thefile->bufpos : size;
  ------------------
  |  Branch (73:21): [True: 0, False: 16.3k]
  ------------------
   74|  16.3k|        memcpy(pos, thefile->buffer + thefile->bufpos, blocksize);
   75|  16.3k|        thefile->bufpos += blocksize;
   76|  16.3k|        pos += blocksize;
   77|  16.3k|        size -= blocksize;
   78|  16.3k|    }
   79|       |
   80|  16.3k|    *nbytes = pos - (char *)buf;
   81|  16.3k|    if (*nbytes) {
  ------------------
  |  Branch (81:9): [True: 16.3k, False: 38]
  ------------------
   82|  16.3k|        rv = 0;
   83|  16.3k|    }
   84|  16.3k|    return rv;
   85|  16.3k|}

apr_thread_mutex_create:
   40|  1.11k|{
   41|  1.11k|    apr_thread_mutex_t *new_mutex;
   42|  1.11k|    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.11k|    new_mutex = apr_pcalloc(pool, sizeof(apr_thread_mutex_t));
  ------------------
  |  |  454|  1.11k|    apr_pcalloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.11k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.11k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  1.11k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   51|  1.11k|    new_mutex->pool = pool;
   52|       |
   53|  1.11k|#ifdef HAVE_PTHREAD_MUTEX_RECURSIVE
   54|  1.11k|    if (flags & APR_THREAD_MUTEX_NESTED) {
  ------------------
  |  |   44|  1.11k|#define APR_THREAD_MUTEX_NESTED   0x1   /**< enable nested (recursive) locks */
  ------------------
  |  Branch (54:9): [True: 1.11k, False: 0]
  ------------------
   55|  1.11k|        pthread_mutexattr_t mattr;
   56|       |
   57|  1.11k|        rv = pthread_mutexattr_init(&mattr);
   58|  1.11k|        if (rv) return rv;
  ------------------
  |  Branch (58:13): [True: 0, False: 1.11k]
  ------------------
   59|       |
   60|  1.11k|        rv = pthread_mutexattr_settype(&mattr, PTHREAD_MUTEX_RECURSIVE);
   61|  1.11k|        if (rv) {
  ------------------
  |  Branch (61:13): [True: 0, False: 1.11k]
  ------------------
   62|      0|            pthread_mutexattr_destroy(&mattr);
   63|      0|            return rv;
   64|      0|        }
   65|       |
   66|  1.11k|        rv = pthread_mutex_init(&new_mutex->mutex, &mattr);
   67|       |
   68|  1.11k|        pthread_mutexattr_destroy(&mattr);
   69|  1.11k|    } 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.11k|    if (rv) {
  ------------------
  |  Branch (92:9): [True: 0, False: 1.11k]
  ------------------
   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.11k|    apr_pool_cleanup_register(new_mutex->pool,
  113|  1.11k|                              new_mutex, thread_mutex_cleanup,
  114|  1.11k|                              apr_pool_cleanup_null);
  115|       |
  116|  1.11k|    *mutex = new_mutex;
  117|  1.11k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.11k|#define APR_SUCCESS 0
  ------------------
  118|  1.11k|}
apr_thread_mutex_lock:
  121|  1.11k|{
  122|  1.11k|    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.11k|    rv = pthread_mutex_lock(&mutex->mutex);
  159|       |#ifdef HAVE_ZOS_PTHREADS
  160|       |    if (rv) {
  161|       |        rv = errno;
  162|       |    }
  163|       |#endif
  164|       |
  165|  1.11k|    return rv;
  166|  1.11k|}
apr_thread_mutex_unlock:
  302|  1.11k|{
  303|  1.11k|    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.11k|    status = pthread_mutex_unlock(&mutex->mutex);
  331|       |#ifdef HAVE_ZOS_PTHREADS
  332|       |    if (status) {
  333|       |        status = errno;
  334|       |    }
  335|       |#endif
  336|       |
  337|  1.11k|    return status;
  338|  1.11k|}
thread_mutex.c:thread_mutex_cleanup:
   24|  1.11k|{
   25|  1.11k|    apr_thread_mutex_t *mutex = data;
   26|  1.11k|    apr_status_t rv;
   27|       |
   28|  1.11k|    rv = pthread_mutex_destroy(&mutex->mutex);
   29|       |#ifdef HAVE_ZOS_PTHREADS
   30|       |    if (rv) {
   31|       |        rv = errno;
   32|       |    }
   33|       |#endif
   34|  1.11k|    return rv;
   35|  1.11k|}

apr_pool_initialize:
 1662|  1.11k|{
 1663|  1.11k|    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.11k|    if (apr_pools_initialized++)
  ------------------
  |  Branch (1669:9): [True: 0, False: 1.11k]
  ------------------
 1670|      0|        return APR_SUCCESS;
  ------------------
  |  |  225|      0|#define APR_SUCCESS 0
  ------------------
 1671|       |
 1672|  1.11k|#if defined(_SC_PAGESIZE)
 1673|  1.11k|    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.11k|    boundary_index = 12;
 1682|  1.11k|    while ( (1 << boundary_index) < boundary_size)
  ------------------
  |  Branch (1682:13): [True: 0, False: 1.11k]
  ------------------
 1683|      0|        boundary_index++;
 1684|  1.11k|    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.11k|    if ((rv = apr_pool_create_ex(&global_pool, NULL, NULL,
  ------------------
  |  |  247|  1.11k|    apr_pool_create_ex_debug(newpool, parent, abort_fn, allocator, \
  |  |  248|  1.11k|                             APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.11k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.11k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  1.11k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1691:9): [True: 0, False: 1.11k]
  ------------------
 1692|  1.11k|                                 NULL)) != APR_SUCCESS) {
  ------------------
  |  |  225|  1.11k|#define APR_SUCCESS 0
  ------------------
 1693|      0|        return rv;
 1694|      0|    }
 1695|       |
 1696|  1.11k|    apr_pool_tag(global_pool, "APR global pool");
 1697|       |
 1698|  1.11k|    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.11k|    if ((rv = apr_atomic_init(global_pool)) != APR_SUCCESS) {
  ------------------
  |  |  225|  1.11k|#define APR_SUCCESS 0
  ------------------
  |  Branch (1703:9): [True: 0, False: 1.11k]
  ------------------
 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.11k|    return APR_SUCCESS;
  ------------------
  |  |  225|  1.11k|#define APR_SUCCESS 0
  ------------------
 1747|  1.11k|}
apr_pool_terminate:
 1750|  1.11k|{
 1751|  1.11k|    if (!apr_pools_initialized)
  ------------------
  |  Branch (1751:9): [True: 0, False: 1.11k]
  ------------------
 1752|      0|        return;
 1753|       |
 1754|  1.11k|    if (--apr_pools_initialized)
  ------------------
  |  Branch (1754:9): [True: 0, False: 1.11k]
  ------------------
 1755|      0|        return;
 1756|       |
 1757|  1.11k|    apr_pool_destroy(global_pool); /* This will also destroy the mutex */
  ------------------
  |  |  388|  1.11k|    apr_pool_destroy_debug(p, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  1.11k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  1.11k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  1.11k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1758|  1.11k|    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.11k|}
apr_palloc_debug:
 1811|  23.7k|{
 1812|  23.7k|    void *mem;
 1813|       |
 1814|  23.7k|    apr_pool_check_integrity(pool);
 1815|       |
 1816|  23.7k|    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|  23.7k|    return mem;
 1823|  23.7k|}
apr_pcalloc_debug:
 1827|  2.43k|{
 1828|  2.43k|    void *mem;
 1829|       |
 1830|  2.43k|    apr_pool_check_integrity(pool);
 1831|       |
 1832|  2.43k|    mem = pool_alloc(pool, size);
 1833|  2.43k|    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.43k|    return mem;
 1840|  2.43k|}
apr_pool_destroy_debug:
 1973|  1.11k|{
 1974|  1.11k|#if APR_HAS_THREADS
 1975|  1.11k|    apr_thread_mutex_t *mutex;
 1976|  1.11k|#endif
 1977|       |
 1978|  1.11k|    apr_pool_check_lifetime(pool);
 1979|       |
 1980|  1.11k|    if (pool->joined) {
  ------------------
  |  Branch (1980:9): [True: 0, False: 1.11k]
  ------------------
 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.11k|#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.11k|    mutex = parent_lock(pool);
 1996|  1.11k|#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.11k|    pool_destroy_debug(pool, file_line);
 2003|       |
 2004|  1.11k|#if APR_HAS_THREADS
 2005|       |    /* Unlock the mutex we obtained above */
 2006|  1.11k|    parent_unlock(mutex);
 2007|  1.11k|#endif /* APR_HAS_THREADS */
 2008|  1.11k|}
apr_pool_create_ex_debug:
 2015|  2.23k|{
 2016|  2.23k|    apr_pool_t *pool;
 2017|       |
 2018|  2.23k|    *newpool = NULL;
 2019|       |
 2020|  2.23k|    if (!parent) {
  ------------------
  |  Branch (2020:9): [True: 2.23k, False: 0]
  ------------------
 2021|  2.23k|        parent = global_pool;
 2022|  2.23k|    }
 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.23k|    if (!abort_fn && parent)
  ------------------
  |  Branch (2030:9): [True: 2.23k, False: 0]
  |  Branch (2030:22): [True: 1.11k, False: 1.11k]
  ------------------
 2031|  1.11k|        abort_fn = parent->abort_fn;
 2032|       |
 2033|  2.23k|    if ((pool = malloc(SIZEOF_POOL_T)) == NULL) {
  ------------------
  |  |  615|  2.23k|#define SIZEOF_POOL_T       APR_ALIGN_DEFAULT(sizeof(apr_pool_t))
  |  |  ------------------
  |  |  |  |  150|  2.23k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  2.23k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2033:9): [True: 0, False: 2.23k]
  ------------------
 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.23k|    memset(pool, 0, SIZEOF_POOL_T);
  ------------------
  |  |  615|  2.23k|#define SIZEOF_POOL_T       APR_ALIGN_DEFAULT(sizeof(apr_pool_t))
  |  |  ------------------
  |  |  |  |  150|  2.23k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  2.23k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2041|       |
 2042|  2.23k|    pool->allocator = allocator;
 2043|  2.23k|    pool->abort_fn = abort_fn;
 2044|  2.23k|    pool->tag = file_line;
 2045|  2.23k|    pool->file_line = file_line;
 2046|       |
 2047|  2.23k|#if APR_HAS_THREADS
 2048|  2.23k|    pool->owner = apr_os_thread_current();
 2049|  2.23k|#endif /* APR_HAS_THREADS */
 2050|       |
 2051|  2.23k|#if APR_HAS_THREADS
 2052|  2.23k|    if (parent == NULL || parent->allocator != allocator) {
  ------------------
  |  Branch (2052:9): [True: 1.11k, False: 1.11k]
  |  Branch (2052:27): [True: 0, False: 1.11k]
  ------------------
 2053|  1.11k|        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.11k|        if ((rv = apr_thread_mutex_create(&pool->mutex,
  ------------------
  |  Branch (2063:13): [True: 0, False: 1.11k]
  ------------------
 2064|  1.11k|                APR_THREAD_MUTEX_NESTED, pool)) != APR_SUCCESS) {
  ------------------
  |  |   44|  1.11k|#define APR_THREAD_MUTEX_NESTED   0x1   /**< enable nested (recursive) locks */
  ------------------
                              APR_THREAD_MUTEX_NESTED, pool)) != APR_SUCCESS) {
  ------------------
  |  |  225|  1.11k|#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.11k|    }
 2071|  1.11k|    else {
 2072|  1.11k|        pool->mutex = parent->mutex;
 2073|  1.11k|    }
 2074|  2.23k|#endif /* APR_HAS_THREADS */
 2075|       |
 2076|  2.23k|    if ((pool->parent = parent) != NULL) {
  ------------------
  |  Branch (2076:9): [True: 1.11k, False: 1.11k]
  ------------------
 2077|  1.11k|        pool_lock(parent);
 2078|       |
 2079|  1.11k|        if ((pool->sibling = parent->child) != NULL)
  ------------------
  |  Branch (2079:13): [True: 0, False: 1.11k]
  ------------------
 2080|      0|            pool->sibling->ref = &pool->sibling;
 2081|       |
 2082|  1.11k|        parent->child = pool;
 2083|  1.11k|        pool->ref = &parent->child;
 2084|       |
 2085|  1.11k|        pool_unlock(parent);
 2086|  1.11k|    }
 2087|  1.11k|    else {
 2088|  1.11k|        pool->sibling = NULL;
 2089|  1.11k|        pool->ref = NULL;
 2090|  1.11k|    }
 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.23k|    *newpool = pool;
 2097|       |
 2098|  2.23k|    return APR_SUCCESS;
  ------------------
  |  |  225|  2.23k|#define APR_SUCCESS 0
  ------------------
 2099|  2.23k|}
apr_pvsprintf:
 2201|    926|{
 2202|    926|    struct psprintf_data ps;
 2203|    926|    debug_node_t *node;
 2204|       |
 2205|    926|    apr_pool_check_integrity(pool);
 2206|       |
 2207|    926|    ps.size = 64;
 2208|    926|    ps.mem = malloc(ps.size);
 2209|    926|    ps.vbuff.curpos  = ps.mem;
 2210|       |
 2211|       |    /* Save a byte for the NUL terminator */
 2212|    926|    ps.vbuff.endpos = ps.mem + ps.size - 1;
 2213|       |
 2214|    926|    if (apr_vformatter(psprintf_flush, &ps.vbuff, fmt, ap) == -1) {
  ------------------
  |  Branch (2214:9): [True: 0, False: 926]
  ------------------
 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|    926|    *ps.vbuff.curpos++ = '\0';
 2222|       |
 2223|       |    /*
 2224|       |     * Link the node in
 2225|       |     */
 2226|    926|    node = pool->nodes;
 2227|    926|    if (node == NULL || node->index == 64) {
  ------------------
  |  Branch (2227:9): [True: 0, False: 926]
  |  Branch (2227:25): [True: 0, False: 926]
  ------------------
 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|    926|    node->beginp[node->index] = ps.mem;
 2241|    926|    node->endp[node->index] = ps.mem + ps.size;
 2242|    926|    node->index++;
 2243|       |
 2244|    926|    return ps.mem;
 2245|    926|}
apr_psprintf:
 2341|    926|{
 2342|    926|    va_list ap;
 2343|    926|    char *res;
 2344|       |
 2345|    926|    va_start(ap, fmt);
 2346|    926|    res = apr_pvsprintf(p, fmt, ap);
 2347|       |    va_end(ap);
 2348|    926|    return res;
 2349|    926|}
apr_pool_tag:
 2403|  1.11k|{
 2404|  1.11k|    pool->tag = tag;
 2405|  1.11k|}
apr_pool_cleanup_register:
 2493|  2.23k|{
 2494|  2.23k|    cleanup_t *c = NULL;
 2495|       |
 2496|  2.23k|#if APR_POOL_DEBUG
 2497|  2.23k|    apr_pool_check_integrity(p);
 2498|  2.23k|#endif /* APR_POOL_DEBUG */
 2499|       |
 2500|  2.23k|    if (p != NULL) {
  ------------------
  |  Branch (2500:9): [True: 2.23k, False: 0]
  ------------------
 2501|  2.23k|        if (p->free_cleanups) {
  ------------------
  |  Branch (2501:13): [True: 0, False: 2.23k]
  ------------------
 2502|       |            /* reuse a cleanup structure */
 2503|      0|            c = p->free_cleanups;
 2504|      0|            p->free_cleanups = c->next;
 2505|  2.23k|        } else {
 2506|  2.23k|            c = apr_palloc(p, sizeof(cleanup_t));
  ------------------
  |  |  425|  2.23k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  2.23k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  2.23k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  2.23k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2507|  2.23k|        }
 2508|  2.23k|        c->data = data;
 2509|  2.23k|        c->plain_cleanup_fn = plain_cleanup_fn;
 2510|  2.23k|        c->child_cleanup_fn = child_cleanup_fn;
 2511|  2.23k|        c->next = p->cleanups;
 2512|  2.23k|        p->cleanups = c;
 2513|  2.23k|    }
 2514|       |
 2515|  2.23k|#if APR_POOL_DEBUG
 2516|  2.23k|    if (!c || !c->plain_cleanup_fn || !c->child_cleanup_fn) {
  ------------------
  |  Branch (2516:9): [True: 0, False: 2.23k]
  |  Branch (2516:15): [True: 0, False: 2.23k]
  |  Branch (2516:39): [True: 0, False: 2.23k]
  ------------------
 2517|      0|        abort();
 2518|      0|    }
 2519|  2.23k|#endif /* APR_POOL_DEBUG */
 2520|  2.23k|}
apr_pool_create_ex:
 2942|  1.11k|{
 2943|  1.11k|    return apr_pool_create_ex_debug(newpool, parent,
 2944|  1.11k|                                    abort_fn, allocator,
 2945|  1.11k|                                    "undefined");
 2946|  1.11k|}
apr_pools.c:apr_pool_check_integrity:
 1645|  29.3k|{
 1646|  29.3k|    apr_pool_check_lifetime(pool);
 1647|  29.3k|    apr_pool_check_owner(pool);
 1648|  29.3k|}
apr_pools.c:apr_pool_check_owner:
 1630|  31.5k|{
 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|  31.5k|}
apr_pools.c:pool_alloc:
 1771|  26.2k|{
 1772|  26.2k|    debug_node_t *node;
 1773|  26.2k|    void *mem;
 1774|       |
 1775|  26.2k|    if ((mem = malloc(size)) == NULL) {
  ------------------
  |  Branch (1775:9): [True: 0, False: 26.2k]
  ------------------
 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|  26.2k|    node = pool->nodes;
 1783|  26.2k|    if (node == NULL || node->index == 64) {
  ------------------
  |  Branch (1783:9): [True: 2.23k, False: 23.9k]
  |  Branch (1783:25): [True: 1, False: 23.9k]
  ------------------
 1784|  2.23k|        if ((node = malloc(SIZEOF_DEBUG_NODE_T)) == NULL) {
  ------------------
  |  |  562|  2.23k|#define SIZEOF_DEBUG_NODE_T APR_ALIGN_DEFAULT(sizeof(debug_node_t))
  |  |  ------------------
  |  |  |  |  150|  2.23k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  2.23k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1784:13): [True: 0, False: 2.23k]
  ------------------
 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.23k|        memset(node, 0, SIZEOF_DEBUG_NODE_T);
  ------------------
  |  |  562|  2.23k|#define SIZEOF_DEBUG_NODE_T APR_ALIGN_DEFAULT(sizeof(debug_node_t))
  |  |  ------------------
  |  |  |  |  150|  2.23k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  2.23k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1793|       |
 1794|  2.23k|        node->next = pool->nodes;
 1795|  2.23k|        pool->nodes = node;
 1796|  2.23k|        node->index = 0;
 1797|  2.23k|    }
 1798|       |
 1799|  26.2k|    node->beginp[node->index] = mem;
 1800|  26.2k|    node->endp[node->index] = (char *)mem + size;
 1801|  26.2k|    node->index++;
 1802|       |
 1803|  26.2k|    pool->stat_alloc++;
 1804|  26.2k|    pool->stat_total_alloc++;
 1805|       |
 1806|  26.2k|    return mem;
 1807|  26.2k|}
apr_pools.c:apr_pool_check_lifetime:
 1598|  30.4k|{
 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|  30.4k|    if (pool->parent == NULL)
  ------------------
  |  Branch (1610:9): [True: 4.46k, False: 26.0k]
  ------------------
 1611|  4.46k|        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|  30.4k|}
apr_pools.c:parent_lock:
 1473|  1.11k|{
 1474|  1.11k|    if (pool->parent) {
  ------------------
  |  Branch (1474:9): [True: 0, False: 1.11k]
  ------------------
 1475|      0|        apr_thread_mutex_lock(pool->parent->mutex);
 1476|      0|        return pool->parent->mutex;
 1477|      0|    }
 1478|  1.11k|    return NULL;
 1479|  1.11k|}
apr_pools.c:pool_clear_debug:
 1850|  2.23k|{
 1851|  2.23k|    debug_node_t *node;
 1852|  2.23k|    apr_size_t index;
 1853|       |
 1854|       |    /* Run pre destroy cleanups */
 1855|  2.23k|    run_cleanups(&pool->pre_cleanups);
 1856|  2.23k|    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.23k|    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.34k|    while (pool->child)
  ------------------
  |  Branch (1867:12): [True: 1.11k, False: 2.23k]
  ------------------
 1868|  1.11k|        pool_destroy_debug(pool->child, file_line);
 1869|       |
 1870|       |    /* Run cleanups */
 1871|  2.23k|    run_cleanups(&pool->cleanups);
 1872|  2.23k|    pool->free_cleanups = NULL;
 1873|  2.23k|    pool->cleanups = NULL;
 1874|       |
 1875|       |    /* If new child pools showed up, this is a reason to raise a flag */
 1876|  2.23k|    if (pool->child)
  ------------------
  |  Branch (1876:9): [True: 0, False: 2.23k]
  ------------------
 1877|      0|        abort();
 1878|       |
 1879|       |    /* Free subprocesses */
 1880|  2.23k|    free_proc_chain(pool->subprocesses);
 1881|  2.23k|    pool->subprocesses = NULL;
 1882|       |
 1883|       |    /* Clear the user data. */
 1884|  2.23k|    pool->user_data = NULL;
 1885|       |
 1886|       |    /* Free the blocks, scribbling over them first to help highlight
 1887|       |     * use-after-free issues. */
 1888|  4.46k|    while ((node = pool->nodes) != NULL) {
  ------------------
  |  Branch (1888:12): [True: 2.23k, False: 2.23k]
  ------------------
 1889|  2.23k|        pool->nodes = node->next;
 1890|       |
 1891|  29.3k|        for (index = 0; index < node->index; index++) {
  ------------------
  |  Branch (1891:25): [True: 27.1k, False: 2.23k]
  ------------------
 1892|  27.1k|            memset(node->beginp[index], POOL_POISON_BYTE,
  ------------------
  |  | 1847|  27.1k|#define POOL_POISON_BYTE 'A'
  ------------------
 1893|  27.1k|                   (char *)node->endp[index] - (char *)node->beginp[index]);
 1894|  27.1k|            free(node->beginp[index]);
 1895|  27.1k|        }
 1896|       |
 1897|  2.23k|        memset(node, POOL_POISON_BYTE, SIZEOF_DEBUG_NODE_T);
  ------------------
  |  | 1847|  2.23k|#define POOL_POISON_BYTE 'A'
  ------------------
                      memset(node, POOL_POISON_BYTE, SIZEOF_DEBUG_NODE_T);
  ------------------
  |  |  562|  2.23k|#define SIZEOF_DEBUG_NODE_T APR_ALIGN_DEFAULT(sizeof(debug_node_t))
  |  |  ------------------
  |  |  |  |  150|  2.23k|#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  2.23k|    (((size) + ((boundary) - 1)) & ~((boundary) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1898|  2.23k|        free(node);
 1899|  2.23k|    }
 1900|       |
 1901|  2.23k|    pool->stat_alloc = 0;
 1902|  2.23k|    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.23k|}
apr_pools.c:run_cleanups:
 2647|  4.46k|{
 2648|  4.46k|    cleanup_t *c = *cref;
 2649|       |
 2650|  6.69k|    while (c) {
  ------------------
  |  Branch (2650:12): [True: 2.23k, False: 4.46k]
  ------------------
 2651|  2.23k|        *cref = c->next;
 2652|  2.23k|        (*c->plain_cleanup_fn)((void *)c->data);
 2653|  2.23k|        c = *cref;
 2654|  2.23k|    }
 2655|  4.46k|}
apr_pools.c:free_proc_chain:
 2727|  2.23k|{
 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.23k|    struct process_chain *pc;
 2733|  2.23k|    int need_timeout = 0;
 2734|  2.23k|    apr_time_t timeout_interval;
 2735|       |
 2736|  2.23k|    if (!procs)
  ------------------
  |  Branch (2736:9): [True: 2.23k, False: 0]
  ------------------
 2737|  2.23k|        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.11k|{
 1484|  1.11k|    if (mutex) {
  ------------------
  |  Branch (1484:9): [True: 0, False: 1.11k]
  ------------------
 1485|      0|        apr_thread_mutex_unlock(mutex);
 1486|      0|    }
 1487|  1.11k|}
apr_pools.c:pool_destroy_debug:
 1952|  2.23k|{
 1953|  2.23k|    pool_clear_debug(pool, file_line);
 1954|       |
 1955|       |    /* Remove the pool from the parent's child list */
 1956|  2.23k|    if (pool->parent != NULL
  ------------------
  |  Branch (1956:9): [True: 1.11k, False: 1.11k]
  ------------------
 1957|  1.11k|        && (*pool->ref = pool->sibling) != NULL) {
  ------------------
  |  Branch (1957:12): [True: 0, False: 1.11k]
  ------------------
 1958|      0|        pool->sibling->ref = pool->ref;
 1959|      0|    }
 1960|       |
 1961|       |    /* Destroy the allocator if the pool owns it */
 1962|  2.23k|    if (pool->allocator != NULL
  ------------------
  |  Branch (1962:9): [True: 0, False: 2.23k]
  ------------------
 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.23k|    free(pool);
 1969|  2.23k|}
apr_pools.c:pool_lock:
 1456|  1.11k|{
 1457|  1.11k|#if APR_HAS_THREADS
 1458|  1.11k|    apr_thread_mutex_lock(pool->mutex);
 1459|  1.11k|#endif /* APR_HAS_THREADS */
 1460|  1.11k|}
apr_pools.c:pool_unlock:
 1464|  1.11k|{
 1465|  1.11k|#if APR_HAS_THREADS
 1466|  1.11k|    apr_thread_mutex_unlock(pool->mutex);
 1467|  1.11k|#endif /* APR_HAS_THREADS */
 1468|  1.11k|}

apr_vformatter:
  684|    926|{
  685|    926|    register char *sp;
  686|    926|    register char *bep;
  687|    926|    register int cc = 0;
  688|    926|    register apr_size_t i;
  689|       |
  690|    926|    register char *s = NULL;
  691|    926|    char *q;
  692|    926|    apr_size_t s_len = 0;
  693|       |
  694|    926|    register apr_size_t min_width = 0;
  695|    926|    apr_size_t precision = 0;
  696|    926|    enum {
  697|    926|        LEFT, RIGHT
  698|    926|    } adjust;
  699|    926|    char pad_char;
  700|    926|    char prefix_char;
  701|       |
  702|    926|    double fp_num;
  703|    926|    apr_int64_t i_quad = 0;
  704|    926|    apr_uint64_t ui_quad;
  705|    926|    apr_int32_t i_num = 0;
  706|    926|    apr_uint32_t ui_num = 0;
  707|       |
  708|    926|    char num_buf[NUM_BUF_SIZE];
  709|    926|    char char_buf[2];                /* for printing %% and %<unknown> */
  710|       |
  711|    926|    enum var_type_enum {
  712|    926|            IS_QUAD, IS_LONG, IS_SHORT, IS_INT
  713|    926|    };
  714|    926|    enum var_type_enum var_type = IS_INT;
  715|       |
  716|       |    /*
  717|       |     * Flag variables
  718|       |     */
  719|    926|    boolean_e alternate_form;
  720|    926|    boolean_e print_sign;
  721|    926|    boolean_e print_blank;
  722|    926|    boolean_e adjust_precision;
  723|    926|    boolean_e adjust_width;
  724|    926|    int is_negative;
  725|       |
  726|    926|    sp = vbuff->curpos;
  727|    926|    bep = vbuff->endpos;
  728|       |
  729|  33.3k|    while (*fmt) {
  ------------------
  |  Branch (729:12): [True: 32.4k, False: 926]
  ------------------
  730|  32.4k|        if (*fmt != '%') {
  ------------------
  |  Branch (730:13): [True: 31.4k, False: 926]
  ------------------
  731|  31.4k|            INS_CHAR(*fmt, sp, bep, cc);
  ------------------
  |  |  244|  31.4k|#define INS_CHAR(c, sp, bep, cc)                    \
  |  |  245|  31.4k|{                                                   \
  |  |  246|  31.4k|    if (sp) {                                       \
  |  |  ------------------
  |  |  |  Branch (246:9): [True: 31.4k, False: 0]
  |  |  ------------------
  |  |  247|  31.4k|        if (sp >= bep) {                            \
  |  |  ------------------
  |  |  |  Branch (247:13): [True: 0, False: 31.4k]
  |  |  ------------------
  |  |  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|  31.4k|        *sp++ = (c);                                \
  |  |  255|  31.4k|    }                                               \
  |  |  256|  31.4k|    cc++;                                           \
  |  |  257|  31.4k|}
  ------------------
  732|  31.4k|        }
  733|    926|        else {
  734|       |            /*
  735|       |             * Default variable settings
  736|       |             */
  737|    926|            boolean_e print_something = YES;
  738|    926|            adjust = RIGHT;
  739|    926|            alternate_form = print_sign = print_blank = NO;
  740|    926|            pad_char = ' ';
  741|    926|            prefix_char = NUL;
  ------------------
  |  |   55|    926|#define NUL '\0'
  ------------------
  742|       |
  743|    926|            fmt++;
  744|       |
  745|       |            /*
  746|       |             * Try to avoid checking for flags, width or precision
  747|       |             */
  748|    926|            if (!apr_islower(*fmt)) {
  ------------------
  |  |  216|    926|#define apr_islower(c) (islower(((unsigned char)(c))))
  ------------------
  |  Branch (748:17): [True: 926, False: 0]
  ------------------
  749|       |                /*
  750|       |                 * Recognize flags: -, #, BLANK, +
  751|       |                 */
  752|    926|                for (;; fmt++) {
  753|    926|                    if (*fmt == '-')
  ------------------
  |  Branch (753:25): [True: 0, False: 926]
  ------------------
  754|      0|                        adjust = LEFT;
  755|    926|                    else if (*fmt == '+')
  ------------------
  |  Branch (755:30): [True: 0, False: 926]
  ------------------
  756|      0|                        print_sign = YES;
  757|    926|                    else if (*fmt == '#')
  ------------------
  |  Branch (757:30): [True: 0, False: 926]
  ------------------
  758|      0|                        alternate_form = YES;
  759|    926|                    else if (*fmt == ' ')
  ------------------
  |  Branch (759:30): [True: 0, False: 926]
  ------------------
  760|      0|                        print_blank = YES;
  761|    926|                    else if (*fmt == '0')
  ------------------
  |  Branch (761:30): [True: 0, False: 926]
  ------------------
  762|      0|                        pad_char = '0';
  763|    926|                    else
  764|    926|                        break;
  765|    926|                }
  766|       |
  767|       |                /*
  768|       |                 * Check if a width was specified
  769|       |                 */
  770|    926|                if (apr_isdigit(*fmt)) {
  ------------------
  |  |  212|    926|#define apr_isdigit(c) (isdigit(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (212:24): [True: 0, False: 926]
  |  |  ------------------
  ------------------
  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|    926|                else if (*fmt == '*') {
  ------------------
  |  Branch (774:26): [True: 0, False: 926]
  ------------------
  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|    926|                else
  786|    926|                    adjust_width = NO;
  787|       |
  788|       |                /*
  789|       |                 * Check if a precision was specified
  790|       |                 */
  791|    926|                if (*fmt == '.') {
  ------------------
  |  Branch (791:21): [True: 926, False: 0]
  ------------------
  792|    926|                    adjust_precision = YES;
  793|    926|                    fmt++;
  794|    926|                    if (apr_isdigit(*fmt)) {
  ------------------
  |  |  212|    926|#define apr_isdigit(c) (isdigit(((unsigned char)(c))))
  |  |  ------------------
  |  |  |  Branch (212:24): [True: 926, False: 0]
  |  |  ------------------
  ------------------
  795|    926|                        STR_TO_DEC(fmt, precision);
  ------------------
  |  |  262|    926|    num = NUM(*str++);                              \
  |  |  ------------------
  |  |  |  |  259|    926|#define NUM(c) (c - '0')
  |  |  ------------------
  |  |  263|    926|    while (apr_isdigit(*str))                       \
  |  |  ------------------
  |  |  |  |  212|    926|#define apr_isdigit(c) (isdigit(((unsigned char)(c))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (212:24): [True: 0, False: 926]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  264|    926|    {                                               \
  |  |  265|      0|        num *= 10 ;                                 \
  |  |  266|      0|        num += NUM(*str++);                         \
  |  |  ------------------
  |  |  |  |  259|      0|#define NUM(c) (c - '0')
  |  |  ------------------
  |  |  267|      0|    }
  ------------------
  796|    926|                    }
  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|    926|                }
  805|      0|                else
  806|      0|                    adjust_precision = NO;
  807|    926|            }
  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|    926|            if ((sizeof(APR_OFF_T_FMT) > sizeof(APR_INT64_T_FMT)) &&
  ------------------
  |  |  600|    926|#define APR_OFF_T_FMT "ld"
  ------------------
                          if ((sizeof(APR_OFF_T_FMT) > sizeof(APR_INT64_T_FMT)) &&
  ------------------
  |  |  606|    926|#define APR_INT64_T_FMT PRId64
  ------------------
  |  Branch (819:17): [Folded, False: 926]
  ------------------
  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|    926|            else if ((sizeof(APR_INT64_T_FMT) == 4 &&
  ------------------
  |  |  606|    926|#define APR_INT64_T_FMT PRId64
  ------------------
  |  Branch (832:23): [Folded, False: 926]
  ------------------
  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|    926|                (sizeof(APR_INT64_T_FMT) == 3 &&
  ------------------
  |  |  606|    926|#define APR_INT64_T_FMT PRId64
  ------------------
  |  Branch (835:18): [True: 926, Folded]
  ------------------
  836|    926|                 fmt[0] == APR_INT64_T_FMT[0]) ||
  ------------------
  |  |  606|    926|#define APR_INT64_T_FMT PRId64
  ------------------
  |  Branch (836:18): [True: 0, False: 926]
  ------------------
  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|    926|            else if (*fmt == 'q') {
  ------------------
  |  Branch (844:22): [True: 0, False: 926]
  ------------------
  845|      0|                var_type = IS_QUAD;
  846|      0|                fmt++;
  847|      0|            }
  848|    926|            else if (*fmt == 'l') {
  ------------------
  |  Branch (848:22): [True: 0, False: 926]
  ------------------
  849|      0|                var_type = IS_LONG;
  850|      0|                fmt++;
  851|      0|            }
  852|    926|            else if (*fmt == 'h') {
  ------------------
  |  Branch (852:22): [True: 0, False: 926]
  ------------------
  853|      0|                var_type = IS_SHORT;
  854|      0|                fmt++;
  855|      0|            }
  856|    926|            else {
  857|    926|                var_type = IS_INT;
  858|    926|            }
  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|    926|            switch (*fmt) {
  872|      0|            case 'u':
  ------------------
  |  Branch (872:13): [True: 0, False: 926]
  ------------------
  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: 926]
  ------------------
  892|      0|            case 'i':
  ------------------
  |  Branch (892:13): [True: 0, False: 926]
  ------------------
  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: 926]
  ------------------
  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|    926|            case 'x':
  ------------------
  |  Branch (943:13): [True: 926, False: 0]
  ------------------
  944|    926|            case 'X':
  ------------------
  |  Branch (944:13): [True: 0, False: 926]
  ------------------
  945|    926|                if (var_type == IS_QUAD) {
  ------------------
  |  Branch (945:21): [True: 0, False: 926]
  ------------------
  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|    926|                else {
  951|    926|                    if (var_type == IS_LONG)
  ------------------
  |  Branch (951:25): [True: 0, False: 926]
  ------------------
  952|      0|                        ui_num = va_arg(ap, apr_uint32_t);
  953|    926|                    else if (var_type == IS_SHORT)
  ------------------
  |  Branch (953:30): [True: 0, False: 926]
  ------------------
  954|      0|                        ui_num = (unsigned short) va_arg(ap, unsigned int);
  955|    926|                    else
  956|    926|                        ui_num = va_arg(ap, unsigned int);
  957|    926|                    s = conv_p2(ui_num, 4, *fmt,
  958|    926|                            &num_buf[NUM_BUF_SIZE], &s_len);
  ------------------
  |  |   69|    926|#define NUM_BUF_SIZE 512
  ------------------
  959|    926|                }
  960|    926|                FIX_PRECISION(adjust_precision, precision, s, s_len);
  ------------------
  |  |  280|    926|    if (adjust) {                                   \
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 926, False: 0]
  |  |  ------------------
  |  |  281|    926|        apr_size_t p = (precision + 1 < NUM_BUF_SIZE) \
  |  |  ------------------
  |  |  |  |   69|    926|#define NUM_BUF_SIZE 512
  |  |  ------------------
  |  |  |  Branch (281:24): [True: 926, False: 0]
  |  |  ------------------
  |  |  282|    926|                     ? precision : NUM_BUF_SIZE - 1;  \
  |  |  ------------------
  |  |  |  |   69|      0|#define NUM_BUF_SIZE 512
  |  |  ------------------
  |  |  283|  1.16k|        while (s_len < p)                           \
  |  |  ------------------
  |  |  |  Branch (283:16): [True: 239, False: 926]
  |  |  ------------------
  |  |  284|    926|        {                                           \
  |  |  285|    239|            *--s = '0';                             \
  |  |  286|    239|            s_len++;                                \
  |  |  287|    239|        }                                           \
  |  |  288|    926|    }
  ------------------
  961|    926|                if (alternate_form && ui_num != 0) {
  ------------------
  |  Branch (961:21): [True: 0, False: 926]
  |  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|    926|                break;
  967|       |
  968|       |
  969|      0|            case 's':
  ------------------
  |  Branch (969:13): [True: 0, False: 926]
  ------------------
  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: 926]
  ------------------
 1014|      0|            case 'e':
  ------------------
  |  Branch (1014:13): [True: 0, False: 926]
  ------------------
 1015|      0|            case 'E':
  ------------------
  |  Branch (1015:13): [True: 0, False: 926]
  ------------------
 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: 926]
  ------------------
 1048|      0|            case 'G':
  ------------------
  |  Branch (1048:13): [True: 0, False: 926]
  ------------------
 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: 926]
  ------------------
 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: 926]
  ------------------
 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: 926]
  ------------------
 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: 926]
  ------------------
 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: 926]
  ------------------
 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: 926]
  ------------------
 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|    926|            }
 1328|       |
 1329|    926|            if (prefix_char != NUL && s != S_NULL && s != char_buf) {
  ------------------
  |  |   55|  1.85k|#define NUL '\0'
  ------------------
                          if (prefix_char != NUL && s != S_NULL && s != char_buf) {
  ------------------
  |  |   58|    926|#define S_NULL ((char *)null_string)
  ------------------
  |  Branch (1329:17): [True: 0, False: 926]
  |  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|    926|            if (adjust_width && adjust == RIGHT && min_width > s_len) {
  ------------------
  |  Branch (1334:17): [True: 0, False: 926]
  |  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|    926|            if (print_something == YES) {
  ------------------
  |  Branch (1347:17): [True: 926, False: 0]
  ------------------
 1348|  2.77k|                for (i = s_len; i != 0; i--) {
  ------------------
  |  Branch (1348:33): [True: 1.85k, False: 926]
  ------------------
 1349|  1.85k|                    INS_CHAR(*s, sp, bep, cc);
  ------------------
  |  |  244|  1.85k|#define INS_CHAR(c, sp, bep, cc)                    \
  |  |  245|  1.85k|{                                                   \
  |  |  246|  1.85k|    if (sp) {                                       \
  |  |  ------------------
  |  |  |  Branch (246:9): [True: 1.85k, False: 0]
  |  |  ------------------
  |  |  247|  1.85k|        if (sp >= bep) {                            \
  |  |  ------------------
  |  |  |  Branch (247:13): [True: 0, False: 1.85k]
  |  |  ------------------
  |  |  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.85k|        *sp++ = (c);                                \
  |  |  255|  1.85k|    }                                               \
  |  |  256|  1.85k|    cc++;                                           \
  |  |  257|  1.85k|}
  ------------------
 1350|  1.85k|                    s++;
 1351|  1.85k|                }
 1352|    926|            }
 1353|       |
 1354|    926|            if (adjust_width && adjust == LEFT && min_width > s_len)
  ------------------
  |  Branch (1354:17): [True: 0, False: 926]
  |  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|    926|        }
 1357|  32.4k|        fmt++;
 1358|  32.4k|    }
 1359|    926|    vbuff->curpos = sp;
 1360|       |
 1361|    926|    return cc;
 1362|    926|}
apr_snprintf.c:conv_p2:
  617|    926|{
  618|    926|    register int mask = (1 << nbits) - 1;
  619|    926|    register char *p = buf_end;
  620|    926|    static const char low_digits[] = "0123456789abcdef";
  621|    926|    static const char upper_digits[] = "0123456789ABCDEF";
  622|    926|    register const char *digits = (format == 'X') ? upper_digits : low_digits;
  ------------------
  |  Branch (622:35): [True: 0, False: 926]
  ------------------
  623|       |
  624|  1.61k|    do {
  625|  1.61k|        *--p = digits[num & mask];
  626|  1.61k|        num >>= nbits;
  627|  1.61k|    }
  628|  1.61k|    while (num);
  ------------------
  |  Branch (628:12): [True: 687, False: 926]
  ------------------
  629|       |
  630|    926|    *len = buf_end - p;
  631|    926|    return (p);
  632|    926|}

apr_pstrdup:
   73|  4.29k|{
   74|  4.29k|    char *res;
   75|  4.29k|    apr_size_t len;
   76|       |
   77|  4.29k|    if (s == NULL) {
  ------------------
  |  Branch (77:9): [True: 0, False: 4.29k]
  ------------------
   78|      0|        return NULL;
   79|      0|    }
   80|  4.29k|    len = strlen(s) + 1;
   81|  4.29k|    res = apr_pmemdup(a, s, len);
   82|  4.29k|    return res;
   83|  4.29k|}
apr_pstrmemdup:
  103|  4.07k|{
  104|  4.07k|    char *res;
  105|       |
  106|  4.07k|    if (s == NULL) {
  ------------------
  |  Branch (106:9): [True: 0, False: 4.07k]
  ------------------
  107|      0|        return NULL;
  108|      0|    }
  109|  4.07k|    res = apr_palloc(a, n + 1);
  ------------------
  |  |  425|  4.07k|    apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
  |  |  ------------------
  |  |  |  |  143|  4.07k|#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  160|  4.07k|#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  162|  4.07k|#define APR_STRINGIFY_HELPER(n) #n
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  110|  4.07k|    memcpy(res, s, n);
  111|  4.07k|    res[n] = '\0';
  112|  4.07k|    return res;
  113|  4.07k|}
apr_pmemdup:
  116|  4.47k|{
  117|  4.47k|    void *res;
  118|       |
  119|  4.47k|    if (m == NULL)
  ------------------
  |  Branch (119:9): [True: 0, False: 4.47k]
  ------------------
  120|      0|	return NULL;
  121|  4.47k|    res = apr_palloc(a, n);
  ------------------
  |  |  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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  122|  4.47k|    memcpy(res, m, n);
  123|  4.47k|    return res;
  124|  4.47k|}
apr_strtoi64:
  395|  1.11k|{
  396|  1.11k|#ifdef APR_INT64_STRFN
  397|  1.11k|    errno = 0;
  398|  1.11k|    return APR_INT64_STRFN(nptr, endptr, base);
  ------------------
  |  |   31|  1.11k|#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.11k|}

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

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

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

