1 /* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements. See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
22 apr_status_t ctutil_path_join(char **out, const char *dirname, const char *basename,
23 apr_pool_t *p, server_rec *s);
25 int ctutil_dir_exists(apr_pool_t *p, const char *dirname);
27 int ctutil_file_exists(apr_pool_t *p, const char *filename);
29 void ctutil_buffer_to_array(apr_pool_t *p, const char *b,
30 apr_size_t b_size, apr_array_header_t **out);
32 int ctutil_in_array(const char *needle, const apr_array_header_t *haystack);
34 apr_status_t ctutil_fopen(const char *fn, const char *mode, FILE **f);
36 apr_status_t ctutil_read_dir(apr_pool_t *p,
40 apr_array_header_t **outarr);
42 apr_status_t ctutil_read_file(apr_pool_t *p,
47 apr_size_t *contents_size);
49 apr_status_t ctutil_run_to_log(apr_pool_t *p,
52 const char *desc_for_log);
54 void ctutil_thread_mutex_lock(apr_thread_mutex_t *m);
55 void ctutil_thread_mutex_unlock(apr_thread_mutex_t *m);
57 apr_status_t ctutil_file_write_uint16(server_rec *s,
61 apr_status_t ctutil_file_write_uint24(server_rec *s,
65 void ctutil_log_array(const char *file, int line, int module_index,
66 int level, server_rec *s, const char *desc,
67 apr_array_header_t *arr);
69 apr_status_t ctutil_read_var_bytes(const unsigned char **mem,
71 const unsigned char **start,
74 apr_status_t ctutil_deserialize_uint64(const unsigned char **mem,
75 apr_size_t *avail, apr_uint64_t *pval);
76 apr_status_t ctutil_deserialize_uint16(const unsigned char **mem,
80 apr_status_t ctutil_serialize_uint64(unsigned char **mem, apr_size_t *avail,
83 apr_status_t ctutil_serialize_uint24(unsigned char **mem, apr_size_t *avail,
86 apr_status_t ctutil_serialize_uint16(unsigned char **mem, apr_size_t *avail,
89 apr_status_t ctutil_serialize_uint8(unsigned char **mem, apr_size_t *avail,
92 apr_status_t ctutil_write_var16_bytes(unsigned char **mem, apr_size_t *avail,
93 const unsigned char *val,
96 apr_status_t ctutil_write_var24_bytes(unsigned char **mem, apr_size_t *avail,
97 const unsigned char *val,
100 void ctutil_run_internal_tests(apr_pool_t *p);
102 #endif /* SSL_CT_UTIL_H */