Move the code for 'openssl list' to its own translation unit.
[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 APPS_FUNCTION_H
11 # define APPS_FUNCTION_H
12
13 # include <openssl/lhash.h>
14 # include "opt.h"
15
16 typedef enum FUNC_TYPE {
17     FT_none, FT_general, FT_md, FT_cipher, FT_pkey,
18     FT_md_alg, FT_cipher_alg
19 } FUNC_TYPE;
20
21 typedef struct function_st {
22     FUNC_TYPE type;
23     const char *name;
24     int (*func)(int argc, char *argv[]);
25     const OPTIONS *help;
26 } FUNCTION;
27
28 DEFINE_LHASH_OF(FUNCTION);
29
30 /* Structure to hold the number of columns to be displayed and the
31  * field width used to display them.
32  */
33 typedef struct {
34     int columns;
35     int width;
36 } DISPLAY_COLUMNS;
37
38 void calculate_columns(FUNCTION *functions, DISPLAY_COLUMNS *dc);
39
40 #endif