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