EVP: Add support for comparing provided EVP_PKEYs
[openssl.git] / apps / include / function.h
1 /*
2  * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
3  *
4  * Licensed under the Apache License 2.0 (the "License").  You may not use
5  * this file except in compliance with the License.  You can obtain a copy
6  * in the file LICENSE in the source distribution or at
7  * https://www.openssl.org/source/license.html
8  */
9
10 #ifndef OSSL_APPS_FUNCTION_H
11 # define OSSL_APPS_FUNCTION_H
12
13 # include <openssl/lhash.h>
14 # include "opt.h"
15
16 #define DEPRECATED_NO_ALTERNATIVE   "unknown"
17
18 typedef enum FUNC_TYPE {
19     FT_none, FT_general, FT_md, FT_cipher, FT_pkey,
20     FT_md_alg, FT_cipher_alg
21 } FUNC_TYPE;
22
23 typedef struct function_st {
24     FUNC_TYPE type;
25     const char *name;
26     int (*func)(int argc, char *argv[]);
27     const OPTIONS *help;
28     const char *deprecated_alternative;
29 } FUNCTION;
30
31 DEFINE_LHASH_OF(FUNCTION);
32
33 /* Structure to hold the number of columns to be displayed and the
34  * field width used to display them.
35  */
36 typedef struct {
37     int columns;
38     int width;
39 } DISPLAY_COLUMNS;
40
41 void calculate_columns(FUNCTION *functions, DISPLAY_COLUMNS *dc);
42
43 #endif