• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright (c) 2015, Google Inc.
2  *
3  * Permission to use, copy, modify, and/or distribute this software for any
4  * purpose with or without fee is hereby granted, provided that the above
5  * copyright notice and this permission notice appear in all copies.
6  *
7  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
10  * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
12  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
13  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
14 
15 #ifndef OPENSSL_HEADER_CRYPTO_CONF_INTERNAL_H
16 #define OPENSSL_HEADER_CRYPTO_CONF_INTERNAL_H
17 
18 #include <openssl/base.h>
19 
20 #include "../lhash/internal.h"
21 
22 #if defined(__cplusplus)
23 extern "C" {
24 #endif
25 
26 
27 DEFINE_LHASH_OF(CONF_VALUE)
28 
29 struct conf_st {
30   LHASH_OF(CONF_VALUE) *data;
31 };
32 
33 // CONF_VALUE_new returns a freshly allocated and zeroed |CONF_VALUE|.
34 CONF_VALUE *CONF_VALUE_new(void);
35 
36 // CONF_parse_list takes a list separated by 'sep' and calls |list_cb| giving
37 // the start and length of each member, optionally stripping leading and
38 // trailing whitespace. This can be used to parse comma separated lists for
39 // example. If |list_cb| returns <= 0, then the iteration is halted and that
40 // value is returned immediately. Otherwise it returns one. Note that |list_cb|
41 // may be called on an empty member.
42 OPENSSL_EXPORT int CONF_parse_list(
43     const char *list, char sep, int remove_whitespace,
44     int (*list_cb)(const char *elem, size_t len, void *usr), void *arg);
45 
46 
47 #if defined(__cplusplus)
48 }  // extern C
49 #endif
50 
51 #endif  // OPENSSL_HEADER_CRYPTO_CONF_INTERNAL_H
52