function.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Copyright 2019-2020 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. #ifndef OSSL_APPS_FUNCTION_H
  10. #define OSSL_APPS_FUNCTION_H
  11. #include <openssl/lhash.h>
  12. #include "opt.h"
  13. #define DEPRECATED_NO_ALTERNATIVE "unknown"
  14. typedef enum FUNC_TYPE {
  15. FT_none,
  16. FT_general,
  17. FT_md,
  18. FT_cipher,
  19. FT_pkey,
  20. FT_md_alg,
  21. FT_cipher_alg
  22. } FUNC_TYPE;
  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. const char *deprecated_version;
  30. } FUNCTION;
  31. DEFINE_LHASH_OF_EX(FUNCTION);
  32. /* Structure to hold the number of columns to be displayed and the
  33. * field width used to display them.
  34. */
  35. typedef struct {
  36. int columns;
  37. int width;
  38. } DISPLAY_COLUMNS;
  39. void calculate_columns(FUNCTION *functions, DISPLAY_COLUMNS *dc);
  40. #endif